Data storage method, device and system and computer equipment

By determining the target area and order of write requests on the host side, generating and issuing write instructions, the problem of degradation of Zone sequential write performance in ZNS SSD is solved, and system efficiency and write performance are improved.

CN119127057APending Publication Date: 2024-12-13BEIJING SUPERSTRING ACAD OF MEMORY TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310693245.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-12
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In ZNS SSD, under the NVMe standard, the limitation of zone sequential writes leads to degradation of host system performance, and the return of physical addresses in the Append command response affects system efficiency.

Method used

Send query commands to the SSD side through the host side, receive flag feedback, and determine the target area and issuance order of data to be written according to the attributes of the write request, generate write instructions, and send the write instructions to the queue in the preset order in the order of the write request. In this case, the controller on the SSD side is made to read and store data in turn.

Benefits of technology

It improves the writing efficiency of the target area, reduces the time the host side waits for feedback information, reduces the system complexity, and improves the overall system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127057A_ABST
    Figure CN119127057A_ABST
Patent Text Reader

Abstract

The invention relates to a data storage method, device and system and computer equipment. The method comprises the following steps: determining a target area and an issuing sequence of each piece of to-be-written data according to an attribute of a write request sent by a requester, and issuing each write instruction corresponding to each piece of to-be-written data to a queue in sequence according to the issuing sequence, so that a controller on an SSD side reads each write instruction in sequence, and storing the to-be-written data corresponding to each writing instruction into a target area in the writing instruction. According to the method, the write operation can be executed on each target area according to the preset execution sequence, so that the write efficiency of the target areas is improved; in addition, the host end can execute the next processing command without waiting for feedback information, so that the system efficiency is improved, and the system complexity is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a data storage method, device, system and computer equipment. Background Art

[0002] SSD (Solid State Drive) is a new type of solid-state drive that supports Zoned Namespace (ZNS). The host and SSD can interact collaboratively based on the ZNS protocol. ZNS divides the Namespace within an SSD into multiple zones. Each zone is an independent read and write unit that can be read in any order but needs to be written in order. These features allow ZNS SSD to improve its internal data placement, thereby achieving higher performance through higher write throughput, higher quality of service (QoS), and larger capacity.

[0003] The NVMe standard is an interface protocol for PCI-E solid-state drives. The NVMe specification does not require the order in which the controller in the SSD executes commands. Under the restriction of sequential write in the zones, the host system software needs to ensure that only one write instruction is being processed for the same zone at any one time, which results in a decrease in system performance.

[0004] To solve the above problems, the ZNS specification introduces a new Zone Append command (multiple commands are sent). This mechanism allows the host to submit multiple zone append operations at the same time and let the SSD process these operations in any order. However, the physical address needs to be returned to the Host in the Append command response. The Host maintains the mapping from logical addresses to physical addresses, which affects system efficiency. Summary of the invention

[0005] Based on this, it is necessary to provide a data storage method, device, system and computer equipment to effectively improve the problem of returning the physical address to the Host in the Append command response, which affects the system efficiency, in response to the above technical problems.

[0006] In a first aspect, the present application provides a data storage method, which is applied to a host side. The method comprises:

[0007] The host side responds to the write request sent by the requester, receives the data to be written, and sends a query command to the SSD side through the hardware interface;

[0008] Receiving the flag bit fed back by the SSD side in response to the query command, and when the flag bit meets the preset condition, determining the target area and the sending order of each of the data to be written according to the attribute of the write request; wherein the flag bit is associated with the sending order of each of the data to be written;

[0009] According to the target area, generating a corresponding write instruction for each of the data to be written;

[0010] According to the sending order, the generated multiple write instructions are sent to the queue in sequence, so that the controller on the SSD side reads each write instruction from the queue in sequence and stores the data to be written corresponding to each write instruction in the target area in the write instruction.

[0011] In one embodiment, the method of determining whether the flag bit meets a preset condition includes:

[0012] If the flag bit is set to 1, it is considered that the flag bit meets the preset condition.

[0013] In one embodiment, determining the target area of ​​each data to be written according to the attribute of the write request includes:

[0014] Determine the length of each of the to-be-written data in the write request;

[0015] According to each of the lengths and the pre-acquired remaining capacity of each area on the SSD side, the target area to which each of the data to be written is written and the starting position of each of the data to be written in the target area to be written are determined.

[0016] In one embodiment, determining the order of sending the data to be written according to the attribute of the write request includes:

[0017] Determining a writing order of each of the data to be written in the target area to be written according to a starting position of each of the data to be written in the target area to be written;

[0018] When each of the write instructions in a queue corresponds to a target area, the writing order of each of the to-be-written data in the target area is used as the issuing order of the write instructions.

[0019] In one embodiment, determining the order of sending the data to be written according to the attribute of the write request further includes:

[0020] When the write instructions in a queue correspond to different target areas, for a plurality of data to be written corresponding to a target area, the execution order of the data to be written is the same as the writing order of the data to be written in the target area;

[0021] Furthermore, the sending order of any two data to be written in different target areas is irrelevant.

[0022] In one embodiment, generating a corresponding write instruction for each of the data to be written according to the target area includes:

[0023] According to the target area where each of the data to be written is written and the starting position of each of the data to be written in the target area, a corresponding write instruction is generated for each of the data to be written.

[0024] In one embodiment, when multiple write requests are received, responding to the write request sent by the requester includes:

[0025] According to the request sequence of each of the write requests, each of the write requests is responded to in sequence from first to last.

[0026] In a second aspect, the present application also provides a data storage device. The device comprises:

[0027] A receiving module, used to respond to a write request sent by a requester and receive data to be written;

[0028] A query module, used to send a query command to the SSD side through a hardware interface, and receive a flag bit fed back by the SSD side in response to the query command;

[0029] A processing module, used for determining the target area and the sending order of each of the data to be written according to the attribute of the write request when the flag bit meets the preset condition; wherein the flag bit is associated with the sending order of each of the data to be written;

[0030] A write instruction generation module, used for generating a corresponding write instruction for each of the data to be written according to the target area;

[0031] The sending module is used to send the generated multiple write instructions to the queue in sequence according to the sending order, so that the controller on the SSD side reads each write instruction from the queue in sequence and stores the data to be written corresponding to each write instruction in the target area in the write instruction.

[0032] In a third aspect, the present application also provides a data storage method, which is applied to the SSD side. The method comprises:

[0033] The controller on the SSD side queries the flag bit corresponding to the writing order of the data in response to the query command sent by the host side, and sends it to the host side through the hardware interface; wherein the flag bit is set based on the ZNS storage specification and pre-stored in the controller;

[0034] Read each write instruction from the queue in sequence, and store the to-be-written data corresponding to each write instruction in the target area in the write instruction;

[0035] Among them, each write instruction is generated by the host side in response to a write request sent by the requester when the flag bit meets the preset conditions, and the sending order of each write instruction in the queue is determined by the host side according to the attributes of the write request.

[0036] In a fourth aspect, the present application further provides a data storage device, the device comprising:

[0037] A controller, configured to query a flag bit corresponding to a writing order of data in response to a query command sent by a host side, and send the flag bit to the host side through a hardware interface; wherein the flag bit is set based on the ZNS storage specification and pre-stored in the controller;

[0038] It is also used to read each write instruction from the queue in sequence, and store the to-be-written data corresponding to each write instruction in the target area in the write instruction;

[0039] Among them, each write instruction is generated by the host side in response to a write request sent by the requester when the flag bit meets the preset conditions, and the sending order of each write instruction in the queue is determined by the host side according to the attributes of the write request.

[0040] In a fifth aspect, the present application also provides a data storage method, the method comprising:

[0041] The host side responds to the write request sent by the requester, receives the data to be written, and sends a query command to the SSD side through the hardware interface;

[0042] The controller on the SSD side queries the flag bit corresponding to the writing order of the data in response to the query command sent by the host side, and sends it to the host side; wherein the flag bit is set based on the ZNS storage specification and pre-stored in the controller;

[0043] The host side receives the flag bit fed back by the SSD side in response to the query command, and when the flag bit meets the preset condition, determines the target area and the sending order of each data to be written according to the attribute of the write request; wherein the flag bit is associated with the sending order of each data to be written; generates a corresponding write instruction for each data to be written according to the target area; and sends the generated multiple write instructions to the queue in sequence according to the sending order;

[0044] The controller reads each write instruction from the queue in sequence, and stores the to-be-written data corresponding to each write instruction in a target area in the write instruction.

[0045] In a sixth aspect, the present application further provides a data storage system implemented by a computer program, the system comprising:

[0046] A receiving module, arranged at the host side, for responding to a write request sent by a requester and receiving data to be written;

[0047] A query module, arranged on the host side, for sending a query command to the SSD side through a hardware interface, and receiving a flag bit fed back by the SSD side in response to the query command;

[0048] A processing module, arranged on the host side, is used to determine the target area and the sending order of each of the data to be written according to the attribute of the write request when the flag bit meets the preset condition; wherein the flag bit is associated with the sending order of each of the data to be written;

[0049] A write instruction generation module, arranged on the host side, for generating a corresponding write instruction for each of the data to be written according to the target area;

[0050] A sending module, arranged on the host side, is used to send the generated multiple write instructions to the queue in sequence according to the sending order;

[0051] A controller is arranged on the SSD side, and is used to respond to a query command sent by the host side, query a flag bit corresponding to the writing order of the data, and send it to the host side; wherein the flag bit is set based on the ZNS storage specification and pre-stored in the controller; and is also used to read each write instruction from the queue in sequence, and store the data to be written corresponding to each write instruction in the target area in the write instruction.

[0052] In a seventh aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method steps described in any one of the first aspect, the method steps described in any one of the third aspect, the method steps described in any one of the fifth aspect, or the solution described in the sixth aspect when executing the computer program.

[0053] In an eighth aspect, the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method steps described in any one of the first aspect, the method steps described in any one of the third aspect, the method steps described in any one of the fifth aspect, or the solution described in the sixth aspect are implemented.

[0054] The above data storage method, device, system and computer equipment have at least the following advantages:

[0055] This application determines the target area and the order of issuance of each data to be written according to the attributes of the write request sent by the requester, and sends each write instruction corresponding to each data to be written to the queue in the order of issuance, so that the controller on the SSD side reads each write instruction in turn and stores the data to be written corresponding to each write instruction in the target area in the write instruction. This application can perform write operations on each target area according to the preset execution order, which improves the write efficiency of the target area; in addition, the host side can execute the next processing command without waiting for feedback information, which improves system efficiency and reduces system complexity. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The drawings constituting a part of this application are used to provide a further understanding of the present invention. The illustrative embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0058] Figure 1 A schematic diagram of an application environment of a data storage system in an embodiment;

[0059] Figure 2 is a structural block diagram of a data storage system in one embodiment;

[0060] Figure 3 A schematic diagram of a flow chart of a data storage method in one embodiment;

[0061] Figure 4 A schematic diagram of a process for determining a target area in one embodiment;

[0062] Figure 5 A schematic diagram of the structure of a data storage method in one embodiment;

[0063] Figure 6 A schematic diagram of the structure of a data storage method in another embodiment;

[0064] Figure 7 is a structural block diagram of a data storage device in one embodiment;

[0065] Figure 8 A schematic diagram of a flow chart of a data storage method in another embodiment;

[0066] Fig. 9 A schematic diagram of a flow chart of a data storage method in another embodiment;

[0067] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0068] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0069] While some exemplary embodiments of the present invention have been described for the purpose of illustration, it should be understood that the present invention may be implemented in other ways not specifically shown in the drawings.

[0070] See also Figure 1 The data storage system provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. It should be understood that a solid state drive (SSD) is a hard disk made of a solid-state electronic memory chip array. In some embodiments, the SSD consists of a control unit and a storage unit (FLASH chip, DRAM chip). Storage devices enable users to store and retrieve data. Examples of storage devices include non-volatile memory devices. Further, ZNS is an SSD namespace architecture. The non-volatile memory in the SSD is divided into fixed-size groups of logical addresses or zones by ZNS. Each zone can be used for a specific application, such as Figure 1It can be divided into zone 0, zone 1...zone N. Each zone includes multiple blocks, where the block size can be set as needed, for example, each block is set to 4k in size. The stored data can be user data, XOR or parity data, device metadata, or any other suitable data to be stored in the SSD. Each zone can be read in any order, but only LBA sequential writes are supported. The NVMe specification in the ZNS command set allows the device controller to execute commands in multiple available submission queues in any order, which has an impact on the host IO stack. Even if the host submits write instructions for the zone sequentially, these instructions may be reordered before processing and violate the sequential write requirements, resulting in errors and performance degradation. The Zone Append command of the ZNS specification can specify the first logical block of a target zone as a write operation for the write location. This mechanism allows the host to submit multiple zone append operations at the same time and let the SSD process these operations in any order. However, when the controller executes a command and writes data in the specified area, the change of the pointer position of the current area is automatic, and the effective write position of the data is eventually indicated to the host through the command completion information. As a result, the host can only execute the next processing command after receiving the command completion information, which affects the system efficiency.

[0071] To this end, a hardware interface or a network cluster with a hardware interface is provided between the host and the SSD in the embodiment of the present application. Through the hardware interface, the host can communicate with the solid state drive and realize data transmission. For example, the host can respond to the service request of the requester to read or write to the solid state drive; wherein the service request includes a write request and a read request. Exemplarily, when the service request is a write request, the host responds to the write request, receives the data to be written, and sends a query command to the SSD side through the hardware interface. When the flag bit fed back by the SSD side in response to the query command is received and the flag meets the preset conditions, the target area and the order of issuance of each data to be written are determined according to the attributes of the write request. The host generates a corresponding write instruction for each data to be written according to the target area; according to the issuance order, the generated multiple write instructions are sequentially issued to the queue to form at least one queue. The controller on the SSD side reads each write instruction in a queue each time, and stores the data to be written corresponding to each write instruction in the target area in the write instruction in turn.

[0072] See also Figure 2 In some embodiments, the data storage system provided by the embodiments of the present application includes:

[0073] The receiving module is arranged at the host side, and is used to respond to the write request sent by the requester and receive the data to be written.

[0074] The query module is arranged on the host side, and is used to send a query command to the SSD side through the hardware interface, and receive a flag bit fed back by the SSD side in response to the query command.

[0075] The processing module is arranged on the host side, and is used to determine the target area and the sending order of each data to be written according to the attribute of the write request when the flag bit meets the preset condition; wherein the flag bit is associated with the sending order of each data to be written.

[0076] The write instruction generation module is arranged on the host side and is used to generate a corresponding write instruction for each data to be written according to the target area.

[0077] The sending module is arranged on the host side and is used to send the generated multiple write instructions to the queue in sequence according to the sending order.

[0078] The controller is arranged on the SSD side, and is used to respond to the query command sent by the host side, query the flag corresponding to the writing order of the data, and send it to the host side; wherein the flag is set based on the ZNS storage specification and pre-stored in the controller; and is also used to read each write instruction from the queue in sequence, and store the data to be written corresponding to each write instruction in the target area in the write instruction; wherein the controller reads only one queue at a time.

[0079] The above data storage method determines the target area and the sending order of each data to be written according to the attributes of the write request sent by the requester, and sends each write instruction corresponding to each data to be written to the queue in the sending order, so that the controller on the SSD side reads each write instruction in turn and stores the data to be written corresponding to each write instruction in the target area in the write instruction. The present application can perform write operations on each target area according to the preset execution order, thereby improving the write efficiency of the target area; in addition, the host side can execute the next processing command without waiting for feedback information, thereby improving system efficiency and reducing system complexity.

[0080] See also Figure 3 In some embodiments, the present application provides a data storage method, which specifically includes the following steps:

[0081] Step S302: the host side receives the data to be written in response to the write request sent by the requester.

[0082] Step S304, sending a query command to the SSD side through the hardware interface, and receiving the flag bit fed back by the SSD side in response to the query command; wherein the flag bit is associated with the order in which each data to be written is sent, and the association here can be understood as different flags corresponding to different sending orders.

[0083] Step S306: When the flag meets the preset condition, the target area and the sending order of each data to be written are determined according to the attribute of the write request.

[0084] Step S308: Generate a corresponding write instruction for each data to be written according to the target area.

[0085] Step S310, sending the generated multiple write instructions to the queue in sequence according to the sending order, so that the controller on the SSD side reads each write instruction from the queue in sequence and stores the to-be-written data corresponding to each write instruction in the target area in the write instruction.

[0086] Specifically, a write request is sent by an application to the system software on the host side, where the application can run on the host or on a terminal and communicate with the host through a network. After receiving the write request and the data to be written, the host responds to the write request, allocates a target area for the data to be written, and determines the order of writing so that the controller on the SSD side stores the data to be written in the target area in sequence according to the order.

[0087] Furthermore, the specifications followed by the solid-state drive vary depending on the manufacturer. In the ZNS storage specification (Nvmezoned command sepc), a flag bit associated with the writing order of data can be set, which indicates whether the controller is allowed to perform sequential write operations on an area in a queue. If the flag bit is set to "0", the execution order of the controller on an area in a queue is not guaranteed; if it is set to "1", the controller is allowed to perform sequential write operations on an area in a queue. The solid-state drive sets the flag bit based on the ZNS storage specification before leaving the factory, and stores the setting result in the corresponding position of the controller of the solid-state drive. Before determining the order of sending the data to be written, the host first sends a query instruction to the controller on the SSD side through the hardware interface. The controller responds to the query instruction, queries the value corresponding to the flag bit, and feeds back the value corresponding to the flag bit to the host. If the flag bit meets the preset condition, that is, the flag bit is set to "1", the host determines the order of sending each data to be written according to the attributes of the write request. Otherwise, the host only submits the regional operation, and the SSD side processes the above operations in any order. In this way, the host first determines the working mode of the controller, and determines the data storage method based on the working mode, so that the system can be applied to a variety of application scenarios.

[0088] The above data storage method determines the target area and the sending order of each data to be written according to the attributes of the write request sent by the requester, and sends each write instruction corresponding to each data to be written to the queue in the sending order, so that the controller on the SSD side reads each write instruction in turn and stores the data to be written corresponding to each write instruction in the target area in the write instruction. The present application can perform write operations on each target area according to the preset execution order, thereby improving the write efficiency of the target area; in addition, the host side can execute the next processing command without waiting for feedback information, thereby improving system efficiency and reducing system complexity.

[0089] See also Figure 4 Optionally, according to the attribute of the write request, determining the target area of ​​each data to be written includes:

[0090] Step S402, determining the length of each data to be written in the write request;

[0091] Step S404 , determining the target area to which each data to be written is to be written and the starting position of each data to be written in the target area to be written according to each length and the pre-acquired remaining capacity of each area on the SSD side.

[0092] Specifically, when allocating a target area for data to be written, the length of the data to be written and the area capacity of the target area should be considered, and the capacity of the data to be written should be less than or equal to the area capacity of the target area to which it is written. Specifically, for example, the size of each block in the target area Zone 0 is 4k, and there are three data to be written this time, of which the first data is 4k, the second data is 8k, and the third data is 4k. At this time, it is necessary to confirm whether the capacity of the free block in the target area Zone 0 meets the requirement of 16k to be written. If it does, then at the first write instruction, after writing the first data of 4k to the first block in the target area Zone 0, update the write pointer WP to the beginning of the second block, continue to write the second data of 8k to the second and third blocks, update the write pointer WP to the beginning of the fourth block, write the third data of 4k to the fourth block, and end this write operation. If it does not meet the requirement, the target area needs to be reallocated to write all the data into the solid-state drive.

[0093] Optionally, according to the target area, a corresponding write instruction is generated for each data to be written, including:

[0094] According to the target area where each data to be written is written and the starting position of each data to be written in the target area, a corresponding write instruction is generated for each data to be written.

[0095] Specifically, each write instruction corresponding to the data to be written includes the target area of ​​the data to be written and the write position in the target area. Exemplarily, for the first data, if the target area to be written is zone 0 (Zone 0) and the write address is lbaN, then the generated write instruction is instruction 0 (zone 0: address N), and its corresponding program code is cmd0 (Zone0: lbaN); for the second data, if the target area to be written is zone 0 (Zone 0) and the write address is lbaN+1, then the generated write instruction is instruction 1 (zone 0: address N+1), and its corresponding program code is cmd1 (Zone0: lbaN+1), and the corresponding write instructions are generated for each data to be written in turn.

[0096] Optionally, according to the attribute of the write request, determining the order in which the data to be written are sent includes:

[0097] The writing order of each data to be written in the target area to be written is determined according to the starting position of each data to be written in the target area to be written; when each write instruction in a queue corresponds to a target area, the writing order of each data to be written in the target area is used as the issuing order of the write instruction.

[0098] See also Figure 5 Before sending write instructions to each queue, the host determines the target area corresponding to each data to be written and the writing order in the target area according to the actual storage situation of each area on the SSD side. If each write instruction in a queue corresponds to the same target area, the above writing order is the sending order. For example, three data to be written are written in target area 0 (Zone 0), and the write address of the first data is lbaN, the write address of the second data is lbaN+1, and the write address of the third data is lbaN+2; then the host generates corresponding write instructions for the above three data to be written in turn, and sends the write instructions corresponding to the first data, the second data, and the third data to queue 1 in turn according to the writing order of each data to be written in target area 0. By analogy, each write instruction in target area 1 is sent to queue 2 in turn, and each write instruction in target area N is sent to queue N in turn.

[0099] Further, the controller on the SSD side forms two threads in instance 0 (Core0), wherein thread 1 is used to read and execute each write instruction from queue 1 in sequence, and store the data to be written corresponding to each write instruction in area 0. For example, thread 1 first reads the first write instruction, that is, instruction 0. After executing instruction 0, the write pointer (WP) of area 0 will point to N+1, and continue to execute the second write instruction until the data corresponding to all write instructions in queue 1 are written into area 0. Similarly, thread 2 is used to read and execute each write instruction from queue 2 in sequence, and store the data to be written corresponding to each write instruction in area 1. It should be understood that since the execution speeds of different threads are not the same, in order to ensure that the write instructions in each queue are written into the corresponding target area in the order of issuance, the controller in this embodiment has one thread for each queue component, and each thread is independent of each other. Using the above method, the write instructions in the above queues 1, queue 2, and queue N can be executed simultaneously, and the host only needs to determine the execution order. After issuing the write instruction, the next processing command can be executed, thereby greatly improving the processing efficiency of the system.

[0100] Optionally, determining the order of sending the data to be written according to the attribute of the write request further includes:

[0101] When each write instruction in a queue corresponds to a different target area, for multiple data to be written corresponding to a target area, the execution order of each data to be written is the same as the writing order of the data to be written in the target area; and the sending order of any two data to be written with different target areas is unrelated.

[0102] See also Figure 6 If each write instruction in a queue corresponds to a different target area, it is only necessary to ensure the order of issuing each write instruction in each target area, and the issuing order is the same as the writing order of each write instruction in the target area. However, this application does not require the issuing order between different target areas. For example, Figure 6 The queue 1 in includes four write instructions, among which the target area corresponding to the first write instruction and the third write instruction, that is, instruction 0 and instruction 2, is area 0, and the write address of instruction 0 is lbaN, and the write address of instruction 2 is lbaN+1. When issuing the write instruction, it is necessary to ensure that the issuing order of instruction 0 is before the issuing order of instruction 2. Similarly, the target area corresponding to the second write instruction and the fourth write instruction, that is, instruction 1 and instruction 3, is area 1, and the write address of instruction 1 is lbaN, and the write address of instruction 3 is lbaN+1. When issuing the write instruction, it is necessary to ensure that the issuing order of instruction 1 is before the issuing order of instruction 3. The issuing order of instruction 0 and instruction 1 is not related and can be issued randomly.

[0103] Furthermore, the controller on the SSD side forms two threads in instance 0 (Core0), wherein thread 1 is used to read and execute each write instruction from queue 1 in sequence, and store the data to be written corresponding to each write instruction in area 0 or area 1. For example, thread 1 first reads the first write instruction, that is, instruction 0. After executing instruction 0, the write pointer (WP) of area 0 will point to N+1, and continue to execute the second write instruction to write the data to the lbaN position in area 1. After completing the second write instruction, the WP in area 1 automatically increases by 1 and points to N+1; then execute the third write instruction, at this time, write the data to the lbaN+1 position in area 0; continue to execute the fourth write instruction, and write the data to the lbaN+1 position in area 1. The above write instructions are executed in sequence, and finally the data is written to the target area Zone 0 and the target area Zone 1, completing all the write instructions in the queue. Similarly, thread N is used to read and execute each write instruction from queue N in sequence, and store the data to be written corresponding to each write instruction in area N. It should be noted that, in this embodiment, one thread can perform write operations on multiple areas, but only corresponds to one queue.

[0104] Optionally, when the host receives multiple write requests, in response to the write request sent by the requester, the host includes:

[0105] According to the request sequence of each write request, each write request is responded to in sequence from first to last.

[0106] Furthermore, when there are multiple applications interacting with the host at the same time, each application can set a priority in advance according to the project development requirements. When multiple applications act as requesters at the same time and send multiple write requests to the host, the host side can not only respond in the order of the request of each write request, but also obtain the priority carried in each write request, and respond to each requester in order from high to low priority.

[0107] In order to enable those skilled in the art to fully understand the present application, the steps of the data storage method of the present application are described in detail below:

[0108] The host responds to the write request sent by the requester and receives the data to be written; at the same time, it sends a query command to the SSD side through the hardware interface and receives the flag bit fed back by the SSD side in response to the query command. When the flag bit meets the preset conditions, the length of each data to be written in the write request is determined, and the target area to be written for each data to be written and the starting position of each data to be written in the target area to be written are determined based on each length and the remaining capacity of each area on the SSD side obtained in advance.

[0109] Furthermore, the host generates a corresponding write instruction for each data to be written according to the target area to which each data to be written is written and the starting position of each data to be written in the target area to be written. Then, according to the starting position of each data to be written in the target area to be written, the writing order of each data to be written in the target area to be written is determined; when each write instruction in a queue corresponds to a target area, the writing order of each data to be written in the target area is used as the sending order of the write instruction. When each write instruction in a queue corresponds to different target areas, for multiple data to be written corresponding to a target area, the execution order of each data to be written is the same as the writing order of the data to be written in the target area; and the sending order of any two data to be written with different target areas is irrelevant.

[0110] The controller on the SSD side builds multiple threads, and each thread corresponds to a queue. When each thread is executed, it reads the write instructions from the corresponding queue in turn, and stores the data to be written corresponding to each write instruction in the target area in the write instruction.

[0111] The above data storage method determines the target area and the sending order of each data to be written according to the attributes of the write request sent by the requester, and sends each write instruction corresponding to each data to be written to the queue in the sending order, so that the controller on the SSD side reads each write instruction in turn and stores the data to be written corresponding to each write instruction in the target area in the write instruction. The present application can perform write operations on each target area according to the preset execution order, thereby improving the write efficiency of the target area; in addition, the host side can execute the next processing command without waiting for feedback information, thereby improving system efficiency and reducing system complexity.

[0112] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0113] Based on the same inventive concept, the embodiment of the present application also provides a data storage device for implementing the data storage method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more data storage device embodiments provided below can refer to the limitations on the data storage method above, and will not be repeated here.

[0114] See also Figure 7 In some embodiments, the present application provides a data storage device, including: a receiving module, a query module, a processing module, a write instruction generation module and a sending module, wherein:

[0115] A receiving module, used to respond to a write request sent by a requester and receive data to be written;

[0116] A query module, used to send a query command to the SSD side through a hardware interface, and receive a flag bit fed back by the SSD side in response to the query command;

[0117] A processing module, used for determining the target area and the sending order of each data to be written according to the attribute of the write request when the flag bit meets the preset condition; wherein the flag bit is associated with the sending order of each data to be written;

[0118] A write instruction generation module, used to generate corresponding write instructions for each data to be written according to the target area;

[0119] The sending module is used to send the generated multiple write instructions to the queue in sequence according to the sending order, so that the controller on the SSD side reads each write instruction from the queue in sequence and stores the data to be written corresponding to each write instruction in the target area in the write instruction.

[0120] Optionally, when the host receives multiple write requests, the receiving module responds to the write requests sent by the requester, including: responding to each write request in order from first to last according to the request order of each write request. Furthermore, when there are multiple applications that interact with the host at the same time, each application can set a priority in advance according to the project development requirements. When multiple applications act as requesters at the same time and send multiple write requests to the host, in addition to responding in the request order of each write request, the host side can also obtain the priority carried in each write request and respond to each requester in order from high to low priority.

[0121] Optionally, the processing module determines the target area for each data to be written according to the attributes of the write request, including: determining the length of each data to be written in the write request; determining the target area for each data to be written and the starting position of each data to be written in the target area according to each length and the remaining capacity of each area on the SSD side obtained in advance.

[0122] Optionally, the write instruction generation module generates corresponding write instructions for each data to be written according to the target area, including: generating corresponding write instructions for each data to be written according to the target area where each data to be written is written and the starting position of each data to be written in the target area.

[0123] Optionally, the processing module determines the order in which each data to be written is sent according to the attributes of the write request, including: determining the writing order of each data to be written in the target area to be written according to the starting position of each data to be written in the target area to be written; when each write instruction in a queue corresponds to a target area, the writing order of each data to be written in the target area is used as the sending order of the write instruction.

[0124] Optionally, the processing module determines the order in which each data to be written is sent according to the attributes of the write request, and also includes: when each write instruction in a queue corresponds to a different target area, for multiple data to be written corresponding to a target area, the execution order of each data to be written is the same as the writing order of the data to be written in the target area; and the sending order of any two data to be written with different target areas is unrelated.

[0125] The above data storage device determines the target area and the sending order of each data to be written according to the attributes of the write request sent by the requester, and sends each write instruction corresponding to each data to be written to the queue in the sending order, so that the controller on the SSD side reads each write instruction in turn, and stores the data to be written corresponding to each write instruction in the target area in the write instruction. The present application can perform write operations on each target area according to the preset execution order, thereby improving the write efficiency of the target area; in addition, the host side can execute the next processing command without waiting for feedback information, thereby improving system efficiency and reducing system complexity.

[0126] Each module in the above data storage device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0127] See also Figure 8In some embodiments, the present application also provides a data storage method, which specifically includes the following steps:

[0128] In step S802, the controller on the SSD side queries the flag bit corresponding to the writing order of the data in response to the query command sent by the host side, and sends it to the host side through the hardware interface. The flag bit is set based on the ZNS storage specification and pre-stored in the controller.

[0129] Step S804, read each write instruction from the queue in sequence, and store the to-be-written data corresponding to each write instruction in the target area in the write instruction. Wherein, each write instruction is generated by the host side in response to the write request sent by the requester when the flag bit meets the preset condition, and the order of issuing each write instruction in the queue is determined by the host side according to the attributes of the write request.

[0130] In the above data storage method, the controller performs a write operation on each target area according to the execution order preset by the host, thereby improving the write efficiency of the target area; at the same time, the host side can execute the next processing command without waiting for feedback information, thereby improving system efficiency and reducing system complexity.

[0131] In some embodiments, the present application also provides a data storage device, including: a controller, wherein:

[0132] The controller is used to respond to the query command sent by the host side, query the flag bit corresponding to the writing order of the data, and send it to the host side through the hardware interface. The flag bit is set based on the ZNS storage specification and pre-stored in the controller.

[0133] The controller is also used to read each write instruction from the queue in sequence, and store the data to be written corresponding to each write instruction in the target area in the write instruction; wherein each write instruction is generated by the host side in response to a write request sent by the requester when the flag bit meets the preset conditions, and the order in which each write instruction is sent in the queue is determined by the host side according to the attributes of the write request.

[0134] In the above data storage device, the controller performs write operations on each target area according to the execution order preset by the host, thereby improving the write efficiency of the target area; at the same time, the host side can execute the next processing command without waiting for feedback information, thereby improving system efficiency and reducing system complexity.

[0135] See also Fig. 9 In some embodiments, the present application also provides a data storage method, which specifically includes the following steps:

[0136] Step S902: The host side receives the data to be written in response to the write request sent by the requester, and sends a query command to the SSD side through the hardware interface.

[0137] Step S904: The controller on the SSD side queries the flag bit corresponding to the writing order of the data in response to the query command sent by the host side, and sends it to the host side. The flag bit is set based on the ZNS storage specification and pre-stored in the controller.

[0138] Step S906, the host side receives the flag bit fed back by the SSD side in response to the query command. When the flag bit meets the preset conditions, the target area and the sending order of each data to be written are determined according to the attributes of the write request; wherein the flag bit is associated with the sending order of each data to be written.

[0139] Step S908, generating a corresponding write instruction for each data to be written according to the target area; and sending the generated multiple write instructions to the queue in sequence according to the sending order.

[0140] Step S910: The controller reads each write instruction from the queue in sequence, and stores the to-be-written data corresponding to each write instruction into the target area in the write instruction.

[0141] The above data storage method determines the target area and the sending order of each data to be written according to the attributes of the write request sent by the requester, and sends each write instruction corresponding to each data to be written to the queue in the sending order, so that the controller on the SSD side reads each write instruction in turn and stores the data to be written corresponding to each write instruction in the target area in the write instruction. The present application can perform write operations on each target area according to the preset execution order, thereby improving the write efficiency of the target area; in addition, the host side can execute the next processing command without waiting for feedback information, thereby improving system efficiency and reducing system complexity.

[0142] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Fig.10As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data involved in the data storage method. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data storage method is implemented.

[0143] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0144] In some embodiments, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method steps in the above-mentioned data storage method are implemented.

[0145] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method steps in the above-mentioned data storage method are implemented.

[0146] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0147] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0148] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data storage method, characterized in that: Applied to the host side, the method includes: The host side responds to the write request sent by the requester, receives the data to be written, and sends a query command to the solid-state drive (SSD) side through the hardware interface; receiving a flag bit fed back by the SSD side in response to the query command, and determining, when the flag bit meets a preset condition, a target area and a sending order of each piece of data to be written according to the attributes of the write request; wherein the flag bit is associated with the sending order of each piece of data to be written; generating a corresponding write instruction for each of the data to be written according to the target area; In accordance with the sending order, the generated multiple write instructions are sent to the queue in sequence, so that the controller on the SSD side reads each write instruction from the queue in sequence and stores the data to be written corresponding to each write instruction in the target area in the write instruction.

2. The method according to claim 1, characterized in that Parsing the flag bit to determine if it meets the preset conditions includes: If the flag bit is set to 1, it is considered that the flag bit meets the preset condition.

3. The method according to claim 1, characterized in that The determining, according to the attributes of the write request, a target area for each data to be written, includes: Determining the length of each of the to-be-written data in the write request; The target area to which each of the data to be written is written and the starting position of each of the data to be written in the target area are determined according to each of the lengths and the pre-acquired remaining capacity of each area on the SSD side.

4. The method according to claim 3, characterized in that The step of determining the order in which the data to be written are sent according to the attributes of the write request includes: determining a writing order of each of the data to be written in the target area according to a starting position of each of the data to be written in the target area; When each of the write instructions in a queue corresponds to a target area, the writing order of each of the to-be-written data in the target area is used as the issuing order of the write instructions.

5. The method according to claim 4, characterized in that The step of determining the order of sending the data to be written according to the attributes of the write request further includes: When the write instructions in a queue correspond to different target areas, for a plurality of data to be written corresponding to a target area, the execution order of the data to be written is the same as the writing order of the data to be written in the target area; Furthermore, the sending order of any two data to be written in different target areas is irrelevant.

6. The method according to claim 4, characterized in that Generating a corresponding write instruction for each of the data to be written according to the target area includes: A corresponding write instruction is generated for each data to be written according to the target area to which each data to be written is written and the starting position of each data to be written in the target area to which each data to be written is written.

7. The method according to claims 1-6, characterized in that When a plurality of write requests are received, responding to the write request sent by the requester includes: According to the request sequence of the write requests, the write requests are responded to in sequence from earliest to latest.

8. A data storage device, characterized in that The device comprises: A receiving module, configured to respond to a write request sent by a requester and receive data to be written; A query module, configured to send a query command to the SSD side through a hardware interface, and receive a flag bit fed back by the SSD side in response to the query command; a processing module, configured to determine, when the flag bit meets a preset condition, a target area and a sending order of each of the data to be written according to an attribute of the write request; wherein the flag bit is associated with the sending order of each of the data to be written; A write instruction generating module, configured to generate a corresponding write instruction for each of the data to be written according to the target area; The sending module is used to send the generated multiple write instructions to the queue in sequence according to the sending order, so that the controller on the SSD side reads each write instruction from the queue in sequence and stores the data to be written corresponding to each write instruction in the target area in the write instruction.

9. A data storage method, applied to the SSD side, characterized in that: The method comprises: The controller on the SSD side responds to the query command sent by the host side, queries the flag bit corresponding to the write order of the data, and sends it to the host side through the hardware interface; wherein the flag bit is set based on the ZNS storage specification and pre-stored in the controller; Read each write instruction from the queue in sequence, and store the to-be-written data corresponding to each write instruction in the target area of ​​the write instruction; Among them, each write instruction is generated by the host side in response to a write request sent by the requester when the flag bit meets the preset conditions, and the issuance order of each write instruction in the queue is determined by the host side according to the attributes of the write request.

10. A data storage device, characterized in that: The device comprises: The controller is configured to query a flag corresponding to a data writing order in response to a query command sent by the host side, and send the flag to the host side through a hardware interface; wherein the flag is set based on the ZNS storage specification and pre-stored in the controller; It is also used to read each write instruction from the queue in sequence, and store the to-be-written data corresponding to each write instruction into the target area in the write instruction; Among them, each write instruction is generated by the host side in response to a write request sent by the requester when the flag bit meets the preset conditions, and the issuance order of each write instruction in the queue is determined by the host side according to the attributes of the write request.

11. A data storage method, characterized in that: The method comprises: The host side responds to the write request sent by the requester, receives the data to be written, and sends a query command to the SSD side through the hardware interface; The controller on the SSD side queries a flag bit corresponding to the writing order of the data in response to a query command sent by the host side, and sends the flag bit to the host side; wherein the flag bit is set based on the ZNS storage specification and pre-stored in the controller; The host side receives the flag bit fed back by the SSD side in response to the query command, and when the flag bit meets a preset condition, determines the target area and the issuance order of each data to be written according to the attribute of the write request; wherein the flag bit is associated with the issuance order of each data to be written; generates a corresponding write instruction for each data to be written according to the target area; and sequentially issues the generated multiple write instructions to the queue according to the issuance order; The controller reads each write instruction from the queue in sequence, and stores the to-be-written data corresponding to each write instruction into a target area in the write instruction.

12. A data storage system, characterized in that: The system comprises: A receiving module, provided on the host side, for responding to a write request sent by a requester and receiving data to be written; A query module is provided on the host side, and is used to send a query command to the SSD side through a hardware interface, and receive a flag bit fed back by the SSD side in response to the query command; a processing module, provided on the host side, for determining, when the flag bit meets a preset condition, a target area and a sending order of each of the data to be written according to the attributes of the write request; wherein the flag bit is associated with the sending order of each of the data to be written; A write instruction generation module, provided on the host side, for generating a corresponding write instruction for each data to be written according to the target area; The sending module is provided on the host side and is used to send the generated multiple write instructions to the queue in sequence according to the sending order; A controller is provided on the SSD side and is used to respond to a query command sent by the host side, query a flag corresponding to the writing order of the data, and send it to the host side; wherein the flag is set based on the ZNS storage specification and pre-stored in the controller; and is also used to read each write instruction from the queue in sequence, and store the data to be written corresponding to each write instruction in the target area in the write instruction.

13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the processor implements the steps of the method according to any one of claims 1 to 7, the steps of the method according to claim 9, or the steps of the method according to claim 11.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 7, the steps of the method according to claim 9, or the steps of the method according to claim 11.