Storage device, method, equipment and storage system
By processing and responding to write requests directly in the memory in the storage device, the processing and disk placement delays of the non-volatile memory are reduced, the problem of large distributed data writing delays is solved, and the efficiency of data writing is improved. efficiency and reliability.
Patent Information
- Application Number
- CN202310326133.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-22
- Publication Date
- 2024-09-24
AI Technical Summary
In the existing technology, distributed data writing has a large delay, which affects the data persistence and online transaction processing efficiency of the data center.
By using the first network card in the storage device to receive the write request and store the target data in the memory, the response is sent directly without waiting for writing to the non-volatile memory, thereby reducing the processing and disk placement delays of the processor and memory, and Improve throughput performance through asynchronous processing.
It reduces the number of network interactions and processor response overhead between the server and the client, reduces data writing latency, improves data writing throughput performance and interaction efficiency, and ensures data reliability through persistent memory and backup battery modules.
Smart Images

Figure CN118689783A
Abstract
Description
Technical Field
[0001] 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
[0002] Distributed data write latency is an important indicator for data centers to achieve data persistence. In the online transaction processing (OLTP) process, the user data of the client needs to be quickly transmitted to the server for processing, and the server needs to give the processing results in a very short time. In the prior art, the client remotely accesses the solid state disk (SSD) of the server to achieve distributed data writing. However, the prior art has the problem of large data write latency. Summary of the invention
[0003] Embodiments of the present application provide a storage device, method, equipment and storage system, which solve the problem of large data writing delay in the prior art.
[0004] In order to achieve the above objectives, this application adopts the following technical solutions:
[0005] In a first aspect, a storage device is provided, the device comprising: 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, the write request comprising target data. The first network card is also 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, the first response being used to indicate the 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.
[0006] 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 the scenario 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 first non-volatile memory, further saving the processing delay of the first processor and the delay of writing to 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 performed 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.
[0007] In a possible implementation of the first aspect, 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 power the first memory. In the above possible implementations, by setting the first memory as a persistent memory, or by using the backup battery module to power the first memory, it can be ensured that when the main power supply of the first device is cut off, the target data stored in the first memory is not lost, thereby improving data reliability.
[0008] 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.
[0009] 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 lost 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 the present application, which can improve data reliability, reduce latency, improve the throughput performance of the first device, and improve interaction efficiency.
[0010] 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 used to write the target data in the first memory into the first non-volatile memory based on the storage performance development toolkit. In the above possible implementation, 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, which can reduce latency, improve throughput performance of the first device, and improve interaction efficiency.
[0011] 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.
[0012] In a second aspect, a storage device is provided, the device comprising: a second network card. The second network card is used to send a write request to a first device, the write request including target data. The second network card is also used to receive a first response from the first device, the first response being the first response received from the first device by the second network card after sending the write request, the first response being used to indicate the end of writing the target data.
[0013] In the above technical solution, first, the write request includes the target data. Therefore, the solution is suitable for the scenario 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, which is the response from the first device received for the first time by the second network card 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 into 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, by interacting 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, reducing the number of network interactions, saving the processor response overhead, reducing the processing tasks of the processor, and further improving the throughput performance and interaction efficiency.
[0014] 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, and 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, and 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 writing path of the technical solution provided in the present application, which can improve data reliability, reduce latency, improve throughput performance, and improve interaction efficiency.
[0015] In a third aspect, a storage method is provided, which is applied to a storage device including a first memory and a first non-volatile memory, the method comprising: receiving a write request from a second device, the write request including target data, storing the target data in the first memory, sending a first response to the second device based on the target data being stored in the first memory, the first response being used to indicate the end of writing the target data, and writing the target data in the first memory into the first non-volatile memory.
[0016] 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.
[0017] In a possible implementation of the third aspect, 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 in the second non-volatile memory. Storing the target data in the second non-volatile memory in the first memory.
[0018] 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.
[0019] In a possible implementation manner 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.
[0020] In a possible implementation manner of the third aspect, the first non-volatile memory includes an NVMe SSD.
[0021] In a fourth aspect, a storage method is provided, the method comprising: sending a write request to a first device, the write request comprising target data, and receiving a first response from the first device, the first response being used to indicate an end of writing the target data.
[0022] In a possible implementation of the fourth aspect, the method also 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 includes a backup battery module for powering the first memory of the first device.
[0023] According to 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.
[0024] According to 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.
[0025] 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.
[0026] 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 method of the third aspect is implemented.
[0027] In a 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.
[0028] According to 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, the computer executes 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.
[0029] 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
[0030] Figure 1 This is a schematic diagram of the disk placement delay;
[0031] Figure 2 A flowchart of a data writing method is shown;
[0032] Figure 3 A flowchart of another data writing method is shown;
[0033] Figure 4 A schematic diagram of another data writing method;
[0034] Figure 5 A schematic diagram of a communication network provided in an embodiment of the present application;
[0035] Figure 6 A schematic diagram of a client and a data center provided in an embodiment of the present application;
[0036] Figure 7 A schematic diagram of the data writing process of the NOF protocol provided in an embodiment of the present application;
[0037] Figure 8 A schematic diagram of the structure of a storage device provided in an embodiment of the present application;
[0038] Fig. 9 A schematic diagram of the structure of a storage device provided in an embodiment of the present application;
[0039] Fig.10 A schematic diagram of a data writing process provided in an embodiment of the present application;
[0040] Fig.11A schematic diagram of a first memory provided in an embodiment of the present application;
[0041] Fig.12 The power supply module provided in the embodiment of the present application is a schematic diagram of a process of storing target data in a first memory into a second non-volatile memory;
[0042] Fig.13 A schematic diagram of a flow chart of a power supply module storing target data in a second non-volatile memory into a first memory;
[0043] Fig.14 A schematic diagram of a negotiated data transmission path provided in an embodiment of the present application;
[0044] Fig.15 A schematic diagram of data transmission provided in an embodiment of the present application;
[0045] Fig.16 A schematic diagram of a storage method provided in an embodiment of the present application;
[0046] Fig.17 A flowchart of another storage method provided in an embodiment of the present application;
[0047] Fig.18 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0048] Fig.19 A schematic diagram of the structure of another electronic device provided in an embodiment of the present application;
[0049] Fig. 20 A schematic diagram of the structure of a storage system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The technical scheme in the embodiment of the present application will be described below in conjunction with the accompanying drawings in the embodiment of the present application. In the embodiment of the present application, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there may be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists 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 its similar expressions refers to any combination of these items, including any combination of single items 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 embodiment of the present application, the words "first", "second" and the like do not limit the quantity and order.
[0051] 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 more advantageous than other embodiments or designs. Specifically, the use of words such as "optional", "exemplary" or "for example" is intended to present related concepts in a specific way.
[0052] 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.
[0053] Non-volatile memory express (NVMe) is a logical device interface specification. NVMe enables solid state disk (SSD) to communicate with the host through the peripheral component interconnect express (PCIe) bus. NVMe is a communication standard developed for NVMe SSD.
[0054] When NVMe is adapted to different types of network protocols such as the fiber channel protocol (FCP), transmission control protocol (TCP), and remote direct memory access (RDMA) protocol, different technical routes are formed, which are collectively referred to as the NVMe protocol over fabric (NOF). The NOF protocol can use TCP, RDMA, and FC to remotely access SSDs and implement distributed storage from the SSD disk side.
[0055] Persistent memory (PMEM) / storage class memory (SCM) is a solid-state, high-performance byte-addressable memory device on a memory bus. PMEM is accessed in a similar way to dynamic random access memory (DRAM). PMEM has the advantages of high speed, low latency, and non-volatility similar to flash memory (NAND). Application examples of persistent memory technology include: nonvolatile dual in-line memory module (NVDIMM) and DC persistent memory module.
[0056] The battery backup unit (BBU) is a battery module that backs up the system. Specifically, the BBU can be used to power the system for a short period of time when the main power supply of the system is lost. In abnormal power-off and reset scenarios, the hardware module BBU powers the system, and the software module basic input output system (BIOS) writes cache data to the disk, which can ensure that the user's cache data is not lost.
[0057] The Storage Performance Development Kit (SPDK) is an acceleration library for accelerating access to backend storage NVMe SSDs. In the SPDK NVMe over RDMA solution, the driver code runs in user mode rather than kernel mode, which can save system call time and enable zero-copy access to data by applications, replacing interrupts with polling to reduce latency and ensure latency stability and lock-free I / O paths, which can further save software stack latency and achieve lower read and write latency. 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. In this way, the data transmission path can be shortened and lower latency can be achieved. Among them, such as Figure 1 As shown in the figure, for the traditional spdk NOF solution, spdk is installed between the client and the server. In the case of 4k random write across the RDMA network and queue depth (iodepth) = 1, the average latency required for the client to store the target data to the server's NVMe SSD (i.e., the NVMe SSD disk latency 101) exceeds half of the overall latency, and other latency 102 is less than half of the overall latency. It can be seen that the overhead of the disk latency 101 accounts for a large proportion.
[0058] Distributed data write latency is an important indicator for data centers to achieve data persistence. In online transaction processing (OLTP), such as in the high-frequency trading (HFT) market, data write latency needs to be ultra-low latency (ULL). The client's target data needs to be quickly transmitted to the server for processing, and the server needs to give the processing results in a very short time.
[0059] Figure 2 It is a flowchart diagram of a data writing method, which includes steps S110 to S140.
[0060] S110: The server network card receives a write instruction from the client, wherein the write instruction does not include the target data to be written, and the write instruction may be in a scatter gather list (SGL) format.
[0061] S120: The server network card transmits the write instruction to the processor, and 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 according to the first read instruction. The first read instruction may carry the source address of the target data on the client and the target address in the target memory of the server.
[0062] S130: The server network card receives a read response from the client, the read response includes target data, and writes the target data into a target memory according to a target address, the target memory being a non-volatile memory, and specifically, the target memory may be an SSD.
[0063] 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 is finished. The client processor finishes writing to the target data according to the write response.
[0064] 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, in this method, the number of network interactions between the server and the client 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. Due to the large delay of the non-volatile memory falling to the disk, the delay of this interaction between the server and the client is large.
[0065] Figure 3 It is a flowchart diagram of another data writing method, which includes steps S210 to S260.
[0066] S210: The server network card receives a write instruction from the client. The write instruction does not include the 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.
[0067] S220: The server network card transmits the write instruction to the processor, the processor parses the write instruction, generates a second read instruction, and sends the second read instruction to the network card, wherein 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.
[0068] 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 can be executed simultaneously. The client processor sends a read response to the server according to the third read instruction. The third read instruction can carry the source address and the memory address of the server.
[0069] S240: The server network card receives a read response from the client, the read response including target data, and writes the target data into the memory according to the memory address.
[0070] S250: The server network card receives the second read instruction, and writes the target data in the memory into the target storage according to the target address, where the target storage is a non-volatile storage, and specifically, the target storage may be an SSD.
[0071] 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.
[0072] The problems existing in the data writing method include at least: first, the method is applicable to the scenario where the write instruction does not include the target data, but is not applicable to the scenario 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 ends the writing of the target data according to 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 with the previous data writing method. Therefore, the number of interactions between the server and the client in this method is large, and the delay is large. Second, by using a programmable network card, when the write instruction is transmitted to the processor, the write instruction is parsed and the second read instruction is sent, which can save the interaction delay between the server and the client. However, the hardware implementation of the programmable network card is difficult and the cost is high. Third, the write response is sent only after the server network card writes the target data to the target memory. Due to the large delay of the non-volatile memory, the interaction delay between the server and the client is large.
[0073] Figure 4 FIG. 1 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. Figure 4 As shown in (A), the client includes an application 211, a memory 212, and an RDMA network card 213. The memory 212 may be a DRAM. The server includes an RDMA network card 221, a processor cache 223, and a persistent memory 224. Alternatively, Figure 4 As shown in (B), 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, and is compatible with a variety of RDMA protocols, such as Infiniband (IB)TM, Internet Wide Area RDMA Protocol (iWARP), RDMA over converged ethernet (RoCE), and RDMA over converged ethernet version 2 (RoCEv2).
[0074] 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.
[0075] After introducing the related technologies involved in the embodiments of the present application, the applicable scenarios of the embodiments of the present application are described in detail below. The technical solution provided in the embodiments of the present application can be applied to a communication network, which may include multiple network nodes, and 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 node in the communication network can also be referred to as a node, which can be a computer, a server, etc.
[0076] Figure 5 A schematic diagram of a communication network provided for 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, a data packet can be transmitted between the client 300 and the server 400. Among them, the client 300 may include a second network card (network interface card, NIC) 311 and a second processor 312. In one example, the second processor 312 may be a central processing unit (central processing unit, CPU). The server 400 may include a first network 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 (may be referred to as memory). Optionally, the memory may be a dynamic random access memory (dynamic random access memory, DRAM) or a double data rate (double data rate, DDR) memory. The memory may also be a non-volatile memory such as an SSD.
[0077] It is understandable that the above Figure 5 The structures of the client 300 and the server 400 shown are only exemplary. In actual applications, the client 300 and the server 400 may also include more or fewer components than those shown in the figure, or combine certain components, or arrange the components differently. Figure 5 It does not limit the embodiments of the present application.
[0078] In a possible embodiment, the technical solution provided in the embodiment of the present application can be applied in an online transaction processing (OLTP) process, such as in the securities high frequency trading market (HFT). Figure 6 A schematic diagram of a client and a data center provided for an embodiment of the present application. The data center may include multiple servers, which 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 server 400, and the slave nodes may be server 500 and server 600. The client 300 needs to write the target data to the data center. 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).
[0079] by Figure 6 Taking as an example, the process of the client 300 writing the target data into the data center is described. 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 into 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.
[0080] The technical solution provided in the embodiment of the present application can be compatible with the NOF protocol. Figure 7 A schematic diagram of a data writing process of a NOF protocol provided in an embodiment of the present application, the method includes steps S310 to S350.
[0081] S310: The second processor 312 sends a write request to the server through the second network card 311, where the write request includes target data. When the second network card 311 sends the write request to the server, there is an RDMA network delay.
[0082] S320: The first network card 411 stores the target data in the write request into the first memory according to the write request from the client.
[0083] S330: The first network card 411 sends a second response to the client, and the second response is used to indicate 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 delay of the data writing.
[0084] S340: When the first processor 412 determines that the target data is stored in the first memory by polling the first memory, the target data in the first memory is written into the first non-volatile memory. Specifically, the first non-volatile memory may be an NVMe SSD. When the target data in the first memory is written into the first non-volatile memory, there is a delay in writing to the disk.
[0085] S350: The first processor 412 sends a first response to the client through the first network card 411, where the first response is used to indicate the end of writing the target data. When the first network card 411 sends the first response to the client, there is an RDMA network delay.
[0086] 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.
[0087] This data writing method can be applied to the scenario where the write instruction includes target data (in-capsule data), but the first processor 412 sends the write response only after writing the target data to the first non-volatile memory. Since the disk delay of the first non-volatile memory is relatively large, the interaction delay between the server and the client is relatively large. Based on this, an embodiment of the present application provides a storage device for reducing the interaction delay during data writing. The storage device provided in an embodiment of the present application is described in detail below.
[0088] Figure 8 A schematic diagram of a storage device provided in an embodiment of the present application. The storage device 410 can be used as a first device and applied to 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.
[0089] Fig. 9 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 and applied in a client or as a server of a slave node. The storage device 310 may include: a second network card 311. 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 set in the first non-volatile memory 414.
[0090] For example, Figure 6As shown, 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 a host. Fig.10 Schematic diagram of the data writing process provided by the embodiment of the present application. Taking the first device as the device of the server 400 and the second device as the device of the client 300 as an example, Fig.10 Provide explanation.
[0091] The second network card 311 is used to send a write request to the first device, and the write request includes target data. The second processor 312 can enable the second network card 311 to send a write request to the first network card 411 through a remote direct memory access send (RDMA SEND) interface. The write mode can be an in-capsule data mode, and the target data included in the write request can be a small block of data, such as data of 0 to 16 kilobytes (KB) in size. When the second network card 311 sends a write request to the first device, there is an RDMA network delay.
[0092] The first network card 411 is used to receive a write request from the second device, the write request including target data. The first network card 411 is also used 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 being used to indicate the end of writing the target data.
[0093] Fig.11 A schematic diagram of a 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.
[0094] Exemplarily, the second device may include a second memory 313, and the second memory 313 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.
[0095] Exemplarily, in the first device, the first memory 413 may be coupled to the first processor 412 via a memory bus, and the first processor 412 may 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 may be coupled to the second processor 312 via a memory bus, and the second processor 312 may be coupled to the second network card 311 via a PCIe bus. Between the first device and the second device, the first network card 411 may communicate with the second network card 311 via an RDMA protocol.
[0096] The first network card 411 is further used to store the target data in the first memory 413 , which may be: the first network card 411 is used to store the target data in the receiving queue 432 in the RDMA buffer of the first memory 413 .
[0097] Furthermore, the first network card 411 is also used to send a first response to the second device based on the target data being stored in the first memory 413, which can be: the first network card 411 is also used 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 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 delay. Different from the traditional NOF protocol, in the traditional NOF protocol, the processor sends the first response to the second device only after the target data is written to the first non-volatile memory 414.
[0098] Furthermore, the first network card 411 is further configured to write a completion queue element (CQE) corresponding to the target data into a completion queue 433 in an RDMA buffer of the first memory 413 after the target data is stored in the first memory 413 .
[0099] The second network card 311 is also used to receive a first response from the first device, and the first response is the response from the first device that the second network card 311 receives for the first time after sending the write request. Different from the traditional NOF protocol, in the traditional NOF protocol, the second response is the response from the first device that the second network card 311 receives for the first time after sending the write request, and the first response is the response from the first device that the second network card 311 receives for the second time after sending the write request.
[0100] Optionally, after receiving the first response, the second network card 311 is further used to store the first response in the receiving queue 332 in the RDMA buffer of the second memory 313, and write the CQE corresponding to the first response into the completion queue 333 in the RDMA buffer of the second memory 313.
[0101] Optionally, the second processor 312 is used 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 end the writing of the target data. Specifically, the second processor 312 is used to end the writing of the target data, including: the second processor 312 is used to determine the storage space in the second memory 313 for storing the target data according to the CQE corresponding to the first response, end the timing of the write request, and release the storage space in the second memory 313 for storing the target data.
[0102] 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 send (RDMASEND) interface, and the completion instruction is used to indicate the completion of writing the target data.
[0103] The first processor 412 is used to write the target data in the first memory 413 into the first non-volatile memory 414. The first processor 412 is used to poll the CQE corresponding to the target data in the completion queue 433, determine that a write request is received, and write the target data in the first memory 413 into the first non-volatile memory 414. Specifically, the first processor 412 is used to write the target data in the first memory 413 into the first non-volatile memory 414, including: the first processor 412 is used to parse the write request, generate an NVMe instruction, and write the NVMe instruction as a send queue element (SQE) in the send queue 421 in the NVMe buffer of the first memory 413. The first device may also include a direct memory access circuit (DMA), and the DMA includes a DMA controller. The NVMe instruction is used 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 in 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.
[0104] The first non-volatile memory 414 is also used to write a CQE indicating the completion of writing in the completion queue 422 of the NVMe buffer of the first memory 413 after writing the target data. The first processor 412 is also used to, when polling the CQE indicating the completion of writing, determine that the first non-volatile memory 414 has written the target data according to the CQE, and release the storage space in the first memory 413 used to store the target data.
[0105] 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 that the first non-volatile memory 414 has written the target data according to the CQE, and enable the first network card 411 to send a first response to the client through the RDMA SEND interface.
[0106] And, in the traditional NOF protocol, the first network card 411 is also used to receive the completion instruction from the second device, store the completion instruction in the receiving queue 432 in the RDMA buffer of the first memory 413, and write the CQE corresponding to the completion instruction in the completion queue 422 of the NVMe buffer of the first memory 413. The first processor 412 is also used to parse the completion instruction when polling the CQE corresponding to the completion instruction, and release the storage space in the first memory 413 for storing the target data.
[0107] 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, the scheme is suitable for the scenario 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, the scheme 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 into a synchronous process that returns after writing, bypassing the processing process of the first processor 412 and the process of the first non-volatile memory 414 falling to disk, further saving the processing delay of the first processor 412 and the non-volatile memory falling to disk delay. 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 performed 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.
[0108] 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. Among them, the persistent memory can 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 powered off, the target data stored in the first memory 413 is not lost, thereby improving data reliability.
[0109] Optionally, the first network card 411 can also be used to Fig.11 The path shown registers a storage space in the first memory 413, 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.
[0110] In a possible embodiment, the backup battery module includes a power supply module and a second non-volatile memory. The first processor 412 is used to store the target data of 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 also used to store the target data in the second non-volatile memory to the first memory 413.
[0111] When the main power supply of the first device is cut off, in order to avoid loss of target data in the first memory 413 , the power supply module supplies power to the first memory 413 . Fig.12 The power supply module provided for the embodiment of the present application is a schematic diagram of a process of storing target data of the first memory 413 into the second non-volatile memory, which may specifically include S410 to S460.
[0112] S410: Main power failure.
[0113] 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 device.
[0114] S430: The first processor 412 powers off the power-consuming devices, where the power-consuming devices may include: the first non-volatile memory 414, a hard disk in the host, a fan, and other devices.
[0115] S440 : The first processor 412 suspends the operating system (OS) and the software. The first processor 412 stores the data in its cache into the first memory 413 .
[0116] S450: The first processor 412 calculates a cyclic redundancy check (CRC) of a storage space used to store target data.
[0117] 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) in which a basic input output system (BIOS) is installed, and the first processor 412 executes steps S430 to S460 based on the BIOS.
[0118] Fig.13 This 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 .
[0119] S501: The main power supply is restored and the first device is started.
[0120] 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.
[0121] S503: The first processor 412 detects whether there is dirty data. If yes, execute S504. If no, execute S511.
[0122] S504: The first processor 412 detects whether the target data is successfully verified. If so, execute S505. If not, execute S511. Specifically, the first processor 412 reads the target data in the second non-volatile memory and performs CRC verification to detect whether the verification is successful.
[0123] S505 : the first processor 412 stores the target data in the second non-volatile memory to the first memory 413 .
[0124] S506: The first processor 412 clears dirty data.
[0125] S507: The first processor 412 starts the 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.
[0126] S508: The first processor 412 detects whether the first non-volatile memory 414 is in an available state. If yes, execute S509. If no, execute S511.
[0127] S509 : the first processor 412 writes the target data in the first memory 413 into the first non-volatile memory 414 .
[0128] 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.
[0129] 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.
[0130] In the storage device provided in the 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 of the first device is cut off, thereby improving data reliability.
[0131] In a 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 first information from the first device.
[0132] Exemplarily, the second device may adopt the data writing path of the traditional NOF protocol or the data writing path of the technical solution provided by the present application. Before each data writing between the first device and the second device, the first device needs to negotiate the data transmission path with the second device. Fig.14 The schematic diagram of the negotiated data transmission path provided in the embodiment of the present application may specifically include S610-S630.
[0133] S610: The second processor 312 determines that the interaction object 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.
[0134] S620: The first processor 412 sends the first information to the second device according to the interactive confirmation information. The first information may be a special field L, and a preset bit in the special field L is 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, that is, 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 is off.
[0135] S630: The second processor 312 receives the first information, determines the data writing path using the technical solution provided by the present application to interact with the first device according to the first information, and sends a path response to the first device to complete the negotiation of the data transmission path.
[0136] In the storage device provided in the embodiment of the present application, the first processor 412 is used to send the first information to the second device, and the first information is used to indicate that the first memory 413 is the persistent memory, or the storage device 410 includes the backup battery module. In this way, when the first device can ensure that the main power supply is powered off and the target data stored in the first memory 413 is not lost, the second device and the first device adopt the data writing path of the technical solution provided in the present application, which can improve data reliability, reduce latency, improve the throughput performance of the first device, and improve interaction efficiency.
[0137] 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 according to 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 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 according to 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.
[0138] In the storage device provided in the embodiment of the present application, the second processor 312 is also used to receive second information, and the second information is used to indicate that the memory of the third device is not a persistent memory and the memory of the third device does not have a backup battery module. When the third device cannot ensure that the main power supply is powered off and the target data stored in the first memory 413 is not lost, the second device and the third device adopt the data writing 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 a suitable data transmission path according to the hardware of the interactive object, which is more flexible.
[0139] In a possible embodiment, a storage performance development toolkit is installed on the first processor 412, and 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. Optionally, a storage performance development toolkit is installed on the second processor 312, and the second processor 312 is used to perform the steps in the above embodiment based on the storage performance development toolkit.
[0140] Exemplarily, 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. Fig.15 A data transmission schematic diagram provided for 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 the RoCE interface) of the storage device 310. The RDMA interface (such as the 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 an NVMe SSD). The first processor 412 of the server sends a first response to the client. The client ends writing the target data based on the first response 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.
[0141] The I / O model of the target data can be: the input / output (I / O) block size is 4K, and the client's I / O queue depth (iodepth) is 1. The network data transmission in the NOF protocol adopts the in-capsule data method, and the data is included in the RDMA_SEND capsule and sent to the server.
[0142] 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 (CQE of the second corresponding response) is received. When a CQE of type RDMA_WR_TYPE_RECV (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 CQE of type RDMA_WR_TYPE_RECV.
[0143] 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.
[0144] Fig.16 A flowchart of a storage method provided in an embodiment of the present application is provided, which can be applied to a storage device including a first memory and a first non-volatile memory, and the method includes steps S710 to S730.
[0145] S710: Receive a write request from a second device, where the write request includes target data.
[0146] S720: 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, where the first response is used to indicate the end of writing to the target data.
[0147] S730: Write the target data in the first memory into the first non-volatile memory.
[0148] 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.
[0149] 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 of the first memory into the second non-volatile memory. The target data in the second non-volatile memory is stored into the first memory.
[0150] 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 the storage device includes the backup battery module.
[0151] 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.
[0152] In one possible embodiment, the first non-volatile memory includes an NVMe SSD.
[0153] 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 storage device 410 embodiment, it will not be repeated here.
[0154] Fig.17 A flowchart of another storage method provided in an embodiment of the present application. The method includes steps S810 and S820.
[0155] S810: Send a write request to a first device, where the write request includes target data.
[0156] S820: Receive a first response from the first device, where the first response is used to indicate the end of writing the target data.
[0157] In a possible embodiment, 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 includes a backup battery module for powering the first memory of the first device.
[0158] 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 storage device 310 embodiment, it will not be repeated here.
[0159] Fig.18 The electronic device 500 may include: Figure 8Optionally, the electronic device 500 may include a host 510, and the storage device 410 is coupled to the host 510.
[0160] 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 to perform 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 to communicate, such as supporting the device to communicate 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 a computing function, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like.
[0161] It can be understood that the various components of the above-mentioned electronic device 500 can be used to realize 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.
[0162] Fig.19 FIG. 6 is a schematic diagram of another electronic device provided in an embodiment of the present application. The electronic device 600 may include Fig. 9 Optionally, the electronic device 600 may include a host 610, and the storage device 310 is coupled to the host 610.
[0163] 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 to perform one or more steps of the above-mentioned method embodiment and other technical processes described herein. The second network card is used to support the device to communicate, such as supporting the device to communicate 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 devices, transistor logic devices, hardware components 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 a computing function, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like.
[0164] It can be understood that the various components of the above-mentioned electronic device 600 can be used to realize the corresponding purposes in the above-mentioned device embodiment. Since the various purposes have been described in detail in the above-mentioned storage device 310 embodiment, they will not be repeated here.
[0165] Fig. 20 A schematic diagram of the structure of a storage system provided in an embodiment of the present application. The storage system includes Figure 8 The storage device 310 and Fig. 9 The storage device 410 in the embodiment of the storage device. Since each component has been described in detail in the above storage device embodiment, it will not be repeated here.
[0166] 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.
[0167] 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.
[0168] 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 embodiments.
[0169] 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 embodiments.
[0170] 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.
[0171] In the several embodiments provided in the present 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 only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, 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.
[0172] Finally, it should be noted that the above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope 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 that 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.
