Storage apparatus and method, device, and storage system
By using technologies such as the first network card and persistent memory in the storage device, the problem of long distributed data writing latency is solved, more efficient data writing and reliability are achieved, and it is suitable for low-time processing in online transaction processing. delay demand.
Patent Information
- Application Number
- PCT/CN2023/139962
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-22
- Filing Date
- 2023-12-19
- Publication Date
- 2024-09-26
AI Technical Summary
In the existing technology, the writing delay of distributed data is relatively large, which affects the efficiency of data persistence in the data center during online transaction processing. Especially under ultra-low latency requirements such as the high-frequency securities trading market, the communication between the client and the server There are many network interactions, and the processor and non-volatile memory have a large disk placement delay.
By using the first network card in the storage device to receive write requests and store them in the memory, the response is sent immediately, reducing the number of network interactions and processor processing latency, using persistent memory and backup battery modules to ensure data reliability, and developing storage performance The toolkit optimizes the data writing path.
It reduces the data writing delay, improves the throughput performance and interaction efficiency, and ensures the reliability of data when the main power supply is powered off. It is suitable for scenarios where the write instructions include target data, and reduces the network interaction between the server and the client. frequency.
Smart Images

Figure CN2023139962_26092024_PF_FP
Abstract
Description
Storage device, method, equipment and storage system
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 22, 2023, with application number 202310326133.7 and application name “Storage Device, Method, Equipment and Storage System”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of computer technology, and in particular to a storage device, method, equipment, and storage system. Background Art
[0003] Distributed data write latency is a crucial metric for achieving data persistence in data centers. In online transaction processing (OLTP), client-side user data must be quickly transmitted to the server for processing, and the server must provide processing results within a very short time. Existing technologies implement distributed data writes by remotely accessing the server's solid-state drive (SSD). However, this existing technology suffers from significant data write latency.
[0004] Summary of the Invention
[0005] The embodiments of the present application provide a storage device, method, equipment and storage system, which solve the problem of long data writing delay in the prior art.
[0006] To achieve the above objectives, this application adopts the following technical solutions:
[0007] In a first aspect, a storage device is provided, comprising: a first network interface card (NIC), a first memory, a first processor, and a first non-volatile memory. The first NIC is configured to receive a write request from a second device, the write request including target data. The first NIC is further configured to store the target data in the first memory and, upon storage of the target data in the first memory, send a first response to the second device, the first response indicating completion of writing the target data. The first processor is configured to write the target data in the first memory to the first non-volatile memory.
[0008] In the above technical solution, first, the first network card is used to receive a write request from the second device, and the write request includes target data. Therefore, this solution is suitable for scenarios where the write instruction includes target data (in-capsule data), which can reduce the number of network interactions between the server and the client and reduce latency. Secondly, this solution uses a universal network card, and the hardware implementation is easy. Furthermore, the first network card is used to send a first response to the second device based on the target data being stored in the first memory, and the first response is used to indicate the end of writing to the target data. The first network card does not need to send a write response after the target data is written from the first memory to the first non-volatile memory. Instead, the asynchronous processing process of the first device is changed into a synchronous process that returns as soon as it is written, bypassing the processing process of the first processor and the process of writing to the disk of the first non-volatile memory, further saving the processing delay of the first processor and the writing delay of the non-volatile memory. In addition, the writing range of the target data is expanded from the first non-volatile memory to the first device, so that interaction can be carried out between the first network card and the second network card, without the first processor sending a response to the second device for the second time, thereby reducing the number of network interactions, saving processor response overhead, and reducing the processor's processing tasks, which can further improve the throughput performance of the first device and improve interaction efficiency.
[0009] In one possible implementation of the first aspect, the first memory is a persistent memory, or the storage device further includes a backup battery module configured to power the first memory. In these possible implementations, by configuring the first memory as a persistent memory or using the backup battery module to power the first memory, target data stored in the first memory can be protected from loss when the main power supply of the first device fails, thereby improving data reliability.
[0010] In a possible implementation of the first aspect, the backup battery module includes a power supply module and a second non-volatile memory. The first processor is used to store the target data of the first memory to the second non-volatile memory when the power supply module supplies power to the first memory. The first processor is also used to store the target data in the second non-volatile memory to the first memory. In the above possible implementation, by storing the target data of the first memory to the second non-volatile memory and storing the target data in the second non-volatile memory to the first memory when the power supply module supplies power to the first memory, it is ensured that the target data stored in the first memory is not lost when the main power of the first device is cut off, thereby improving data reliability.
[0011] In a possible implementation of the first aspect, the first processor is further used to send first information to the second device, and the first information is used to indicate that the first memory is the persistent memory, or the storage device includes the backup battery module. In the above possible implementation, the first processor is used to send first information to the second device, and the first information is used to indicate that the first memory is the persistent memory, or the storage device includes the backup battery module. In this way, when the first device can ensure that the main power supply is cut off and the target data stored in the first memory is not lost, the second device and the first device adopt the data writing path of the technical solution provided in this application, which can improve data reliability, reduce latency, improve the throughput performance of the first device, and improve interaction efficiency.
[0012] In a possible implementation of the first aspect, a storage performance development toolkit is installed on the first processor, and the first processor is specifically configured to write the target data in the first memory to the first non-volatile memory based on the storage performance development toolkit. In the above possible implementation, the first processor is specifically configured to write the target data in the first memory to the first non-volatile memory based on the storage performance development toolkit, which can reduce latency, improve throughput performance of the first device, and improve interaction efficiency.
[0013] In a possible implementation of the first aspect, the first non-volatile memory includes an NVMe SSD. In the above possible implementation, using an NVMe SSD can reduce latency, improve throughput performance of the first device, and improve interaction efficiency.
[0014] In a second aspect, a storage device is provided, comprising: a second network card. The second network card is configured to send a write request to a first device, the write request including target data. The second network card is further configured to receive a first response from the first device, the first response being the first response received by the second network card from the first device after sending the write request, the first response indicating the end of writing the target data.
[0015] In the above technical solution, first, the write request includes the target data. Therefore, this solution is suitable for scenarios where the write instruction includes the target data (in-capsule data), which can reduce the number of network interactions between the server and the client and reduce the delay. Secondly, this solution uses a universal network card, and the hardware implementation is easy. Furthermore, the second network card is also used to receive a first response from the first device. The first response is the response from the first device that the second network card receives for the first time after sending the write request. The first response is used to indicate the end of writing to the target data, and the asynchronous processing process of the first device is changed to a synchronous process that returns after writing, bypassing the processing process of the processor in the first device and the process of writing to the non-volatile memory, further saving the processing delay of the processor and the delay of writing to the non-volatile memory. In addition, through the interaction between the first network card and the second network card, there is no need for the first device to send a response to the second device for the second time, which reduces the number of network interactions, saves the processor response overhead, reduces the processor's processing tasks, and can further improve throughput performance and interaction efficiency.
[0016] In a possible implementation of the second aspect, the device further includes: a second processor. The second processor is used to receive first information from the first device, the first information is used to indicate that the first memory of the first device is a persistent memory, or the first device includes a backup battery module for powering the first memory of the first device. In the above possible implementation, the second processor is used to receive first information from the first device, the first information is used to indicate that the first memory of the first device is a persistent memory, or the first device includes a backup battery module for powering the first memory of the first device. In this way, when the first device can ensure that the main power supply is lost and the target data stored in the first memory is not lost, the second device and the first device adopt the data write path of the technical solution provided in this application, which can improve data reliability, reduce latency, improve throughput performance, and improve interaction efficiency.
[0017] In a third aspect, a storage method is provided for a storage device including a first memory and a first non-volatile memory. The method comprises: receiving a write request from a second device, the write request including target data; storing the target data in the first memory; and, based on the target data being stored in the first memory, sending a first response to the second device, the first response indicating completion of writing the target data; and writing the target data in the first memory to the first non-volatile memory.
[0018] In a possible implementation manner of the third aspect, the first memory is a persistent memory, or the storage device further includes a backup battery module, and the method further includes: the backup battery module supplies power to the first memory.
[0019] In a possible implementation of the third aspect, the backup battery module includes a power supply module and a second non-volatile memory. The method further includes: storing the target data in the first memory into the second non-volatile memory when the power supply module supplies power to the first memory. The target data in the second non-volatile memory is stored in the first memory.
[0020] In a possible implementation manner of the third aspect, the method further includes: sending first information to the second device, where the first information is used to indicate that the first memory is the persistent memory, or the storage device includes the backup battery module.
[0021] In a possible implementation of the third aspect, writing the target data in the first memory into the first non-volatile memory includes: writing the target data in the first memory into the first non-volatile memory based on a storage performance development toolkit.
[0022] In a possible implementation of the third aspect, the first non-volatile memory includes an NVMe SSD.
[0023] In a fourth aspect, a storage method is provided, comprising: sending a write request to a first device, the write request including target data, and receiving a first response from the first device, the first response indicating completion of writing the target data.
[0024] In a possible implementation of the fourth aspect, the method further includes: receiving first information from the first device, the first information being used to indicate that the first memory of the first device is a persistent memory, or the first device including a backup battery module for powering the first memory of the first device.
[0025] In a fifth aspect, an electronic device is provided, comprising the storage device provided by the first aspect or any possible implementation of the first aspect.
[0026] In a sixth aspect, an electronic device is provided, comprising the storage device provided by the second aspect or any possible implementation of the second aspect.
[0027] In a seventh aspect, a storage system is provided, comprising the storage device provided by the first aspect or any possible implementation of the first aspect, and the storage device provided by the second aspect or any possible implementation of the second aspect.
[0028] In an eighth aspect, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, the storage method provided by the third aspect or any possible implementation of the third aspect is implemented.
[0029] In the ninth aspect, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, the storage method provided by the fourth aspect or any possible implementation of the fourth aspect is implemented.
[0030] In another aspect of the embodiments of the present application, a computer program product is provided. When the computer program product is run on a computer, it enables the computer to execute the method provided by the third aspect, any possible implementation of the third aspect, the fourth aspect, or any possible implementation of the fourth aspect.
[0031] It can be understood that the methods, systems, computer storage media or computer program products corresponding to any of the storage devices provided above are used to implement the functions corresponding to the storage devices provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding storage devices provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 is a schematic diagram of disk placement delay;
[0033] FIG2 is a flow chart of a data writing method;
[0034] FIG3 is a flow chart of another method for writing data;
[0035] FIG4 is a schematic diagram of another data writing method;
[0036] FIG5 is a schematic diagram of a communication network provided in an embodiment of the present application;
[0037] FIG6 is a schematic diagram of a client and a data center provided in an embodiment of the present application;
[0038] FIG7 is a schematic diagram of a data writing process of the NOF protocol provided in an embodiment of the present application;
[0039] FIG8 is a first structural diagram of a storage device provided in an embodiment of the present application;
[0040] FIG9 is a second structural diagram of a storage device provided in an embodiment of the present application;
[0041] FIG10 is a schematic diagram of a data writing process provided in an embodiment of the present application;
[0042] FIG11 is a schematic diagram of a first memory provided in an embodiment of the present application;
[0043] FIG12 is a schematic diagram of a process for a power supply module according to an embodiment of the present application to store target data in a first memory into a second non-volatile memory;
[0044] FIG13 is a schematic diagram of a process for the power supply module to store target data in the second non-volatile memory into the first memory;
[0045] FIG14 is a schematic diagram of a negotiated data transmission path provided in an embodiment of the present application;
[0046] FIG15 is a schematic diagram of data transmission provided in an embodiment of the present application;
[0047] FIG16 is a flow chart of a storage method provided in an embodiment of the present application;
[0048] FIG17 is a flow chart of another storage method provided in an embodiment of the present application;
[0049] FIG18 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0050] FIG19 is a schematic structural diagram of another electronic device provided in an embodiment of the present application;
[0051] FIG20 is a schematic structural diagram of a storage system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers 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 represent: a, b, c, a and b, a and c, b and c or a, b and c, where a, b and c can be single or multiple. In addition, in the embodiments of the present application, words such as "first" and "second" do not limit the quantity and order.
[0053] It should be noted that, in the embodiments of the present application, words such as "optional," "exemplary," or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "optional," "exemplary," or "for example" in the embodiments of the present application should not be interpreted as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "optional," "exemplary," or "for example" is intended to present the relevant concepts in a concrete manner.
[0054] Before introducing the embodiments of the present application, the relevant technical terms and technical background involved in the embodiments of the present application are first introduced and explained.
[0055] Non-Volatile Memory Express (NVMe) is a logical device interface specification. NVMe enables communication between solid-state drives (SSDs) and hosts over the Peripheral Component Interconnect Express (PCIe) bus. NVMe is a communication standard specifically designed for NVMe SSDs.
[0056] When NVMe is adapted to different network protocols such as the Fibre Channel Protocol (FCP), the Transmission Control Protocol (TCP), and the Remote Direct Memory Access (RDMA) protocol, different technical approaches are formed. These technical approaches are collectively referred to as the NVMe over fabric (NOF) protocol. The NOF protocol can use TCP, RDMA, and FC to remotely access SSDs, realizing distributed storage from the SSD disk side.
[0057] Persistent memory (PMEM) / storage class memory (SCM) is a solid-state, high-performance, byte-addressable memory device on a memory bus. PMEM is accessed similarly to dynamic random access memory (DRAM). PMEM offers advantages such as high speed, low latency, and non-volatility similar to NAND flash memory. Application examples of persistent memory technology include nonvolatile dual in-line memory modules (NVDIMMs) and DC persistent memory modules.
[0058] A battery backup unit (BBU) is a battery module that provides backup power to the system. Specifically, the BBU provides short-term system power if the system's main power source fails. In the event of an abnormal power outage or reset, the BBU hardware module provides system power, while the BIOS software module writes cached data to disk, ensuring that user cache data is not lost.
[0059] The Storage Performance Development Kit (SPDK) is an acceleration library for accelerating access to back-end storage NVMe SSDs. In the SPDK NVMe over RDMA solution, the driver code runs in user mode rather than kernel mode, which saves system call time and enables zero-copy access to data by applications. Polling replaces interrupts, thereby reducing latency and ensuring latency stability and a lock-free I / O path. This can further save software stack latency and achieve lower read and write latencies. In the SPDK solution, data is transmitted in an in-capsule data manner. For example, when a client sends a write instruction to a server, the write instruction includes the target data. This shortens the data transmission path and achieves lower latency. As shown in Figure 1, with SPDK installed on both the client and server, in a traditional SPDK NOF solution, when performing 4K random writes across an RDMA network with a queue depth (iodepth) of 1, the average latency required for the client to store the target data on the server's NVMe SSD (i.e., the NVMe SSD write latency 101) exceeds half of the overall latency, while other latency 102 accounts for less than half of the overall latency. This indicates that the write latency 101 accounts for a significant portion of the overhead.
[0060] Distributed data write latency is a crucial metric for achieving data persistence in data centers. In online transaction processing (OLTP), such as in the high-frequency trading (HFT) market, data write latency must be ultra-low (ULL). The client's target data must be quickly transmitted to the server for processing, and the server must provide processing results in a very short time.
[0061] FIG2 is a flow chart of a data writing method, which includes steps S110 to S140 .
[0062] S110: The server network card receives a write instruction from the client. The write instruction does not include the target data to be written. The write instruction may be in a scatter gather list (SGL) format.
[0063] S120: The server network card transmits the write instruction to the processor. The processor parses the write instruction, generates a first read instruction, and sends the first read instruction to the client. The client processor sends a read response to the server based on the first read instruction. The first read instruction may include the source address of the target data on the client and the target address in the target memory on the server.
[0064] S130: The server network card receives a read response from the client, the read response including target data, and writes the target data into a target memory according to a target address. The target memory is a non-volatile memory, specifically, an SSD.
[0065] S140: The server network card sends a write response to the client, where the write response is used to indicate that writing to the target data has ended. The client processor ends writing to the target data according to the write response.
[0066] The problems with this data writing method include at least the following: First, this method is applicable to scenarios where the write instruction does not include the target data, but is not applicable to scenarios where the write instruction includes the target data (in-capsule data). After receiving the write instruction, the server needs to send a first read instruction and receive a read response before sending a write response to the client, so that the client ends writing the target data according to the write response. Therefore, the number of network interactions between the server and the client in this method is large, and the delay is large. Second, the first read instruction is sent only after the server network card transmits the write instruction to the processor. There is a processor waiting time, and the delay of this interaction between the server and the client is large. Third, the write response is sent only after the server network card writes the target data to the target memory. Since the disk write delay of the non-volatile memory is large, the delay of this interaction between the server and the client is large.
[0067] FIG3 is a flow chart of another data writing method, which includes steps S210 to S260 .
[0068] S210: The server network card receives a write instruction from the client. The write instruction does not include target data to be written. The server network card may be a programmable network card. The write instruction may be in a scatter gather list (SGL) format.
[0069] S220: The server network card transmits the write instruction to the processor, which parses the write instruction, generates a second read instruction, and sends the second read instruction to the network card. The second read instruction may carry the source address of the target data on the client and the target address of the target memory on the server.
[0070] S230: The server network card parses the write instruction, generates a third read instruction, and sends the third read instruction to the client. Optionally, S220 and S230 may be executed simultaneously. The client processor sends a read response to the server based on the third read instruction. The third read instruction may include a source address and a memory address of the server.
[0071] S240: The server network card receives a read response from the client, where the read response includes target data, and writes the target data into the first memory according to the memory address.
[0072] S250: The server network card receives the second read instruction and writes the target data in the memory into a target storage according to the target address. The target storage is a non-volatile memory, specifically, an SSD.
[0073] S260: The server network card sends a write response to the client, where the write response is used to indicate the end of writing the target data.
[0074] This data writing method has at least the following problems: First, this method is suitable for scenarios where the write instruction does not include the target data, but is not suitable for scenarios where the write instruction includes the target data (in-capsule data). After receiving the write instruction, the server needs to send a third read instruction and receive a read response before sending a write response to the client, so that the client can complete writing the target data based on the write response. The interaction steps between the server and the client are S210, S230, S240, and S260. The number of network interactions between the server and the client is not reduced compared to the previous data writing method. Therefore, this method has a large number of interactions between the server and the client, resulting in a large latency. Second, by using a programmable network card, the write instruction is parsed and the second read instruction is sent when the write instruction is transmitted to the processor, which can reduce the latency of this interaction between the server and the client. However, the hardware implementation of programmable network cards is difficult and costly. Third, the write response is sent only after the server network card writes the target data to the target memory. Due to the long latency of writing to disk in non-volatile memory, the latency of this interaction between the server and the client is large.
[0075] FIG4 is a schematic diagram of another data writing method. This method uses the RDMA interface through the remote persistent memory access (RPMA) library (librpma) to access the persistent memory on the remote system. As shown in (A) in FIG4 , the client includes an application 211, a memory 212, and an RDMA network card 213. The memory 212 can be a DRAM. The server includes an RDMA network card 221, a processor cache 223, and a persistent memory 224. Alternatively, as shown in (B) in FIG4 , the server also includes an application 222. The RDMA network card 213 communicates with the RDMA network card 221 via the RDMA network. The client can access the server persistent memory 224 through the RDMA network card. The RPMA library is a user-space library that supports the standard RDMA user-space Linux interface, namely the libiverbs library. It is compatible with multiple RDMA protocols, such as Infiniband (IB)™, Internet Wide Area RDMA Protocol (iWARP), RDMA over converged Ethernet (RoCE), and RDMA over converged Ethernet version 2 (RoCEv2).
[0076] This data writing method remotely accesses persistent memory through the RDMA network, but does not support access to SSDs and is not compatible with the NOF protocol.
[0077] After introducing the relevant technologies involved in the embodiments of this application, the applicable scenarios of the embodiments of this application are described in detail below. The technical solutions provided by the embodiments of this application can be applied to a communication network, which may include multiple network nodes. The multiple network nodes can communicate with each other through a network, and the communication can be implemented using a network transmission protocol. The network nodes in the communication network can also be simply referred to as nodes, which can be computers, servers, etc.
[0078] Figure 5 is a schematic diagram of a communication network provided in an embodiment of the present application. Exemplarily, the communication network 110 includes a first node and a second node, the first node may be a client 300, and the second node may be a server 400. The client 300 and the server 400 are connected via the network 110. Data can be shared between the client 300 and the server 400, for example, data packets can be transmitted between the client 300 and the server 400. The client 300 may include a second network interface card (NIC) 311 and a second processor 312. In one example, the second processor 312 may be a central processing unit (CPU). The server 400 may include a first network interface card 411 and a first processor 412. In one example, the first processor 412 may be a CPU. The client 300 and the server 400 may also include a memory, which may be an internal memory (which may be referred to as memory). Optionally, the memory may be a dynamic random access memory (DRAM) or a double data rate (DDR) memory. The memory may also be a non-volatile memory such as an SSD.
[0079] It will be understood that the structures of the client 300 and the server 400 shown in FIG5 are merely exemplary. In actual applications, the client 300 and the server 400 may also include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, etc. FIG5 does not constitute a limitation to the embodiments of the present application.
[0080] In a possible embodiment, the technical solution provided by the embodiment of the present application can be applied to online transaction processing (OLTP), such as in the securities high frequency trading market (HFT). Figure 6 is a schematic diagram of the client and data center provided by the embodiment of the present application. The data center may include multiple server terminals, and the multiple server terminals may include a master node and multiple slave nodes. The master node may be a remote device relative to the slave node. For example, the master node may be the server 400, and the slave nodes may be the server 500 and the server 600. The client 300 needs to write the target data to the data center. In order to ensure the reliability of the target data written by the client 300, after the client 300 writes the target data to the master node (server 400) of the data center, the master node needs to write the target data to the slave nodes (server 500 and server 600).
[0081] Taking Figure 6 as an example, the process of the client 300 writing the target data to the data center is explained. The client 300 sends a write request to the server 400, and the write request includes the target data. The server 400 sends a write request to the server 500 and the server 600. After the server 500 and the server 600 respectively send a first response to the server 400, the server 400 sends a first response to the client, and the first response is used to indicate the end of writing the target data. Therefore, the overall delay of the client 300 writing the target data to the data center depends on the delay of writing the target data between the two nodes. The technical solution provided in the embodiment of the present application can be applied to the data writing process between the client and the data center, and can also be applied to the data writing process between multiple servers within the data center.
[0082] The technical solution provided by the embodiment of the present application is compatible with the NOF protocol. FIG7 is a schematic diagram of a data writing process of the NOF protocol provided by the embodiment of the present application, the method comprising steps S310 to S360.
[0083] S310: The second processor 312 sends a write request including target data to the server via the second network card 311. When the second network card 311 sends the write request to the server, there is an RDMA network delay.
[0084] S320: The first network card 411 stores the target data in the write request to the first memory according to the write request from the client.
[0085] S330: The first network card 411 sends a second response to the client, indicating that the target data has been received. The client does not process the second response after receiving it. Therefore, the sending time of the second response does not affect the latency of the data write.
[0086] S340: When the first processor 412 polls the first memory and determines that the target data is stored in the first memory, it writes the target data in the first memory to the first non-volatile memory. Specifically, the first non-volatile memory may be an NVMe SSD. Writing the target data in the first memory to the first non-volatile memory may result in a write latency.
[0087] S350: The first processor 412 sends a first response to the client via the first network card 411. The first response is used to indicate that writing of the target data has ended. When the first network card 411 sends the first response to the client, there is an RDMA network delay.
[0088] S360: The second processor 312 receives the first response through the second network card 311, and ends writing the target data according to the first response.
[0089] This data writing method can be applied to scenarios where the write instruction includes target data (in-capsule data). However, the first processor 412 sends a write response only after writing the target data to the first non-volatile memory. Due to the long latency of writing data to the first non-volatile memory, the interaction latency between the server and the client is relatively long. Based on this, an embodiment of the present application provides a storage device for reducing the interaction latency during the data writing process. The storage device provided in an embodiment of the present application is described in detail below.
[0090] FIG8 is a schematic diagram of the structure of a storage device provided in an embodiment of the present application. The storage device 410 can be used as a first device in a server. The storage device 410 can include: a first network card 411, a first memory 413, a first processor 412, and a first non-volatile memory 414.
[0091] FIG9 is a schematic diagram of the structure of a storage device 310 provided in an embodiment of the present application. The storage device 310 can be used as a second device in a client or as a server in a slave node. The storage device 310 may include: a second network card 311 and a second processor 312. Optionally, the first network card 411 and the second network card 311 may be RDMA network cards. The first non-volatile memory 414 may include an NVMe SSD. A buffer may be provided in the first non-volatile memory 414.
[0092] For example, as shown in FIG6 , when the client 300 writes the target data to the server 400, the first device may be a device of the server 400, and the second device may be a device of the client 300. When the server 400 writes the target data to the server 500, the first device may be a device of the server 500, and the second device may be a device of the server 400. Optionally, the storage device 410 is coupled to the host. FIG10 is a schematic diagram of the data writing process provided in an embodiment of the present application. Taking the first device as a device of the server 400 and the second device as a device of the client 300 as an example, the following is explained in conjunction with FIG10 .
[0093] The second network card 311 is configured to send a write request to the first device, the write request including target data. The second processor 312 can enable the second network card 311 to send the write request to the first network card 411 via a remote direct memory access (RDMA SEND) interface. The write method can be an in-capsule data method, and the target data included in the write request can be small blocks of data, such as data of 0 to 16 kilobytes (KB). When the second network card 311 sends the write request to the first device, RDMA network latency is present.
[0094] The first network card 411 is configured to receive a write request from a second device, the write request including target data. The first network card 411 is further configured to store the target data in the first memory 413 and, based on the target data being stored in the first memory 413, send a first response to the second device, the first response indicating completion of writing the target data.
[0095] FIG11 is a schematic diagram of the first memory 413 provided in an embodiment of the present application. Exemplarily, the first memory 413 may include areas such as an NVMe buffer, an RDMA buffer, and a data buffer. The NVMe buffer may include a send queue (SQ) 421 and a completion queue (CQ) 422. The RDMA buffer may include a send queue 431, a receive queue (RQ) 432, and a completion queue 433. The data buffer may be used to store data.
[0096] Exemplarily, the second device may include a second memory 313, which may include areas such as an NVMe buffer, an RDMA buffer, and a data buffer. The NVMe buffer may include a send queue 321 and a completion queue 322. The RDMA buffer may include a send queue 331, a receive queue 332, and a completion queue 333. The data buffer may be used to store data.
[0097] For example, in the first device, the first memory 413 can be coupled to the first processor 412 via a memory bus, and the first processor 412 can be coupled to the first network card 411 and the first non-volatile memory 414 via a PCIe bus. In the second device, the second memory 313 can be coupled to the second processor 312 via a memory bus, and the second processor 312 can be coupled to the second network card 311 via a PCIe bus. Between the first and second devices, the first network card 411 can communicate with the second network card 311 via the RDMA protocol.
[0098] The first network card 411 is further configured to store the target data in the first memory 413 , which may be: the first network card 411 is configured to store the target data in the receiving queue 432 in the RDMA buffer of the first memory 413 .
[0099] Furthermore, the first network card 411 is further configured to send a first response to the second device based on the target data being stored in the first memory 413. This may be configured to send the first response to the second device after the target data is stored in the first memory 413, rather than sending the first response to the second device only after the target data is written to the first non-volatile memory 414. When the first network card 411 sends the first response to the second device, there is an RDMA network latency. This differs from the traditional NOF protocol, in which the processor sends the first response to the second device only after the target data is written to the first non-volatile memory 414.
[0100] Furthermore, the first network card 411 is further configured to write a completion queue element (CQE) corresponding to the target data into the completion queue 433 in the RDMA buffer of the first memory 413 after the target data is stored in the first memory 413 .
[0101] The second network card 311 is further configured to receive a first response from the first device. The first response is the first response received by the second network card 311 from the first device after the second network card 311 sends the write request. Unlike the conventional NOF protocol, in the conventional NOF protocol, the second response is the first response received by the second network card 311 from the first device after the second network card 311 sends the write request, while the first response is the second response received by the second network card 311 from the first device after the second network card 311 sends the write request.
[0102] Optionally, after receiving the first response, the second network card 311 is further configured to store the first response in the receive queue 332 in the RDMA buffer of the second memory 313 , and write a CQE corresponding to the first response into the completion queue 333 in the RDMA buffer of the second memory 313 .
[0103] Optionally, the second processor 312 is configured to poll the CQE corresponding to the first response in the completion queue 333, determine that the first device has written the target data, and terminate the writing of the target data. Specifically, the second processor 312 is configured to terminate the writing of the target data, including: the second processor 312 is configured to determine the storage space in the second memory 313 for storing the target data based on the CQE corresponding to the first response, terminate the timing of the write request, and release the storage space in the second memory 313 for storing the target data.
[0104] Different from the traditional NOF protocol, in the traditional NOF protocol, the second processor 312 is also used to, after polling the CQE corresponding to the first response in the completion queue 333, enable the second network card 311 to send a completion instruction to the first device through the remote direct memory access (RDMA SEND) interface. The completion instruction is used to indicate the completion of writing the target data.
[0105] The first processor 412 is configured to write the target data in the first memory 413 into the first non-volatile memory 414. The first processor 412 is configured to poll the CQE corresponding to the target data in the completion queue 433, determine that a write request has been received, and write the target data in the first memory 413 into the first non-volatile memory 414. Specifically, the first processor 412 is configured to write the target data in the first memory 413 into the first non-volatile memory 414, including: the first processor 412 is configured to parse the write request, generate an NVMe instruction, and write the NVMe instruction as a send queue element (SQE) into the send queue 421 in the NVMe buffer of the first memory 413. The first device may further include a direct memory access circuit (DMA), wherein the DMA includes a DMA controller. The NVMe instruction is configured to instruct the first processor or the DMA controller to send the target data in the receive queue 432 in the first memory 413 to the first non-volatile memory 414. The first processor 412 is also used to assign a value to the doorbell register (DB) of the controller of the first non-volatile memory 414 so that the controller of the first non-volatile memory 414 executes the NVMe instruction.
[0106] The first non-volatile memory 414 is further configured to, after writing the target data, write a CQE indicating the completion of the write into the completion queue 422 of the NVMe buffer of the first memory 413. The first processor 412 is further configured to, when polling the CQE indicating the completion of the write, determine, based on the CQE, that the target data has been written into the first non-volatile memory 414, and release storage space in the first memory 413 for storing the target data.
[0107] Different from the traditional NOF protocol, in the traditional NOF protocol, the first processor 412 is also used to poll the CQE used to indicate the completion of writing, determine according to the CQE that the first non-volatile memory 414 has written the target data, and enable the first network card 411 to send a first response to the client through the RDMA SEND interface.
[0108] Furthermore, in the traditional NOF protocol, the first network card 411 is further configured to receive the completion instruction from the second device, store the completion instruction in the receive queue 432 in the RDMA buffer of the first memory 413, and write the CQE corresponding to the completion instruction into the completion queue 422 in the NVMe buffer of the first memory 413. The first processor 412 is further configured to, upon polling the CQE corresponding to the completion instruction, parse the completion instruction and release storage space in the first memory 413 for storing the target data.
[0109] In the storage device provided in the embodiment of the present application, first, the first network card 411 is used to receive a write request from the second device, and the write request includes target data. Therefore, this solution is suitable for scenarios where the write instruction includes target data (in-capsule data), which can reduce the number of network interactions between the server and the client and reduce latency. Secondly, this solution uses a universal network card, and the hardware implementation is easy. Furthermore, the first network card 411 is used to send a first response to the second device based on the target data being stored in the first memory 413, and the first response is used to indicate the end of writing to the target data. The first network card 411 does not need to send a write response until the target data is written from the first memory 413 to the first non-volatile memory 414. Instead, the asynchronous processing process of the first device is changed to a synchronous process that returns upon writing, bypassing the processing process of the first processor 412 and the process of writing to the disk of the first non-volatile memory 414, further saving the processing delay of the first processor 412 and the writing delay of the non-volatile memory. In addition, the writing range of the target data is expanded from the first non-volatile memory 414 to the first device, so that interaction can be carried out between the first network card 411 and the second network card 311, without the first processor 412 sending a response to the second device for the second time, thereby reducing the number of network interactions, saving processor response overhead, and reducing the processor's processing tasks, which can further improve the throughput performance of the first device and improve interaction efficiency.
[0110] In a possible embodiment, the first memory 413 is a persistent memory, or the storage device 410 further includes a backup battery module, which is used to power the first memory 413. The persistent memory may be: a memory using a persistent memory medium. The first device may also include a main power supply for powering the first device. In the storage device provided in the embodiment of the present application, by setting the first memory 413 as a persistent memory, or by using the backup battery module to power the first memory 413, it can be ensured that when the main power of the first device is cut off, the target data stored in the first memory 413 is not lost, thereby improving data reliability.
[0111] Optionally, the first network card 411 can also be used to register a storage space in the first memory 413 through the path shown in Figure 11, and the storage space is used to store the target data. In the storage device provided in the embodiment of the present application, by registering the storage space, the memory space is mapped to the non-volatile space of the persistent memory in software to ensure the reliability of the target data.
[0112] In one possible embodiment, the backup battery module includes a power supply module and a second non-volatile memory. The first processor 412 is configured to store the target data in the first memory 413 to the second non-volatile memory when the power supply module supplies power to the first memory 413. The first processor 412 is further configured to store the target data in the second non-volatile memory to the first memory 413.
[0113] When the main power supply of the first device is lost, the power supply module supplies power to the first memory 413 to prevent loss of target data in the first memory 413. FIG12 is a flow chart of the power supply module according to an embodiment of the present application storing target data from the first memory 413 to the second non-volatile memory, which may specifically include S410 to S460.
[0114] S410: Main power failure.
[0115] S420: The power supply module detects that the main power supply is powered off and supplies power to the first memory 413. Optionally, the power supply module also supplies power to other components in the first apparatus.
[0116] S430: The first processor 412 powers off the power-consuming devices, which may include the first non-volatile memory 414, a hard disk in the host, a fan, and other devices.
[0117] S440 : The first processor 412 suspends the operating system (OS) and software and stores the data in its cache into the first memory 413 .
[0118] S450 : The first processor 412 calculates a cyclic redundancy check (CRC) of the storage space used to store the target data.
[0119] S460: The first processor 412 stores the target data and the cyclic redundancy check code in the second non-volatile memory. The first device further includes a read-only memory (ROM) having a basic input and output system (BIOS) installed therein. The first processor 412 executes steps S430 to S460 based on the BIOS.
[0120] FIG13 is a schematic diagram of a process for a power supply module to store target data in a second non-volatile memory into a first memory 413 , which may specifically include S501 to S511 .
[0121] S501: The main power supply is restored and the first device is started.
[0122] S502: The first processor 412 detects that the main power supply is restored, initializes the memory, and reports the storage space in the first memory 413 and other spaces except the storage space.
[0123] S503: The first processor 412 detects whether there is dirty data. If so, the process goes to S504. If not, the process goes to S511.
[0124] S504: The first processor 412 detects whether the target data is successfully verified. If so, the process proceeds to S505. If not, the process proceeds to S511. Specifically, the first processor 412 reads the target data from the second non-volatile memory and performs a CRC check to detect whether the check is successful.
[0125] S505 : The first processor 412 stores the target data in the second non-volatile memory to the first memory 413 .
[0126] S506: The first processor 412 clears dirty data.
[0127] S507: The first processor 412 starts a daemon process to identify and rebuild the RDMA queue. Specifically, the first processor 412 identifies and rebuilds the queue in the RDMA buffer according to the existing flag bit.
[0128] S508: The first processor 412 detects whether the first non-volatile memory 414 is in an available state. If so, the process goes to S509. If not, the process goes to S511.
[0129] S509 : The first processor 412 writes the target data in the first memory 413 into the first non-volatile memory 414 .
[0130] S510: The first processor 412 switches the application to a serviceable state. Specifically, after all target data is written into the first non-volatile memory 414, the first processor 412 switches the application to a serviceable state, and the second device can write data to the first device again.
[0131] S511: The first processor 412 determines that the startup fails. The first processor 412 executes steps S502 to S508 and S511 based on the BIOS.
[0132] In the storage device provided in an embodiment of the present application, when the power supply module supplies power to the first memory 413, the target data of the first memory 413 is stored in the second non-volatile memory, and the target data in the second non-volatile memory is stored in the first memory 413, thereby ensuring that the target data stored in the first memory 413 is not lost when the main power supply of the first device is lost, thereby improving data reliability.
[0133] In one possible embodiment, the first processor 412 is further configured to send first information to the second device, where the first information is used to indicate that the first memory 413 is the persistent memory, or that the storage device 410 includes the backup battery module. The second processor 312 is further configured to receive the first information from the first device.
[0134] For example, the second device can use the data write path of the traditional NOF protocol or the data write path of the technical solution provided in this application. Before each data write between the first device and the second device, the first device needs to negotiate the data transmission path with the second device. Figure 14 is a schematic diagram of the negotiated data transmission path provided in an embodiment of the present application, which specifically includes S610-S630.
[0135] S610: The second processor 312 determines that the interaction partner is the first device through the Internet Protocol (IP) address and port of the first device, and sends interaction confirmation information to the first device.
[0136] S620: The first processor 412 sends first information to the second device based on the interactive confirmation information. The first information may be a special field L, in which a preset bit is set to true. The first information is used to indicate that the first memory 413 is the persistent memory, or that the storage device 410 includes the backup battery module. In other words, the first information is used to indicate that the second device can ensure that the target data stored in the first memory 413 is not lost when the main power supply is lost.
[0137] S630: The second processor 312 receives the first information, determines based on the first information the data writing path using the technical solution provided in this application to interact with the first device, and sends a path response to the first device to complete the negotiation of the data transmission path.
[0138] In the storage device provided in an embodiment of the present application, the first processor 412 is configured to send first information to the second device, the first information being configured to indicate that the first memory 413 is the persistent memory, or that the storage device 410 includes the backup battery module. In this manner, when the first device can ensure that the target data stored in the first memory 413 is not lost in the event of a power outage, the second device and the first device utilize the data write path provided in the technical solution of the present application, thereby improving data reliability, reducing latency, increasing the throughput performance of the first device, and improving interaction efficiency.
[0139] In another possible embodiment, the second device can also be used to write target data to the third device. The processor of the third device is used to send the second information to the second device based on the interactive confirmation information. The second information can be a special field L, and the preset bit in the special field L is false. The second information is used to indicate that the memory of the third device is not a persistent memory and that the memory of the third device does not have a backup battery module, that is, the third device cannot ensure that the target data stored in the memory of the third device is not lost when the main power is lost. The second processor 312 is used to receive the second information and determine the data write path using the traditional NOF protocol to interact with the third device based on the second information. The second processor 312 is also used to send a path response to the third device to complete the negotiation of the data transmission path.
[0140] In the storage device provided in the embodiment of the present application, the second processor 312 is further configured to receive second information indicating that the memory of the third device is not persistent memory and that the memory of the third device does not have a backup battery module. When the third device cannot ensure that the target data stored in the first memory 413 is not lost due to a power outage of the main power supply, the second and third devices adopt the data write path of the traditional NOF protocol. Therefore, the storage device provided in the embodiment of the present application is compatible with the traditional NOF protocol. The second device can select an appropriate data transmission path based on the hardware of the interactive object, which is more flexible.
[0141] In one possible embodiment, a storage performance development toolkit is installed on the first processor 412. The first processor 412 is specifically configured to, based on the storage performance development toolkit, write the target data in the first memory 413 to the first non-volatile memory 414. Optionally, a storage performance development toolkit is installed on the second processor 312. The second processor 312 is configured to, based on the storage performance development toolkit, execute the steps in the above embodiment.
[0142] For example, the software corresponding to the technical solution provided in the embodiment of the present application can be developed through the input and output verification tool example / perf in spdk. Figure 15 is a data transmission schematic diagram provided in an embodiment of the present application. The client application (application, APP) calls the spdk write interface and sends the write request to the server through the RDMA interface (such as RoCE interface) of the storage device 310. The RDMA interface (such as RoCE interface) of the server receives the write request and stores the target data in the persistent memory. The first processor 412 parses the write request based on spdk, generates an NVMe instruction, and writes the target data in the first memory 413 to the first non-volatile memory 414 (such as NVMe SSD). The first processor 412 of the server sends a first response to the client. Based on the first response, the client ends writing the target data and clears the target data in the dynamic random access memory. The RoCE interface of the client and the RoCE interface of the server are interconnected through the RDMA network.
[0143] The target data I / O model can be: the input / output (I / O) block size is 4KB, and the client's I / O queue depth (iodepth) is 1. The NOF protocol uses the in-capsule data method to send network data to the server by enclosing the data in an RDMA_SEND capsule.
[0144] In the function interface nvme_rdma_cq_process_completions() of the spdk client, each entry will poll the CQE to be processed in the CQ through ibv_poll_cq. In the classic NOF protocol, no processing is performed when a CQE of type RDMA_WR_TYPE_SEND (the CQE of the second corresponding response) is received. However, when a CQE of type RDMA_WR_TYPE_RECV (the CQE corresponding to the first response) is received, the current I / O is ended, and the function pointer (callback, cb) of the callback function is called to execute the next I / O sending. The technical solution provided in the embodiment of the present application changes the processing logic. When a CQE of type RDMA_WR_TYPE_SEND is received, the current I / O is ended, and the function pointer cb of the callback function is called to execute the next I / O sending. There is no subsequent process such as the CQE of type RDMA_WR_TYPE_RECV.
[0145] In the storage device provided in the embodiment of the present application, the first processor 412 is specifically used to write the target data in the first memory 413 to the first non-volatile memory 414 based on the storage performance development toolkit, which can reduce latency, improve the throughput performance of the first device, and improve interaction efficiency.
[0146] FIG16 is a flow chart of a storage method provided in an embodiment of the present application, which can be applied to a storage device including a first memory and a first non-volatile memory, and includes steps S710 to S730.
[0147] S710: Receive a write request from a second device, where the write request includes target data.
[0148] S720: Storing the target data in the first memory, and sending a first response to the second device based on the target data being stored in the first memory, where the first response is used to indicate the end of writing the target data.
[0149] S730: Writing the target data in the first memory into the first non-volatile memory.
[0150] In a possible embodiment, the first memory is a persistent memory, or the storage device further includes a backup battery module, and the method further includes: the backup battery module supplies power to the first memory.
[0151] In a possible embodiment, the backup battery module includes a power supply module and a second non-volatile memory, and the method further includes: when the power supply module supplies power to the first memory, storing the target data in the first memory into the second non-volatile memory, and storing the target data in the second non-volatile memory into the first memory.
[0152] In a possible embodiment, the method further includes: sending first information to the second device, where the first information is used to indicate that the first memory is the persistent memory, or that the storage device includes the backup battery module.
[0153] In a possible embodiment, writing the target data in the first memory into the first non-volatile memory includes: writing the target data in the first memory into the first non-volatile memory based on a storage performance development toolkit.
[0154] In one possible embodiment, the first non-volatile memory includes an NVMe SSD.
[0155] The storage method provided in the embodiment of the present application can be applied to the above-mentioned storage device 410, so as to realize the functions and effects of the above-mentioned storage device 410. Since it has been described in detail in the above-mentioned embodiment of the storage device 410, it will not be repeated here.
[0156] Figure 17 is a flow chart of another storage method provided in an embodiment of the present application. The method includes steps S810 and S820.
[0157] S810: Send a write request to the first device, where the write request includes target data.
[0158] S820: Receive a first response from the first device, where the first response is used to indicate the end of writing the target data.
[0159] In a possible embodiment, the method further includes: receiving first information from the first device, where the first information is used to indicate that the first memory of the first device is a persistent memory, or the first device includes a backup battery module for powering the first memory of the first device.
[0160] The storage method provided in the embodiment of the present application can be applied to the above-mentioned storage device 310, so as to realize the functions and effects of the above-mentioned storage device 310. Since it has been described in detail in the above-mentioned embodiment of the storage device 310, it will not be repeated here.
[0161] FIG18 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 500 may include the storage device 410 in FIG8 . Optionally, the electronic device 500 may include a host 510 , and the storage device 410 is coupled to the host 510 .
[0162] Exemplarily, the first processor 412 is used to control and manage the actions of the device. In a possible embodiment, the first processor 412 can be used to support the device in executing one or more steps of the above-mentioned method embodiment, as well as other technical processes described herein. The first network card is used to support the device in communicating, such as supporting the device in communicating with the second device. In an embodiment of the present application, the first processor 412 can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of the embodiments of the present application. The first processor 412 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like.
[0163] It can be understood that the various components of the above-mentioned electronic device 500 can be used to implement the corresponding purposes in the above-mentioned device embodiment. Since the various purposes have been described in detail in the above-mentioned storage device 410 embodiment, they will not be repeated here.
[0164] Figure 19 is a schematic diagram of the structure of another electronic device provided in an embodiment of the present application. The electronic device 600 may include the storage device 310 shown in Figure 9. Optionally, the electronic device 600 may include a host 610, and the storage device 310 is coupled to the host 610.
[0165] Exemplarily, the second processor 312 is used to control and manage the actions of the device. In a possible embodiment, the second processor 312 can be used to support the device in executing one or more steps of the above-mentioned method embodiment, as well as other technical processes described herein. The second network card is used to support the device in communicating, such as supporting the device in communicating with the first device. In an embodiment of the present application, the second processor 312 can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of the embodiments of the present application. The second processor 312 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like.
[0166] It is understandable that the various components of the electronic device 600 can be used to implement the corresponding purposes in the aforementioned device embodiment. Since the various purposes have been described in detail in the aforementioned storage device 310 embodiment, they will not be repeated here.
[0167] Figure 20 is a schematic diagram of the structure of a storage system provided in an embodiment of the present application. The storage system includes the storage device 410 in Figure 8 and the storage device 310 in Figure 9. Since each component has been described in detail in the aforementioned storage device embodiment, it will not be repeated here.
[0168] In another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, steps S710 to S730 in the above method embodiment are implemented.
[0169] In another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, steps S810 and S820 in the above method embodiment are implemented.
[0170] In another aspect of the embodiments of the present application, a computer program product is provided, which includes: a computer program (also referred to as code, or instructions), which, when executed, enables a computer to execute steps S710 to S730 in the above method embodiment.
[0171] In another aspect of the embodiments of the present application, a computer program product is provided, which includes: a computer program (also referred to as code, or instructions), which, when executed, enables a computer to execute steps S810 and S820 in the above method embodiment.
[0172] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0173] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0174] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A storage device, characterized in that: The device comprises: a first network card, a first memory, a first processor and a first non-volatile memory; The first network card is used to receive a write request from a second device, wherein the write request includes target data; The first network card is further used to store the target data in the first memory, and based on the target data being stored in the first memory, send a first response to the second device, wherein the first response is used to indicate an end of writing the target data; The first processor is used to write the target data in the first memory into the first non-volatile memory.
2. The device according to claim 1, characterized in that The first memory is a persistent memory, or the storage device further includes a backup battery module, and the backup battery module is used to supply power to the first memory.
3. The device according to claim 2, characterized in that The backup battery module includes a power supply module and a second non-volatile memory; The first processor is configured to store the target data of the first memory into the second non-volatile memory when the power supply module supplies power to the first memory; The first processor is further configured to store the target data in the second non-volatile memory into the first memory.
4. The device according to claim 2 or 3, characterized in that The first processor is further used to send first information to the second device, where the first information is used to indicate that the first memory is the persistent memory, or that the storage device includes the backup battery module.
5. The device according to any one of claims 1 to 4, characterized in that: A storage performance development toolkit is installed on the first processor, and the first processor is specifically used to write the target data in the first memory into the first non-volatile memory based on the storage performance development toolkit.
6. The device according to any one of claims 1 to 5, characterized in that The first non-volatile memory includes an NVMe SSD.
7. A storage device, characterized in that: The device comprises: a second network card; The second network card is used to send a write request to the first device, wherein the write request includes target data; The second network card is further used to receive a first response from the first device, where the first response is the first response from the first device received by the second network card after sending the write request, and the first response is used to indicate the end of writing the target data.
8. The device according to claim 7, characterized in that The apparatus further includes: a second processor; The second processor is used to receive first information from the first device, where the first information is used to indicate that the first memory of the first device is a persistent memory, or the first device includes a backup battery module for powering the first memory of the first device.
9. A storage method, characterized in that: Applied to a storage device including a first memory and a first non-volatile memory, the method includes: receiving a write request from a second device, the write request including target data; storing the target data in the first memory, and sending a first response to the second device based on the target data being stored in the first memory, wherein the first response is used to indicate an end of writing the target data; The target data in the first memory is written into the first non-volatile memory.
10. The method according to claim 9, characterized in that The first memory is a persistent memory, or the storage device further includes a backup battery module, and the method further includes: The backup battery module supplies power to the first memory.
11. The method according to claim 10, characterized in that The backup battery module includes a power supply module and a second non-volatile memory, and the method further includes: When the power supply module supplies power to the first memory, storing the target data of the first memory into the second non-volatile memory; The target data in the second non-volatile memory is stored in the first memory.
12. The method according to claim 10 or 11, characterized in that: The method further comprises: sending first information to the second device, where the first information is used to indicate that the first memory is the persistent memory, or, The storage device includes the backup battery module.
13. The method according to any one of claims 9 to 12, characterized in that: Writing the target data in the first memory into the first non-volatile memory comprises: The target data in the first memory is written into the first non-volatile memory based on a storage performance development toolkit.
14. The method according to any one of claims 9 to 13, characterized in that: The first non-volatile memory includes an NVMe SSD.
15. A storage method, characterized in that: The method comprises: Sending a write request to the first device, the write request including target data; A first response is received from the first device, where the first response is used to indicate that writing of the target data is finished.
16. The method according to claim 15, characterized in that The method further comprises: First information is received from the first device, where the first information is used to indicate that a first memory of the first device is a persistent memory, or that the first device includes a backup battery module for powering the first memory of the first device.
17. An electronic device, characterized in that: Comprising the storage device according to any one of claims 1 to 6.
18. An electronic device, characterized in that: Comprising the storage device as claimed in claim 7 or 8.
19. A storage system, characterized in that: It comprises the storage device according to any one of claims 1 to 6 and the storage device according to claim 7 or 8.
20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or instruction, and when the computer program or instruction is executed, the storage method according to any one of claims 9 to 16 is implemented.
Citation Information
Patent Citations
Power-off protection method, system and device
CN101183801A
Data writing method, flash memory devices and storage equipment
CN107908571A
Memory simulation nonvolatile processing method, device and equipment and readable storage medium
CN113010451A
Data writing method and device, equipment and storage medium
CN115167784A
Data access system, method, equipment and network card
CN115270033A
