WO2025257624A1 - 数据存储与读取方法、设备、系统、存储介质与程序产品 - Google Patents
数据存储与读取方法、设备、系统、存储介质与程序产品Info
- Publication number
- WO2025257624A1 WO2025257624A1 PCT/IB2025/053640 IB2025053640W WO2025257624A1 WO 2025257624 A1 WO2025257624 A1 WO 2025257624A1 IB 2025053640 W IB2025053640 W IB 2025053640W WO 2025257624 A1 WO2025257624 A1 WO 2025257624A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- flash memory
- data
- target
- storage
- type
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11C—STATIC STORES
- G11C11/00—Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor
- G11C11/56—Digital stores characterised by the use of particular electric or magnetic storage elements; Storage elements therefor using storage elements with more than two stable states represented by steps, e.g. of voltage, current, phase, frequency
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
Definitions
- Flash memory is a non-volatile storage medium. Based on the different connection methods of storage cells, flash memory is divided into various types such as NOR Flash and NAND Flash. Among them, NAND Flash storage cells are smaller in size, suitable for high-density integration, and can provide larger storage capacity, therefore it is widely used.
- NAND Flash has evolved from the first generation of Single-Level Cell (SLC) to the fourth generation of Quad-Level Cell (QLC).
- SLC Single-Level Cell
- QLC flash memory offers significantly increased storage capacity on the same hardware basis, thus providing a cost advantage.
- QLC flash memory suffers from degradation in lifespan and read/write performance, limiting its application. For example, it does not meet the read/write cycles and speed requirements of cloud applications, making it unsuitable for cloud storage systems. Therefore, overcoming the shortcomings of QLC flash memory in terms of lifespan and read/write performance, and fully leveraging its advantages in storage capacity and cost, is an urgent technical problem to be solved.
- This invention discloses several aspects of a data storage and retrieval method, device, system, storage medium, and program product to leverage the advantages of flash memory media in storage capacity and cost while overcoming its shortcomings in lifespan and read/write performance.
- This disclosure provides a flash memory storage system, including: a storage engine and persistent storage.
- the persistent storage uses a target-type flash memory medium, and at least two types of flash memory areas are implemented on the target-type flash memory medium.
- the storage capacity of a single storage cell in the different types of flash memory areas is different to store data of different data types.
- the storage engine is used to respond to write requests, acquire first data, wherein the first data belongs to the target data type; determine a first target flash memory area corresponding to the target data type from the at least two types of flash memory areas; and store the first data in the first target flash memory area.
- This disclosure provides a flash memory storage system, including: a storage engine, a main memory, and persistent storage.
- the persistent storage device uses a target-type flash memory medium, on which a first type of flash memory area and a second type of flash memory area are implemented.
- the storage capacity of a single storage cell in the first type of flash memory area is greater than the storage capacity of a single storage cell in the second type of flash memory area.
- a storage engine is used to respond to write requests and obtain first data; if the first data belongs to a first data type, the first data is stored in the first type of flash memory area according to the first storage capacity; if the first data belongs to a second data type, the first data is temporarily stored in a memory storage device, and when the first data temporarily stored in the memory storage device reaches a first data volume threshold, the first data temporarily stored in the memory storage device is transferred to the second type of flash memory area according to the second storage capacity.
- This disclosure provides a host that applies any of the flash memory storage systems provided in this disclosure.
- This disclosure also provides a cloud storage system, including: computing nodes and storage nodes; the computing nodes and/or storage nodes are implemented using the host in the above embodiments.
- This disclosure also provides a data storage method applied to a storage engine on a host.
- the host's persistent memory uses a target-type flash memory medium, and at least two types of flash memory areas are implemented on the target-type flash memory medium.
- the storage capacity of a single storage cell in the different types of flash memory areas is different, so as to store data of different data types.
- the method includes: responding to a write request and obtaining first data, wherein the first data belongs to the target data type; determining a first target flash memory area corresponding to the target data type from the at least two types of flash memory areas; and storing the first data in the first target flash memory area.
- This disclosure also provides a data reading method applied to a storage engine on a host.
- the host's persistent memory uses a target-type flash memory medium, and at least two types of flash memory areas are implemented on the target-type flash memory medium.
- the storage capacity of a single storage cell in the different types of flash memory areas is different, so as to store data of different data types.
- the method includes: responding to a read request and determining a second target flash memory area where second data is located, wherein the second target flash memory area is any one of the at least two types of flash memory areas; and reading the second data from the second target flash memory area.
- This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method.
- This disclosure also provides a computer program product comprising a computer program/instructions, which, when executed by a processor, enables the processor to implement the steps in the above-described method embodiments.
- different types of flash memory regions are divided on the target type flash memory medium.
- the storage capacity of a single storage cell in each of the different types of flash memory regions is different, meaning that the lifespan and read/write performance of different flash memory regions are different, to adapt to different data types.
- the data is written to the corresponding flash memory region.
- NAND Flash has also been continuously iterating and evolving, successively going through the first generation of SLC flash memory, the second generation of Multi-Level Cell (MLC) flash memory, the third generation of Trinary-Level Cell (TLC) flash memory, and the fourth generation of QLC flash memory.
- MLC Multi-Level Cell
- TLC Trinary-Level Cell
- SLC flash memory stores 1 bit of data per cell (1 bit/cell), offering fast read/write speeds, a long lifespan of approximately 100,000 write/erase cycles, but is expensive and has a small capacity.
- MLC flash memory stores 2 bits of data per cell (2 bits/cell), with moderate read/write speeds and a moderate lifespan of approximately 3,000-10,000 write/erase cycles, also moderately priced and with moderate capacity.
- TLC flash memory stores 3 bits of data per cell (3 bits/cell), with slow read/write speeds and a short lifespan of approximately 500-1,000 write/erase cycles, but is relatively inexpensive and has a larger capacity.
- QLC flash memory stores 4 bits of data per cell (4 bits/cell), with even slower read/write speeds and a shorter lifespan of approximately 150 write/erase cycles.
- flash memory media While having a shorter lifespan, flash memory offers lower prices and larger storage capacity. It should be noted that the comparison of storage capacity among different flash memory types is based on identical hardware. As data storage models continue to evolve, flash memory media becomes increasingly advantageous in terms of storage capacity and cost, but its lifespan and read/write performance tend to decline.
- the read/write performance of flash memory media can be characterized by, but is not limited to, the number of input/output requests per second (IOPS). Insufficient storage capacity and cost, or limitations in lifespan and read/write performance, will limit the application of flash memory media. For example, SLC and MLC flash memory, due to their smaller storage capacity and higher cost, are generally used in scenarios with low storage capacity requirements but high read/write performance requirements to reduce storage costs.
- TLC and QLC flash memory due to their larger storage capacity and lower cost, are generally used in scenarios with high storage capacity requirements but low read/write performance requirements to avoid frequent erasing and writing, thus extending the lifespan of the flash memory media.
- flash memory media with relative advantages in storage capacity and cost such as QLC flash memory
- flash memory media with relative advantages in storage capacity and cost are referred to as target flash memory media.
- this disclosure first proposes a solution: using heterogeneous media to enable the target flash memory medium.
- Heterogeneous media is a different type of storage medium from flash memory, and it is superior to the target flash memory medium in at least terms of lifespan and read/write performance.
- this solution by classifying the data to be stored and using high-performance heterogeneous media in conjunction with the target flash memory medium, the advantages of the target flash memory medium in storage capacity and cost are fully utilized while the shortcomings in lifespan and read/write performance are compensated for by the high-performance heterogeneous media.
- Figure 1 shows the hardware and software architecture of a heterogeneous storage system provided in an embodiment of this disclosure, corresponding to the above solution.
- the heterogeneous storage system includes a software layer 101 and a persistent storage layer 102.
- the software layer 101 includes a data source 1011 and a storage engine 1012.
- the persistent storage layer 102 includes a high-performance heterogeneous medium 1021 and a target-type flash memory medium 1022.
- the data source 1011 refers to various software objects that generate data requiring persistent storage, such as... This includes, but is not limited to, various functional modules within applications, processes, threads, or operating systems. Figure 1 illustrates this using data source 1011 as an example of an application.
- Storage engine 1012 refers to the software program responsible for persistently storing the data generated by data source 1011 into persistent storage layer 102.
- Io sensitive data is generally considered hot data, including but not limited to various log data (Journal Data); throughput sensitive data is generally considered warm or cold data, such as data that needs to be dumped from memory to persistent storage media (Dump Data).
- Journal Data log data
- throughput sensitive data is generally considered warm or cold data, such as data that needs to be dumped from memory to persistent storage media (Dump Data).
- Dump Data persistent storage media
- Io sensitive data refers to data with a small volume and high latency sensitivity.
- data source 1011 such as an application
- Io sensitive data can be aggregated in the application's data buffer, and when it reaches a certain size, it can be persistently stored in the persistent storage layer 102.
- throughput-sensitive data refers to data with a large volume that is not sensitive to latency.
- data source 1011 such as an application
- 10-sensitive data can be regarded as the first data type
- throughput-sensitive data can be regarded as the second data type.
- dividing data into two categories is only an example, 10-sensitive data is only an example of the first data type, and throughput-sensitive data is only an example of the second data type, and neither is limited to this.
- throughput-sensitive data which is not latency-sensitive
- data aggregation can be performed in the data buffer, and then written to the target flash memory in large blocks.
- the target flash memory can meet the throughput bandwidth requirements of throughput-sensitive data, and due to the lower read/write frequency, the lifespan requirement for the target flash memory is not high.
- using high-performance heterogeneous media to carry IOPS-sensitive data compensates for the shortcomings of the target flash memory in terms of lifespan and IOPS latency. This allows the target flash memory to carry throughput-sensitive data in the write direction, keeping the write amplification factor within a certain range and solving the problems of insufficient lifespan and write IOPS of the target flash memory.
- This heterogeneous media solution enables the widespread application of target-type flash memory in cloud storage scenarios.
- this solution relies on high-performance heterogeneous media.
- high-performance heterogeneous media with superior lifespan and read/write performance compared to QLC flash memory are rare.
- Storage Class Memory (SCM) media for instance, surpasses QLC flash memory, but SCM is still under development. Therefore, without high-performance heterogeneous media to complement QLC flash memory, this solution faces significant challenges in practical implementation.
- high-performance heterogeneous media increases storage costs. Even if such media exists that can work with QLC flash memory, the trade-off between the increased costs of the heterogeneous media solution and the cost advantages of QLC flash memory is difficult to assess.
- This disclosure continuously innovates and explores technologies. After a great deal of creative work, it proposes an alternative solution.
- This solution not only overcomes the shortcomings of the target flash memory medium in terms of lifespan and read/write performance, but also fully leverages the advantages of the target flash memory medium in terms of storage capacity and cost. Furthermore, it eliminates the target flash memory medium's dependence on high-performance heterogeneous media.
- a novel flash memory storage system is built on the target flash memory medium through a hardware-software co-design approach. This not only overcomes the shortcomings of the target flash memory medium in terms of lifespan and read/write performance, but also fully leverages the advantages of the target flash memory medium in terms of storage capacity and cost.
- FIG. 2a is a hardware-software architecture diagram of a flash memory storage system provided by an embodiment of this disclosure.
- the flash memory storage system 200 includes: a storage engine 1012, a memory storage 201, and a persistent storage 202.
- the persistent memory 202 can be any memory that uses the target type of flash memory as its storage medium, such as a solid-state drive (SSD) or a combination of an SSD and a hard disk drive (HDD). This disclosure does not limit the specific type of flash memory.
- SSD solid-state drive
- HDD hard disk drive
- the amount of data that a single storage cell can store is different (or simply, the storage capacity is different).
- the storage capacity is represented by the number of bits that a single storage cell can store; the more bits a single storage cell can store, the greater its storage capacity. The more bits a single storage cell can store, the greater its storage capacity, and the more data it can store.
- the read/write performance of a flash memory area is related to the amount of data that can be stored in a single storage cell. A smaller data capacity per cell means faster read/write operations on that cell, resulting in higher overall read/write performance but lower storage capacity.
- a larger data capacity per cell means slower read/write operations on that cell, resulting in lower overall read/write performance but higher storage capacity.
- the first data capacity stored in a single storage cell of the first type of flash memory area 2021 is less than the second data capacity stored in a single storage cell of the second type of flash memory area 2022.
- ZNS is a feature in the Non-Volatile Memory Express 2.0 (NVMe2.0) technical specification. Its core idea is that persistent storage (e.g., SSDs) provides a zone access interface to replace the block device interface provided by traditional persistent storage (e.g., SSDs). ZNS introduces the concept of "partitions" on top of NVMe, also known as flash memory partitions.
- the storage density of Type I flash memory is one-third that of Type II flash memory, but its lifespan is longer and it has extremely low read/write I/O latency.
- the partitioning result when partitioning the target type flash memory medium, can yield flash memory areas with the same data storage mode as the original data storage mode supported by the target type flash memory medium. For example, when the target type flash memory medium is QLC type, QLC type flash memory areas can be obtained.
- the partitioning result also includes flash memory areas with fewer bits than the number of bits that a single storage cell of the target type flash memory medium can store. For example, when the target type flash memory medium is QLC type, at least pSLC type flash memory areas can be obtained.
- pSLC type flash memory areas does not mean that flash memory areas with fewer bits than the number of bits that a single storage cell of the target type flash memory medium can store are pSIC type.
- pTLC type flash memory areas can also be implemented, etc. Any flash memory area that can be implemented with fewer bits than the number of bits that a single storage cell of the target type flash memory medium can store...
- different types of flash memory regions are implemented on the target type of flash memory medium.
- the QLC flash memory medium is divided into pSLC flash memory regions and QLC flash memory regions as described above. This division can be static or dynamic.
- Static division means that various flash memory regions and the quantity of each type of flash memory region are pre-defined before the persistent memory leaves the factory.
- Dynamic division means that after the persistent memory leaves the factory and is installed on the host, the storage engine dynamically divides the memory region as needed based on the application and data types on the host. There are as many types of data as there are flash memory regions, and the quantity of each type of flash memory region is determined based on the approximate data volume of each type of data.
- Each type of flash memory area can contain one or more, typically multiple. When there are multiple flash memory areas of each type, the storage engine determines how data is allocated and used across these areas based on a data layout strategy. This data layout strategy includes, but is not limited to, hash distribution, list distribution, and range distribution.
- Hash distribution calculates the hash value of the data and maps it to a specific flash memory area, achieving a uniform distribution.
- List distribution allocates data to different flash memory areas based on specific fields, suitable for certain scenarios.
- Range distribution divides data into different flash memory areas according to a certain range, suitable for processing continuous data.
- the data generated by the data source that needs to be persistently stored can be divided into a first data type (e.g., 10-sensitive) and a second data type (e.g., throughput-sensitive).
- first data type e.g., 10-sensitive
- second data type e.g., throughput-sensitive
- different data storage modes of flash memory areas are implemented on the target type of flash memory medium. Different types of flash memory areas can be used to carry corresponding data types. Different flash memory areas have different lifespans and read/write performance to adapt to different data types.
- the data when writing data, the data is written to the corresponding flash memory area according to the data type. For data sensitive to type 10, it can be directly written to the corresponding flash memory area; for data sensitive to throughput, the data can be temporarily stored in memory, and then transferred to the corresponding flash memory area when the data volume reaches a certain threshold.
- the data read/write process will be described in detail below.
- the flash memory storage system is used to provide data storage services to data sources using the flash memory storage system, involving data writing and data reading processes. The data writing and reading processes are handled by the storage engine 1012.
- the storage engine 1012 can respond to write requests and obtain first data; if the first data belongs to a first data type, it stores the first data in a first type of flash memory area 2021 according to the first data volume; if the first data belongs to a second data type, it temporarily stores the first data in the memory storage 201, and when the first data temporarily stored in the memory storage 201 reaches a first data volume threshold, it transfers the first data temporarily stored in the memory storage 201 to a second type of flash memory area 2022 according to the second data volume.
- the first data volume is less than the second data volume.
- metadata is generated simultaneously.
- the metadata is information describing the characteristics of the first data, including at least the storage location information of the first data in the flash memory storage system (e.g., the identification information of the flash memory area where the data is located and the storage path in that flash memory area), to locate the first data during the data reading process.
- different types of flash memory areas are divided on the target flash memory medium.
- the amount of data that a single storage cell in each flash memory area can store differs, meaning that the lifespan and read/write performance of different flash memory areas vary, thus adapting to different data types.
- the data is written to the corresponding flash memory area based on the data type.
- the storage engine 1012 when the storage engine 1012 stores the first data into the first type of flash memory area 2021, it is also used to: if the first data belongs to a first data type, temporarily store the first data in the non-volatile cache area 2023, and if the first data temporarily stored in the non-volatile cache area 2023 reaches a second data volume threshold... In this case, according to the first data volume, the first data temporarily stored in the non-volatile cache 2023 is transferred to the first type of flash memory 2021.
- the second data volume threshold is greater than the data volume of the first data written in a single operation, but the size of the second data volume threshold is not limited and can be flexibly set according to the actual situation.
- the first data volume threshold is greater than the data volume of the first data written in a single instance, but the size of the first data volume threshold is not limited and can be flexibly set according to the actual situation.
- the second data type can be throughput-sensitive data. This type of data has a large volume and is not sensitive to latency. For throughput-sensitive data, it can be aggregated in the data buffer of the memory storage, aggregated to a size compatible with the second type of flash memory area, and then persisted to the second type of flash memory area. This can significantly reduce the number of writes to the flash memory area, thereby extending its lifespan.
- the data buffer corresponding to the second type of flash memory area can also be called a merge buffer.
- the data buffer is implemented at the software level and resides in the memory storage. Since the data buffer is implemented at the software level, it is volatile when power is lost. Therefore, after persistence is complete, the storage engine needs to confirm the completion of the I/O operation with the software object. In this embodiment, it is precisely because of the existence of the data buffer that throughput-sensitive data can be aggregated in this data buffer, thus eliminating the need for the support of a non-volatile buffer. This eliminates the need to configure a non-volatile buffer for the second type of flash memory area on the target type of flash memory medium. Considering the large volume of throughput-sensitive data, the amount of data to be aggregated for this type of data will also be substantial.
- non-volatile cache on the second type of flash memory would require designing a large amount of non-volatile cache, increasing the complexity of persistent storage implementation.
- QLC SSDs require a larger amount of aggregated data than TLC SSDs, necessitating the design of large-capacity NVRAM, thus increasing SSD design complexity.
- the internal NVRAM of QLC SSDs can be eliminated. This avoids the need for large-capacity power-saving capacitors required by QLC SSDs, simplifying design and implementation, and improving system reliability.
- the storage engine 1012 When reading data, the storage engine 1012 is used to: respond to a data read request and determine the target flash memory area where the second data to be read is located; and read the second data from the target flash memory area based on the amount of data that a single storage cell in the target flash memory area can store.
- the target flash memory area may be a first-type flash memory area or a second-type flash memory area, depending on the data type of the second data.
- the target flash memory area is a first-type flash memory area (such as a pSLC flash memory area), and the second data is read from the first-type flash memory area based on the amount of data that a single storage cell in the first-type flash memory area can store; if the second data belongs to the second data type, then the target flash memory area is a second-type flash memory area (such as a QLC flash memory area), and the second data is read from the second-type flash memory area based on the amount of data that a single storage cell in the second-type flash memory area can store.
- a first-type flash memory area such as a pSLC flash memory area
- the second data is read from the first-type flash memory area based on the amount of data that a single storage cell in the first-type flash memory area can store
- the target flash memory area is a second-type flash memory area (such as a QLC flash memory area)
- the second data is read from the second-type flash memory area based on the amount of data that a single storage
- the second data can be any data that needs to be read from the flash memory area, such as the first data that has already been written to the flash memory area, but is not limited to this.
- the target flash memory medium e.g., NAND Flash
- flash memory regions include flash memory blocks, also known as storage blocks. These blocks are the basic units for data reading and writing in flash memory, and also the smallest units for data erasure.
- a storage block can include one or more storage pages. When a storage block is not yet full (i.e., during a write operation), if a read request hits that block, it will cause severe read interference. The latency will increase significantly during subsequent reads.
- a temporary cache area 2012 corresponding to the second type of flash memory area 2022 is added to the memory storage. This temporary cache area 2012 can also be called a block cache. The temporary cache area 2012 is used to cache data being written to a storage block.
- the storage blocks in the persistent storage can have the following states: Open, Seal, Offline, Garbage Collection, Erase, and Free. For ease of management, these states can be simplified to three states: Free, Open, and Closed.
- a storage block in an idle state refers to a storage block that has not been allocated any data. An idle storage block needs to be opened before being written to, thus changing its state from idle to open.
- a storage block When a storage block is in an open state, it accepts write operations (i.e., it is writable). In the writable state, it also accepts read operations; therefore, the writable state can also be called the read-write state.
- the read-write state of a storage block When a storage block is full, it switches from an open state to a closed state. When a storage block is in a closed state, it accepts read operations but no longer accepts write operations (i.e., it is read-only).
- the read-write state of a storage block can also be referred to as its programming state.
- the programming state of a storage block includes...
- the memory storage block can be in two states: partially programmed (i.e., writable) and fully programmed (i.e., read-only).
- a memory block is considered partially programmed when some pages within it have been written to; it is considered fully programmed when all pages have been written to.
- read interference is a concern.
- the read voltage causes changes in the storage voltage of other pages within the same block.
- the impact on other pages accumulates, ultimately leading to an increase in the data error rate of the memory block.
- the memory storage 201 also includes a temporary cache 2012 corresponding to the second type of flash memory area 2022. It should be noted that the data buffer 2011 and the temporary cache 2012 in the memory storage can be pre-configured or dynamically allocated.
- the storage engine can request the data from the host OS, and the allocation size can be determined on demand or pre-configured.
- the temporary cache area 2012 is used to cache data in storage blocks that are at least partially in a locally programmed state within the second type of flash memory area.
- the "storage blocks at least partially in a locally programmed state" can be a portion or all of the storage blocks in a locally programmed state within the second type of flash memory area.
- When implemented as a partial locally programmed state it can include storage blocks used to store specific data, or the first N storage blocks in a locally programmed state, where N is a positive integer.
- When implemented as all storage blocks in a locally programmed state it can include all identified storage blocks in a locally programmed state.
- the programming state of the storage blocks changes dynamically. Therefore, when implemented as all storage blocks in a locally programmed state, the specific implementation depends on the identification of the storage block programming state. If each storage block in a locally programmed state can be accurately identified, the data of the locally programmed storage blocks can be cached; if the identification is not very accurate, the data of the identified locally programmed storage blocks is stored. Furthermore, as data is continuously stored, the programming state of the storage blocks will dynamically change.
- the temporary cache can also temporarily store data from storage blocks that transition from a partially programmed state to a fully programmed state, until the data in the fully programmed storage block is deleted. The data stored in the temporary cache 2012 is written under the control of the storage engine 1012.
- the storage engine 1012 writes the first data to the data buffer 2011; simultaneously, it also stores the first data temporarily stored in the data buffer 2011 into the temporary cache 2012, so as to read the first data from the temporary cache 2012.
- the metadata of the second data can be queried to determine the read address carried in the read request and identify the flash memory area to which that read address belongs as the target flash memory area. If the target flash memory area belongs to the second type of flash memory area 2022, a query is first performed in the temporary cache area 2012. If the second data is found in the temporary cache area 2012, it is read from there.
- the second data is not found in the temporary cache area 2012, it is read from the target flash memory area (i.e., the second type of flash memory area) based on the amount of second data. This mitigates read interference issues faced by the second type of flash memory area.
- the first data represents the data written to the second type of flash memory area
- the second data represents the data to be read from it.
- the first data and the second data may be the same data or different data; this is not limited.
- the write request originates from the flash storage system...
- the user end can be various applications, systems, or functional modules.
- the storage engine when reading second data from the target flash memory area (i.e., the second type of flash memory area) based on the second data volume, can send the identifier of the second data and the identifier of the target flash memory area to the storage controller on the persistent memory 202 where the target flash memory area is located.
- the storage controller then reads the second data from the target flash memory area based on the identifier of the target flash memory area and the identifier of the second data, and returns it to the storage engine; the storage engine receives the second data returned by the storage controller.
- the read interference problem existing in the storage blocks in a locally programmed state within the second type of flash memory area is solved.
- the memory storage can be configured with abundant memory resources to cache the data of the storage blocks in a locally programmed state, thereby solving the problem of limited cache space on the persistent memory.
- flash memory storage systems can be configured with abundant memory resources, solving the problem of limited cache space on persistent storage, memory resources are still finite.
- the storage engine is further configured to: evict data in the temporary cache based on programming state change information of storage blocks that are at least partially in a partially programmed state, in order to release cache space.
- the storage engine is configured to: for any storage block that caches data in the temporary cache, when that storage block changes from a partially programmed state (writable state) to a fully programmed state (read-only state), delete the data cached in that storage block in the temporary cache.
- the eviction management of data in the temporary cache depends on the programming state of the storage blocks, requiring maintenance and management of the programming state of the storage blocks.
- the data corresponding to the storage blocks in the second type of flash memory that are in a fully programmed state is evicted.
- the temporary cache may store data corresponding to multiple storage blocks. Therefore, when evicting any storage block, it is necessary to accurately determine the boundary of the data corresponding to that storage block in the temporary cache.
- the storage engine creates a virtual cache block adapted to any storage block.
- the virtual cache block can be created before data is stored in any storage block, or when data is first stored in any storage block. Furthermore, when data from any storage block is cached in the temporary cache, the virtual cache block records the data information cached in the temporary cache for that storage block, and maintains the programming state of that storage block through the read/write state of the virtual cache block.
- the writable state and read-only state of the virtual cache block correspond to the partial programming state and fully programming state of that storage block, respectively.
- the data information may include data identification information, the data's storage location in the temporary cache, etc., used to identify which data needs to be deleted during data deletion.
- any storage block and adapter ...
- the programming state of the virtual cache block corresponds to the data stored in any storage block and the corresponding virtual cache block.
- the programming state of any storage block and its data boundaries in the temporary cache area can be determined from the virtual cache block. Furthermore, when any storage block is detected to change from a partially programmed state to a fully programmed state, only the data cached in the corresponding virtual cache block in the temporary cache area needs to be deleted.
- the virtual cache block is a logical resource designed as a data structure.
- the data structure can be an array, list, or binary tree, etc., used to organize and store data.
- the virtual cache block is an abstract concept, not a specific physical storage unit, but rather an abstraction of any storage block in the second type of flash memory area within the temporary cache area.
- the temporary cache area can also be divided into physical cache blocks of the same size according to the size of the storage block, with the data in each storage block cached in one physical cache block. Additionally, each physical cache block corresponds to a virtual cache block, used to record the correspondence between the data cached in that physical cache block and the storage block.
- virtual cache blocks adapted to storage blocks there is a corresponding relationship between virtual cache blocks and storage blocks. This relationship can be one virtual cache block corresponding to one storage block, one virtual cache block corresponding to multiple storage blocks, or multiple virtual cache blocks corresponding to one storage block; there are no restrictions on this.
- the temporary cache area when the temporary cache area is divided into physical cache blocks, the correspondence between physical cache blocks and virtual cache blocks is the same as the correspondence between virtual cache blocks and storage blocks; it can be one-to-one, one-to-many, or many-to-one, and there are no restrictions on this.
- the persistent storage exposes the underlying storage medium to the storage engine, which directly performs read and write operations on the underlying storage medium (i.e., flash memory). Therefore, the storage engine can perceive the state of the storage blocks in the underlying storage medium.
- the state of the storage blocks is transparent to the storage engine, and the storage engine's detection of changes in the state of the storage blocks is direct and effective.
- the storage engine when storing data in the second type of flash memory, the storage engine creates a virtual cache block adapted to the idle storage block in each activated second type of flash memory area. Each time a new storage block is activated, it transitions from an idle state to a partially programmable state. Furthermore, when writing data to each storage block in the partially programmable state, the data can be cached in a temporary cache. Because the storage engine is aware of the state of the storage blocks in the underlying storage medium and creates a corresponding virtual cache block in the temporary cache each time a new storage block is activated, the programming state of the storage block corresponds to the read/write state of the virtual cache block, and the boundaries of the storage block are aligned with the boundaries of the virtual cache block.
- the programming state of the storage block can be mapped to the read/write state of the virtual cache block, and directly mapped to the corresponding virtual cache block. Furthermore, due to this alignment, cross-block writes are avoided. Based on the perception of the state of storage blocks in the underlying storage medium, corresponding virtual cache blocks can be marked in the temporary cache area to complete the mapping from the programming state of the storage block to the read/write state of the virtual cache block. Therefore, when the storage engine maintains the programming state of each storage block through the read/write state of the virtual cache block, if an enabled storage block is in a partially programmed state, the virtual cache block corresponding to that storage block is marked as writable.
- the programming state of the storage block will change; when the storage block is full, it means...
- the virtual cache block corresponding to that storage block is marked as read-only. This completes the mapping from the programming state of the storage block to the read/write state of the virtual cache block.
- the storage engine can obtain the programming state of the corresponding storage block by detecting the read/write state of the virtual cache block.
- the storage engine monitors the read/write state of any virtual cache block.
- any virtual cache block When any virtual cache block is in a read-only state, based on the data information recorded in that virtual cache block, it deletes the data cached in the temporary cache area from the storage block corresponding to that virtual cache block, thus achieving data eviction management in the temporary cache area.
- the above embodiments of this disclosure mainly describe how to solve the read interference problem faced by storage blocks in a partially programmed state. In practical applications, read interference problems also exist for storage blocks in a fully programmed state. To address this issue, in this embodiment, the storage engine is further configured to: count the number of reads of storage blocks; and when the number of reads reaches a set threshold, move the data from a fully programmed storage block to another idle storage block in persistent storage.
- a list of idle blocks can be maintained, recording information about currently available idle storage blocks, including the starting address and length of the block and the number of erase/write cycles.
- an idle storage block can be selected from this list.
- the second data can be divided into cold data and hot data based on the access frequency, and a suitable idle storage block can be selected for storage based on the characteristics of cold and hot data.
- hot data is selected from storage blocks with fewer erase/write cycles
- cold data is selected from storage blocks with more erase/write cycles to optimize storage performance and extend the lifespan of persistent storage.
- garbage collection can be triggered to reclaim storage space occupied by expired data and recycle and reuse storage space by moving valid data, thus restoring some storage blocks to an idle state.
- This disclosure does not limit the garbage collection strategy, such as mark-sweep algorithms, generational collection algorithms, etc.
- a temporary cache area is introduced in the memory storage to cache data in storage blocks in the second type of flash memory area that are at least partially in a locally programmed state.
- the flash memory storage system shown in FIG2a can be applied to a host for persistent storage functionality.
- the host in this case can be any physical machine containing various hardware and software resources, such as a traditional server, terminal device, or cloud server, cloud host, etc.
- Figure 3a which is a schematic diagram of the structure of a host provided in an embodiment of this disclosure, the host 300 includes: software resources and hardware resources; the software resources include: a storage engine 1012, and the hardware resources include: a memory storage 201 and a persistent storage 202.
- the persistent storage 202 adopts a target-type flash memory medium, and a first type flash memory area 2021 and a second type flash memory area 2022 are implemented on the target-type flash memory medium.
- the first data amount that a single storage cell in the first type flash memory area 2021 can store is less than the second data amount that a single storage cell in the second type flash memory area 2022 can store; the storage engine is used to respond to write requests and obtain first data; when the first data belongs to a first data type, the first data is stored in the first type flash memory area according to the first data amount; when the first data belongs to a second data type, the first data is temporarily stored in the memory storage, and when the first data temporarily stored in the memory storage reaches a first data amount threshold, the first data temporarily stored in the memory storage is transferred to the second type flash memory area according to the second data amount.
- a non-volatile cache area 2023 corresponding to the first type of flash memory area 2021 is further implemented on the target type flash memory medium; the storage engine is further configured to: when the first data belongs to a first data type, temporarily store the first data in the non-volatile cache area, and when the first data temporarily stored in the non-volatile cache area reaches a second data volume threshold, transfer the first data temporarily stored in the non-volatile cache area to the first type of flash memory area according to the first data volume.
- the storage engine is further configured to: respond to a data read request, determine the target flash memory area where the second data to be read is located; and read the second data from the target flash memory area according to the amount of data that a single storage cell in the target flash memory area can store.
- the storage engine is further configured to: read the second data from the temporary cache area if the target flash memory area belongs to the second type of flash memory area and the second data is found in the temporary cache area; and read the second data from the target flash memory area according to the amount of the second data if the second data is not found in the temporary cache area.
- the implementation of two types of flash memory regions on the target type flash memory medium is used as an example for illustration.
- two or more (i.e., at least two) types of flash memory regions can be implemented on the target type flash memory medium.
- the target type flash memory medium is QLC type
- at least a QLC type flash memory region is implemented; and at least a flash memory region with fewer bits than that that can be stored in a single storage cell of the target type flash memory medium is implemented.
- the target type flash memory medium is QLC type
- at least a pSLC type flash memory region can be obtained.
- pSLC flash regions and QLC flash regions can be implemented on the QLC flash memory medium; or pSLC flash regions, pMLC flash regions and QLC flash regions can be implemented on the QLC flash memory medium; or pSLC flash regions, pMLC flash regions, pTLC flash regions and QLC flash regions can be implemented on the QLC flash memory medium; or pMLC flash regions and QLC flash regions can be implemented on the QLC flash memory medium; or pTLC flash regions and QLC flash regions can be implemented on the QLC flash memory medium, and so on.
- this embodiment also provides a flash memory storage system 400, including: a storage engine 401 and a persistent memory 402.
- the persistent memory 402 uses a target-type flash memory medium, and at least two types of flash memory areas are implemented on the target-type flash memory medium.
- the amount of data that a single storage cell in different types of flash memory areas can store is different, so as to store data of different data types.
- the data generated by the data source that needs to be persistently stored can be divided into at least two types.
- N types of data from the first type of data to the Nth type of data, are shown.
- N types of flash memory areas corresponding to the N types of data are also shown, namely, the first type of flash memory area to the Nth type of flash memory area.
- Each data type corresponds to one type of flash memory area, and N is a natural number greater than or equal to 2.
- Storage engine 401 is used to respond to write requests and obtain first data, wherein the first data belongs to the target data type; determine a first target flash memory area corresponding to the target data type from at least two types of flash memory areas; and store the first data into the first target flash memory area according to the amount of data that a single storage cell in the first target flash memory area can store.
- the first target flash memory area may be any type of flash memory area, specifically determined by the data type of the first data and the correspondence between data types and flash memory areas.
- N types of flash memory areas can be divided into target type flash memory areas and non-target type flash memory areas according to the amount of data that a single storage cell in the flash memory area can store.
- a target type flash memory area refers to a flash memory area where the amount of data that a single storage cell can store is greater than a set data volume threshold;
- a non-target type flash memory area refers to a flash memory area where the amount of data that a single storage cell can store is less than or equal to the set data volume threshold.
- the data volume threshold is not limited. Taking the number of bits as an example, the data volume threshold can be 1, 2, or 3, etc. For example: when the data volume threshold is set to 1, it means that the flash memory area that can store 1 unit of data is a non-target type flash memory area; all other flash memory areas are target type flash memory areas. When the data volume threshold is set to 2, it means that the flash memory areas that can store 1 or 2 units of data are non-target type flash memory areas; all other flash memory areas are target type flash memory areas. In Figure 4a, the first type of flash memory area is used as an example of a non-target type flash memory area, and the other types of flash memory areas are examples of target type flash memory areas.
- the flash memory storage system 400 also includes: a memory storage 403, which includes a data buffer 40310 corresponding to the target type flash memory area.
- the target type flash memory area can be one or more, and each target type flash memory area corresponds to a data buffer. Specifically, for data that needs to be written to the target type of flash memory, it can be aggregated in the data buffer 4031 and then persisted to the corresponding type of flash memory in batches.
- the storage engine is also used to: when the first target flash memory belongs to the target type of flash memory, temporarily store the first data in the corresponding data buffer, and when the first data temporarily stored in the data buffer reaches a first data volume threshold, transfer the first data temporarily stored in the data buffer to the first target flash memory according to the amount of data that a single storage cell in the first target flash memory can store; when the first target flash memory belongs to a non-target type of flash memory, directly store the first data in the first target flash memory.
- a non-volatile cache area 4021 (including but not limited to NVRAM) corresponding to the non-target type flash memory area is also implemented on the target type flash memory medium.
- the non-target type flash memory area can be one or more, and each non-target type flash memory area corresponds to a non-volatile cache area.
- the non-volatile buffer 4021 is used to aggregate data written to non-target type flash memory areas (e.g., data sensitive to type 10), which can reduce read and write operations on non-target type flash memory areas to a certain extent.
- the storage engine is also used to: when the first target flash memory area is a non-target type flash memory area, temporarily store the first data in the corresponding non-volatile buffer; and when the first data temporarily stored in the non-volatile buffer reaches a second data volume threshold, transfer the first data temporarily stored in the non-volatile buffer to the first target flash memory area according to the amount of data that a single storage cell in the first target flash memory area can store.
- the memory storage 403 also includes a temporary buffer 4032o corresponding to the target type flash memory area.
- the target type flash memory area can be one or more, and each target type flash memory area corresponds to a temporary buffer.
- the storage engine 401 When the first data temporarily stored in the data buffer reaches a first data volume threshold, the storage engine 401, in addition to transferring the first data temporarily stored in the data buffer to the first target flash memory area, can also store the first data temporarily stored in the data buffer 4031 to a temporary cache area 4032, so that the first data can be read from the temporary cache area 4032 when reading data.
- the storage engine is further configured to: respond to a read request, determine the second target flash memory area where the second data is located; and read the second data from the second target flash memory area according to the amount of data that a single storage cell in the second target flash memory area can store.
- the second target flash memory area can be any type of flash memory area, specifically determined according to the data type of the second data and the correspondence between the data type and the flash memory area. For example, if the second data is the first... If the second data is of a certain data type, then the second target flash memory area belongs to the first type of flash memory area; if the second data is of a second data type, then the second target flash memory area belongs to the second type of flash memory area, and so on.
- the storage engine is further configured to: if the second target flash memory area belongs to the target type of flash memory area, first query the temporary cache area corresponding to the second target flash memory area; if the second data is found in the temporary cache area corresponding to the second target flash memory area, read the second data from the temporary cache area corresponding to the second target flash memory area; if the second data is not found in the temporary cache area corresponding to the second target flash memory area, then read the second data from the second target flash memory area according to the amount of data that a single storage unit in the second target flash memory area can store. Accordingly, in this embodiment of the disclosure, the deployment implementation of the flash memory storage system shown in FIG4a is not limited.
- FIG5a is a schematic diagram of the structure of a host 500 provided in an embodiment of the present disclosure.
- the host 500 includes software resources and hardware resources.
- the software resources include a storage engine 401, and the hardware resources include persistent memory 402.
- the persistent memory 402 uses a target-type flash memory medium and implements at least two types of flash memory areas on the target-type flash memory medium. The amount of data that can be stored in a single storage cell in the different types of flash memory areas is different, so as to store data of different data types.
- the storage engine is used to respond to write requests, obtain first data, wherein the first data belongs to the target data type; determine a first target flash memory area corresponding to the target data type from the at least two types of flash memory areas; and store the first data into the first target flash memory area according to the amount of data that can be stored in a single storage cell in the first target flash memory area.
- the hardware resources further include: a memory storage 403, which includes a data buffer 4031 corresponding to a flash memory area of the target type.
- the flash memory area of the target type refers to a flash memory area where the amount of data that a single storage unit can store is greater than a set data amount threshold.
- the storage engine is further configured to: when the first target flash memory area belongs to the flash memory area of the target type, temporarily store the first data in the corresponding data buffer, and when the first data temporarily stored in the data buffer reaches the first data amount threshold, transfer the first data temporarily stored in the data buffer to the first target flash memory area according to the amount of data that a single storage unit in the first target flash memory area can store.
- a non-volatile buffer 4021 corresponding to a non-target type flash memory area is further implemented on the target type flash memory medium.
- the non-target type flash memory area refers to a flash memory area where the amount of data that a single storage cell can store is less than or equal to a set data amount threshold.
- the storage engine is further configured to: when the first target flash memory area belongs to a non-target type flash memory area, temporarily store the first data in the corresponding non-volatile buffer area, and when the first data temporarily stored in the non-volatile buffer area reaches a second data amount threshold, transfer the first data temporarily stored in the non-volatile buffer area to the first target flash memory area according to the amount of data that a single storage cell in the first target flash memory area can store.
- the memory storage also includes a temporary buffer 4032 corresponding to a target type flash memory area; the storage engine 401 is further configured to: transfer the first data temporarily stored in the data buffer 4031 to the first target flash memory area.
- the data is stored in a temporary cache 4032 for reading the first data from the temporary cache 4032.
- the storage engine is further configured to: respond to a read request and determine the second target flash memory area where the second data is located; and read the second data from the second target flash memory area according to the amount of data that a single storage unit in the second target flash memory area can store.
- the storage engine is further configured to: read the second data from the temporary cache area corresponding to the second target flash memory area if the second target flash memory area is a flash memory area of the target type and the second data is found in the temporary cache area corresponding to the second target flash memory area; and read the second data from the second target flash memory area according to the amount of data that a single storage unit in the second target flash memory area can store if the second data is not found in the temporary cache area corresponding to the second target flash memory area.
- the cloud storage system 100 includes: a computing layer and a storage layer, the computing layer including at least one computing node 10a, and the storage layer including at least one storage node 10b.
- the computing node 10a includes memory and persistent storage medium
- the storage node 10b also includes memory and persistent storage medium.
- the internal implementation structure of the computing node 10a and/or the storage node 10b can adopt the host shown in Figure 5a or Figure 5b, or the host shown in Figure 3a or Figure 3b, without limitation.
- Figure 5c the internal implementation structure of the computing node 10a and the storage node 10b is illustrated using the host structure shown in Figure 5b as an example.
- a detailed description of the internal implementation structure of the computing node 10a and/or the storage node 10b can be found in the foregoing embodiments, and will not be repeated here.
- this disclosure also provides a data storage method applied to a storage engine in a host or flash memory storage system.
- the persistent storage in the host or flash memory storage system uses a target type flash memory medium, and at least two types of flash memory areas are implemented on the target type flash memory medium.
- the storage capacity of a single storage cell in the different types of flash memory areas is different, so as to store data of different data types.
- the method includes:
- S601 Respond to a write request and obtain first data, wherein the first data belongs to the target data type; S602: Determine a first target flash memory area corresponding to the target data type from at least two types of flash memory areas; S603: Store the first data in the first target flash memory area.
- the host's memory storage includes a data buffer corresponding to the target type flash memory area, wherein the target type flash memory area refers to a flash memory area where the storage capacity of a single storage unit is greater than a set capacity threshold; wherein storing the first data in the first target flash memory area includes: if the first target flash memory area belongs to the target type flash memory area, temporarily storing the first data in the corresponding data buffer; if the first data temporarily stored in the data buffer reaches a first data volume threshold, transferring the first data temporarily stored in the data buffer to the first target flash memory area according to the storage capacity of a single storage unit in the first target flash memory area.
- the memory storage also includes a temporary cache area corresponding to the target type flash memory area; the method further includes: storing the first data temporarily stored in the data buffer in the temporary cache area to read the first data from the temporary cache area.
- the target type flash memory medium also includes flash memory regions corresponding to non-target types.
- a non-volatile buffer, or a non-target type flash memory area refers to a flash memory area where the storage capacity of a single storage cell is less than or equal to a set capacity threshold.
- the process of storing the first data into the first target flash memory area includes: if the first target flash memory area is a non-target type flash memory area, temporarily storing the first data in the corresponding non-volatile buffer; if the first data temporarily stored in the non-volatile buffer reaches a second data volume threshold, transferring the first data temporarily stored in the non-volatile buffer to the first target flash memory area.
- this disclosure also provides a data reading method applied to a storage engine in a host or flash memory storage system.
- the persistent memory in the host or flash memory storage system uses a target type flash memory medium, and at least two types of flash memory areas are implemented on the target type flash memory medium.
- the storage capacity of a single storage cell in the different types of flash memory areas is different, so as to store data of different data types.
- the method includes:
- S701 In response to a read request, determine the second target flash memory area where the second data is located, wherein the second target flash memory area is any one of at least two types of flash memory areas;
- the host's memory storage includes a temporary cache area corresponding to a flash memory area of the target type.
- the target type flash memory area refers to a flash memory area where the storage capacity of a single storage cell is greater than a set capacity threshold.
- Reading the second data from the second target flash memory area according to the storage capacity of a single storage cell in the second target flash memory area includes: if the second target flash memory area belongs to the target type flash memory area and the second data is found in the temporary cache area corresponding to the second target flash memory area, then read the second data from the temporary cache area corresponding to the second target flash memory area; if the second data is not found in the temporary cache area corresponding to the second target flash memory area, then read the second data from the second target flash memory area according to the storage capacity of a single storage cell in the second target flash memory area.
- the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can be executed by different devices.
- the execution subject of steps 601 to 603 can be device A; or, for example, the execution subject of steps 601 and 602 can be device A, and the execution subject of step 603 can be device B; and so on.
- multiple operations appearing in a specific order are included. However, it should be clearly understood that these operations may not be executed in the order they appear in this document, or may be executed in parallel.
- the operation numbers, such as 601, 602, etc. are merely used to distinguish different operations, and the numbers themselves do not represent any execution order.
- embodiments of this disclosure also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method embodiments. Accordingly, embodiments of this disclosure also provide a computer program product, which includes a computing... The computer program/instructions, when executed by the processor, cause the processor to perform the steps in the above method embodiments.
- the memory described above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
- SRAM Static Random-Access Memory
- EEPROM Electrically Erasable Programmable Read Only Memory
- EPROM Erasable Programmable Read Only Memory
- PROM Programmable Read-Only Memory
- ROM Read-Only Memory
- magnetic storage flash memory
- flash memory magnetic disk
- optical disk optical disk.
- the communication component described above is configured to facilitate wired or wireless communication between the device containing the communication component and other devices.
- the device containing the communication component can access wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G/LTE, 5G, or combinations thereof.
- the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel.
- the communication component also includes a Near Field Communication (NFC) module to facilitate short-range communication.
- NFC Near Field Communication
- the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth, and other technologies.
- RFID Radio Frequency Identification
- IrDA Infrared Data Association
- UWB Ultra Wide Band
- Bluetooth Bluetooth
- the aforementioned display includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen can be implemented as a touchscreen to receive input signals from the user.
- the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel.
- the touch sensors can sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation.
- the aforementioned power supply component provides power to various components of the device in which the power supply component resides.
- the power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply component resides.
- the aforementioned audio component can be configured to output and/or input audio signals.
- the audio component includes a microphone (MIC) configured to receive external audio signals when the device in which the audio component resides is in an operating mode, such as a call mode, recording mode, or voice recognition mode.
- the received audio signals may be further stored in memory or transmitted via a communication component.
- the audio component also includes a speaker for outputting audio signals.
- this disclosure can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects.
- this disclosure can be implemented using one or more computer-readable storage media (including, but not limited to, disk storage, and Compact Disc Read-Only) containing computer-usable program code.
- This disclosure refers to a computer program product implemented on a memory (such as a CD-ROM, optical memory, etc.).
- a memory such as a CD-ROM, optical memory, etc.
- each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams can be implemented by computer program instructions.
- These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more flowchart illustrations and/or one or more block diagrams.
- These computer program instructions can also be stored in a computer-readable storage medium capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowchart illustrations and/or one or more block diagrams.
- These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing steps for implementing the functions specified in one or more flowcharts and/or one or more blocks of a block diagram.
- a computing device includes one or more processors (Central Processing Unit, CPU), input/output interfaces, network interfaces, and memory.
- Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash RAM.
- RAM random access memory
- ROM read-only memory
- Memory is an example of computer-readable media.
- Computer-readable media includes both permanent and non-persistent, removable and non-removable media, and information storage can be implemented by any method or technology.
- Information may be computer-readable instructions, data structures, modules of a program, or other data.
- Examples of computer storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, Digital Video Disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information that can be accessed by a computing device.
- PRAM phase-change random access memory
- SRAM static random access memory
- DRAM dynamic random access memory
- RAM random access memory
- ROM read-only memory
- EEPROM electrically erasable programmable read-only memory
- flash memory or other memory technologies
- CD-ROM Compact Disc
- DVD Digital Video Disc
- magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information that can be accessed by a computing
- Embodiments of this disclosure divide the target type of flash memory medium into different types of flash memory regions.
- the storage capacity of a single storage cell in different types of flash memory regions is different, that is, the lifespan and read/write performance of different flash memory regions are different, to adapt to different data types.
- the data is written to the appropriate flash memory area according to the different data types.
- the target type of flash memory can store different types of data, meet the requirements of different data types on the lifespan and read/write performance of the flash memory, and thus solve the technical problem of the poor lifespan and read/write performance of the target type of flash memory.
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)
- Computer Hardware Design (AREA)
- Read Only Memory (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
本公开实施例提供一种数据存储与读取方法、设备、系统、存储介质与程序产品。其中,该闪存存储系统可以包括:存储引擎和持久存储器,持久存储器采用目标型的闪存介质,在目标型的闪存介质上实现有至少两种类型的闪存区,比如,第一类闪存区和第二类闪存区,不同类型的闪存区中单个存储单元的存储能力不同,以用于存储不同数据类型的数据;存储引擎用于响应写请求,获取第一数据,其中,第一数据属于目标数据类型的数据;从至少两种类型的闪存区中,确定与目标数据类型对应的第一目标闪存区;将第一数据存储至第一目标闪存区中。.
Description
数据存储与读取方法、 设备、 系统、 存储介质与程序产品 交叉援引 本公开要求于 2024年 06月 11 日提交中国专利局、 申请号为 202410748806. 2, 发明名称 为 “数据存储与读取方法、 设备、 系统、 存储介质与程序产品 " 的中国专利 申请的优先权 , 其全部内容通过引用结合在本公开中。 技术领域 本公开涉及云存储技 术领域, 尤其涉及一种数据存储与读取方法 、 设备、 系统、 存储介质 与程序产品。 背景技术 闪存 (Flash Memory) 是一种非易失性的存储介质, 根据存储单元的连接方式不 同, 闪存被分为 NOR Flash和 NAND Flash等多种类型。 其中, NAND Flash的存储单 元的体积较 小, 适于高密度集成, 能提供更大存储容量, 因此被广泛应用。 根据数据存储模式的不 同, NAND Flash从第一代的单层单元( Single-Level Cell, 简称为 SLC) 逐渐发展到了第四代的四层单元 (Quad-Level Cell, 简称为 QLC) , 相 比于其它几 代, 在相同硬件基础上, QLC闪存的存储容量有较大提升, 因此可以获得 成本上的优 势。 但是, QLC闪存在使用寿命和 读写性能方面有所退化, 这限制了 QLC闪存的应 用, 例如, 因为不满足云应用对读写次数和速率的要求 , 不适合云存储系统。 因此, 如何克服 QLC闪存在使用寿命和读 写性能方面的不足, 充分发挥 QLC闪存在存储容 量和成本 方面的优势是亟待解决的技术 问题。 发明内容 本公开的多个方面提供一 种数据存储与读取方法、 设备、 系统、 存储介质与程序 产品, 用以发挥闪存介质在存储容量和成 本方面的优势, 同时克服闪存介质在使用寿 命和读写性 能方面的不足。 本公开实施例提供一种 闪存存储系统, 包括: 存储引擎和持久存储器, 持久存储 器采用 目标型的闪存介质, 在目标型的闪存介质上实现有至少两种类型 的闪存区, 不 同类型的 闪存区中单个存储单元 的存储能力不同, 以用于存储不同数据类型的 数据; 存储引擎, 用于响应写请求, 获取第一数据, 其中, 第一数据属于目标数据类型 的数据 ; 从至少两种类型的闪存区中, 确定与目标数据类型对应的第一目标 闪存区; 将第一数据 存储至第一目标闪存区 中。 本公开实施例提供一种 闪存存储系统, 包括: 存储引擎、 内存存储器和持久存储
器, 持久存储器采用目标型的闪存介质, 在目标型的闪存介质上实现有 第一类闪存区 和第二类 闪存区, 第一类闪存区中单个存储单元的存储能力, 大于第二类闪存区中单 个存储单元 的存储能力。 存储引擎, 用于响应写请求, 获取第一数据; 在第一数据属于第一数据类型的数 据的情况下 , 按照第一存储能力, 将第一数据存储至第一类闪存区中; 在第一数据属 于第二数据 类型的数据的情况下, 将第一数据暂存至内存存储器 中, 并在内存存储器 中暂存的 第一数据达到第一数据量阈值 的情况下, 按照第二存储能力, 将内存存储器 中暂存的 第一数据转存至第二类闪存 区中。 本公开实施例提供一种主 机, 应用本公开实施例提供的任一闪存存储系统。 本公开实施例提供 一种云存储系统, 包括: 计算节点和存储节点; 计算节点和 / 或存储节 点采用上述实施例中的主机实现 。 本公开实施例还提供一种 数据存储方法, 应用于主机上的存储引擎, 主机的持久 存储器采 用目标型的闪存介质, 在目标型的闪存介质上实现有至少两种 类型的闪存区, 不同类型的 闪存区中单个存储单元的存储 能力不同, 以用于存储不同数据类型的数据; 方法包括 : 响应写请求, 获取第一数据, 其中, 第一数据属于目标数据类型的数据; 从至少两种 类型的闪存区中, 确定与目标数据类型对应的第一目标闪存 区; 将第一数 据存储至 第一目标闪存区中。 本公开实施例还提供一种 数据读取方法, 应用于主机上的存储引擎, 主机的持久 存储器采 用目标型的闪存介质, 在目标型的闪存介质上实现有至少两种 类型的闪存区, 不同类型的 闪存区中单个存储单元的存储 能力不同, 以用于存储不同数据类型的数据; 方法包括 : 响应读请求, 确定第二数据所在的第二目标闪存区, 其中, 第二目标闪存 区是至少 两种类型的闪存区中的任 一个闪存区; 从第二目标闪存区中读取第二数 据。 本公开实施例还提供一种 存储有计算机程序的计算机 可读存储介质, 当计算机程 序被处理器执 行时, 致使处理器能够实现以上方法中的步骤。 本公开实施例还提供 一种计算机程序产 品, 该计算机程序产品包括计算机程序 / 指令, 当计算机程序/指令被处理器执行时, 致使处理器能够实现上述方法实施例中的 步骤。 在本公开实施例中, 在目标型的闪存介质上划分不 同类型的闪存区, 不同类型的 闪存区 中单个存储单元的存储能力不 同, 意味着不同闪存区的使用寿命和读写性能不 同, 以适配不同的数据类型。 在写入数据时, 根据数据类型的不同, 将数据写入与之 相适配的 闪存区中, 在充分发挥目标型的闪存介质在存储容量和成本方 面的优势的同 时, 能够让目标型的闪存介质存储不同 类型的数据, 满足不同数据类型对闪存介质在 使用寿命和读 写性能方面的要求, 克服目标型的闪存介质在使用寿命和读 写性能方面 存在的不足 。 此外, 在本公开实施例中, 无需为目标型的闪存介质配置高性能的异构介质, 即
可解决 目标型的闪存介质在使用寿命和 读写性能方面存在的不足 , 不受高性能的异构 介质的限制 , 落地实施也更加容易。 附图说明 此处所说明的附图用来提 供对本公开的进一步理解 , 构成本公开的一部分, 本公 开的示意性 实施例及其说明用于解释 本公开, 并不构成对本公开的不当限定。 在附图 中: 图 1为本公开实施例提供的异构存 储系统的软硬架构图; 图 2a-图 2b为本公开实施例提供的一种闪存存储系统的软硬架构图; 图 3a-图 3b为本公开实施例提供的一种主机的结构示意图; 图 4a-图 4b为本公开实施例提供的一种闪存存储系统的软硬架构图; 图 5a-图 5b为本公开实施例提供的一种主机的结构示意图; 图 5c为本公开实施例提供的一种云存储 系统的结构示意图; 图 6为本公开实施例提供的一种数 据存储方法的流程示意 图; 图 7为本公开实施例提供的一种数据读取方法的流程示意图。 具体实施方式 为使本公开的 目的、 技术方案和优点更加清楚, 下面将结合本公开具体实施例及 相应的附 图对本公开技术方案进行清楚 、 完整地描述。 显然, 所描述的实施例仅是本 公开一部分 实施例, 而不是全部的实施例。 基于本公开中的实施例, 本领域普通技术 人员在没有 做出创造性劳动前提下所获 得的所有其他实施例, 都属于本公开保护的范 围。 需要说明的是, 本公开所涉及的用户信息 (包括但不限于用户设备信息、 用户个 人信息等 ) 和数据 (包括但不限于用于分析的数据、 存储的数据、 展示的数据等) , 均为经用 户授权或者经过各方充分授权 的信息和数据, 并且相关数据的收集、 使用和 处理需要遵 守相关国家和地区的相关 法律法规和标准, 并提供有相应的操作入口, 供 用户选择授 权或者拒绝。 另外, 本公开涉及的各种模型 (包括但不限于语言模型或大 模型) 是符合相关法律和标准规定的 。 随着芯片技术的发展, NAND Flash也在不断迭代发展,依次经历了第一代的 SLC 闪存, 第二代的二层单元 (Mulit-Level Cell, 简称为 MLC) 闪存, 第三代的三层单元 (Trinary-Level Cell, 简称为 TLC) 闪存, 以及第四代的 QLC闪存。 SLC闪存的每个 存储单元存 储 1比特数据 (即 Ibit/cell) , 读写速度快, 寿命长, 具有约 10万次的擦 写寿命,价格贵,存储容量小; MLC闪存的每个存储单元存储 2比特数据(即 2bit/cell), 读写速度一般 , 寿命一般, 具有约 3000-10000次的擦写寿命, 价格一般, 存储容量一 般; TLC闪存的每个存储单元 存储 3比特数据(即 3bit/cell) , 读写速度慢, 寿命短, 具有约 500-1000次的擦写寿命, 价格偏低, 存储容量较大; QLC 闪存的每个存储单 元存储 4比特数据 (即 4bit/cell) , 读写速度慢, 寿命更短, 具有约 150次的擦写寿
命, 但是价格更低, 存储容量更大。 在此说明, 对几种闪存的存储容量的比较是在相 同硬件基础之 上进行比较说明的。 基于上述内容可知, 随着数据存储模式的不断发展, 闪存介质在存储容量和成本 方面越来越 有优势, 但是在使用寿命和读写性能方面会有所退化。 其中, 闪存介质的 读写性能可 以采用但不限于每秒能处理 的输入输出请求数量 (Input/Output Per Second , 简称为 IOPS) 进行表征。 无论是在存储容量和成本方面存在不足, 还是在使用寿命 和读写性 能方面存在不足, 会限制闪存介质的应用。 例如, 对于 SLC闪存和 MLC闪 存, 由于存储容量较小且成本较高, 一般用在存储容量需求不大但对读 写性能要求较 高的场景 中, 以降低存储成本; 对于 TLC闪存和 QLC闪存, 由于存储容量较大且成 本较低, 一般用在存储容量需求较大但对读 写性能要求不高的场景 中, 避免对闪存介 质进行频繁擦 写, 延长闪存介质的使用寿命。 对于在存储容量和成本 方面相对具有优势的闪存介质 , 例如 QLC 闪存, 如果能 够克服这 类闪存介质在使用寿命和读 写性能方面的不足, 让这类闪存介质在各种应用 场景中得 以规模化使用, 使得各种应用场景有机会采用性能更高的 闪存介质, 从而在 存储容量和 成本方面获得更多红利。 在此说明, 在本公开各实施例中, 将在存储容量 和成本方 面相对具有优势的闪存介质称 为目标型的闪存介质, 目标型的闪存介质的存 储容量相对较 大且成本相对较低, 目标型的闪存介质在存储容量和成本优势是相对而 言的, 而不是绝对的。 例如, 相对 SLC闪存, 目标型的闪存介质可以是但不限于 TLC 闪存、 QLC闪存等 ; 相对 TLC闪存, 目标型的闪存介质可以是但不限于 QLC, 例如 还可以是未 来可能出现的在存储容量和 成本方面更具优势的闪存介 质, 例如第五代闪 存介质、 第六代闪存介质等。 无论目标型的闪存介 质具体是哪种, 若其在存储容量和成本方面具 有相对优势, 意味着其在使 用寿命和读写性能方面存在 一定不足。 为了弥补目标型的闪存介质在使 用寿命和读 写性能方面的不足, 同时充分发挥目标型的闪存介质在存储容 量和成本方 面的优势 ,本公开首先提出一种解决方案, 即采用异构介质来使能目标型的闪存介质; 其中, 异构介质是不同于闪存介质的另一种存 储介质, 且至少在使用寿面和读写性能 方面优于 目标型的闪存介质。 在该解决方案中, 通过对待存储的数据进行分类, 以及 对高性能的 异构介质和目标型的闪存介质 的配合使用, 在充分发挥目标型的闪存介质 在存储容量和 成本方面的优势的同时 , 借助于高性能的异构介质来弥补目标型的闪存 介质在使 用寿命和读写性能方面的不足 。 图 1为本公开实施例提供的异构存储 系统的软硬架构图, 该异构存储系统与上述 解决方案对应 。如图 1所示,该异构存储系统包括:软件层 101和持久化存储层 102, 软件层 101包括: 数据源 1011和存储引擎 1012 ; 持久化存储层 102包括高性能的异 构介质 1021和目标型的闪存介质 1022 o 其中, 数据源 1011 是指产生需要持久化存储的数据的各种软件对象, 例如可以
是但不限 于: 应用程序、 进程、 线程或操作系统中的各种功能模块等。 在图 1中, 以 数据源 1011是应用程序为例进行图示。 存储引擎 1012是指负责将数据源 1011产生 的数据持久 化存储到持久化存储层 102中的软件程序。 持久化存储层 102中的异构介 质 1021 是不同于闪存介质的其它类型的存储介质, 其使用寿命和读写性能优于目标 型的闪存介 质, 目标型的闪存介质 1022 是指在存储容量和成本方面相对具有优势的 闪存介质 , 例如可以是但不限于: QLC闪存。 其中, 在图 1中, 以目标型的闪存介质 1022是 QLC闪存为例进行图示。 在本公开实施例中, 将数据源 1011 产生的需要持久化存储的数据分为两类, 一 类是输入输 出 (Input Output, 简称为 10)敏感型的数据, 一类是吞吐敏感型的数据; 如果从数据 冷热角度来看, 10敏感型的数据一般属于热数据, 例如包括但不限于各种 日志数据 (Journal Data) ; 吞吐敏感型的数据一般属于温数据或冷数据, 例如需要从 内存向持久 化存储介质中转储的数据 (Dump Data) 。 以 J ournal Data为例, 10敏感 型的数据是 指数据量较小且对延迟较 为敏感的数据, 数据源 1011 (如应用程序) 产生 这类数据 时, 一般需要及时在持久化存储层中进行持久化存储。 可选地, 对于 10敏 感型的数据 可以在应用程序的数据缓存 (Data buffer) 中进行聚合, 在聚合到一定大 小的时候 , 再持久化存储到持久化存储层 102中。 以 D ump Data为例, 吞吐敏感型的 数据是指数 据量较大且对延迟不敏感 的数据, 数据源 1011 (如应用程序) 产生这类数 据时, 需要在持久化存储层 102中进行持久化存储, 但对存储延迟不敏感。 其中, 10 敏感型的数 据可以视为第一数据类型 , 吞吐敏感型的数据可以视为第二数据类型。 但 需要说明 的是, 将数据划分为两类仅为示例, 10敏感型的数据也仅为第一数据类型的 示例, 吞吐敏感型的数据页仅为第二数 据类型的示例, 均不限于此。 对目标型的闪存介质来讲 , 比较友好的 10模式是大块顺序写, 相对不友好的 10 模式是小块 随机写。 在小块随机写情况下, 目标型的闪存介质 (例如 QLC 闪存) 的 低使用寿命 以及低 IOPS问题将会变得非常突出, 因此, 针对 10敏感型的数据 (例如 Journal Data) , 可以通过高性能的异构介质来承载。 高性能的异构介质具有较高的使 用寿命 以及较低的读写 10延迟, 符合 10敏感型的数据的存储需求。 将 10敏感型的 数据直接 写入到高性能的异构介质, 满足了低 10延迟的需求 , 并且高性能的异构介 质具有很 高的使用寿命, 可以承受 10敏感型的数据的频繁擦 写。 对于吞吐敏感型的 数据, 由于对延迟不敏感, 可以在 D ata buffer中完成数据聚合, 然后以大数据块的方 式写入 目标型的闪存介质, 目标型的闪存介质可以满足吞吐敏感型的数据 对吞吐带宽 的需求, 且由于读写频率较低, 对目标型的闪存介质的使用寿命要 求也不高。 在上述方案中, 通过高性能的异构介质来承载 10敏感型的数据, 弥补了目标型 的闪存介 质在使用寿命、 IOPS 延迟方面的不足, 从而使得目标型的闪存介质在写方 向上承载吞 吐敏感型的数据, 可以将目标型的闪存介质的写放大系数控 制在一定范围 之内, 解决了目标型的闪存介质在使 用寿命以及写 IOPS 方面不足的问题。 理论上,
通过这种 异构介质方案, 可以使得目标型的闪存介质在云存储场景下得 到广泛的应用。 但是, 在上述异构介质方案中, 依赖高性能的异构介质。 以 QLC 闪存为例, 在 使用寿命和 读写性能优于 QLC 闪存的高性能的异构介质并不多见, 例如存储分类内 存 (Storage Class Memory, 简称为 SCM) 介质由于 QLC闪存, 但 SCM介质还在发 展演进过程 中, 由此可见, 如果没有高性能的异构介质和 QLC 闪存进行配合, 则上 述异构介质 方案存在难以落地的问题。 另外, 高性能的异构介质还会带来存储成本的 上升, 即使存在能够与 QLC 闪存进行配合实现异构介质方案的高性 能异构介质, 异 构介质方案 自身带来的成本上升与 QLC闪存的成本优势两者的折 中效果并不好估计。 这些问题使 得异构介质方案称为一种理论 型的解决方案, 落地实施的难度较大。 本公开不断进行技术创 新和开拓, 在付出大量创造性劳动之后, 提出了另一种解 决方案, 该解决方案不仅能够克服 目标型的闪存介质在使用寿命和读 写性能方面存在 的不足, 充分发挥目标型的闪存介质在存 储容量和成本方面的优势 , 同时还能去除目 标型的 闪存介质对高性能异构介质的依赖 。在解决方案中,通过软硬协同的设计方法, 在 目标型的闪存介质的基础上构建一种新 型的闪存存储系统, 不仅能够克服目标型的 闪存介质在使 用寿命和读写性能方面存在 的不足, 充分发挥目标型的闪存介质在存储 容量和成 本方面的优势。 采用该解决方案可以拓展目标型的闪存介质 的应用范围, 使 得 目标型的闪存介质可以被广泛且规模 化应用于各种应用场景 中, 例如可以应用于云 存储系统 中, 取代目前价格较高的存储介质, 极大降低云存储系统的存储成本。 图 2a为本公开实施例提供的一种闪存存 储系统的软硬架构图。 如图 2a所示, 该 闪存存储 系统 200包括: 存储引擎 1012、 内存存储器 201和持久存储器 202。 持久化 存储器 202, 可以是任何采用目标型的闪存介质作为存储介质的存储 器, 例如可以是 固态硬盘 (Solid State Drive, 简称为 SSD)、或者 SSD与机械硬盘(Hard Disk Drive, 简称为 HDD) 的组合, 本公开实施例对此不做限定。 简单来说, 持久存储器 202采用 目标型的 闪存介质。 在本实施例中, 目标型的闪存介质是支持某种数据存储模式的闪存介质, 而不是 混合类型 的闪存介质, 例如可以是 QLC类型的闪存介质, 或者是 TLC类型的闪存介 质, 本公开对此不作限制。 关于目标型的闪存介质的更多信息可参见前 述实施例中的 描述, 在此不再赘述。 在本实 施例中, 针对目标型的 闪存介质 , 可以通过分区 命名空 间 ( Zoned Namespace, 简称为 ZNS) 技术, 将目标型的闪存介质划分为两类闪存区 (zone) , 即在 目标型的闪存介质上实现有第一 类闪存区 2021和第二类闪存区 2022, 无论是哪 类闪存 区, 均包含多个存储单元 (cell) , 每个存储单元用于存储一定数量的数据。 进一步, 结合伪单层单元 (Pseudo-Single Level Cell, 简称为 pSLC) 或类似的技 术, 将第一类闪存区和第二类闪存区配置 为不同的数据存储模式, 其中, 对于支持不 同数据存储模 式的闪存区, 单个存储单元的存储能力不同。 在闪存存储介质中, 单个
存储单元 所能存储的数据量可以用 “比特数 (bit) ”进行表示。 单个存储单元的存储 能力是指 单个存储单元的存储容量, 可通过其所能存储的比特数来 定义的, 比特数越 多, 存储能力越大。 因此, 对于支持不同数据存储模式的闪存区, 单个存储单元所能 存储的数据 量不同 (或简称为存储能力不同) 。 在本实施例中, 利用单个存储单元所 能存储的 比特数来表示其存储能力, 单个存储单元所能存储的比特数 越多, 则表示其 存储能力越 大。 单个存储单元所能存储 的比特数越多, 表示该存储单元的存储容量越大, 所能存 储的数据量 也就越多。 其中, 闪存区所能提供的读写性能与单个存储单元中所能存储 的数据量 有关系, 单个存储单元所能存储的数据量越小, 意味着对该存储单元进行读 写操作的速 度越快, 也就意味着整个闪存区的读写性能越高, 但是存储容量较小; 反 之, 若单个存储单元所能存储的数据量越 大, 意味着对该存储单元进行读写操作的速 度越慢, 也就意味着整个闪存区的读 写性能越低, 但是存储容量会越大。 在本实施例 中, 第一类闪存区 2021 中单个存储单元所能存储的第一数据量, 小于第二类闪存区 2022中单个存储 单元所能存储的第二数据量 。 在本实施例中 , ZNS是非易失性存储器快速接口 2.0( Non-Volatile Memory Express 2.0, 简称为 NVMe2.0) 技术规范中的一种功能, 其核心思想是持久化存储器 (例如 SSD) 对外提供 zone访问接口, 用以取代传统持久化存储器 (例如 SSD) 提供的块设 备接 口。 ZNS在 NVMe的基础上引入 “分区 "的概念, 分区又称闪存区。 其中, 持久 化存储器被 划分为不同类型的闪存 区(或称分区), 闪存区包括多个闪存块(Block) , 闪存块是 一种顺序追加写入的存储资 源,不支持进行原地随机更新,一旦被填满之后, 闪存块就进 入了只读模式。 如果想要对该闪存块进行更新写入, 那么需要对闪存块进 行整体数据 擦除操作。 和传统块设备接口的持久化存储器 (例如 SSD) 相比, ZNS简
在一示例中, 目标型的闪存介质为 QLC类型, 则借助 ZNS技术和 pSLC技术, 在 目标型的闪存介质上实现的第一 类闪存区为 pSLC类型, 采用 Ibit的存储方式; 第 二类闪存 区为 QLC 类型, 采用 4bit的存储方式。 这两种不同类型的闪存区具有不同
的特性 ; 第一类闪存区的存储密度是第二类闪存区的四分之一, 但是使用寿命比第二 类闪存 区更长, 并且具有极低的读写 10延迟, 通过牺牲容量, 换取了使用寿命和性 能; 第二类闪存区具有很高的存储密度 , 但使用寿命和性能则不如第二类闪存区。 在另一示例中, 目标型的闪存介质为 TLC类型,则借助 ZNS技术和 pSLC技术, 在 目标型的闪存介质上实现的第一类 闪存区为 pSLC类型, 采用 Ibit的存储方式; 第 二类闪存 区为 TLC 类型, 采用 3bit的存储方式。 在此种情况下, 第一类闪存区的存 储密度是 第二类闪存区的三分之一, 但是使用寿命比第二类闪存 区长, 并且具有极低 的读写 io延迟。 在本实施例中, 在对目标型的闪存介质进行划分时, 划分结果可以得到数据存储 模式与 目标型的闪存介质原本支持的数 据存储模式相同的闪存 区, 例如, 在目标型的 闪存介质 为 QLC类型时, 可以得到 QLC类型的闪存 区; 以及, 划分结果至少还包括 比 目标型的闪存介质的单个存储单元所 能存储的比特数少的闪存 区, 例如, 在目标型 的闪存介质 为 QLC类型时, 至少可以得到 pSLC类型的闪存区。 当然, 此处以 pSLC 类型的 闪存区作为示例, 并不代表比目标型的闪存介质的单个存储单元 所能存储的比 特数少的 闪存区是 pSIC类型, 借助于与 pSLC类似的技术, 也可实现为 pTLC类型的 闪存区等等 , 凡是可以实现为比目标型的闪存介质所支持的单个存储单 元所能存储的
在本实施例中, 在目标型的闪存介质上实现不同类型的 闪存区, 例如上述将 QLC 闪存介质 划分成 pSLC闪存区、 QLC闪存区, 可以是静态划分的, 也可以是动态划分 的; 其中, 静态划分是指持久化存储器出厂前, 就预先划分好了各种闪存区以及每种 闪存区的数 量; 动态划分是指持久存储器出厂后安装到主机上, 由存储引擎根据主机 上的应用 情况和数据类型, 按需动态划分的, 有几种数据类型就划分几种闪存区, 并 根据每种数 据类型的大概数据量, 确定每种闪存区的数量。 每种类型的闪存区可 以包含一个或多个, 通常为多个; 在每种类型的闪存区为多 个的情况 下, 存储引擎根据数据布局策略决定数据如何在多个闪存区 中进行分配和使 用, 其中, 数据布局策略包括但不限于哈希分布、 列表分布和范围分布等, 其中, 哈 希分布通过 计算数据的哈希值并将其 映射到特定的闪存区, 可以实现均匀分布; 列表 分布则根据 数据的特定字段将数据分配 到不同的闪存区, 适用于某些特定场景; 范围 分布则是将 数据按照一定范围划分到不 同的闪存区, 适用于连续数据的处理。 在本实施例中, 为了与不同闪存区进行适配, 可以将数据源产生的需要持久化存 储的数据分 为第一数据类型 (如 10敏感型) 和第二数据类型 (如吞吐敏感型) , 以
及在 目标型的闪存介质上实现不同数据 存储模式的闪存区, 进一步, 可以利用不同类 型的闪存 区去承载与之适配的数据类型 , 不同闪存区的使用寿命和读写性能不同, 以 适配不同的数 据类型。 具体来说, 在写入数据时, 根据数据类型的不同, 将数据写入 与之相适配 的闪存区当中。 其中, 对于 10敏感型的数据, 可以直接写入与之适配的 闪存区 中; 对于吞吐敏感型的数据, 则可以将数据暂存至内存存储器中, 并在数据量 达到一定 阈值时, 再将数据转存至与之适配的闪存区。 下面将详细介绍数据的读写过 程。 在本实施例中, 闪存存储系统用于面向使用该闪存存储 系统的数据源提供数据存 储服务, 涉及数据写入过程和数据读取过程, 数据的写入和读取过程由存储引擎 1012 负责。 一方面, 存储引擎 1012 可响应写请求, 获取第一数据; 在第一数据属于第一 数据类型 的情况下, 按照第一数据量, 将第一数据存储至第一类闪存区 2021 中; 在 第一数据属 于第二数据类型的情况下 , 将第一数据暂存至内存存储器 201 中, 并在内 存存储器 201 中暂存的第一数据达到第一数据量阈值的情况下, 按照第二数据量, 将 内存存储 器 201 中暂存的第一数据转存至第二类闪存区 2022 中。 其中, 第一数据量 小于第二数 据量。 在一可选实施例中, 第一数据在写入时, 同时会生成元数据, 其中, 元数据是描 述第一数据 特征的信息, 至少包括第一数据在闪存存储系统中的存储位 置信息 (例如 数据所在 闪存区的标识信息以及在该 闪存区中的存储路径) , 以在数据读取过程中定 位第一数据 。 在本实施例中, 在目标型的闪存介质上划分不同类型 的闪存区, 不同闪存区中单 个存储单 元所能存储的数据量不 同, 意味着不同闪存区的使用寿命和读写性 能不同, 以适配不 同的数据类型。 在写入数据时, 根据数据类型的不同, 将数据写入与之相适 配的闪存 区中, 在充分发挥目标型的闪存介质在存储容 量和成本方面的优势 的同时, 能够让 目标型闪存介质存储不同类型 的数据, 满足不同数据类型对闪存介质在使用寿 命和读写性 能方面的要求, 克服目标型的闪存介质在使用寿命和读写性 能方面存在的 不足。 此外, 在本公开实施例中, 无需为目标型的闪存介质配置高性能的异构 介质, 即可解决 目标型的闪存介质在使用寿命 和读写性能方面存在的不足 , 不受高性能的异 构介质的限制 , 落地实施也更加容易。 在一可选实施例中, 如图 2b 所示, 目标型的闪存介质上还实现有与第一类闪存 区对应的非 易失性缓存区 2023,包括但不限于非易失性随机存取存储 器(Non-Volatile Random Access Memory , 简称为 NVRAM) , 非易失性缓存区 2023用于对写入第一 类闪存 区中的数据 (例如 10敏感型的数据) 进行聚合, 可以在一定程度上减少对闪 存区的读 写操作。 基于此, 存储引擎 1012在将第一数据存储至第一类闪存区 2021 中 时, 还用于: 在第一数据属于第一数据类型的情况下, 将第一数据暂存至非易失性缓 存区 2023中, 并在非易失性缓存区 2023中暂存的第一数据达到第二数据量阈值的情
况下, 按照第一数据量, 将非易失性缓存区 2023 中暂存的第一数据转存至第一类闪 存区 2021 中。 在本实施例中, 第二数据量阈值大于单次写入的第一数据的数据量, 但并不对 第二数据量阈值的大小进行 限定, 可以根据实际情况灵活设定。 在本实施例中, 第一数据类型是对时延敏感的数据, 例如可以是但不限于: 10敏 感型的数据 , 一般数据量较小, 因此可以在非易失性缓存区中进行聚合, 在聚合到一 定大小的 时候, 再持久化存储到第一闪存区中, 可以在一定程度上减少对第一闪存区 的读写次数 , 提高第一闪存区的使用寿命。 另外, 由于非易失性缓存区是掉电非易失 的, 因此数据写入非易失性缓存区之后 , 存储引擎可以直接向软件对象确认 10操作 已完成, 保证时延要求。 在一些实施例中, 如图 2b所示, 内存存储器 201 中包括: 与第二类闪存区对应 的数据缓冲 区 2011 , 数据可以在数据缓冲区 2011 中进行聚合, 然后再批量地将数据 持久化到 第二类闪存区中。 基于此, 存储引擎 1012 在将第一数据写入第二类闪存区 2022时, 还用于: 在第一数据属于第二数据类型的情况下, 将第一数据暂存至数据缓 冲区 2011中,并在数据缓冲区 2011中暂存的第一数据达到第一数据量阈值的情况下, 按照第二数 据量,将数据缓冲区 2011中暂存的第一数据转存至第二类闪存区 2022中。 在本实施例 中, 第一数据量阈值大于单次写入的第一数据的数据量 , 但并不对第一数 据量阈值 的大小进行限定, 可以根据实际情况灵活设定。 在本实施例中, 第二数据类型可以为吞吐敏感型的数据 , 这类数据的数据量较大 且对延迟不敏 感, 对于吞吐敏感型的数据, 可以在内存存储器中的数据缓冲区进行聚 合, 聚合到与第二类闪存区相适配的 10 大小之后, 然后持久化到第二类闪存区中, 可以显著减 少对闪存区的写入次数, 从而延长其使用寿命。 其中, 第二类闪存区对应 的数据缓 冲区也可以称为合并缓冲 区 (Merge Buffer) , 相比非易失性缓冲区, 数据 缓冲区是在 软件层面实现的, 位于内存存储器中。 由于数据缓冲区是在软件层面上实 现的, 因此是掉电易失的, 所以需在持久化完成之后, 存储引擎可以向软件对象确认 10操作 已完成。 在本实施例中, 正是由于数据缓冲区的存在, 吞吐敏感型的数据得以在该数据缓 冲区中进行 聚合, 因此不再需要非易失性缓存区的支持, 这样无需在目标型的闪存介 质上为第二 类闪存区配置非易失性缓存 区。 考虑到吞吐敏感性数据的数据量较大, 则 将这种类型 的数据进行聚合的数据量也会 比较大, 所以如果在第二类闪存区上实现非 易失性缓存 区, 需要设计大量的非易失性缓存区, 会导致持久化存储器的实现复杂度 上升。 例如, QLC类型的 SSD需要聚合的数据量会比 TLC类型的 SSD大, 所以需要 设计大容量 的 NVRAM 以聚合数据, 导致 SSD的设计复杂度上升, 如果通过软件技 术在内存存 储器中实现数据缓冲区, 使得数据可以在数据缓冲区 中完成聚合, 便可去 除 QLC类型的 SSD内部的 NVRAM, 避免 QLC类型的 SSD需要大量非易失性缓存 区而引入 的大容量保电电容设计, 简化设计与实现, 并提升系统可靠性。
除了向闪存区中写入数据 之外, 有可能从闪存区中读取数据。 在读取数据时, 存 储引擎 1012 用于: 响应数据读请求, 确定需要读取的第二数据所在的目标闪存区; 根据 目标闪存区中单个存储单元 所能存储的数据量, 从目标闪存区中读取第二 数据。 目标闪存 区可能是第一类闪存区, 也可能是第二类闪存区, 具体根据第二数据的数据 类型而定 。如果第二数据属于第一数据类型, 则目标闪存区是第一类闪存区 (如 pSLC 闪存区) , 根据第一类闪存区中单个存储单元所能存储的数据量, 从第一类闪存区中 读取第二数据 ; 如果第二数据属于第二数据类型, 则目标闪存区是第二类闪存区 (如 QLC 闪存区) , 根据第二类闪存区中单个存储单元所能存储的数据量, 从第二类闪存 区中读取 第二数据。 第二数据是需要从闪存区中读取的任意数据, 例如可以是已经写 入闪存 区中的第一数据, 但不限于此。 在本案中, 目标型的闪存介质 (例如 NAND Flash) 包括至少两类闪存区, 闪存 区包括闪存块 (Block) , 闪存块也可以称为存储块, 是闪存介质中进行数据读写的基 本单位, 也是进行数据擦除的最小单位 , 一个存储块可以包括一个或多个存储页。 当 一个存储块还 没有写满时, 即在写过程中, 如果有读请求命中该存储块, 那么该读请 求将会对存储 块导致严重的读干扰问题 。存储块中的数据在后继读取的过程 中, 10延 迟将显著增 长。 存储块在处于写状态过程中被访问, 该存储块中的数据会产生一定程 度的破坏 , 后继读请求会进入很耗时的数据解码过程, 增加了读访问延迟。 随着闪存 介质 (例如 NAND Flash) 制程的进步, 单个存储单元能够存储的数据量增加 (如从 SLC 至 q QLC) , 读干扰问题会变得更加突出。 为了解决读干扰问题, 在内存存储器中增设第二类 闪存区 2022 对应的临时缓存 区 2012, 临时缓存区 2012还可以称为块缓存 (Block Cache) 。 临时缓存区 2012用 于对正在 写入存储块的数据进行缓存 , 读请求如果命中正在写入过程的存储块, 可以 直接从临 时缓存区去进行读取, 从而避免了对第二类闪存区的访问 。 进一步, 如果在 临时缓存 区中未能成功读取数据, 再从第二类闪存区读取数据, 可以保证成功读取数 据。 下面对根据临时缓存 区来解决读干扰问题的实现方 式进行介绍。 在本实施例中, 持久化存储器中的存储块可具 有如下几种状态: 开放 (Open) 、 只读 (Seal) 、 损坏 (Offline) 、 数据搬迁 (Garbage Collection) 、 擦除 (Erase) 和 空闲 (Free) 。 其中, 为了方便管理, 可将上述几种状态简化为空闲、 开放和关闭三 种状态。 处于空闲状态的存储块是指未被 分配任何数据的存储块 ; 处于空闲状态的存 储块在写入之 前需要被打开, 以从空闲状态变为开放状态; 存储块处于开放状态时可 接受写入操作 , 即处于可写状态, 在可写状态下, 也可以接受读取操作, 因此可写状 态也可 以称为可读写状态; 存储块在被写满时则会从开放状态切换至 关闭状态; 存储 块在处于 关闭状态时可接受读取操作 , 不再接受写入操作, 即处于只读状态。 其中, 也可以将存储块的读写状态称为存储块的编程状 态, 存储块的编程状态包
括局部编程 状态 (即可写状态) 和完全编程状态 (即只读状态) 。 在存储块中的部分 存储页被 写入数据的情况下, 可称存储块处于局部编程状态; 在存储块中存储页已写 入数据的 情况下, 可称存储块处于完全编程状态。 对于处于局部编程状态的 存储块, 存在读干扰 问题。 在读取闪存介质中同一个存储块中的某个存储 页时, 读取电压会导 致同一个 存储块中其它存储页的 存储电压发生变化, 并且随着读取次数的不 断增多, 对其它存储 页的影响会不断累积, 最终导致该存储块的数据错误率 上升。 在一可选实施例中, 如图 2b所示, 内存存储器 201 中还包括第二类闪存区 2022 对应的临 时缓存区 2012。 需要说明的是, 内存存储器中数据缓冲区 2011和临时缓存 区 2012 可以是预先配置的也可以动态灵活申请的, 如果是动态申请, 则可以由存储 引擎负责 向主机 OS申请, 申请的大小可以按需确定, 也可以是预先配置好的。 其中, 临时缓存区 2012 用于缓存第二类闪存区中至少部分处于局部编程状态的 存储块 中的数据。 其中, “至少部分处于局部编程状态的存储块" 可以是第二类闪存 区中处于局 部编程状态的存储块中的一 部分或全部, 在实现为一部分处于局部编程状 态的存储块 的情况下, 可以包括用于存储特定数据的处于局部编程状 态的存储块, 或 最早处于局 部编程状态的前 N个存储块 , N是正整数; 在实现为全部处于局部编程状 态的存储块 的情况下, 可以包括识别到的处于局部编程状态的各个存 储块。 随着数据 的不断存储 , 存储块的编程状态也会动态变化, 因此, 在实现为全部处于局部编程状 态的存储块 的情况下, 具体视对存储块的编程状态的识别情况而定 , 如果能够准确识 别出各个处 于局部编程状态的存储块 , 则可以缓存处于局部编程状态的存储块的数据; 如果识别不 是很准确, 则存储识别出的处于局部编程状态的存储块的数 据。 另外, 随 着数据的不 断存储, 存储块的编程状态也会动态变化, 临时缓存区中也可以临时存储 从局部编程 状态进入完全编程状态的存 储块中的数据, 直至该处于完全编程状态的存 储块中的数 据被删除。 临时缓存区 2012中存储的数据是由存储引擎 1012控制写入的。 具体地, 存储引 擎 1012响应于写请求, 在向第二类闪存区中写入第一数据的过程中, 存储引擎 1012 一方面将 第一数据写入数据缓冲区 2011中; 另一方面还会将数据缓冲区 2011 中暂存 的第一数据 存储至临时缓存区 2012中,以从临时缓存区 2012中读取第一数据。这样, 当后续需要 读取第二数据时, 可以查询第二数据的元数据, 以确定读请求中携带的读 地址确定 该读地址所属的 闪存区作为目标 闪存区; 在目标闪存区属于第二类闪存 区 2022的情况下 , 首先在临时缓存区 2012中进行查询, 若在临时缓存区 2012中查询到 第二数据 , 从临时缓存区 2012中读取第二数据; 若未在临时缓存区 2012中查询到第 二数据, 则根据第二数据量, 从目标闪存区 (即第二类闪存区) 中读取第二数据, 可 减轻第二 类闪存区面临的读干扰问题 。 其中, 第一数据代表写入第二类闪存区中的数 据, 第二数据代表需要从第二类闪存 区中读取的数据, 第一数据和第二数据可能是同 一数据, 也可能不是同一数据, 对此不做限定。 其中, 写请求来自闪存存储系统的使
用端, 使用端可以是各种应用程序、 系统或功能模块等。 进一步, 在根据第二数据量, 从目标闪存区 (即第二类闪存区) 中读取第二数据 的情况下 , 存储引擎可以将第二数据的标识和目标闪存区的标识发送给 目标闪存区所 在持久存储 器 202上的存储控制器, 由该存储控制器根据目标闪存区的标识和第二数 据的标识 , 从目标闪存区中读取第二数据, 然后返回给存储引擎; 存储引擎接收存储 控制器返 回的第二数据。 在上述实施例中, 通过在内存存储器中入了临时缓存 区, 缓存第二类闪存区中至 少部分处于 局部编程状态的存储块 中的数据, 从而解决了在第二类闪存区内部处于局 部编程状 态的存储块存在的读干扰问题 。 另外, 在本实施例的闪存存储系统中, 相比 于在持久化 存储器中设置数据缓存 区 (或称缓存空间) , 内存存储器可配置丰富的内 存资源来实现 对处于局部编程状态的存储 块的数据缓存, 由此可解决持久化存储器上 的缓存空 间受限的问题。 尽管闪存存储系统中的 内存存储器可配置丰富的 内存资源, 可解决持久化存储器 上的缓存 空间受限的问题, 但内存资源依然是有限的, 所以有必要对临时缓存区中的 数据进行淘 汰管理, 以提高缓存资源利用率。 为此, 在一可选实施例中, 存储引擎还用于: 根据至少部分处于局部编程状态的 存储块的编程 状态变化信息,对临时缓存区中的数据进 行淘汰处理, 以释放缓存空间。 在根据存储块 的编程变化信息, 对临时缓存区中的数据进行淘汰处理 时, 存储引擎用 于 :针对在临时缓存区中缓存数据的任 一存储块,在该任一存储块从局部编程状态 (可 写状态) 进入完全编程状态 (只读状态) 的情况下 , 将临时缓存区中缓存的该任一 存储块 中的数据删除。 由此可见, 临时缓存区中的数据的淘汰管理依赖于存储块的编 程状态, 需要对存储块的编程状态进行维护和管理。 在从临时缓存区中进行数 据淘汰时, 是对第二类闪存区中处于完全编程状态的存 储块对应的数 据进行淘汰。 但是临时缓存区中可能存储有多个存储块对 应的数据, 因 此在淘汰任 一存储块时, 还需准确确定该任一存储块所对应的数据在临时缓 存区中的 边界。 为了实现针对存储块的编程 状态的维护和管理, 以及准确确定该任一存储块所对 应的数据在 临时缓存区中的边界。 在本实施例中, 存储引擎针对任一存储块, 创建与 之适配的虚拟 缓存块, 其中, 创建虚拟缓存块的时机可以是在开始向该任一存储块存 储数据之前 , 或者, 在首次向任一存储块中存储数据的情况下; 进一步, 在临时缓存 区中缓存任 一存储块中的数据的情况下 , 在虚拟缓存块中记录该任一存储块在临时缓 存区中缓存 的数据信息, 并通过虚拟缓存块的读写状态维护该任一存储块 的编程状态; 其中, 虚拟缓存块的可写状态和只读状态分 别对应该任一存储块的局部编 程状态和完 全编程状 态。 数据信息可以是数据的标识信息、 数据在临时缓存区中的存储位 置等, 用于在进行数 据删除时能够标识需要删 除哪些数据的信息。 至此, 任一存储块与适配
的虚拟缓存块 的编程状态对应, 以及任一存储块与适配的虚拟缓存块所存 储的数据对 应, 由虚拟缓存块即可确定任一存储块的编程 状态和在临时缓存区 中的数据边界。 进 而, 在检测到任一存储块从局部编程状态 变化为完全编程状态时, 只需将临时缓存区 中缓存的 与之适配的虚拟缓存块中的数据 删除即可。 在本公开实施例中, 虚拟缓存块是一种逻辑资源, 被设计为一种数据结构, 可选 地, 数据结构可以是数组、 列表或二叉树等, 用于组织和存储数据。 虚拟缓存块是抽 象的概念 , 不是具体的物理存储单元, 而是对第二类闪存区中的任一存储块, 在临时 缓存区 中进行抽象得到的。 在一些实施例中, 还可以按照存储块的大小将临时缓存区 切分为相 同大小的物理缓存块, 每个存储块中的数据被缓存在一个物理 缓存块中。 另 外, 每个物理缓存块对应虚拟缓存块, 用于记录该物理缓存块中缓存的数 据与存储块 之间的对应 关系。 其中, 在为存储块创建与之适配的虚拟缓存块, 虚拟缓存块与存储块具有对应关 系, 可以是一个虚拟缓存块对应一个存储块 、 一个虚拟缓存块对应多个存储块或者多 个虚拟缓存块 对应一个存储块, 对此不做限制。 相应地, 在将临时缓存区切分为物理 缓存块的情 况下, 物理缓存块与虚拟缓存块的对应关系, 与虚拟缓存块与存储块的对 应关系相 同, 可以是一对一、 一对多或多对一, 对此不做限定。 在本实施例中, 持久化存储器将底层存储介质暴露给 了存储引擎, 由存储引擎对 持久化存储 器的底层存储介质 (即闪存介质) 直接进行读写操作, 所以存储引擎可感 知底层存储介 质中存储块的状态, 存储块的状态对存储引擎来说是透 明的, 存储引擎 对存储块的状 态变化的检测直接有效 。 基于此, 存储引擎在向第二类闪存区中存储数据过程 中, 在每次启用的第二类闪 存区中处于 空闲状态的存储块时, 创建与该存储块适配的虚拟缓存块 , 其中, 每次启 用一个新的 存储块时被启用的存储块会从 空闲状态进入局部可编程状 态。 进而, 在向 每个进入局部 编程状态的存储块中写入数 据时, 可以在临时缓存区中缓存每个进入局 部编程状 态的存储块中的数据。 由于存储引擎可感知底层存储介质中存储块的 状态, 并在每次启 用一个新的存储块时, 在临时缓存区中创建与之适配的虚拟缓 存块, 因此 可以做到存储 块的编程状态与虚拟缓存块 的读写状态 — 对应, 以及存储块的边界与 虚拟缓存块 的边界对齐。 这样在向每个存储块写入数据时, 存储块的编程状态可映射 至虚拟缓存块 的读写状态, 以及可直接映射到与之对应的虚拟缓存块 中, 并且由于对 齐, 还可避免跨存储块的写入。 在感知到底层存储介质 中存储块的状态的基础上, 可在临时缓存区中对相应的虚 拟缓存块进 行标记, 以完成存储块的编程状态到虚拟缓存块的读写状态的映射。因此, 存储引擎在通 过虚拟缓存块的读写状态维护 各个存储块的编程状态 时, 在被启用的存 储块处于局部 编程状态的情况下, 标记与该存储块对应的虚拟缓存块 为可写状态; 随 着第二数据 的不断写入, 该存储块的编程状态会发生变化, 当存储块被写满时, 意味
着存储块从 局部编程状态进入完全编程 状态, 在该情况下, 标记与该存储块对应的虚 拟缓存块 为只读状态。至此, 完成存储块的编程状态到虚拟缓存块的读写状态的映射。 存储块的编程状态映射 到虚拟缓存块的读写状态 。 存储引擎可通过检测虚拟缓存 块的读写状 态来获取与之对应的存储块 的编程状态。 存储引擎监测任一虚拟缓存块的 读写状态 , 在任一虚拟缓存块为只读状态的情况下, 根据任一虚拟缓存块中记录的数 据信息 , 将临时缓存区中缓存的与该任一虚拟缓存块对应存储块 中的数据删除, 实现 对临时缓存 区中数据的淘汰管理。 进一步, 在本公开上述实施例中, 主要描述了如何解决处于局部编程状态的存储 块面临的读 干扰问题。 在实际应用中, 对于处于完全编程状态下的存储块, 也存在读 干扰问题 。 为解决该问题, 在本公开实施例中, 存储引擎还用于: 对存储块的读次数 进行统计 , 在读次数达到设定次数阈值时, 将处于完全编程状态的存储块中的数据搬 移到持久化 存储器中处于空闲状态的 另一存储块中。 在一可选实施例 中, 可维护一个空闲块列表, 记录当前可用的空闲存储块信息, 该信息 包括存储块的起始地址和长度 以及该存储块的擦写次数。 当需要进行写入操作 时, 从该列表中选择一个空闲存储块 即可。 为延长闪存的使用寿命, 需确保存储块的 擦写次数尽 可能均匀 (即磨损均衡) , 因此在选择空闲存储块时, 可优先选择擦写次 数较少的存储 块, 以避免某些存储块被过度消耗。 在另一可选实施例中, 还可以根据 第二数据 的访问频率,将第二数据分为冷数据和热数据 ,基于冷数据和热数据的特性, 选择合适的 空闲存储块进行存储。 其中, 热数据选择擦写次数较少的存储块, 冷数据 选择擦写次数 较多的存储块, 以优化存储性能和延长持久化存储 器的使用寿命。 可选地, 当第二类闪存区中的空闲存储块不足时, 还可触发垃圾回收操作, 对已 失效数据 占据的存储空间进行回收, 并通过对有效数据进行搬移, 实现存储空间的回 收再利 用, 使一些存储块恢复空闲状态。 其中, 本公开实施例对垃圾回收的策略不作 限定, 例如标记 -清除 ( Mark-Sweep ) 算法、 分代收集 ( Generational Collection ) 算法 等等。 在上述实施例中, 在目标闪存区属于第二类闪存 区时, 在内存存储器中引入了临 时缓存 区, 缓存第二类闪存区中至少部分处于局部编程状态的存储块 中的数据, 读请 求如果命 中正在写入过程的存储块, 可以直接从临时缓存区去进行读 取, 从而避免了 对第二 类闪存区的访问, 解决了在第二类闪存区内部处于局部编程状 态的存储块存在 的读干扰 问题。 下面对在目标闪存区属于第一类闪存区的情况下的读取 过程进行介绍 O 在一可选实施例中, 在目标闪存区属于第一类闪存 区 2021 的情况下, 可以先从 非易失性缓 存区 2023中查询第二数据, 在非易失性缓存区 2023中查询到第二数据的 情况下, 从非易失性缓存区 2023中读取第二数据; 在非易失性缓存区 2023中未查询 到第二数据 的情况下, 则根据第二数据量, 从目标闪存区中读取第二数据。 在另一可 选实施例 中, 在目标闪存区属于第一类闪存区 2021 的情况下, 也可直接根据第一数
据量, 从目标闪存区 (即第一类闪存区 2021) 中读取第二数据。 在此说明, 在本公开实施例中, 并不限定图 2a 所示闪存存储系统在实际应用时 的部署实施 方式。 在一可选实施例中, 图 2a 所示闪存存储系统可以应用于主机中, 为主机持久化 存储功能。 本案中的主机可以是各种包含各种硬件资源和软 件资源的物 理机, 可以是传统的服务器、 终端设备等, 也可以是云服务器、 云主机等。 基于此, 如图 3a所示, 为本公开实施例提供的一种主机的结构示意图, 该主机 300包括: 软 件资源和硬件 资源; 软件资源包括: 存储引擎 1012, 硬件资源包括: 内存存储器 201 和持久存储 器 202, 持久存储器 202采用目标型的闪存介质, 在目标型的闪存介质上 实现有第一 类闪存区 2021和第二类闪存区 2022,第一类闪存区 2021中单个存储单元 所能存储的 第一数据量, 小于第二类闪存区 2022 中单个存储单元所能存储的第二数 据量; 存储引擎, 用于响应写请求, 获取第一数据; 在第一数据属于第一数据类型的情 况下, 按照第一数据量, 将第一数据存储至第一类闪存区中; 在第一数据属于第二数 据类型的情 况下, 将第一数据暂存至内存存储器中, 并在内存存储器中暂存的第一数 据达到第一数 据量阈值的情况下, 按照第二数据量, 将内存存储器中暂存的第一数据 转存至第二 类闪存区中。 在一可选实施例 中, 如图 3b所示, 目标型的闪存介质上还实现有与第一类闪存 区 2021对应的非易失性缓存区 2023 ; 存储引擎还用于: 在第一数据属于第一数据类 型的情况下 , 将第一数据暂存至非易失性缓存区中, 并在非易失性缓存区中暂存的第 一数据达到 第二数据量阈值的情况下 , 按照第一数据量, 将非易失性缓存区中暂存的 第一数据转 存至第一类闪存区中。 在一可选实施例中,如图 3b所示, 内存存储器 201中包括:与第二类闪存区 2022 对应的数据缓 冲区 2011; 存储引擎还用于: 在第一数据属于第二数据类型的情况下, 将第一数据 暂存至数据缓冲区中, 并在数据缓冲区中暂存的第一数据达 到第一数据量 阈值的情况 下, 按照第二数据量, 将数据缓冲区中暂存的第一数据转存至第二类闪存 区中。 在一可选实施例中, 如图 3b所示, 内存存储器 201 中还包括第二类闪存区 2022 对应的临 时缓存区 2012; 存储引擎还用于: 将数据缓冲区中暂存的第一数据存储至临 时缓存 区中, 以从临时缓存区中读取第一数据。 在一可选实施例中, 存储引擎还用于: 响应数据读请求, 确定需要读取的第二数 据所在的 目标闪存区; 根据目标闪存区中单个存储单元所能存储的数据 量, 从目标闪 存区中读取 所述第二数据。 在一可选实施例中, 存储引擎还用于: 在目标闪存区属于第二类闪存区, 且在临 时缓存 区中查询到第二数据的情况下 , 从临时缓存区中读取第二数据; 在临时缓存区 中未查询 到第二数据的情况下, 则根据第二数据量, 从目标闪存区中读取第二数据。
在上述闪存存 储系统和主机实施例中,在目标型的闪存介 质上实现有两种类型的 闪存 区为例进行说明, 但随着闪存技术的发展, 以及类似 pSLC技术的发展, 可能出 现 pMLC技术、 pTLC技术等, 则在目标型的闪存介质上可以实现 有两种或两种以上 (即至少两种) 类型的闪存区。 例如, 在目标型的闪存介质为 QLC 类型时, 至少实 现 QLC 类型的闪存区; 以及, 至少实现比目标型的闪存介质的单个存储单元所能存 储的比特数 少的闪存区, 例如, 在目标型的闪存介质为 QLC 类型时, 至少可以得到 pSLC 类型的闪存区。 下面进行举例说明: 在目标型的 闪存介质是 QLC闪存介 质时, 在 QLC闪存介质上可以实现 pSLC闪 存区和 QLC闪存区, 或者在 QLC闪存介质上可 以实现 pSLC闪存区、 pMLC闪存 区 和 QLC闪存区;或者在 QLC闪存介质上可 以实现 pSLC闪存区、 pMLC闪存区、 pTLC 闪存 区和 QLC闪存区; 或者在 QLC闪存介质上 可以实现 pMLC 闪存区和 QLC 闪存 区; 或者在 QLC闪存介质上可 以实现 pTLC闪存区和 QLC 闪存区, 等等。 在目标型的 闪存介质是 TLC闪存介质 时, 在 TLC闪存介质上可以实现 pSLC闪 存区和 TLC闪存区, 或者在 TLC闪存介质上可 以实现 pSLC闪存区、 pMLC闪存 区 和 TLC闪存区;或者在 TLC闪存介质上可以实现 p MLC闪存区和 TLC闪存区,等等。 基于上述, 如图 4a所示, 本实施例还提供一种闪存存储系统 400, 包括: 存储引 擎 401和持久存储器 402, 持久存储器 402采用目标型的闪存介质, 在目标型的闪存 介质上实现 有至少两种类型的闪存 区, 不同类型的闪存区中单个存储单元所能存储的 数据量不 同, 以用于存储不同数据类型的数据。 在本实施例中, 与闪存区的类型数量 相适配, 可以将数据源产生的需要持久化 存储的数据划分为至少两种 类型。 其中, 在 图 4a中, 示出了第一数据类型的数据至第 N数据类型的数据等 N种类型的数 据, 相 应地, 也示出了与 N种类型的数据 对应的 N种闪存 区, 即第一类闪存区至第 N类闪 存区, 其中, 每种数据类型对应一种闪存区, N是大于等于 2的自然数。 关于各类闪 存区和数据 类型的详细说明可参见前 述实施例, 在此不再赘述。 存储引擎 401 , 用于响应写请求, 获取第一数据, 其中, 第一数据属于目标数据 类型的数据 ; 从至少两种类型的闪存区中, 确定与目标数据类型对应的第一目标闪存 区; 根据第一目标闪存区中单个存储单 元所能存储的数据量, 将第一数据存储至第一 目标闪存 区中。 其中, 第一目标闪存区可能是任何一种类型的闪存区, 具体根据第一 数据的数据 类型以及数据类型与闪存 区之间的对应关系而定。 例如, 如果第一数据是 第一数据 类型,则第一目标闪存区属于第一类闪存 区,如果第一数据是第二数据类型, 则第一 目标闪存区属于第二类闪存 区, 以此类推。 在一可选实施例 中, 可以根据闪存区中单个存储单元所能存储 的数据量的大小, 将 N类闪存区划分为目标类型的闪存 区和非目标类型的闪存 区。 目标类型的闪存区是 指单个存储 单元所能存储的数据量 大于设定数据量阈值的闪存 区; 非目标类型的闪存 区是指单个 存储单元所能存储的数据量 小于或等于设定数据量 阈值的闪存区。 关于设
定数据量 阈值不做限定, 以比特数为例, 该设定数据量阈值可以是 1或 2或 3等。 举 例说明 : 在设定数据量阈值取值为 1的情况下, 表示单个存储单元所能存储的数据量 为 1的闪存区为非目标类型的闪存区; 其它闪存区均为目标类型的闪存区 ; 在设定数 据量阈值取值 为 2的情况下, 表示单个存储单元所能存储的数据量为 1和为 2的闪存 区为非 目标类型的闪存区; 其它闪存区均为目标类型的闪存区。 在图 4a 中, 以第一 类闪存 区作为非目标类型的闪存区的示例 , 其它类闪存区为目标类型的闪存区的示例, 并不代表非 目标类型的闪存区或 目标类型的闪存区仅局限于此。 如图 4b所示, 闪存存储系统 400还包括: 内存存储器 403 , 内存存储器 403 中 包括与 目标类型的闪存区对应的数据缓 冲区 403 l o 目标类型的闪存区可以是一种或多 种, 每种目标类型的闪存区对应一个数据 缓冲区。 其中, 对于需要写入目标类型的闪 存区中的数据 , 可以在数据缓冲区 4031 中进行聚合, 然后再批量地将数据持久化到 对应类型的 闪存区中。 基于此, 存储引擎还用于: 在第一目标闪存区属于目标类型的 闪存区的情 况下, 将第一数据暂存至对应的数据缓冲区中, 并在数据缓冲区中暂存的 第一数据达 到第一数据量阈值的情况下 , 根据第一目标闪存区中单个存储单元所能存 储的数据量 , 将数据缓冲区中暂存的第一数据转存至第一目标闪存 区中; 在第一目标 闪存区属于非 目标类型的闪存区的情况 下, 直接将第一数据存储至第一目标闪存区中。 在一可选实施例 中, 如图 4b所示, 目标型的闪存介质上还实现有与非目标类型 的闪存 区对应的非易失性缓存区 4021 (包括但不限于 NVRAM) 。 非目标类型的闪存 区可以是一 种或多种, 每种非目标类型的闪存区对应一个非易失性缓 存区。 非易失性 缓存区 4021用于对写入非目标类型的闪存区中的数据 (例如 10敏感型的数据) 进行 聚合, 可以在一定程度上减少对非 目标类型的闪存区的读写操作。 基于此, 存储引擎 还用于 : 在第一目标闪存区属于非目标类型的闪存区的情况下, 将第一数据暂存至对 应的非易失性 缓存区中, 并在非易失性缓存区中暂存的第一数据达到 第二数据量阈值 的情况下 , 根据第一目标闪存区中单个存储单元所能存储的数据量, 将非易失性缓存 区中暂存的 第一数据转存至第一 目标闪存区中。 在一可选实施例 中, 如图 4b所示, 内存存储器 403 中还包括与目标类型的闪存 区对应的 临时缓存区 4032o 目标类型的闪存区可以是一种或多种, 每种目标类型的闪 存区对应一个 临时缓存区。 在数据缓冲区中暂存的第一数据达到第一数据 量阈值的情 况下, 存储引擎 401除了将数据缓冲区中暂存的第一数据转存 至第一目标闪存区中之 外, 还可以将数据缓冲区 4031 中暂存的第一数据存储至临时缓存区 4032中, 以在读 取数据时 能够从临时缓存区 4032中读取第一数据。 在一可选实施例 中, 存储引擎还用于: 响应读请求, 确定第二数据所在的第二目 标闪存 区; 根据第二目标闪存区中单个存储单元所能存储的数据量, 从第二目标闪存 区中读取 第二数据。 第二目标闪存区可以是任意一种类型的闪存 区, 具体根据第二数 据的数据 类型以及数据类型与闪存 区之间的对应关系而定。 例如, 如果第二数据是第
一数据 类型, 则第二目标闪存区属于第一类闪存区, 如果第二数据是第二数据 类型, 则第二 目标闪存区属于第二类闪存 区, 以此类推。 在一可选实施例中, 存储引擎还用于: 在第二目标闪存区属于目标类型的闪存区 的情况下 , 可以先查询第二目标闪存区对应的临时缓存区; 在第二目标闪存区对应的 临时缓存 区中查询到第二数据的情况下 , 从第二目标闪存区对应的临时缓存区中读取 第二数据 ; 在第二目标闪存区对应的临时缓存区中未查询到第二数据 的情况下, 则根 据第二 目标闪存区中单个存储单元所 能存储的数据量, 从第二目标闪存区中读取第二 数据。 相应地, 在本公开实施例中, 并不限定图 4a所示闪存存储系统在实际应 用时的 部署实施 方式。 在一可选实施例中, 图 4a 所示闪存存储系统可以应用于主机中, 为 主机持久化 存储功能。 基于此, 如图 5a 所示, 为本公开实施例提供的一种主机 500 的结构示意 图。该主机 500包括:软件资源和硬件资源,软件资源包括:存储引擎 401 , 硬件资源 包括: 持久存储器 402, 持久存储器 402采用目标型的闪存介质, 在目标型 的闪存介质 上实现有至少两种类型的 闪存区, 不同类型的闪存区中单个存储单元所能 存储的数据量 不同, 以用于存储不同数据类型的数据; 存储引擎, 用于响应写请求, 获取第一数据, 其中, 第一数据属于目标数据类型 的数据 ; 从至少两种类型的闪存区中, 确定与目标数据类型对应的第一目标 闪存区; 根据第一 目标闪存区中单个存储单元所 能存储的数据量, 将第一数据存储至第一目标 闪存区 中。 在一可选实施例 中, 如图 5b所示, 硬件资源还包括: 内存存储器 403 , 内存存 储器 403中包括与目标类型的闪存区对应的数据缓冲 区 4031 , 目标类型的闪存区是指 单个存储单 元所能存储的数据量大于设 定数据量阈值的闪存区 ; 存储引擎还用于 : 在第一目标闪存区属于目标类型的闪存区的情况下, 将第一数 据暂存至对应 的数据缓冲区中, 并在数据缓冲区中暂存的第一数据达到 第一数据量阈 值的情况下 , 根据第一目标闪存区中单个存储单元所能存储的数据量 , 将数据缓冲区 中暂存的 第一数据转存至第一 目标闪存区中。 在一可选实施例 中, 如图 5b所示, 目标型的闪存介质上还实现有与非目标类型 的闪存 区对应的非易失性缓存区 4021 ,非目标类型的闪存区是指单个存储单元所能存 储的数据量 小于或等于设定数据量阈值 的闪存区; 存储引擎还用于 : 在第一目标闪存区属于非目标类型的闪存区的情况下, 将第一 数据暂存至对 应的非易失性缓存区 中, 并在非易失性缓存区中暂存的第一数据达到第 二数据量 阈值的情况下, 根据第一目标闪存区中单个存储单元所能存储 的数据量, 将 非易失性缓 存区中暂存的第一数据转存 至第一目标闪存区中。 在一可选实施例 中, 如图 5b所示, 内存存储器中还包括与目标类型的闪存区对 应的临时缓 存区 4032 ; 存储引擎 401还用于: 将数据缓冲区 4031 中暂存的第一数据
存储至临 时缓存区 4032中, 以从临时缓存区 4032中读取第一数据。 在一可选实施例 中, 存储引擎还用于: 响应读请求, 确定第二数据所在的第二目 标闪存 区; 根据第二目标闪存区中单个存储单元所能存储的数据量, 从第二目标闪存 区中读取 第二数据。 在一可选实施例 中,存储引擎还用于:在第二目标闪存区属于目标类型的闪存 区, 且在第二 目标闪存区对应的临时缓存 区中查询到第二数据的情况下 , 从第二目标闪存 区对应的 临时缓存区中读取第二数据 ; 在第二目标闪存区对应的临时缓存区中未查询 到第二数据 的情况下, 则根据第二目标闪存区中单个存储单元所能存储 的数据量, 从 第二 目标闪存区中读取第二数据。 本公开实施例还提供一种 云存储系统, 如图 5c所示, 该云存储系统 100包括: 计算层和存储 层, 计算层中包括至少一个计算节点 10a, 存储层中包括至少一个存储 节点 10b。 其中, 计算节点 10a包括内存和持久化存储介质, 存储节点 10b也包括内 存和持久化 存储介质。 可选地, 计算节点 10a和 /或存储节点 10b的内部实现结构可以 采用图 5a或图 5b所示的主机, 或者采用图 3a或图 3b所示的主机, 对此不做限定。 在图 5c中, 以计算节点 10a和存储节点 10b的内部实现结构采用图 5b所示的主机结 构为例进行 图示。 另外, 对计算节点 10a和 /或存储节点 10b的内部实现结构的详细描 述可参见前 述实施例, 对此不再赘述。 除上述闪存存储 系统和主机实施例之外, 如图 6所示, 本公开实施例还提供一种 数据存储 方法, 应用于主机或闪存存储系统中的存储引擎, 主机或闪存存储系统中的 持久存储器采 用目标型的闪存介质, 在目标型的闪存介质上实现有至少 两种类型的闪 存区, 不同类型的闪存区中单个存储单元 的存储能力不同, 以用于存储不同数据类型 的数据 ; 该方法包括:
S601: 响应写请求, 获取第一数据, 其中, 第一数据属于目标数据类型的数据; S602:从至少两种类型的闪存区中,确定与目标数据类型对应的第一 目标闪存区; S603: 将第一数据存储至第一目标闪存区中。 在一可选实施例 中,主机的内存存储器中包括与 目标类型的闪存区对应的数据缓 冲区, 目标类型的闪存区是指单个存储单元的存储能 力大于设定能力阈值的 闪存区; 其中, 将第一数据存储至第一目标闪存 区中, 包括: 在第一目标闪存区属于目标类型 的闪存 区的情况下, 将第一数据暂存至对应的数据缓冲区中; 在数据缓冲区中暂存的 第一数据达 到第一数据量阈值的情况下 , 根据第一目标闪存区中单个存储单元的存储 能力, 将数据缓冲区中暂存的第一数据转 存至第一目标闪存区 中。 在一可选实施例中, 内存存储器中还包括与目标类型的 闪存区对应的临时缓存区; 所述方法还 包括: 将数据缓冲区中暂存的第一数据存储至临时缓存 区中, 以从临时缓 存区中读取 第一数据。 在一可选实施例 中, 目标型的闪存介质上还实现有与非目标类型的闪存区对应的
非易失性缓 存区, 非目标类型的闪存区是指单个存储单元的存储能力 小于或等于设定 能力阈值的 闪存区; 其中, 将第一数据存储至第一目标闪存区中, 包括: 在第一目标 闪存区属于非 目标类型的闪存区的情况 下, 将第一数据暂存至对应的非易失性缓存区 中; 在非易失性缓存区中暂存的第一数据 达到第二数据量阈值的情况 下, 将非易失性 缓存区 中暂存的第一数据转存至第一 目标闪存区中。 相应地, 如图 7所示, 本公开实施例还提供一种数据读取方法, 应用于主机或闪 存存储 系统中的存储引擎, 主机或闪存存储系统中的持久存储器采用 目标型的闪存介 质, 在目标型的闪存介质上实现有至少两种 类型的闪存区, 不同类型的闪存区中单个 存储单元的 存储能力不同, 以用于存储不同数据类型的数据; 该方法包括:
S701 : 响应读请求, 确定第二数据所在的第二目标闪存区, 其中, 第二目标闪存 区是至少 两种类型的闪存区中的任一个 闪存区;
S702 : 从第二目标闪存区中读取第二数据。 在一可选实施例 中,主机的内存存储器中包括与 目标类型的闪存区对应的临时缓 存区, 目标类型的闪存区是指单个存储单元的存储能 力大于设定能力阈值的 闪存区; 其中, 根据第二目标闪存区中单个存储单 元的存储能力, 从第二目标闪存区中读取第 二数据, 包括: 在第二目标闪存区属于目标类型的闪存区, 且在第二目标闪存区对应 的临时缓存 区中查询到第二数据的情况 下, 从第二目标闪存区对应的临时缓存区中读 取第二数据 ; 在第二目标闪存区对应的临时缓存区中未查询到第二数据 的情况下, 则 根据第二 目标闪存区中单个存储单元的 存储能力, 从第二目标闪存区中读取第二数据。 关于本实施例方 法中各步骤的详 细实施方式以及有益 效果已经在前述 实施例中 进行了详细描 述, 此处将不做详细阐述说明。 需要说明的是 , 上述实施例所提供方法的各步骤的执行主体均 可以是同一设备, 或者, 该方法也由不同设备作为执行主体 。 比如, 步骤 601至步骤 603的执行主体可 以为设备 A; 又比如, 步骤 601和 602的执行主体可以为设备 A, 步骤 603的执行主 体可以为设备 B; 等等。 另外, 在上述实施例及附图中的描述的一些流程 中, 包含了按照特定顺序出现的 多个操作 , 但是应该清楚了解, 这些操作可以不按照其在本文中出现的顺序来执行或 并行执行 , 操作的序号如 601、 602 等, 仅仅是用于区分开各个不同的操作, 序号本 身不代表任何 的执行顺序。 另外, 这些流程可以包括更多或更少的操作, 并且这些操 作可以按顺 序执行或并行执行。 需要说明的是, 本文中的 “第一”、 “第二 ”等描述, 是 用于区分不 同的消息、 设备、 模块等, 不代表先后顺序, 也不限定 “第一 ”和 “第二 ”是 不同的类型 。 相应地, 本公开实施例还提供一种存储有计算机程 序的计算机可读存储介质 , 计 算机程序被 处理器执行时, 致使处理器能够实现上述方法实施例 中的各步骤。 相应地, 本公开实施例还提供一种计算机程序产 品, 该计算机程序产品包括计算
机程序/指令, 当计算机程序/指令被处理器执行时, 致使处理器能够实现上述 方法实 施例中的 步骤。 上述存储器可以 由任何类型的易失性或非 易失性存储设备或者 它们的组合实现, 如静态随机 存取存储器 (Static Random- Access Memory, 简称为 SRAM) , 电可擦除 可编程只读 存储器 (Electrically Erasable Programmable Read Only Memory , 简称为 EEPROM ) , 可擦除可编程只读存储器 ( Erasable Programmable Read Only Memory , 简称为 EPROM) , 可编程只读存储器 (Programmable Read-Only Memory, 简称为 PROM ) , 只读存储器(Read-Only Memory, 简称为 ROM) , 磁存储器, 快闪存储器, 磁盘或光盘 。 上述通信组件被配置为便 于通信组件所在设备和其他 设备之间有线或无线方式 的通信。 通信组件所在设备可以接入基 于通信标准的无线网络, 如 WiFi, 2G、 3G、 4G/LTE, 5G等移动通信网络, 或它们的组合。 在一个示例性实施例中, 通信组件经 由广播信道接 收来自外部广播管理 系统的广播信号或广播相关信 息。 在一个示例性实 施例中, 通信组件还包括近场通信 (Near Field Communication, 简称为 NFC) 模块, 以促进短程 通信。例如,在 NFC模块可基于射频识别(Radio Frequency Identification, 简称为 RFID) 技术, 红外数据协会 (Infrared Data Association, 简称为 IrDA) 技术, 超宽带 (Ultra Wide Band, 简称为 U WB) 技术, 蓝牙 (BlueTooth, 简称为 BT) 技术 和其他技术 来实现。 上述显示器包括屏幕, 其屏幕可以包括液晶显示器 (Liquid Crystal Display, 简称 为 LCD) 和触摸面板 (TouchPanel, 简称为 TP) 。 如果屏幕包括触摸面板, 屏幕可 以被实现 为触摸屏, 以接收来自用户的输入信号。 触摸面板包括一个或多个触摸传感 器以感测触摸 、 滑动和触摸面板上的手势。 触摸传感器可以不仅感测触摸或滑动动作 的边界, 而且还检测与触摸或滑动操作相关的持续时间和压力。 上述电源组件, 为电源组件所在设备的各种组件提供 电力。 电源组件可以包括电 源管理 系统, 一个或多个电源, 及其他与为电源组件所在设备生成、 管理和分配电力 相关联的 组件。 上述音频组件, 可被配置为输出和 /或输入音频信号。 例如, 音频组件包括一个麦 克风 (Microphone, 简称为 MIC) , 当音频组件所在设备处于操作模式, 如呼叫模式、 记录模式和 语音识别模式时, 麦克风被配置为接收外部音频信号。 所接收的音频信号 可以被进一 步存储在存储器或经由通信 组件发送。 在一些实施例中, 音频组件还包括 一个扬声 器, 用于输出音频信号。 本领域内的技术人 员应明白, 本公开的实施例可提供为方法、 系统、 或计算机程 序产品。 因此, 本公开可采用硬件实施例、 软件实施例、 或结合软件和硬件方面的实 施例的形 式。 而且, 本公开可采用在一个或多个其中包含有计算机可用程序代码的计 算机可读存 储介质 (包括但不限于磁盘存储器、 只读光盘 (Compact Disc Read-Only
Memory, 简称为 CD-ROM) 、 光学存储器等) 上实施的计算机程序产品的形式。 本公开是参照根据本公 开实施例的方法、 设备 (系统) 、 和计算机程序产品的流 程图和 /或方框图来描述的。 应理解可由计算机程序指令实现流程图和 /或方框图中 的每一流程 和/或 方框、 以及流程图和 /或方框图中的流程和/或方框 的结合。 可提 供这些计算 机程序指令到通用计算机 、 专用计算机、 嵌入式处理机或其他可编程数据 处理设备 的处理器以产生一个机器, 使得通过计算机或其他可编程数据 处理设备的处 理器执行 的指令产生用于实现在流程 图一个流程或多个流程和 /或方框图一个方框 或多个方框 中指定的功能的装置。 这些计算机程序指令也 可存储在能引导计算机或其他 可编程数据处理设备以特 定方式工作 的计算机可读存储器中, 使得存储在该计算机可读存储器 中的指令产生包 括指令装置 的制造品, 该指令装置实现在流程图一个流程或多个流程和 /或方框图一 个方框或 多个方框中指定的功能。 这些计算机程序指令也 可装载到计算机或其他可编程 数据处理设备上, 使得在计 算机或其他 可编程设备上执行一系列操作 步骤以产生计算机实现的 处理, 从而在计算 机或其他 可编程设备上执行的指令提供 用于实现在流程图一个流程 或多个流程和/ 或方框图一个 方框或多个方框中指定的功 能的步骤。 在一个典型的配置 中,计算设备包括一个或多个处理器( Central Processing Unit, 简称为 CPU) 、 输入 /输出接口、 网络接口和内存。 内存可能包括计算机可读 介质中的非永久性存储器 , 随机存取存储器 (Random Access Memory, 简称为 RAM) 和 /或非易失性内存等形式, 如只读存储器 (ROM) 或闪存 (flash RAM) 。 内存是计算机可读介质的示例。 计算机可读介质包括永 久性和非永久性、 可移动和非可移动媒体可以由任何方法 或技术来 实现信息存储。 信息可以是计算机可读指令、 数据结构、 程序的模块或其他 数据。计算机的存储介质的例子 包括,但不限于相变内存( Phase-change Random Access Memory, 简称为 PRAM) 、 静态随机存取存储器 (SRAM) 、 动态随机存取存储器 (Dynamic Random Access Memory, 简称为 D RAM) 、 其他类型的随机存取存储器 (RAM) 、 只读存储器 (ROM) 、 电可擦除可编程只读存储器 (EEPROM) 、 快闪 记忆体或其 他内存技术、 只读光盘只读存储器 (CD-ROM) 、数字多功能光盘(Digital Video Disc, 简称为 DVD) 或其他光学存储、 磁盒式磁带, 磁带磁盘存储或其他磁性 存储设备或任 何其他非传输介质, 可用于存储可以被计算设备访 问的信息。 按照本文 中的界定 , 计算机可读介质不包括暂存电脑可读媒体 (transitory media) , 如调制的 数据信号和 载波。 还需要说明的是, 术语“包括”、 “包含”或者其任何其他变体意在涵盖非排他性的 包含, 从而使得包括一系列要素的过程 、 方法、 商品或者设备不仅包括那些要素, 而 且还包括 没有明确列出的其他要素, 或者是还包括为这种过程、 方法、 商品或者设备
所固有的要 素。 在没有更多限制的情况下, 由语句 “包括一个 ..... ”限定的要素, 并不 排除在包括要 素的过程、 方法、 商品或者设备中还存在另外的相同要素。 以上仅为本公开的实施例 而已,并不用于限制本公开。对于本领域技术人员来说 , 本公开可 以有各种更改和变化。 凡在本公开的精神和原理之内所作的任 何修改、 等同 替换、 改进等, 均应包含在本公开的权利要求范围之内。 工业实用性 本公开实施例将 目标型的闪存介质划分为不同类型的 闪存区, 不同类型的闪存区 中单个存储 单元的存储能力不同, 也即不同闪存区的使用寿命和读写性 能不同, 以适 配不同的数据 类型。 在写入数据时, 根据数据类型的不同, 将数据写入相适配的闪存 区中, 在充分发挥目标型的闪存介质在存储 容量和成本方面的优势的 同时, 使目标型 的闪存介质 存储不同类型的数据, 满足不同数据类型对闪存介质在使 用寿命和读写性 能方面的要 求, 从而解决了目标型的闪存介质在使用寿命和读写性能方 面较差的技术 问题。
Claims
1、 一种闪存存储系统, 包括: 存储引擎和持久存储器, 所述持久存储器采用目 标型的闪存介 质, 在所述目标型的闪存介质上实现有至少两种类型的 闪存区, 不同类 型的闪存 区中单个存储单元的存储能力不 同, 以用于存储不同数据类型的数据; 所述存储引擎, 用于响应写请求, 获取第一数据, 其中, 所述第一数据属于目标 数据类型的数 据; 从所述至少两种类型的闪存区中, 确定与所述目标数据类型对应的 第一 目标闪存区; 将所述第一数据存储至所述第一目标闪存区中。
2 、 根据权利要求 1 所述的系统, 还包括: 内存存储器, 所述内存存储器中包括 与目标类型 的闪存区对应的数据缓冲 区, 所述目标类型的闪存区是指单个所述存储单 元的存储能 力大于设定能力阈值的闪存 区; 所述存储引擎还用于: 在所述第一目标闪存区属于所述 目标类型的闪存区的情况 下, 将所述第一数据暂存至对应的数据缓冲 区中, 并在所述数据缓冲区中暂存的所述 第一数据达 到第一数据量阈值的情况下 , 将所述数据缓冲区中暂存的所述第一数据转 存至所述 第一目标闪存区中。
3、 根据权利要求 1或 2所述的系统, 所述目标型的闪存介质上还实现有与非 目 标类型的 闪存区对应的非易失性缓存 区, 所述非目标类型的闪存区是指单个所述存储 单元的存储 能力小于或等于设定能力 阈值的闪存区; 所述存储引擎还用于: 在所述第一目标闪存区属于所述非 目标类型的闪存区的情 况下, 将所述第一数据暂存至对应的非 易失性缓存区中, 并在所述非易失性缓存区中 暂存的所述 第一数据达到第二数据量 阈值的情况下, 将所述非易失性缓存区中暂存的 所述第一数据 转存至所述第一目标闪存 区中。
4 、 根据权利要求 2 所述的系统, 所述内存存储器中还包括与所述目标类型的闪 存区对应的 临时缓存区; 所述存储引擎还用于: 将所述数据缓冲区中暂存的所述第一 数据转存至所述临时 缓存区中, 以从所述临时缓存区中读取所述第一数据。
5、 一种闪存存储系统, 包括: 存储引擎、 内存存储器和持久存储器, 所述持久 存储器采 用目标型的闪存介质, 在所述目标型的闪存介质上实现有第一 类闪存区和第 二类闪存 区, 所述第一类闪存区中单个存储单元的第一存储能力, 大于所述第二类闪 存区中单个所 述存储单元的第二存储能 力; 所述存储引擎, 用于响应写请求, 获取第一数据; 在所述第一数据属于第一数据 类型的数据 的情况下, 按照所述第一存储能力, 将所述第一数据存储至所述第一类闪 存区中; 在所述第一数据属于第二数据类型 的数据的情况下, 将所述第一数据暂存至 所述内存存储 器中, 并在所述内存存储器中暂存的所述第一数据达到第一 数据量阈值 的情况下, 按照所述第二存储能力, 将所述内存存储器中暂存的所述第一 数据转存至
所述第二 类闪存区中。
6、 根据权利要求 5 所述的系统, 所述目标型的闪存介质上还实现有与所述第一 类闪存 区对应的非易失性缓存区; 所述存储引擎还用于 : 在所述第一数据属于所述第一数据类型的数 据的情况下, 将所述第一数 据暂存至所述非易失性缓 存区中, 并在所述非易失性缓存区中暂存的所 述第一数据 达到第二数据量阈值的情况 下, 按照所述第一存储能力, 将所述非易失性 缓存区 中暂存的所述第一数据转存至所 述第一类闪存区中。
7、 根据权利要求 5或 6所述的系统, 所述内存存储器中包括: 与所述第二类闪 存区对应的数 据缓冲区; 所述存储引擎还用于 : 在所述第一数据属于所述第二数据类型的数 据的情况下, 将所述第一数 据暂存至所述数据缓冲 区中, 并在所述数据缓冲区中暂存的所述第一数 据达到所述 第一数据量阈值的情况下 , 按照所述第二存储能力, 将所述数据缓冲区中 暂存的所述 第一数据转存至所述第二 类闪存区中。
8、 根据权利要求 7 所述的系统, 所述内存存储器中还包括: 与所述第二类闪存 区对应的 临时缓存区; 所述存储引擎还用于: 将所述数据缓冲区中暂存的所述 第一数据转存至所述临时 缓存区 中, 以从所述临时缓存区中读取所述第一数据。
9、 一种主机, 应用权利要求 1-4中任一项所述的闪存存储系统, 或者应用权利要 求 5-8中任一项所述的闪存存储系统。
10、 一种云存储系统, 包括: 计算节点和存储节点; 所述计算节点和 /或所述存储 节点采用权利 要求 9所述的主机实现。
11、 一种数据存储方法, 应用于主机上的存储引擎, 所述主机的持久存储器采用 目标型的 闪存介质, 在所述目标型的闪存介质上实现有至少两种类型 的闪存区, 不同 类型的闪存 区中单个存储单元的存储 能力不同, 以用于存储不同数据类型的数据; 所 述方法包括 : 响应写请求, 获取第一数据, 其中, 所述第一数据属于目标数据类型的数据; 从所述至少两种类型的 闪存区中, 确定与所述目标数据类型对应的第一目标闪存 区; 将所述第一数据存储至所 述第一目标闪存区中。
12、 根据权利要求 11 所述的方法, 所述主机的内存存储器中包括与目标类型的 闪存区对应 的数据缓冲区, 所述目标类型的闪存区是指单个所述存储单 元的存储能力 大于设定 能力阈值的闪存区; 将所述第一数据存储至所 述第一目标闪存区中, 包括: 在所述第一目标闪存 区属于所述目标类型的闪存 区的情况下, 将所述第一数据暂 存至对应的 所述数据缓冲区中;
在所述数据缓冲区中暂存 的所述第一数据达到第一数据 量阈值的情况下, 将所述 数据缓冲 区中暂存的所述第一数据转存 至所述第一目标闪存区中。
13、 根据权利要求 12 所述的方法, 所述内存存储器中还包括与所述目标类型的 闪存区对应 的临时缓存区; 所述方法还包括: 将所述数据缓冲区中暂存 的所述第一数据转存至所述 临时缓存区中, 以从所述临 时缓存区 中读取所述第一数据。
14、 根据权利要求 11-13任一项所述的方法, 所述目标型的闪存介质上还实现有 与非 目标类型的闪存区对应的非易失性缓 存区, 所述非目标类型的闪存区是指单个所 述存储单元 的存储能力小于或等于设定 能力阈值的闪存区; 将所述第一数据存储至所 述第一目标闪存区中, 包括: 在所述第一目标闪存 区属于所述非目标类型的闪存 区的情况下, 将所述第一数据 暂存至对应 的所述非易失性缓存区中 ; 在所述非易失性缓存 区中暂存的所述第一数据达到 第二数据量阈值的情况下, 将 所述非易失性 缓存区中暂存的所述第一数 据转存至所述第一 目标闪存区中。
15、 一种数据读取方法, 应用于主机上的存储引擎, 所述主机的持久存储器采用 目标型的 闪存介质, 在所述目标型的闪存介质上实现有至少两种类型的 闪存区, 不同 类型的闪存 区中单个存储单元的存储能 力不同, 以用于存储不同数据类型的数据; 所 述方法包括 : 响应读请求, 确定第二数据所在的第二目标闪存区, 其中, 所述第二目标闪存区 是所述至少 两种类型的闪存区中的任一个 闪存区; 从所述第二目标闪存 区中读取所述第二数据。
16、 根据权利要求 15 所述的方法, 所述主机的内存存储器中包括与目标类型的 闪存区对应 的临时缓存区, 所述目标类型的闪存区是指单个所述存储单元 的存储能力 大于设定能 力阈值的闪存区; 从所述第二目标闪存 区中读取所述第二数据, 包括: 在所述第二目标闪存 区属于所述目标类型的闪存 区, 且在所述第二目标闪存区对 应的所述临 时缓存区中查询到所述第二数 据的情况下, 从所述第二目标闪存区对应的 所述临时缓存 区中读取所述第二数据 ; 在所述第二 目标闪存区对应的所述 临时缓存区中未 查询到所述第二数 据的情况 下, 从所述第二目标闪存区中读取所述 第二数据。
17、 一种存储有计算机程序 /指令的计算机可读存储介质, 当所述计算机程序被处 理器执行时 , 致使所述处理器能够实现权利要求 11-14以及权利要求 15-16 中任一项 所述方法 中的步骤。
18、 一种计算机程序产品, 包括: 计算机程序/指令, 当所述计算机程序/指令被 处理器执行 时, 致使所述处理器能够实现权利要求 11-14以及权利要求 15-16中任一
28 项所述方法 中的步骤。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410748806.2A CN121116154A (zh) | 2024-06-11 | 2024-06-11 | 数据存储与读取方法、设备、系统、存储介质与程序产品 |
| CN202410748806.2 | 2024-06-11 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025257624A1 true WO2025257624A1 (zh) | 2025-12-18 |
Family
ID=97948787
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/IB2025/053640 Pending WO2025257624A1 (zh) | 2024-06-11 | 2025-04-07 | 数据存储与读取方法、设备、系统、存储介质与程序产品 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN121116154A (zh) |
| WO (1) | WO2025257624A1 (zh) |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110955384A (zh) * | 2018-09-26 | 2020-04-03 | 慧荣科技股份有限公司 | 数据储存装置以及非挥发式存储器控制方法 |
| CN111949197A (zh) * | 2019-05-16 | 2020-11-17 | 北京兆易创新科技股份有限公司 | 一种3d tlc闪存存储器及其数据写入方法和装置 |
| US10854290B1 (en) * | 2015-06-26 | 2020-12-01 | EMC IP Holding Company LLC | Utilizing a flash memory drive which includes single-level cell flash memory and multi-level cell flash memory |
| CN113392036A (zh) * | 2020-03-11 | 2021-09-14 | 深圳星火半导体科技有限公司 | 固态存储器及其数据写入方法、装置 |
| CN114327240A (zh) * | 2020-09-29 | 2022-04-12 | 慧荣科技股份有限公司 | 计算机可读存储介质、闪存存储器的数据存储方法及装置 |
| CN114625321A (zh) * | 2022-03-25 | 2022-06-14 | 阿里巴巴(中国)有限公司 | 数据写入方法以及装置 |
| CN116724299A (zh) * | 2021-03-01 | 2023-09-08 | 美光科技公司 | 支持写入命令的两阶段缓冲操作 |
-
2024
- 2024-06-11 CN CN202410748806.2A patent/CN121116154A/zh active Pending
-
2025
- 2025-04-07 WO PCT/IB2025/053640 patent/WO2025257624A1/zh active Pending
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10854290B1 (en) * | 2015-06-26 | 2020-12-01 | EMC IP Holding Company LLC | Utilizing a flash memory drive which includes single-level cell flash memory and multi-level cell flash memory |
| CN110955384A (zh) * | 2018-09-26 | 2020-04-03 | 慧荣科技股份有限公司 | 数据储存装置以及非挥发式存储器控制方法 |
| CN111949197A (zh) * | 2019-05-16 | 2020-11-17 | 北京兆易创新科技股份有限公司 | 一种3d tlc闪存存储器及其数据写入方法和装置 |
| CN113392036A (zh) * | 2020-03-11 | 2021-09-14 | 深圳星火半导体科技有限公司 | 固态存储器及其数据写入方法、装置 |
| CN114327240A (zh) * | 2020-09-29 | 2022-04-12 | 慧荣科技股份有限公司 | 计算机可读存储介质、闪存存储器的数据存储方法及装置 |
| CN116724299A (zh) * | 2021-03-01 | 2023-09-08 | 美光科技公司 | 支持写入命令的两阶段缓冲操作 |
| CN114625321A (zh) * | 2022-03-25 | 2022-06-14 | 阿里巴巴(中国)有限公司 | 数据写入方法以及装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN121116154A (zh) | 2025-12-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10649657B2 (en) | Log-based storage for different data types in non-volatile memory | |
| US9940261B2 (en) | Zoning of logical to physical data address translation tables with parallelized log list replay | |
| US8626987B2 (en) | Flash memory system and defragmentation method | |
| US10282286B2 (en) | Address mapping using a data unit type that is variable | |
| WO2017000658A1 (zh) | 存储系统、存储管理装置、存储器、混合存储装置及存储管理方法 | |
| US11269771B2 (en) | Storage device for improving journal replay, operating method thereof, and electronic device including the storage device | |
| JP2013242908A (ja) | ソリッドステートメモリ、それを含むコンピュータシステム及びその動作方法 | |
| US10296250B2 (en) | Method and apparatus for improving performance of sequential logging in a storage device | |
| US12197318B2 (en) | File system integration into data mining model | |
| US20160124639A1 (en) | Dynamic storage channel | |
| CN113590506B (zh) | Hmb的表项管理方法及固态硬盘的控制系统 | |
| TWI795680B (zh) | 主機效能加速模式的資料讀取方法及裝置 | |
| TW202314471A (zh) | 儲存裝置及其操作方法 | |
| CN116364148A (zh) | 一种面向分布式全闪存储系统的磨损均衡方法及系统 | |
| CN115309329A (zh) | 数据写入方法、装置、存储介质、存储设备和电子设备 | |
| US12498857B2 (en) | Method for writing data to solid-state drive | |
| HK40130814A (zh) | 数据存储与读取方法、设备、系统、存储介质与程序产品 | |
| US12608155B2 (en) | Method and device for data access, electronic apparatus and storage medium | |
| CN121116154A (zh) | 数据存储与读取方法、设备、系统、存储介质与程序产品 | |
| US20250217036A1 (en) | Key-value storage method and system | |
| CN119782198B (zh) | 一种基于分区命名空间固态硬盘的键值缓存系统 | |
| US20250117152A1 (en) | Key-group based data management in kv ssd | |
| WO2025257616A1 (zh) | 数据读取与存储方法、设备、系统、存储介质及程序产品 | |
| CN121364813A (zh) | 基于数据类型的数据搜集方法及装置、存储介质及计算机程序产品 | |
| CN120803363A (zh) | 基于nvm的分层内存和分层存储的方法及系统 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 25821436 Country of ref document: EP Kind code of ref document: A1 |