CN116501253A - Data storage method, device and system, readable storage medium and electronic equipment - Google Patents

Data storage method, device and system, readable storage medium and electronic equipment Download PDF

Info

Publication number
CN116501253A
CN116501253A CN202310443152.8A CN202310443152A CN116501253A CN 116501253 A CN116501253 A CN 116501253A CN 202310443152 A CN202310443152 A CN 202310443152A CN 116501253 A CN116501253 A CN 116501253A
Authority
CN
China
Prior art keywords
target
storage unit
data
block
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310443152.8A
Other languages
Chinese (zh)
Inventor
赵昌磊
尹作刚
李瀚卿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202310443152.8A priority Critical patent/CN116501253A/en
Publication of CN116501253A publication Critical patent/CN116501253A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The embodiment of the application provides a data storage method, a device, a system, a readable storage medium and electronic equipment, wherein the method comprises the following steps: determining a block state of a target block corresponding to the target write command; under the condition that the block state is the first state, determining a target storage unit according to a write pointer corresponding to the target block, and calling an interval engine to lock the target storage unit, wherein the write pointer is used for indicating a target address of the last storage unit in the target block, in which data is stored, and the target storage unit is a storage unit for planning to store target data; and storing the target data acquired from the host into a target storage unit. According to the method and the device, the problem of low data storage efficiency caused by the fact that one data processing module is required to be selected from a plurality of data processing modules to perform unified distribution processing on the target write command in the related technology is solved, and the effect of enabling the plurality of data processing modules to concurrently process the target write command is achieved.

Description

Data storage method, device and system, readable storage medium and electronic equipment
Technical Field
The embodiment of the application relates to the field of computers, in particular to a data storage method, a data storage device, a data storage system, a readable storage medium and electronic equipment.
Background
To support multiple usage scenarios of the ZNS SSD (Zoned Namespaces solid state disk, partition namespace solid state disk), the ZNS protocol supports an application function, i.e. an append write command.
Currently, a controller of a ZNS SSD is generally a multi-core architecture, and for better performance indexes, the controller generally has a plurality of Data processing modules (Data Manager, DM), each Data processing module is located on an independent Data core, when firmware processes an application command request, in order to ensure that the sequence of write pointers WP increases, one Data core is selected as a distribution processing module, that is, one Data processing module is selected from the plurality of Data processing modules to perform unified distribution processing on a target write command (i.e., an application command), and when the number of Data processing modules is greater, the performance indexes are limited by the performance of the distribution processing module, so that the efficiency of Data storage is low.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the application provides a data storage method, a device, a system, a readable storage medium and electronic equipment, which at least solve the technical problem of low data storage efficiency caused by the fact that one data processing module needs to be selected from a plurality of data processing modules to uniformly distribute and process a target write command in the related technology.
According to one embodiment of the present application, there is provided a data storage method including: determining a block state of a target block corresponding to a target write command, wherein the target write command is a command issued by a host and used for writing target data into a storage space; under the condition that the block state is the first state, determining a target storage unit according to a write pointer corresponding to the target block, and calling an interval engine to lock the target storage unit, wherein the write pointer is used for indicating a target address of the last storage unit in the target block, in which data is stored, and the target storage unit is a storage unit for planning to store target data; and storing the target data acquired from the host into a target storage unit.
In one exemplary embodiment, the target write command includes: the method comprises the steps of planning a starting address of a target block stored by target data and target number, wherein the target number is the number of storage units required to be occupied by the target data, and each storage unit corresponds to one target address; determining a block state of a target block corresponding to the target write command includes: determining a target block corresponding to the target write command according to the initial address; determining a block state of the target block, wherein the block state comprises: the first state is used for indicating that idle memory cells exist in the target block, and the second state is used for indicating that all memory cells in the target block are occupied.
In one exemplary embodiment, determining the target storage unit according to the write pointer corresponding to the target block includes: determining a target address of a last storage unit which is indicated by a write pointer of the target block and stores data; the target number of memory cells immediately after the last memory cell in which data has been stored is determined as the target memory cell.
In one exemplary embodiment, the interval engine is configured to lock the target storage unit according to the called chronological order; invoking the interval engine to lock the target storage unit includes: under the condition that the target storage unit which is locked does not exist in the target storage unit, locking the target storage unit, and judging that the locking is successful; and determining that the locking fails in the case that there is a target storage unit that has been locked in the target storage units.
In one exemplary embodiment, storing target data obtained from a host into a target storage unit includes: under the condition that the target storage unit is successfully locked, updating the write pointer, and judging whether the target address indicated by the updated write pointer exceeds the address range of the target block; and storing the target data into the target storage unit under the condition that the target address does not exceed the address range of the target block.
In one exemplary embodiment, the address range of the target block is determined by the start address and the end address of the target block; updating the write pointer, and determining whether the target address indicated by the updated write pointer exceeds the address range of the target block includes: determining a target address corresponding to the last target storage unit in the target storage units as a target address indicated by the updated write pointer; under the condition that the target address indicated by the updated write pointer is not greater than the end address of the target block, judging that the target address indicated by the updated write pointer does not exceed the address range of the target block; and under the condition that the target address indicated by the updated write pointer is larger than the end address of the target block, judging that the target address indicated by the updated write pointer exceeds the address range of the target block, and unlocking the successfully locked target storage unit.
In one exemplary embodiment, the method further comprises: and updating the block state of the target block to a second state under the condition that the target address indicated by the updated write pointer is consistent with the end address of the target block.
In one exemplary embodiment, storing the target data into the target storage unit includes: acquiring target data and storing the target data into a write cache area; and unlocking the target storage unit which is successfully locked, wherein the write cache area is used for writing the target data into the corresponding target storage unit under the condition that the data in the write cache area is full.
According to another embodiment of the present application, there is provided a data storage device including: the state confirmation module is used for determining the block state of a target block corresponding to a target write command, wherein the target write command is a command issued by a host and used for writing target data into a storage space; the locking processing module is used for determining a target storage unit according to a write pointer corresponding to a target block under the condition that the block state is a first state, and calling an interval engine to lock the target storage unit, wherein the write pointer is used for indicating a target address of the last storage unit in the target block, in which data is stored, and the target storage unit is a storage unit for planning to store target data; and the data storage module is used for storing the target data acquired from the host into the target storage unit.
According to yet another embodiment of the present application, there is provided a data storage system including: the system comprises a scheduling module, an interval engine and a plurality of data processing modules, wherein the scheduling module is used for receiving a target write command issued by a host and forwarding the target write command to the data processing modules; the interval engine is used for calling the plurality of data processing modules and locking the target storage unit according to the time sequence of the calling; the data processing module is used for determining the block state of a target block corresponding to a target write command, wherein the target write command is a command issued by a host and used for writing target data into a storage space; under the condition that the block state is the first state, determining a target storage unit according to a write pointer corresponding to the target block, and calling an interval engine to lock the target storage unit, wherein the write pointer is used for indicating a target address of the last storage unit in the target block, in which data is stored, and the target storage unit is a storage unit for planning to store target data; and storing the target data acquired from the host into a target storage unit.
According to a further embodiment of the present application, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the data storage method embodiments described above when run.
According to a further embodiment of the present application there is also provided an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the data storage method embodiments described above.
Through the application, a multi-core concurrency processing scheme is designed, each DM independently applies for Interval engine Interval to lock a logic block address (Logical Block Address, LBA) to be written in, then applies for lock and then performs addition and judgment of a Write Pointer (WP) so that a plurality of DMs can be subjected to concurrency processing, and the uniqueness of the WP in target block information zone Info is not required to be ensured through forwarding to a distribution processing module. Therefore, the problem of low data storage efficiency caused by the fact that one data processing module needs to be selected from a plurality of data processing modules to perform unified distribution processing on the target write command in the related art can be solved, and the effect of enabling the plurality of data processing modules to concurrently process the target write command is achieved.
Drawings
FIG. 1 is a block diagram of a hardware architecture of a computer device for implementing a data storage method according to an embodiment of the present application;
FIG. 2 is a flow chart of a data storage method provided in accordance with an embodiment of the present application;
FIG. 3 is a flowchart of a ZNS application multi-core concurrency processing method provided according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a data storage device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data storage system according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in detail below with reference to the accompanying drawings in conjunction with the embodiments.
For the convenience of those skilled in the art to better understand the embodiments of the present application, some technical terms or nouns related to the embodiments of the present application will now be explained as follows:
ZNS (Zoned Namespace, partition Namespaces): a solution based on nvme protocol;
SSD (State Disk Solid State Disk): i.e. a solid-state electronic storage array hard disk;
ZONE: a unit of management usage in a ZNS SSD (Zoned Namespaces solid state disk, partition namespace solid state disk);
DMA (Direct Memory Access): a direct memory reading unit;
An application command: an additional write function supported by the ZNS SSD;
DM (Data Manager): a data processing module in firmware of the ZNS SSD;
WP (Write Pointer): write pointer of ZNS;
interval engine: a hardware unit that locks LBAs.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
ZNS is a solution based on nvme protocol, and has the characteristics of small write amplification and low cost compared with the traditional SSD. Generally, the ZNS SSD supports sequential writing, so before configuration and use, the ZNS SSD needs to acquire configuration information of all ZONEs in the SSD, and then can accurately determine writing pointers and states of each ZONE. The command is report zone, which is implemented based on zone management receive command in the ZNS protocol. In order to support multiple usage scenarios of the ZNS SSD, the ZNS protocol supports an application function, which is an append write, that is, the host issues an application command that includes only the start LBA of the zone, and the number of write LBAs.
The controller of the ZNS SSD is typically a multi-core architecture, typically with multiple DMs, each DM on a separate data core, for better performance metrics; in the related art, when firmware processes an application command request, in order to ensure that the sequence of write pointers WP increases, a data core is selected as a distribution processing module, that is, each DM transfers the write request of an LBA to the distribution processing module, and then the distribution processing module sequentially increases WP and writes the LBA into a buffer area BUFF; however, in the case where the number of DMs is relatively large (for example, greater than 7, for example), the performance index is limited by the performance of the distribution processing module, resulting in low data storage efficiency.
In order to solve the above problems, embodiments of the present application provide corresponding solutions, and the following detailed description is provided.
The method embodiments provided in the embodiments of the present application may be performed in a computer device, a computer terminal, or a similar computing apparatus. Taking the example of running on a computer device, fig. 1 is a block diagram of a hardware structure of a computer device for implementing a data storage method according to an embodiment of the present application. As shown in fig. 1, the computer device may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing means such as a programmable logic device FPGA) and a memory 104 for storing data, wherein the computer device may further include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those of ordinary skill in the art that the configuration shown in FIG. 1 is merely illustrative and is not intended to limit the configuration of the computer device described above. For example, the computer device may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a data storage method in the embodiment of the present application, and the processor 102 executes the computer program stored in the memory 104, thereby performing various functional applications and data processing, that is, implementing the method described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory located remotely from processor 102, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communications provider of the computer device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
In this embodiment, a data storage method running on the computer device is provided, and fig. 2 is a flowchart of a data storage method provided according to an embodiment of the present application, as shown in fig. 2, where the flowchart includes the following steps:
step S202, determining the block state of a target block corresponding to a target write command, wherein the target write command is a command issued by a host for writing target data into a storage space;
in the technical solution provided in step S202, the target write command includes: the method comprises the steps of planning a starting address of a target block stored by target data and target number, wherein the target number is the number of storage units required to be occupied by the target data, and each storage unit corresponds to one target address;
In this embodiment, the target write command is an application command, and the host issues the application command only including the start LBA (i.e., the start address) of the zone (i.e., the target block) and the number of write LBAs (i.e., the target number).
In some embodiments of the present application, determining a block state of a target block corresponding to a target write command includes the steps of: determining a target block corresponding to the target write command according to the initial address; determining a block state of the target block, wherein the block state comprises: the first state is used for indicating that idle memory cells exist in the target block, and the second state is used for indicating that all memory cells in the target block are occupied.
Specifically, the data processing module DM determines a hit zone (i.e. the target block) according to the startLBA (i.e. the start address of the target block) in the application command (i.e. the target write command), and then determines the block status of the target block zone;
step S204, under the condition that the block state is the first state, determining a target storage unit according to a write pointer corresponding to the target block, and calling an interval engine to lock the target storage unit, wherein the write pointer is used for indicating a target address of the last storage unit in the target block, in which data is stored, and the target storage unit is a storage unit for planning to store target data;
In some embodiments of the present application, determining the target memory unit according to the write pointer corresponding to the target block includes the following steps: determining a target address of a last storage unit which is indicated by a write pointer of the target block and stores data; the target number of memory cells immediately after the last memory cell in which data has been stored is determined as the target memory cell.
Specifically, if the target block zone corresponding to the target write command is an active zone (i.e., one of the first states), the DM applies for locking to the Interval engine hardware unit (i.e., the Interval engine), where the locking range is the range from the write pointer WP to wp+numlba of the current zone, i.e., the target number of storage units immediately after the last storage unit in which data has been stored.
If the target block zone corresponding to the target write command is an empty zone (i.e., another condition in the first state), the open zone is first hidden, and then the lock is applied to the Interval engine hardware unit (i.e., the Interval engine).
In some embodiments of the present application, the interval engine is configured to lock the target storage unit according to the called chronological order; invoking the interval engine to lock the target storage unit comprises the following steps: under the condition that the target storage unit which is locked does not exist in the target storage unit, locking the target storage unit, and judging that the locking is successful; and determining that the locking fails in the case that there is a target storage unit that has been locked in the target storage units.
Specifically, the Interval engine hardware unit processes according to the sequence of receiving the locking request, and the application which is not overlapped with the LBA already locked (namely, the condition that the target storage unit does not exist in the target storage unit already locked) is granted to the success of applying the lock and update WP; otherwise, the lock is applied for failure, the lock is released, a host completion message is returned, and the state is marked as the failure of the io application processing.
In step S206, the target data acquired from the host is stored in the target storage unit.
In some embodiments of the present application, storing target data obtained from a host into a target storage unit includes the steps of: under the condition that the target storage unit is successfully locked, updating the write pointer, and judging whether the target address indicated by the updated write pointer exceeds the address range of the target block; and storing the target data into the target storage unit under the condition that the target address does not exceed the address range of the target block.
In some embodiments of the present application, the address range of the target block is determined by a start address and an end address of the target block; updating the write pointer, and judging whether the target address indicated by the updated write pointer exceeds the address range of the target block or not comprises the following steps: determining a target address corresponding to the last target storage unit in the target storage units as a target address indicated by the updated write pointer; under the condition that the target address indicated by the updated write pointer is not greater than the end address of the target block, judging that the target address indicated by the updated write pointer does not exceed the address range of the target block; and under the condition that the target address indicated by the updated write pointer is larger than the end address of the target block, judging that the target address indicated by the updated write pointer exceeds the address range of the target block, and unlocking the successfully locked target storage unit.
In some embodiments of the present application, storing the target data into the target storage unit includes the steps of: acquiring target data and storing the target data into a write cache area; and unlocking the target storage unit which is successfully locked, wherein the write cache area is used for writing the target data into the corresponding target storage unit under the condition that the data in the write cache area is full.
Specifically, when the IO of the application command applies to the lock, that is, after the locking is successful, the write pointer WP in the target block information zone info is updated, and then it is determined whether the write pointer WP is greater than the endLBA (i.e., the end address) of the target block zone;
if the target address indicated by the write pointer is smaller than or equal to the endLBA (i.e. the end address), the target data is moved from the host side to a write buff (write buffer area) in the SSD by the DMA unit, then the data processing module DM returns a completion message to the host, marks that the application writing is successful, and then releases the lock, i.e. unlocks the target storage unit which is successfully locked; if the target address indicated by the write pointer is greater than the endLBA (i.e., the end address), a failure message is returned to the host, and the lock is released, i.e., the target storage unit that has been successfully locked is unlocked.
When the whole write buffer is full, i.e. the write buffer is full, the firmware will write the target data in the write buffer into the corresponding target storage unit in the nandflash flash memory, and then release the write buffer for other application command processing.
As an alternative embodiment, the method further comprises the steps of: and updating the block state of the target block to a second state under the condition that the target address indicated by the updated write pointer is consistent with the end address of the target block.
Specifically, in the case where the target address indicated by the write pointer is equal to endlba (i.e. the end address described above), the data processing module DM also needs to retrieve the lock of the entire target block zone, and then change the block state of the target block zone to the FULL state (i.e. the second state described above).
The data storage method in steps S202 to S206 in the embodiment of the present application is further described below.
Fig. 3 is a flowchart of a method for processing the ZNS application multi-core concurrency, which is provided in an embodiment of the present application, as shown in fig. 3, and includes the following steps:
in the present embodiment, the case where 8 data processing modules DM exist in the ZNS SSD is described as an example.
Step 1, a host issues an app end command (i.e. the target write command), a scheduling module io dispatch in firmware is distributed to 8 data processing modules DM for processing after receiving the app end command issued by the host, each DM module judges the validity of the app end command firstly after receiving the app end command, when the app end command is legal, the processing is carried out in step 2, when the app end command is illegal, the processing is directly completed with the host, and the state is marked as illegal command;
step 2, 2) when the application command is legal, the data processing module DM determines a hit zone (i.e. the target block) according to the startLBA (i.e. the start address of the target block) in the application command (i.e. the target write command), and then determines the block status of the target block zone;
if the target block zone corresponding to the target write command is an active zone (i.e., one of the first states), the DM applies for locking to the Interval engine (i.e., the Interval engine), where the locking range is the range from the write pointer WP to wp+numlba of the current zone, i.e., the target number of storage units immediately after the last storage unit in which data is stored.
If the target block zone corresponding to the target write command is an empty zone (i.e., another condition in the first state), the open zone is first hidden, and then the lock is applied to the Interval engine hardware unit (i.e., the Interval engine).
Step 3, in the case that a plurality of DMs are all performing similar locking applications in the ZNS SSD, in order to ensure that the DMs can be concurrent, the Interval engine hardware unit processes according to the sequence of receiving the locking requests, and the application which is not overlapped with the LBA which is already locked (i.e. the situation that the target storage unit which is already locked does not exist in the target storage unit) is granted to apply for successful locking and update WP; otherwise, the lock is applied for failure, the lock is released, a host completion message is returned, and the state is marked as the failure of the io application processing.
Step 4, when the IO of the application command applies for the lock, that is, after the lock is successfully applied, the write pointer WP in the target block information zone info is updated, and then whether the write pointer WP is larger than the endLBA of the target block zone (that is, the end address) is judged;
if the target address indicated by the write pointer is smaller than or equal to the endLBA (i.e. the end address), the target data is moved from the host side to a write buff (write buffer area) in the SSD by the DMA unit, then the data processing module DM returns a completion message to the host, marks that the application writing is successful, and then releases the lock, i.e. unlocks the target storage unit which is successfully locked; if the target address indicated by the write pointer is greater than the endLBA (i.e., the end address), a failure message is returned to the host, and the lock is released, i.e., the target storage unit that has been successfully locked is unlocked.
In the case where the target address indicated by the write pointer is equal to endlba (i.e., the end address), the data processing module DM also needs to retrieve the lock of the entire target block zone, and then change the block state of the target block zone to the FULL state (i.e., the second state).
And step 5, after the whole write buffer is full, namely, under the condition that the data in the write buffer is full, the firmware writes the target data in the write buffer into a corresponding target storage unit in the nandflash flash memory, and then releases the write buffer for other application command processing.
According to the scheme, the write scheme for enabling a plurality of DM to concurrently process the application command is designed to optimize the application flow, the multi-core CPU hardware advantage is exerted, the application bandwidth is remarkably improved, the product competitiveness is improved, and the performance bottleneck problem of the distribution processing module in the prior art scheme is solved.
Through the steps, each DM independently applies Interval engine for locking the logic block address (Logical Block Address, LBA) to be written, then applies for the lock and then increases and judges a Write Pointer (WP), so that a plurality of DMs can be processed simultaneously, and the uniqueness of the WP in the target block information zone Info is not required to be ensured by forwarding to a distribution processing module. The problem of performance bottleneck of the CPU where the distribution processing module is located under the condition of a plurality of DM is solved; the bandwidth performance of the application write of the whole ZNS SSD is improved, the problem of low data storage efficiency caused by the fact that one data processing module needs to be selected from a plurality of data processing modules to perform unified distribution processing on a target write command in the related technology is solved, and the effect of enabling the plurality of data processing modules to concurrently process the target write command is achieved.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the embodiments of the present application.
In this embodiment, a data storage device is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and will not be described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 4 is a schematic structural diagram of a data storage device according to an embodiment of the present application, as shown in fig. 4, the device includes:
a state confirmation module 40, configured to determine a block state of a target block corresponding to a target write command, where the target write command is a command issued by the host for writing target data into the storage space;
in some embodiments of the present application, the target write command includes: the method comprises the steps of planning a starting address of a target block stored by target data and target number, wherein the target number is the number of storage units required to be occupied by the target data, and each storage unit corresponds to one target address;
in this embodiment, the target write command is an application command, and the host issues the application command only including the start LBA (i.e., the start address) of the zone (i.e., the target block) and the number of write LBAs (i.e., the target number).
In some embodiments of the present application, determining a block state of a target block corresponding to a target write command includes the steps of: determining a target block corresponding to the target write command according to the initial address; determining a block state of the target block, wherein the block state comprises: the first state is used for indicating that idle memory cells exist in the target block, and the second state is used for indicating that all memory cells in the target block are occupied.
The locking processing module 42 is configured to determine a target storage unit according to a write pointer corresponding to a target block and invoke an interval engine to lock the target storage unit when the block state is a first state, where the write pointer is used to indicate a target address of a last storage unit in the target block where data is stored, and the target storage unit is a storage unit that is scheduled to store target data;
in some embodiments of the present application, determining the target memory unit according to the write pointer corresponding to the target block includes the following steps: determining a target address of a last storage unit which is indicated by a write pointer of the target block and stores data; the target number of memory cells immediately after the last memory cell in which data has been stored is determined as the target memory cell.
In some embodiments of the present application, the interval engine is configured to lock the target storage unit according to the called chronological order; invoking the interval engine to lock the target storage unit comprises the following steps: under the condition that the target storage unit which is locked does not exist in the target storage unit, locking the target storage unit, and judging that the locking is successful; and determining that the locking fails in the case that there is a target storage unit that has been locked in the target storage units.
The data storage module 44 is configured to store target data acquired from the host into the target storage unit.
In some embodiments of the present application, storing target data obtained from a host into a target storage unit includes the steps of: under the condition that the target storage unit is successfully locked, updating the write pointer, and judging whether the target address indicated by the updated write pointer exceeds the address range of the target block; and storing the target data into the target storage unit under the condition that the target address does not exceed the address range of the target block.
In some embodiments of the present application, the address range of the target block is determined by a start address and an end address of the target block; updating the write pointer, and judging whether the target address indicated by the updated write pointer exceeds the address range of the target block or not comprises the following steps: determining a target address corresponding to the last target storage unit in the target storage units as a target address indicated by the updated write pointer; under the condition that the target address indicated by the updated write pointer is not greater than the end address of the target block, judging that the target address indicated by the updated write pointer does not exceed the address range of the target block; and under the condition that the target address indicated by the updated write pointer is larger than the end address of the target block, judging that the target address indicated by the updated write pointer exceeds the address range of the target block, and unlocking the successfully locked target storage unit.
In some embodiments of the present application, the data storage module 44 is further configured to: and updating the block state of the target block to a second state under the condition that the target address indicated by the updated write pointer is consistent with the end address of the target block.
In some embodiments of the present application, storing the target data into the target storage unit includes the steps of: acquiring target data and storing the target data into a write cache area; and unlocking the target storage unit which is successfully locked, wherein the write cache area is used for writing the target data into the corresponding target storage unit under the condition that the data in the write cache area is full.
Through the steps, each DM independently applies Interval engine for locking the logic block address (Logical Block Address, LBA) to be written, then applies for the lock and then increases and judges a Write Pointer (WP), so that a plurality of DMs can be processed simultaneously, and the uniqueness of the WP in the target block information zone Info is not required to be ensured by forwarding to a distribution processing module. The problem of performance bottleneck of the CPU where the distribution processing module is located under the condition of a plurality of DM is solved; the bandwidth performance of the application write of the whole ZNS SSD is improved, the problem of low data storage efficiency caused by the fact that one data processing module needs to be selected from a plurality of data processing modules to perform unified distribution processing on a target write command in the related technology is solved, and the effect of enabling the plurality of data processing modules to concurrently process the target write command is achieved.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
In this embodiment, a data storage system is further provided, and the system is used to implement the foregoing embodiments and preferred implementations, and will not be described in detail.
FIG. 5 is a schematic structural diagram of a data storage system according to an embodiment of the present application, as shown in FIG. 5, the system includes: a scheduling module 50, an interval engine 52, and a plurality of data processing modules 54, wherein,
the scheduling module 50 is configured to receive a target write command issued by the host, and forward the target write command to the data processing module 54;
the interval engine 52 is used for being called by the plurality of data processing modules 54 and locking the target storage units according to the called time sequence;
the data processing module 54 is configured to determine a block state of a target block corresponding to a target write command, where the target write command is a command issued by the host for writing target data into the storage space; under the condition that the block state is the first state, determining a target storage unit according to a write pointer corresponding to the target block, and calling an interval engine 52 to lock the target storage unit, wherein the write pointer is used for indicating a target address of a last storage unit in the target block, in which data is stored, and the target storage unit is a storage unit for planning to store target data; and storing the target data acquired from the host into a target storage unit.
In some embodiments of the present application, the target write command includes: the method comprises the steps of planning a starting address of a target block stored by target data and target number, wherein the target number is the number of storage units required to be occupied by the target data, and each storage unit corresponds to one target address;
in some embodiments of the present application, determining a block state of a target block corresponding to a target write command includes the steps of: determining a target block corresponding to the target write command according to the initial address; determining a block state of the target block, wherein the block state comprises: the first state is used for indicating that idle memory cells exist in the target block, and the second state is used for indicating that all memory cells in the target block are occupied.
In some embodiments of the present application, determining the target memory unit according to the write pointer corresponding to the target block includes the following steps: determining a target address of a last storage unit which is indicated by a write pointer of the target block and stores data; the target number of memory cells immediately after the last memory cell in which data has been stored is determined as the target memory cell.
In some embodiments of the present application, storing target data obtained from a host into a target storage unit includes the steps of: under the condition that the target storage unit is successfully locked, updating the write pointer, and judging whether the target address indicated by the updated write pointer exceeds the address range of the target block; and storing the target data into the target storage unit under the condition that the target address does not exceed the address range of the target block.
In some embodiments of the present application, the address range of the target block is determined by a start address and an end address of the target block; updating the write pointer, and judging whether the target address indicated by the updated write pointer exceeds the address range of the target block or not comprises the following steps: determining a target address corresponding to the last target storage unit in the target storage units as a target address indicated by the updated write pointer; under the condition that the target address indicated by the updated write pointer is not greater than the end address of the target block, judging that the target address indicated by the updated write pointer does not exceed the address range of the target block; and under the condition that the target address indicated by the updated write pointer is larger than the end address of the target block, judging that the target address indicated by the updated write pointer exceeds the address range of the target block, and unlocking the successfully locked target storage unit.
In some embodiments of the present application, the data processing module 54 is further configured to: and updating the block state of the target block to a second state under the condition that the target address indicated by the updated write pointer is consistent with the end address of the target block.
In some embodiments of the present application, storing the target data into the target storage unit includes the steps of: acquiring target data and storing the target data into a write cache area; and unlocking the target storage unit which is successfully locked, wherein the write cache area is used for writing the target data into the corresponding target storage unit under the condition that the data in the write cache area is full.
According to the scheme, the write scheme for enabling a plurality of DM to concurrently process the application command is designed to optimize the application flow, the multi-core CPU hardware advantage is exerted, the application bandwidth is remarkably improved, the product competitiveness is improved, and the performance bottleneck problem of the distribution processing module in the prior art scheme is solved.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the steps of any of the method embodiments described above when run, comprising: determining a block state of a target block corresponding to a target write command, wherein the target write command is a command issued by a host and used for writing target data into a storage space; under the condition that the block state is the first state, determining a target storage unit according to a write pointer corresponding to the target block, and calling an interval engine to lock the target storage unit, wherein the write pointer is used for indicating a target address of the last storage unit in the target block, in which data is stored, and the target storage unit is a storage unit for planning to store target data; and storing the target data acquired from the host into a target storage unit.
In one exemplary embodiment, the computer readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
Embodiments of the present application also provide an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In an exemplary embodiment, the electronic device may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application should be included in the protection scope of the present application.

Claims (12)

1. A method of data storage, comprising:
determining a block state of a target block corresponding to a target write command, wherein the target write command is a command issued by a host and used for writing target data into a storage space;
under the condition that the block state is a first state, determining a target storage unit according to a write pointer corresponding to the target block, and calling an interval engine to lock the target storage unit, wherein the write pointer is used for indicating a target address of the last storage unit in the target block, in which data is stored, and the target storage unit is a storage unit for planning to store the target data;
and storing the target data acquired from the host into the target storage unit.
2. The method of claim 1, wherein the target write command comprises: the target data plan stores the initial address of the target block and the target number, wherein the target number is the number of storage units required to be occupied by the target data, and each storage unit corresponds to one target address; determining a block state of a target block corresponding to the target write command includes:
Determining the target block corresponding to the target write command according to the starting address;
determining the block status of the target block, wherein the block status comprises: the first state is used for indicating that the idle storage units exist in the target block, and the second state is used for indicating that all the storage units in the target block are occupied.
3. The method of claim 2, wherein determining the target storage unit based on the write pointer corresponding to the target block comprises:
determining a target address of a last storage unit, indicated by the write pointer of the target block, in which data is stored;
and determining the target number of storage units immediately after the last storage unit in which the data is stored as the target storage unit.
4. The method of claim 2, wherein the interval engine is configured to lock the target storage units according to the called chronological order; invoking an interval engine to lock the target storage unit includes:
under the condition that the target storage unit which is locked does not exist in the target storage units, locking the target storage units, and judging that the locking is successful; the method comprises the steps of,
And judging that the locking fails when the target storage unit which is locked exists in the target storage units.
5. The method of claim 4, wherein storing the target data obtained from the host into the target storage unit comprises:
under the condition that the target storage unit is successfully locked, updating the write pointer, and judging whether the target address indicated by the updated write pointer exceeds the address range of the target block;
and storing the target data into the target storage unit under the condition that the target address does not exceed the address range of the target block.
6. The method of claim 5, wherein the address range of the target block is determined by a start address and an end address of the target block; updating the write pointer, and judging whether the target address indicated by the updated write pointer exceeds the address range of the target block comprises:
determining a target address corresponding to the last target storage unit in the target storage units as the target address indicated by the updated write pointer;
judging that the target address indicated by the updated write pointer does not exceed the address range of the target block under the condition that the target address indicated by the updated write pointer is not greater than the end address of the target block; the method comprises the steps of,
And under the condition that the target address indicated by the updated write pointer is larger than the end address of the target block, judging that the target address indicated by the updated write pointer exceeds the address range of the target block, and unlocking the successfully locked target storage unit.
7. The method of claim 6, wherein the method further comprises:
and updating the block state of the target block to the second state under the condition that the target address indicated by the updated write pointer is consistent with the end address of the target block.
8. The method of claim 5, wherein storing the target data into the target storage unit comprises:
acquiring the target data and storing the target data into a write cache area;
and unlocking the target storage unit which is successfully locked, wherein the write cache area is used for writing the target data into the corresponding target storage unit under the condition that the data in the write cache area is full.
9. A data storage device, comprising:
the state confirmation module is used for determining the block state of a target block corresponding to a target write command, wherein the target write command is a command issued by a host and used for writing target data into a storage space;
The locking processing module is used for determining a target storage unit according to a write pointer corresponding to the target block under the condition that the block state is a first state, and calling an interval engine to lock the target storage unit, wherein the write pointer is used for indicating a target address of the last storage unit in the target block, in which data is stored, and the target storage unit is a storage unit for planning to store the target data;
and the data storage module is used for storing the target data acquired from the host into the target storage unit.
10. A data storage system, comprising: a scheduling module, an interval engine and a plurality of data processing modules, wherein,
the scheduling module is used for receiving a target write command issued by a host and forwarding the target write command to the data processing module;
the interval engine is used for calling the plurality of data processing modules and locking the target storage unit according to the time sequence of the calling;
the data processing module is used for determining the block state of a target block corresponding to a target write command, wherein the target write command is a command issued by a host and used for writing target data into a storage space; under the condition that the block state is a first state, determining a target storage unit according to a write pointer corresponding to the target block, and calling an interval engine to lock the target storage unit, wherein the write pointer is used for indicating a target address of the last storage unit in the target block, in which data is stored, and the target storage unit is a storage unit for planning to store the target data; and storing the target data acquired from the host into the target storage unit.
11. A computer readable storage medium, characterized in that a computer program is stored in the computer readable storage medium, wherein the computer program, when being executed by a processor, implements the steps of the data storage method of any of claims 1 to 8.
12. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the data storage method of any one of claims 1 to 8 when the computer program is executed.
CN202310443152.8A 2023-04-23 2023-04-23 Data storage method, device and system, readable storage medium and electronic equipment Pending CN116501253A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310443152.8A CN116501253A (en) 2023-04-23 2023-04-23 Data storage method, device and system, readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310443152.8A CN116501253A (en) 2023-04-23 2023-04-23 Data storage method, device and system, readable storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116501253A true CN116501253A (en) 2023-07-28

Family

ID=87319593

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310443152.8A Pending CN116501253A (en) 2023-04-23 2023-04-23 Data storage method, device and system, readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116501253A (en)

Similar Documents

Publication Publication Date Title
CN112650576B (en) Resource scheduling method, device, equipment, storage medium and computer program product
CN110188110B (en) Method and device for constructing distributed lock
CN104065636B (en) Data processing method and system
CN110196759B (en) Distributed transaction processing method and device, storage medium and electronic device
CN109766349B (en) Task duplicate prevention method, device, computer equipment and storage medium
CN103152390B (en) The node configuration method of distributed memory system, device, node and system
CN103544153A (en) Data updating method and system based on database
CN110399227B (en) Data access method, device and storage medium
CN108415758B (en) Distributed transaction coordination method and device
CN111475519A (en) Data caching method and device
CN113010265A (en) Pod scheduling method, scheduler, memory plug-in and system
CN111930305A (en) Data storage method and device, storage medium and electronic device
CN113438275B (en) Data migration method and device, storage medium and data migration equipment
CN104391876A (en) Static data storing and querying method and system
CN111475585B (en) Data processing method, device and system
CN111984379B (en) Read-write transaction control method, system, terminal device and storage medium
CN111125168B (en) Data processing method and device, electronic equipment and storage medium
CN110445580B (en) Data transmission method and device, storage medium, and electronic device
CN116501253A (en) Data storage method, device and system, readable storage medium and electronic equipment
EP3082050A1 (en) Mass data fusion storage method and system
CN108121580A (en) The implementation method and device of application notification service
CN111857545B (en) Read-write lock conflict judging method, system, equipment and computer medium
CN109901933B (en) Operation method and device of business system, storage medium and electronic device
CN108874560B (en) Method and communication device for communication
CN112463757A (en) Resource access method of distributed system and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination