WO2022160317A1 - 一种数据处理方法、装置及系统 - Google Patents

一种数据处理方法、装置及系统 Download PDF

Info

Publication number
WO2022160317A1
WO2022160317A1 PCT/CN2021/074558 CN2021074558W WO2022160317A1 WO 2022160317 A1 WO2022160317 A1 WO 2022160317A1 CN 2021074558 W CN2021074558 W CN 2021074558W WO 2022160317 A1 WO2022160317 A1 WO 2022160317A1
Authority
WO
WIPO (PCT)
Prior art keywords
qlc
space
slc
flash memory
memory array
Prior art date
Application number
PCT/CN2021/074558
Other languages
English (en)
French (fr)
Inventor
王金伟
陈林峰
金加靖
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202180076377.3A priority Critical patent/CN116457885A/zh
Priority to PCT/CN2021/074558 priority patent/WO2022160317A1/zh
Publication of WO2022160317A1 publication Critical patent/WO2022160317A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C16/00Erasable programmable read-only memories
    • G11C16/02Erasable programmable read-only memories electrically programmable
    • G11C16/06Auxiliary circuits, e.g. for writing into memory

Definitions

  • the present application relates to the field of computer technology, and in particular, to a data processing method, device and system.
  • SSD solid state drive
  • NAND Flash flash memory
  • SLC single-level cell
  • QLC quad-level cell
  • SLC mode single-level cell
  • QLC quad-level cell
  • the SSD in the hybrid mode can not only take into account the advantages of high storage density and low cost of the QLC mode, but also combine the advantages of the fast write speed and high number of flashes of the SLC mode, so it has become the most commonly used SSD at present. configuration method.
  • the NAND Flash particles in SLC mode and the NAND Flash particles in QLC mode are pre-configured by the manufacturer before the SSD leaves the factory.
  • Mode NAND Flash particles are each configured to 50%.
  • the NAND Flash particles in the SLC mode and the NAND Flash particles in the QLC mode cannot be changed, so that the SSD can only use the fixed SLC-QLC allocated space to perform data storage services.
  • different business scenarios may require different SLC-QLC allocation spaces.
  • This fixed allocation method in the prior art obviously cannot meet the needs of different business scenarios, resulting in poor generality of SSD. What's more, using inappropriate SLC-QLC to allocate space to perform data storage business will not only affect the processing effect of data storage business, but also affect the storage performance of SSD itself.
  • the present application provides a data processing method, device and system, which adaptively adjusts the space allocation between SLC-mode storage cells and QLC-mode storage cells in the QLC flash memory array by using the heat and remaining space of historical data of the QLC flash memory array, In order to optimize the particle arrangement in the SSD, it can improve the versatility of the SSD, and ensure the business processing effect and the storage performance of the SSD.
  • the present application provides a data processing method, and the method can be implemented by a storage controller.
  • the storage controller can be a storage controller in an SSD.
  • the method may include: the storage controller detects the heat of the historical data of the QLC flash memory array, and adaptively adjusts the storage unit configured in the QLC mode and the storage unit configured as the SLC in the QLC flash memory array according to the heat of the historical data and the remaining space of the QLC flash memory array The space allocation for the storage unit of the pattern.
  • the storage units configured in the SLC mode in the QLC flash memory array are used for storing hot data
  • the storage units configured in the QLC mode in the QLC flash memory array are used for storing cold data.
  • the heat of the historical data of the QLC flash memory array can represent the current business scenario of the QLC flash memory array
  • the remaining space of the QLC flash memory array can be used to represent the remaining capacity of the QLC flash memory array.
  • the heat of historical data and the remaining space of the QLC flash memory array can adjust the space allocation between the storage unit in SLC mode and the storage unit in QLC mode, so that the space allocation can better match the current business scenario without exceeding the remaining capacity of the QLC flash memory array.
  • each NAND Flash storage particle in the SSD can correspond to a storage unit in the QLC flash memory array.
  • the number of particles can also optimize the particle arrangement in the SSD.
  • the storage controller can detect the hotness of the historical data of the QLC flash array in any of the following ways:
  • the storage controller can use the historical data with hot data tags in the historical data as hot data, then synthesize the writing times of the historical data to obtain the total writing times of the historical data, and synthesize the writing of the historical data with the hot data tags.
  • the number of times is the total number of writes of hot data
  • the heat of historical data is determined according to the total number of writes of historical data and the total number of writes of hot data.
  • the memory cells in the QLC flash memory array can be divided into N memory cell blocks, each of the N memory cell blocks includes at least one memory cell, and N is a positive integer greater than or equal to 2.
  • the storage controller can first count the number of times of writing historical data into each storage unit block, and then write the storage unit blocks whose number of writes is greater than the preset number of times among the N storage unit blocks as hot data. After that, the total number of writes of historical data is obtained by combining the number of writes of historical data, and the total number of writes of hot data is obtained by combining the number of writes of the target storage unit block. According to the total number of writes of historical data The number of times and the total number of writes of hot data to determine the hotness of historical data.
  • the storage controller By performing block processing on the storage units when the number of storage units is large, it is convenient for the storage controller to subsequently perform data processing based on fewer storage unit blocks, which helps to reduce the working pressure of the storage controller.
  • the hot and cold historical data can be identified in the case of unknown data types. This identification result refers to the actual data writing situation, so that it can better match the real business scenario.
  • the storage controller may first obtain the first K storage unit blocks obtained by sorting the number of writes in descending order from the N storage unit blocks, and then separately obtain the first K storage unit blocks.
  • the number of writes of each storage unit block in is a preset number of times, and the heat of K historical data is calculated.
  • calculate the K alternative space allocations corresponding to the heat of the K historical data and use the K alternative space allocation to make the QLC flash memory array.
  • the preset performance To achieve the maximum target candidate space allocation, adjust the storage cells configured in QLC mode and the storage cells configured in QLC mode in the QLC flash array.
  • the space allocation may include QLC space and SLC space
  • the QLC space is used to indicate the number of memory cells configured in QLC mode
  • the SLC space is used to indicate the number of memory cells configured in SLC mode.
  • the storage controller adaptively adjusts the storage unit configured in the QLC mode and the storage unit configured as the single-layer storage unit SLC in the QLC flash array according to the heat of the historical data of the QLC flash array and the remaining space of the QLC flash array.
  • the space allocation of the storage unit of the mode including: the storage controller first uses the heat of the historical data of the QLC flash array, the remaining space of the QLC flash array, the QLC space and the SLC space to characterize the preset performance of the QLC flash memory array, and then use the user capacity to match. Determine the value of the QLC space and the value of the SLC space that maximize the preset performance of the QLC flash memory array, and adjust the QLC space according to the value of the QLC space and the value of the SLC space.
  • the user capacity is the writable data volume of the QLC flash memory array that the user can see.
  • this solution can also set the preset performance of the QLC flash memory array according to the business scenario to calculate the allocation ratio that best meets the current business scenario, thus helping to improve the QLC flash memory array's ability to match various business scenarios.
  • the QLC space may include QLC user space and QLC redundant space
  • the SLC space may include SLC user space and SLC redundant space
  • the QLC user space is used to indicate the QLC configured as user space
  • QLC redundant space is used to indicate the number of storage cells in QLC mode configured as redundant space
  • SLC user space is used to indicate the number of storage cells in SLC mode configured as user space
  • SLC redundant Space is used to indicate the number of memory cells configured as redundant space in SLC mode.
  • the storage controller determines the value of the QLC space and the value of the SLC space that maximize the preset performance of the QLC flash memory array according to the principle of user capacity consistency and the consistency of the number of storage units, including: According to the user capacity consistency principle and the storage unit quantity consistency principle, the storage controller calculates the first association relationship between the QLC user space, the QLC redundant space, the SLC user space, and the SLC redundant space, and then calculates the QLC flash memory. The preset performance of the array reaches the maximum second association relationship between the QLC user space, the QLC redundant space, the SLC user space, and the SLC redundant space, and then the QLC user space is determined based on the first association relationship and the second association relationship.
  • the value of the value of QLC redundant space, the value of SLC user space, and the value of SLC redundant space.
  • the design also takes into account the user space used to implement user data storage and the redundant space for garbage collection to be performed to implement user data storage. Adjust space allocation on a finer-grained level of free space.
  • the preset performance of the QLC flash array includes the daily full disk full write DWPD performance of the QLC flash array and/or the write IOPS performance per second of the QLC flash array, to address the current existence of the QLC flash array DWPD performance bottleneck and IOPS performance bottleneck, try to improve the storage capacity of QLC flash array.
  • the remaining space of the QLC flash array may include the remaining rewritable times of the QLC flash array, the write amplification of the QLC flash array, the writable data volume of the QLC flash array in one day, and the One or more of the remaining writable data volumes.
  • the memory controller adaptively adjusts the space allocation between the memory cells configured in the QLC mode and the memory cells configured in the single-level memory cell SLC mode in the QLC flash memory array, including: if the space allocation indicates the configuration The number of memory cells in SLC mode is greater than the current number of memory cells in SLC mode in the QLC flash memory array, indicating that the memory cells in SLC mode at this stage are not enough to store hot data, so the storage controller can store some or all of the memory cells in the QLC flash memory array. All storage cells in QLC mode are configured in SLC mode to improve the ability of the QLC flash memory array to store hot data.
  • the storage controller may not change the current mode of each storage cell in the QLC flash memory array to avoid After reconfiguring the storage unit in the QLC mode to the SLC mode, the storage unit is unavailable due to the limit of the erasable and writeable times of the storage unit in the SLC mode, which improves the availability of the QLC flash memory array.
  • the present application provides a storage controller, including a processor and a storage interface coupled to the processor, where the storage interface is configured to be coupled to a quad-layer storage unit QLC flash memory array.
  • the processor is used to: detect the heat of the historical data of the QLC flash memory array, and adaptively adjust the storage unit and configuration of the QLC flash memory array configured in the QLC mode according to the heat of the historical data of the QLC flash memory array and the remaining space of the QLC flash memory array Space allocation for memory cells in single-layer memory cell SLC mode.
  • the storage units configured in the SLC mode in the QLC flash memory array are used for storing hot data
  • the storage units configured in the QLC mode in the QLC flash memory array are used for storing cold data.
  • the processor can detect the hotness of the historical data of the QLC flash array in any of the following ways:
  • Method 1 The processor can use the historical data with the hot data tag in the historical data as the hot data, and then synthesize the writing times of the historical data to obtain the total writing times of the historical data, and synthesize the writing times of the historical data with the hot data tag.
  • the total number of writes of hot data is obtained, and then the heat of historical data is determined according to the total number of writes of historical data and the total number of writes of hot data.
  • Mode 2 The storage cells in the QLC flash memory array are divided into N storage cell blocks, each of the N storage cell blocks includes at least one storage cell, and N is a positive integer greater than or equal to 2.
  • the processor is specifically used to: first count the number of times of writing historical data into each storage unit block, and then use the storage unit block whose number of writes is greater than the preset number of times among the N storage unit blocks as hot data
  • the written target storage unit block then the total write times of historical data is obtained by synthesizing the write times of historical data, and the total write times of hot data is obtained by synthesizing the write times of the target storage unit block.
  • the total write times of historical data The number of entries and the total number of writes of hot data to determine the popularity of historical data.
  • the processor is further configured to: obtain the first K storage unit blocks obtained by sorting the number of writes from most to the least from the N storage unit blocks, and the first K storage unit blocks in the previous K storage unit blocks are obtained.
  • the number of writes of each storage unit block is a preset number of times, and the heat of the K historical data is calculated.
  • the K corresponding to the heat of the K historical data is calculated. Allocation of alternate space, use the target alternate space allocation that maximizes the preset performance of the QLC flash array among the K alternate space allocations, and adjust the storage units configured in the QLC mode and the storage units configured in the QLC mode in the QLC flash array. unit.
  • the space allocation may include QLC space indicating the number of memory cells configured in QLC mode and SLC space indicating the number of memory cells configured in SLC mode.
  • the processor is specifically used to: first use the heat of the historical data of the QLC flash array, the remaining space of the QLC flash array, the QLC space and the SLC space to characterize the preset performance of the QLC flash array, and then use the user capacity consistency The principle and the principle of consistency of the number of storage units, determine the value of the QLC space and the value of the SLC space that maximize the preset performance of the QLC flash memory array, and finally adjust the QLC according to the value of the QLC space and the value of the SLC space The mode of each memory cell in the flash array.
  • the user capacity is the writable data volume of the QLC flash memory array that the user can see.
  • the QLC space includes the QLC user space and the QLC redundant space
  • the SLC space includes the SLC user space and the SLC redundant space
  • the QLC user space indicates the number of storage units in QLC mode configured as user space
  • QLC redundant space indicates the number of storage cells in QLC mode configured as redundant space
  • SLC user space indicates the number of storage cells in SLC mode configured as user space
  • SLC redundant space indicates SLC mode configured as redundant space the number of storage units.
  • the processor is specifically used to: first, according to the principle of user capacity consistency and the principle of consistency of the number of storage units, to calculate and obtain the first number between the QLC user space, the QLC redundant space, the SLC user space and the SLC redundant space.
  • association relationship calculates the second association relationship between the QLC user space, the QLC redundant space, the SLC user space and the SLC redundant space that maximizes the preset performance of the QLC flash array, and then based on the first association relationship and The second association relationship determines the value of the QLC user space, the value of the QLC redundant space, the value of the SLC user space, and the value of the SLC redundant space.
  • the preset performance of the QLC flash array may include the daily full disk full write DWPD performance of the QLC flash array and/or the write IOPS performance per second of the QLC flash array.
  • the remaining space of the QLC flash array may include the remaining rewritable times of the QLC flash array, the write amplification of the QLC flash array, the writable data volume of the QLC flash array in one day, and the One or more of the remaining writable data volumes.
  • the processor is specifically configured to: if the space allocation indicates that the configured number of memory cells in the SLC mode is greater than the current number of memory cells in the SLC mode in the QLC flash array, then a portion of the QLC flash memory array can be Or all the storage cells in QLC mode are configured in SLC mode. If the number of storage cells in SLC mode indicated in the space allocation is not greater than the current number of storage cells in SLC mode in the QLC flash memory array, then each memory cell in the QLC flash memory array will not be changed. The current mode of the storage unit.
  • the storage controller may be a storage controller in a solid-state storage device SSD, and the storage unit is a flash NAND flash memory particle.
  • the present application provides a storage controller, including a heat perception module and an optimization decision module, wherein the heat perception module and the optimization decision module are respectively connected to a QLC flash memory array.
  • the heat sensing module is used to detect the heat of the historical data of the QLC flash array
  • the optimization decision module is used to adaptively adjust the QLC flash array configured in QLC mode according to the heat of the historical data of the QLC flash array and the remaining space of the QLC flash array. Space allocation between memory cells and memory cells configured in single-layer memory cell SLC mode.
  • the storage units configured in the SLC mode in the QLC flash memory array are used for storing hot data
  • the storage units configured in the QLC mode in the QLC flash memory array are used for storing cold data.
  • the heat sensing module can detect the heat of the historical data of the QLC flash array in any of the following ways:
  • the heat perception module can use the historical data with the hot data tag in the historical data as the hot data, and then synthesize the number of writes of the historical data to obtain the total number of writes of the historical data, and synthesize the writing of the historical data with the hot data tag.
  • the number of times is the total number of writes of hot data, and then the heat of historical data is determined according to the total number of writes of historical data and the total number of writes of hot data.
  • the storage cells in the QLC flash memory array are divided into N storage cell blocks, each of the N storage cell blocks includes at least one storage cell, and N is a positive integer greater than or equal to 2.
  • the heat perception module can first count the number of writes of historical data into each storage unit block, and then write the storage unit blocks whose number of writes is greater than the preset number among the N storage unit blocks as hot data. After that, the total number of writes of historical data is obtained by synthesizing the number of writes of historical data, and the total number of writes of hot data is obtained by combining the number of writes of the target storage unit block. According to the total number of writes of historical data and the total number of writes of hot data to determine the hotness of historical data.
  • the heat sensing module may also obtain the first K storage unit blocks sorted by the number of writes in descending order from the N storage unit blocks, and each of the previous K storage unit blocks The number of times of writing of each storage unit block is a preset number of times, and the hotness of K historical data is calculated.
  • the optimization decision-making module can also calculate the K alternative space allocations corresponding to the heat of the K historical data according to the heat of the K historical data and the remaining space of the QLC flash memory array, and use the K alternative space allocation to make the QLC flash memory array.
  • the preset performance achieves the maximum target candidate space allocation, and adjusts the storage units configured in the QLC mode and the storage units configured in the QLC mode in the QLC flash array.
  • the space allocation may include QLC space indicating the number of memory cells configured in QLC mode and SLC space indicating the number of memory cells configured in SLC mode.
  • the optimization decision module is specifically used to: first use the heat of historical data of the QLC flash memory array, the remaining space of the QLC flash memory array, the QLC space and the SLC space to characterize the preset performance of the QLC flash memory array, and then use the user capacity to match the preset performance of the QLC flash memory array Determine the value of QLC space and the value of SLC space that maximize the preset performance of the QLC flash memory array according to the principle of stability and the consistency of the number of storage cells, and finally adjust the value of the QLC space and the value of SLC space according to the value of the QLC space and the value of the SLC space.
  • the user capacity is the writable data volume of the QLC flash memory array that the user can see.
  • the QLC space includes the QLC user space and the QLC redundant space
  • the SLC space includes the SLC user space and the SLC redundant space
  • the QLC user space indicates the number of storage units in QLC mode configured as user space
  • QLC redundant space indicates the number of storage cells in QLC mode configured as redundant space
  • SLC user space indicates the number of storage cells in SLC mode configured as user space
  • SLC redundant space indicates SLC mode configured as redundant space the number of storage units.
  • the optimization decision-making module is specifically used to: first, according to the principle of user capacity consistency and the principle of storage unit quantity consistency, to calculate the difference between the QLC user space, the QLC redundant space, the SLC user space and the SLC redundant space.
  • the first association relationship calculates the second association relationship between the QLC user space, the QLC redundant space, the SLC user space, and the SLC redundant space that maximizes the preset performance of the QLC flash array, and then based on the first association relationship With the second association relationship, the value of the QLC user space, the value of the QLC redundant space, the value of the SLC user space, and the value of the SLC redundant space are determined.
  • the preset performance of the QLC flash array may include the daily full disk full write DWPD performance of the QLC flash array and/or the write IOPS performance per second of the QLC flash array.
  • the remaining space of the QLC flash array may include the remaining rewritable times of the QLC flash array, the write amplification of the QLC flash array, the writable data volume of the QLC flash array in one day, and the One or more of the remaining writable data volumes.
  • the optimization decision module is specifically used to: if the number of storage cells in the SLC mode indicated by the space allocation is greater than the current number of storage cells in the SLC mode in the QLC flash memory array, then the storage cells in the QLC flash memory array can be changed to Some or all of the storage cells in QLC mode are configured in SLC mode. If the number of storage cells in SLC mode indicated in the space allocation is not greater than the current number of storage cells in SLC mode in the QLC flash memory array, the storage cells in the QLC flash memory array will not be changed. The current mode of each memory cell.
  • the storage controller may be a storage controller in a solid-state storage device SSD, and the storage unit is a flash NAND flash memory particle.
  • the present application provides a memory, comprising a QLC flash memory array and the storage controller according to any one of the second aspect or the third aspect, wherein the storage controller is used to read and write data in the QLC flash memory array .
  • the present application provides a data processing system, comprising a host and the memory according to any one of the foregoing fourth aspects, wherein the host is configured to send a data processing request to the memory, and the memory is configured to execute the stored instructions,
  • the memory implements the data processing method according to any one of the first aspect above by executing the instructions.
  • the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is run on a computer, the computer is made to execute as described in any one of the above-mentioned first aspects. data processing method.
  • the present application provides a computer program product that, when the computer program product runs on a computer, causes the computer to execute the data processing method according to any one of the above-mentioned first aspects.
  • FIG. 1 exemplarily shows a schematic diagram of a system architecture to which an embodiment of the present application is applicable
  • Fig. 2 exemplarily shows an execution flow chart of a data processing method
  • FIG. 3 exemplarily shows a schematic flowchart of a data processing method provided by an embodiment of the present application
  • FIG. 4 exemplarily shows a schematic flowchart of another data processing method provided by an embodiment of the present application
  • Fig. 5 exemplarily shows a QLC flash memory array division relationship diagram before and after relocation
  • FIG. 6 exemplarily shows a schematic diagram of an optimization result provided by an embodiment of the present application.
  • FIG. 7 exemplarily shows a performance change curve diagram of a QLC flash memory array provided by an embodiment of the present application
  • FIG. 8 exemplarily shows a schematic flowchart of another data processing method provided by an embodiment of the present application.
  • FIG. 9 exemplarily shows a schematic structural diagram of a storage controller provided by an embodiment of the present application.
  • the data processing solution in this application can be applied to a device with data storage function, for example, can be applied to a storage device with only data storage function, such as a memory, or can be applied to an electronic device with data storage function and other functions.
  • the data processing apparatus may be an independent unit, the unit may be embedded in an electronic device, and can perform read/write control on the memory of the electronic device.
  • the data processing apparatus may also be a unit packaged inside the electronic device, and is used to implement the data storage function of the memory of the electronic device.
  • the electronic device may be a portable electronic device including functions such as a personal digital assistant and/or a music player, such as a mobile phone, a tablet computer, a wearable device with wireless communication capabilities (eg, a smart watch), or a vehicle-mounted device.
  • portable electronic devices include, but are not limited to, carry-on Or portable electronic devices with other operating systems.
  • the aforementioned portable electronic device may also be, for example, a laptop computer (Laptop) having a touch-sensitive surface (eg, a touch panel). It should also be understood that, in some other embodiments of the present application, the above-mentioned electronic device may also be a desktop computer having a touch-sensitive surface (eg, a touch panel).
  • the memory may be volatile memory, non-volatile memory, or may include both volatile and non-volatile memory. It can also be a hard disk composed of these volatile memories or non-volatile memories, such as SSDs. Among them, the volatile memory may be random access memory (RAM), which is used as an external cache.
  • RAM random access memory
  • RAM random access memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous DRAM
  • SDRAM double data rate synchronous dynamic random access memory
  • double data rate SDRAM double data rate SDRAM
  • DDR SDRAM enhanced synchronous dynamic random access memory
  • ESDRAM enhanced synchronous dynamic random access memory
  • SCRAM synchronous link dynamic random access memory
  • direct rambus RAM direct rambus RAM
  • Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable Programmable read-only memory (electrically EPROM, EEPROM) or flash memory. It should be noted that the memory described herein is intended to include, but not be limited to, these and any other suitable types of memory.
  • SSD solid state drive
  • FeM ferroelectric memory
  • PCM phase change memory
  • MRAM magnetic random Access memory
  • ReM resistive memory
  • FIG. 1 exemplarily shows a schematic diagram of a system architecture to which the embodiments of the present application are applied.
  • the system architecture includes a host 100 and an SSD 200 , and the SSD 200 may include a storage controller 210 and a flash memory array 220 .
  • the flash memory array 220 may also be referred to as a redundant array of independent disks (RAID).
  • the host 100 and the storage controller 210 and between the storage controller 210 and the flash memory array 220 may be connected through a bus as shown in FIG. 1 , or may be connected through interconnection or other means to implement communication.
  • the flash memory array 220 is formed by a plurality of memory cells (ie, NAND Flash particles) arranged in rows and columns.
  • N includes M ⁇ N memory cells arranged in M rows and N columns in total ( M and N are both positive integers), from the perspective of row M: the N memory cells D 11 to D 1N are listed in the first row, the N storage cells D 21 to D 2N are listed in the second row, . . .
  • the N memory cells D M1 to D MN are juxtaposed in the M-th row. From the perspective of N columns: the M memory cells D 11 to D M1 are arranged in the first column, the M memory cells D 12 to D M2 are arranged in the second column, ..., the N memory cells D 1N to D MN Cells are placed side by side in column N.
  • the N memory cells on the same row are also communicated to the memory controller 210 through the same bus.
  • the host 100 is used to interact with an upper-layer application (application, APP), obtain input/output (I/O) interface commands issued by the APP, and send corresponding commands to the storage controller 210 in real time data processing requests.
  • the data processing request carries the data to be read and written.
  • the storage controller 210 allocates a target address for the data to be read and written according to the internal preset logic, and decodes the target row and target column where the target address is located in the flash memory array 220, and then passes through the bus between the memory cells in each row. Turn on the target row and turn off other rows, and then find the target storage unit at the target column in the target row that is turned on to perform read and write operations.
  • each component shown in FIG. 1 may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application-specific integrated circuits, which will not be repeated here. .
  • Hot data is written more frequently than cold data. Determining whether a piece of data is cold data or hot data is not only related to the writing frequency of the data, but also to the actual business scenario.
  • the data can be classified as cold data in this business scenario, while If the writing frequency is higher than the writing frequency of most other data in another business scenario, the data can be classified as hot data in another business scenario.
  • the storage unit is the smallest storage unit of NAND Flash particles.
  • a memory cell can be configured in one of the following modes:
  • a single-level cell has a single-layer electronic structure and a storage density of 1 bit/cell (where bit is a unit of data volume, that is, a bit), that is, each SLC mode storage unit can store 1bit of data.
  • the memory cell in the SLC mode can store a smaller amount of data, so the memory cell receives less voltage shock when writing data, and the memory cell can have a longer program and erase (PE) life.
  • PE program and erase
  • the theoretical erasable times of the memory cells in the SLC mode can reach 100,000 times or even more.
  • a large-capacity storage function is to be implemented, a large number of storage units in the SLC mode must be configured in the SSD, resulting in high cost of the SSD.
  • Multi-level cell a double-layer electronic structure based on different high and low voltages, has a storage density of 2bit/cell, that is, each MLC mode memory cell can store 2bit of data.
  • the memory cells in the MLC mode also have a long PE life. For example, the theoretical rewritable times are between 3000 and 5000 times, and their cost is relatively high.
  • Tri-level cell (trinary-level cell, TLC), the current mainstream flash memory particle, is a three-layer electronic structure based on the extension of the memory cell in the MLC mode.
  • the storage density is 3bit/cell, that is, the storage capacity of each TLC mode 3bit data can be stored in the unit.
  • the memory cell capacity of the TLC mode is theoretically 1.5 times that of the MLC mode, and it can have a lower cost, but the PE life is relatively lower, such as the theoretical rewritable times are between 1000-3000 times.
  • a quad-level cell is a four-layer electronic structure extended from a memory cell based on TLC mode, with a storage density of 4bit/cell, that is, each memory cell in QLC mode can store 4bit of data .
  • the memory cell capacity of the QLC mode is higher than that of the TLC mode, and the cost is lower, but its PE life is shorter, for example, the theoretical erasable times are only about 1500 times.
  • the SSD in the embodiment of the present application has the characteristic of being erased before writing.
  • the storage space of SSD can be divided into user space and redundant space, and the storage capacity of SSD can be divided into user capacity and redundant capacity.
  • the user space refers to the space used for storing user data
  • the redundant space refers to the space that is additionally opened up for realizing the writing operation of the user space.
  • User capacity refers to the amount of data that the SSD presents to the user externally
  • redundancy capacity refers to the amount of data corresponding to the additional redundant space created to realize the full-disk write operation corresponding to the user capacity.
  • the controller when the user capacity is 10 megabytes (MByte, MB), the user can theoretically write 10MB of data to the SSD at a time. However, if the SSD currently has 1MB of user capacity to write other data, it is necessary to To realize this full disk write operation, the controller also needs to migrate the 1MB garbage data that has been written in the user space to the redundant space. After the garbage collection (GC) operation is performed to clear the user space , and then write the 10MB data written by the user this time into the user space.
  • GC garbage collection
  • This erase-before-write feature of SSD will bring additional data copies, which is called write amplification (WA).
  • WA write amplification
  • WA can be calculated based on the ratio of redundant space to user space and some other parameters. When the WA is larger, the additional data copy operations in the SSD are more, resulting in fewer available erasing and writing times of each storage unit in the SSD, and the lifespan of the SSD is shortened. Therefore, it is necessary to reduce WA as much as possible in SSD.
  • the indicators for measuring the storage performance of the SSD may include, but are not limited to:
  • total number of bytes written refers to the maximum amount of written data that the SSD can support during the life of the SSD;
  • the number of PEs refers to the rewritable times of a storage unit (or SSD). Each time a storage unit is programmed (ie, written) or erased once, the number of PEs of the storage unit (or SSD) is reduced by one;
  • the daily full disk write times (disk write per day, DWPD) refers to the number of times that the user can write to the SDD user space every day during the life of the SSD;
  • the number of writes per second refers to the number of files that can be written per second when writing a file with a fixed amount of data
  • IOPS rand_4K which is the number of files that can be written per second when writing a random 4KB file.
  • the number of PE can be represented by the value obtained by dividing TBW by the user capacity (that is, the total number of times that can be fully written during the lifetime), and DWPD can be represented by TBW
  • the value obtained by dividing by the user capacity is then divided by the total number of days corresponding to the lifetime to characterize, or it can be characterized by dividing the number of PEs by the total number of days corresponding to the lifetime.
  • the storage unit in the QLC mode supports setting a higher TBW storage space at a lower cost, it has gradually replaced the storage unit in the SLC mode or the hard disk drive (HDD), etc. to set up the flash memory array, that is, the flash memory. All storage units in the array are configured in QLC mode, and the flash array is also called QLC flash array.
  • the memory cells in the QLC mode will have lower PE times (the memory cells in the QLC mode are about 1500 times, and the memory cells in the SLC mode can reach 50,000 times), and the DWPD (the memory cell in QLC mode is about 200 times, while the memory cell in TLC mode can reach 1000 times) and lower IOPS (especially 4KB IOPS, the 4KB IOPS of the memory cell in QLC mode is about 18K ⁇ 35K, while the TLC mode memory cell can reach 1000 times) and lower IOPS (especially 4KB IOPS.
  • Mode memory cells can reach 125K, and the 4KB IOPS of QLC mode memory cells is only 1/7 that of SLC mode memory cells, which has become a performance bottleneck in QLC flash array setups). Therefore, the configuration of the QLC flash array in pure QLC mode will obviously reduce the DWPD performance and IOPS performance of the SSD itself. Based on this, considering the TBW requirement of SSD, the low cost of the storage unit in QLC mode, and the high PE, high DWPD and high IOPS of the storage unit in SLC mode, it is also possible to switch some QLC mode storage units in the QLC flash array to SLC mode.
  • the storage density of the memory cell in the SLC mode is only 3/4 of the storage density of the memory cell in the QLC mode
  • the PE of the memory cell in the SLC mode is 50000/1500 of the PE of the memory cell in the QLC mode, which makes The QLC flash array after the switch actually holds more data volume than the QLC flash array before the switch, so the TBW of the SSD after the switch is actually higher than the TBW of the SSD before the switch.
  • the SSD after the switch can also take advantage of the advantages of the SLC mode storage unit in the typical time of read (tR) and the typical time of program (tProg) of the write operation, etc., to further improve the DWPD of the SSD itself. Performance and IOPS performance, to a certain extent, solve the technical problems of low DWPD and low IOPS rand_4K in the pure QLC flash memory array configuration.
  • the SSD does not present user capacity to the outside world, and the SLC area in the SSD (that is, the area where the storage unit configured in SLC mode is located) is set as the cache area. .
  • the storage controller in the SSD first writes the data to be written to the SLC area, and then flashes the data from the SLC area to the QLC area (that is, the area where the storage unit configured in QLC mode is located).
  • the QLC area will first use its own redundant space for garbage collection, and then write the downloaded data into its own user space.
  • the SSD can achieve large bandwidth and high IOPS in a short time due to the fast writing speed of the storage unit in SLC mode.
  • the SLC area in the SSD is set as a flash (disk) area.
  • the storage controller in the SSD first determines the cold and hot types of the data to be written according to the hot and cold identification mechanism, and then writes the cold data to the QLC area and the hot data to the SLC area.
  • the SLC area will first use its own redundant space for garbage collection, and then write the hot data to be written into its own user space.
  • the QLC area will first use its own redundant space for garbage collection, and then write the cold data to be written into its own user space.
  • the respective data of the SLC area and the QLC area are not circulated.
  • the SLC area and QLC area that do not communicate with each other are used to store hot data and cold data respectively, which can improve more stable bandwidth and IOPS for users, although the performance is not as good as the first write in solution 1.
  • the performance when entering the SLC area is high, but it is higher than the performance after a long time of writing in scheme 1, which is more in line with the stability requirements of large-capacity SSDs.
  • the storage controller can monitor the data write times of each area in the SLC area and the QLC area in real time, The number of writes and the number of theoretical erasable times for each area determine how well each area has been written.
  • the written levels of the two areas are basically the same, it means that the remaining write capacities of the two areas are also relatively balanced, so the storage controller may not adjust the allocation ratio of the two areas.
  • the storage controller can increase the current area occupied by the more severely worn area.
  • this method starts to adjust the allocation ratio after the remaining write capacity of the two areas deviates, which is actually a post-feedback method, even if new memory cells are subsequently allocated to the area with poor remaining write capacity , the performance of each memory cell that existed before in this area has also caused irreversible damage.
  • the worn-out storage units may even become unusable (for example, the theoretical rewritable times have been used up), reducing the overall performance of the SSD.
  • this implementation only adjusts the allocation ratio based on the remaining write capacity of the two regions, and does not take into account whether the user capacity is consistent.
  • the user capacity in the adjusted SSD is likely to be the same as that in the SSD before the adjustment.
  • the user capacity is different, which leads to the constant change of the user capacity presented by the SSD, which affects the user's writing experience.
  • this embodiment adjusts the space allocation as long as the remaining write capacity is unbalanced, without taking into account any factors related to the service being processed. As the space allocation is adjusted, the WA in each area will also Corresponding changes have resulted in large differences in the performance of SSDs when processing the same service.
  • the present application proposes a data processing method to adaptively adjust the allocation space of the QLC mode storage unit and the SLC mode storage unit in the QLC flash memory array according to the heat of historical data and the remaining space of the QLC flash memory array. , in order to improve the matching degree of QLC flash memory array with business scenarios while avoiding wear and tear, try to show the same performance in the same business scenario, and then achieve the consistency of user capacity presented to the outside world.
  • FIG. 3 exemplarily shows a schematic flowchart of a data processing method provided by an embodiment of the present application, and the method is applicable to a controller, such as the storage controller 210 shown in FIG. 1 .
  • the method includes:
  • Step 301 the storage controller detects the heatness of the historical data of the QLC flash memory array.
  • the storage controller may determine the hotness of the historical data according to the historical data written to the QLC flash memory array within a period of time.
  • a period of time may refer to any of the following periods:
  • a period of time may refer to a periodic period of one cycle.
  • the storage controller can reconfigure the partition of each storage unit in the QLC flash memory array at regular intervals according to the current data writing situation and the remaining space of the QLC flash memory array, so as to avoid the QLC flash memory array. The phenomenon of extreme deterioration of performance occurs;
  • the period of time may refer to the entire period from the moment when a service is executed to the moment when the execution ends.
  • the storage controller can reconfigure the partitions of each storage unit in the QLC flash memory array according to the characteristics of the service to be executed and the remaining space of the QLC flash memory array, so as to improve the performance of the QLC flash memory array.
  • the period of time may refer to a period from the moment when the count of the number of writes is started to the moment when the counted number of writes is greater than the preset number of writes.
  • the preset number of writes may be a fixed value set by those skilled in the art based on experience, or may be a certain value that has a correlation with the remaining rewritable times of the QLC flash memory array, such as 1/1 of the remaining rewritable times. 6.
  • the storage controller can reconfigure the storage unit every time the remaining erasable times of the QLC flash memory array reaches a significant degree of change, for example, by configuring more storage units in the SLC mode to improve the erasability of the QLC flash memory array. Write times, try to delay the deterioration of the remaining erasable times of the QLC flash memory array;
  • a period of time may refer to the period from the moment when the count of the amount of written data is started to the moment when the amount of the counted written data is greater than the preset amount of written data .
  • the preset write data volume may be a fixed value set by those skilled in the art based on experience, or may be a certain value related to the remaining writable data volume of the QLC flash memory array, such as the remaining writable data volume 1/3 of . In this way, the storage controller can reconfigure the storage unit every time the remaining writable data volume of the QLC flash memory array reaches a significant degree of change.
  • the method increases the writable data volume of the QLC flash memory array, and tries to delay the deterioration of the remaining writable data volume of the QLC flash memory array.
  • the hotness of the historical data is used to represent the writing activity of the hot data in the historical data.
  • the greater the hotness of the historical data the higher the writing activity of the hot data, and the more frequently the hot data is written to the storage unit.
  • the smaller the hotness of the historical data the lower the writing activity of the hot data, and the less frequently the hot data is written to the storage unit.
  • the hotness of the historical data may be determined according to the total number of writes of the historical data and the total number of writes of the hot data in the historical data, for example, the total number of hot data in the historical data may be directly
  • the ratio of the number of writes to the total number of writes of the historical data is used as the heat of the historical data, and the difference between the total number of writes of the hot data in the historical data and the total number of writes of the cold data in the historical data can be calculated as the historical data.
  • the ratio of the total number of data writes is used as the heat of historical data, etc.
  • the total number of writes of the historical data and the total number of writes of the hot data in the historical data can be counted in real time by the storage controller each time a write is performed, or the storage controller can determine the space to be reconfigured when The centralized statistics are based on all historical data within a period of time, which is not limited in detail.
  • Embodiment 2 For a specific implementation manner of how the storage controller identifies whether a piece of historical data is hot data or cold data, please refer to the following Embodiment 2 and Embodiment 3, which will not be introduced this time.
  • Step 302 the storage controller adaptively adjusts the space allocation between the storage cells configured in the QLC mode and the storage cells configured in the SLC mode in the QLC flash array according to the heat and remaining space of the historical data of the QLC flash array.
  • the storage controller may first determine the target allocation of the SLC area and the QLC area in the QLC flash memory array according to the heat and remaining space of the historical data of the QLC flash memory array, and then adjust the allocation of each storage unit according to the target allocation. model.
  • the SLC area refers to the area occupied by the storage cells configured in the SLC mode, and the storage cells configured in the SLC mode in the QLC flash memory array are used for storing hot data.
  • the QLC area refers to the area occupied by the storage cells configured in the QLC mode, and the storage cells configured in the QLC mode in the QLC flash memory array are used to store cold data.
  • the storage controller can determine the target allocation of the SLC area and the QLC area in various ways, and two possible implementations are exemplarily introduced:
  • the remaining space of the existing SLC area in the QLC flash memory array (such as the remaining writeable times, or the remaining writeable data capacity) is weaker, it indicates that the existing SLC mode storage in the QLC flash memory array is weaker.
  • the unit may not be able to undertake subsequent frequent hot data writing services. Therefore, the storage controller can configure some storage units in the QLC mode to the SLC mode to provide more storage units to store hot data and improve the QLC flash memory array's ability to support future services.
  • the storage controller can maintain the current configuration, or configure some of the storage cells in SLC mode to QLC mode to provide more storage cells to store cold data.
  • the storage controller may also use the heat of historical data of the QLC flash memory array, the remaining space of the QLC flash memory array, and the allocation ratio of the SLC area to the QLC area to represent the predictions concerned by the current business scenario. Set performance indicators, and then use enumeration or other calculation methods to find the target allocation ratio of the SLC area and the QLC area that can make the preset performance indicators concerned by the current business scenario achieve better results, so as to improve the QLC flash memory array to meet different business needs. ability.
  • the storage controller may also follow certain principles when calculating, such as the principle of user capacity consistency or the consistency principle of the number of storage units.
  • the storage controller can reconfigure the storage cells as follows:
  • the memory controller can find the memory cells in the QLC mode that have been erased and written more times from the current area of the QLC to be reconfigured into the SLC mode. In this way, the remaining erasable times corresponding to the memory cells in the QLC mode that have been erased and written more times after being reconfigured to the SLC mode become larger accordingly, and the remaining memory cells of the QLC mode that have been erased and written many times can also be rewritten. With more remaining rewritable times, whether it is the life of the QLC area or the life of the SLC area, it can be well maintained;
  • the target allocation ratio indicates that the SLC area to be configured is smaller than the current area of the SLC, it indicates that the storage cells in the QLC mode at this stage are insufficient, and some or all of the storage cells in the SLC mode should be configured in the QLC mode.
  • the theoretical erasable times of the memory cells in the SLC mode is much greater than that of the memory cells in the QLC mode.
  • the memory controller can first find all the memory cells in the SLC mode that have been erased and written less than the theoretical erasable times of the memory cells in the QLC mode from the current area of the SLC, and then select from these memory cells.
  • the storage unit that meets the reassignment quantity indicated by the target allocation ratio performs the reassignment operation. If the number of these storage units is less than the reassignment quantity indicated by the target allocation ratio, the storage controller can reassign all these storage units as QLC mode. Alternatively, considering that even if the memory cells in the SLC mode that do not exceed the theoretical erasable times of the memory cells in the QLC mode are reconfigured into the QLC mode, the reconfigured memory cells in the QLC mode may only have less remaining erasable. The number of writes reduces the storage capacity of the QLC flash memory array, so the storage controller can directly stop reconfiguring the storage cells in the SLC mode.
  • Step 303 the storage controller determines the type of data to be written:
  • step 304 When the data to be written is hot data, perform step 304;
  • step 305 is executed.
  • the storage controller may determine the type of data to be written in any of the following ways:
  • the storage controller determines the type of the data to be written according to the data tag of the data to be written.
  • the data tag of the data to be written is designated by the upper-layer APP or the host and sent to the storage controller through a data processing request to indicate that the data to be written is hot data or cold data.
  • the storage controller uses a locally stored preset classification model to predict the type of data to be written.
  • the preset classification model is pre-trained by the storage controller based on a large amount of training data of known data types, and the preset classification model includes feature information of hot data and feature information of cold data.
  • the storage controller After acquiring the data to be written, the storage controller first extracts the feature information of the data to be written, and classifies the data to be written as a hot data type based on the degree of matching between the feature information of the data to be written and the feature information of the hot data Score, based on the degree of matching between the feature information of the data to be written and the feature information of the cold data, score the classification of the cold data type of the data to be written, and then use the classification with the higher score among the two classifications as the classification to be written.
  • Type of data may be a binary classification model, a machine learning model, a neural network model, or the like, which is not specifically limited.
  • Mode 3 The storage controller first identifies the business scenario to which the data to be written belongs, and then uses the business model corresponding to the business scenario to identify the type of the data to be written.
  • the business model here may refer to the above-mentioned preset classification model, or may refer to other models that can classify hot and cold data. For example, in the business scenario to which the data to be written belongs, if the business model divides cold data and hot data based on a preset write frequency threshold, then: if the write frequency of the data to be written is greater than or equal to the preset write frequency If the write frequency threshold is set, the storage controller can determine that the data to be written is hot data, otherwise it can determine that the data to be written is cold data.
  • the storage controller determines whether the data to be written is an update of hot data in the historical data, and if so, determines that the data to be written is hot data, otherwise it determines that the data to be written is cold data.
  • the storage controller may also identify hot and cold data in other ways, such as a clustering algorithm, which will not be described in detail in this application.
  • Step 304 the storage controller writes the data to be written into the storage cells configured in the SLC mode in the QLC flash memory array.
  • the storage controller may find a storage cell with a large number of remaining erasable and rewritable times from the storage cells included in the SLC area, and write the data to be written into the storage cell. Since the theoretical rewritable times of the memory cells in the SLC mode are about 50,000 times, which is far greater than the 1,500 times of the memory cells in the QLC mode, the use of the memory cells in the SLC mode to store hot data can make full use of the memory cells in the SLC mode. High rewritable times serve hot data with high write activity.
  • Step 305 the storage controller writes the data to be written to the storage unit configured in the QLC mode in the QLC flash memory array.
  • the storage controller may find a storage unit with more rewritable and rewritable times from the storage units included in the QLC area, and write the data to be written into the storage unit.
  • the storage unit in the QLC mode can not only meet the requirement of erasing and writing times of cold data with low write activity, but also minimize the cost of SSD and improve the resource utilization rate of the QLC flash memory array.
  • the space allocation of the storage cells in the SLC mode and the storage cells in the QLC mode can be adjusted within the range of the available capacity of the QLC flash memory array.
  • optimize the particle arrangement in the QLC flash memory array improve the versatility of the QLC flash memory array for different business scenarios, and ensure the business processing effect and the QLC flash memory array. storage performance. Further, by configuring the space allocation that matches the business scenario, the same performance can be shown as much as possible in the same business scenario, which effectively improves the user experience.
  • FIG. 4 exemplarily shows a schematic flowchart of another data processing method provided by an embodiment of the present application, and the method is applicable to a storage controller, such as the storage controller 210 shown in FIG. 1 .
  • the memory controller may perform data processing in a periodic manner, and the following takes one of the cycles as an example for description.
  • the method includes:
  • step 401 the storage controller determines hot data from the historical data according to the data tag of the historical data written into the QLC flash memory array.
  • the upper-layer APP or host divides data into metadata and user data in advance. Metadata belongs to hot data, while user data belongs to cold data.
  • the host sends data and corresponding data tags to the storage controller at the same time.
  • the storage controller finds that the data tag corresponding to the data is metadata, it can determine that the data is hot data, and if the data tag corresponding to the data is user data, it can determine that the data is cold data.
  • the storage controller can regard the data with the metadata tag as the hot data written to the QLC flash memory array in the period.
  • Step 402 the storage controller counts the total number of writes of hot data and the total number of writes of historical data, and uses the ratio of the total number of writes of hot data to the total number of writes of historical data as the heatness of historical data.
  • step 403 the storage controller uses the heat of historical data, the remaining space of the QLC flash memory array, and the allocation ratio between the SLC area and the QLC area to characterize the preset performance of the QLC flash memory array, and according to the user capacity consistency principle and the storage unit quantity consistency principle, The target allocation ratio between the SLC area and the QLC area that maximizes the preset performance is calculated.
  • the entire storage space of the SSD is divided into user space and redundant space, in this case:
  • the SLC area can also be composed of SLC user space and SLC redundant space.
  • SLC user space refers to the storage unit used to store user data in the storage unit configured in SLC mode
  • SLC redundant space refers to the storage unit configured in SLC mode.
  • the QLC area can also be composed of the QLC user space and the QLC redundant space.
  • the QLC user space refers to the storage unit used to store user data in the storage unit configured in the QLC mode
  • the QLC redundant space refers to the storage unit configured in the QLC mode.
  • the storage unit in the unit is used to implement the garbage collection function in the user data storage process of the QLC user space.
  • the SLC user space and the QLC user space uniformly constitute the user space in the SSD. These two parts of the user space are used to store the user data written to the SSD. Therefore, the user capacity presented by the SSD to the outside world is the SLC corresponding to the SLC user space.
  • the sum of the user capacity and the SLC user capacity corresponding to the QLC user space is the SLC user capacity corresponding to the SLC user space.
  • the SLC user capacity corresponding to the SLC user space is 4 bits
  • the QLC user capacity corresponding to the QLC user space is (4 ⁇ 3) bit
  • the externally presented user capacity of the SSD is 16 bits.
  • the SLC redundant space and the QLC redundant space uniformly constitute the redundant space in the SSD.
  • the redundancy capacity is the sum of the SLC redundancy capacity corresponding to the SLC redundancy space and the SLC redundancy capacity corresponding to the QLC redundancy space.
  • the SLC redundant capacity corresponding to the SLC redundant space is 2 bits
  • the QLC redundant capacity corresponding to the QLC redundant space is (4 ⁇ 1)bit
  • the redundant capacity in SSD is 6bit.
  • the allocation ratio between the SLC area and the QLC area includes the number of storage units corresponding to the SLC user space, the number of storage units corresponding to the SLC redundancy space, the number of storage units corresponding to the QLC user space, and the QLC redundancy.
  • the storage controller can first calculate the number of storage units corresponding to the SLC user space, the number of storage units corresponding to the SLC redundant space, and the number of storage units corresponding to the QLC user space according to the principle of user capacity consistency and the principle of consistency of the number of storage units.
  • the number of storage units corresponding to the redundant space, the number of storage units corresponding to the QLC user space, and the number of storage units corresponding to the QLC redundant space characterize the preset performance of the QLC flash memory array, and calculate the preset performance of the QLC flash memory array.
  • the number of storage units corresponding to the SLC user space with the maximum performance the number of storage units corresponding to the SLC redundant space, the number of storage units corresponding to the QLC user space, and the number of storage units corresponding to the QLC redundant space.
  • the second association relationship and then based on the first association relationship and the second association relationship, the number of target storage units corresponding to the SLC user space, the number of target storage units corresponding to the SLC redundant space, and the target storage unit corresponding to the QLC user space are parsed. number, and the number of target storage units corresponding to the QLC redundant space.
  • each storage unit in the QLC flash memory array is configured as QLC in the initial state, and the user space and the redundant space are both stored in units of storage units. It should be understood that the user space and the redundant space may also be in units of other indicators, such as storage unit blocks.
  • the relevant content of the storage unit block please refer to Embodiment 3, which will not be introduced here.
  • a dual-mode configuration table may also be set in the storage controller, and the dual-mode configuration table is used to record basic configuration information of the QLC flash memory array and allocation ratio configuration information before and after reconfiguration.
  • the basic configuration information of the QLC flash memory array may include: the initial QLC user space of the QLC flash memory array, the initial QLC redundant space of the QLC flash memory array, the initial DWPD of the QLC flash memory array, the theoretical rewritable times and lifespan of the QLC flash memory array, etc. .
  • the allocation ratio configuration information before reassignment includes: QLC user space before reassignment, QLC redundant space before reassignment, QLC space redundancy ratio before reassignment, write amplification of QLC space before reassignment, before reassignment
  • the allocation ratio configuration information after the reconfiguration includes: the QLC user space after the reconfiguration, the QLC redundancy space after the reconfiguration, the redundancy ratio of the QLC space after the reconfiguration, the write amplification of the QLC space after the reconfiguration, and the QLC space after the reconfiguration.
  • Table 1 exemplarily shows a schematic diagram of a dual-mode configuration table provided by an embodiment of the present application:
  • DWPD refers to the number of times the user can write to the full disk per day according to the user capacity presented by the SSD;
  • PE QLC refers to the theoretical rewritable times of the memory cells in QLC mode, generally about 1500 times;
  • PE SLC refers to the theoretical rewritable times of the memory cells in SLC mode, generally about 50,000 times;
  • the lifespan refers to the usable life of the QLC flash memory array according to the number of times the user can write to the entire disk DWPD 0 per day;
  • QLC 0 refers to the QLC area contained before the QLC flash array is reconfigured, including the QLC user space and the QLC redundant space;
  • QLC 1 refers to the QLC area included after the QLC flash array is reconfigured, including the QLC user space and the QLC redundant space;
  • SLC 1 refers to the SLC area included after the QLC flash array is reconfigured, including the SLC user space and the SLC redundant space;
  • the space redundancy ratio OP refers to the ratio of the number of storage units as redundant space and the number of storage units as user space;
  • Write Amplification WA(OP) refers to the extra data copy brought by SSD according to the characteristics of erasing before writing.
  • Write Amplification WA(OP) has a relationship with the space redundancy ratio OP, and the relationship can be determined by the art. Technicians set it according to experience, and it can also be obtained according to experimental verification.
  • the present application sets the relationship between the write amplification WA(OP) and the spatial redundancy ratio OP to satisfy the following formula (1.1) or the following formula (1.2):
  • W is the Lambertian W function, also known as the Omega function or the product logarithmic function.
  • M+N storage units are all configured in QLC mode, M storage units are used as QLC user space, and the remaining N storage units are used as QLC redundant space.
  • the space redundancy ratio is OP 1 .
  • the corresponding Write amplification is WA(OP 1 ).
  • A+B storage units in the M+N storage units are configured in QLC mode, A storage unit in the A+B QLC mode storage unit exists as user space, and the remaining B storage units As redundant space, the spatial redundancy ratio of the QLC area is OP 2 , and the corresponding write amplification is WA(OP 2 ); S+Q memory cells in M+N memory cells are configured in SLC mode, S+Q There are S storage units in the storage units in SLC mode as user space, and the remaining Q storage units as redundant space.
  • the space redundancy ratio of the SLC area is OP 3
  • the corresponding write amplification is WA(OP 3 ).
  • FIG. 5 exemplarily shows a division relationship diagram of a QLC flash memory array before and after reconfiguration, wherein, (a) in FIG. 5 illustrates the division relationship of each storage space in the QLC flash memory array before reconfiguration, and FIG. 5 (b) The figure shows the division relationship of each storage capacity in the QLC flash memory array before and after reconfiguration:
  • the number of storage cells included in the QLC flash memory array is the same whether before or after reallocation.
  • the configured SLC user space S and the reconfigured SLC redundant space Q satisfy the following formula (2.1):
  • the preset performance indicators of the QLC flash memory array may include any one or more indicators for measuring performance described in the above content, such as TBW indicators, PE times indicators, DWPD indicators, IOPS indicators or IOPS rand_4K indicators, etc.
  • the DWPD performance and IOPS rand_4K performance of the QLC flash memory array are the two bottleneck performances that affect the write capability of the QLC flash memory array at present, the following two aspects of the optimal DWPD indicator and the optimal IOPS rand_4K indicator are introduced to determine the target allocation ratio. specific implementation process.
  • the storage controller may also be provided with a write data volume configuration table, and the write data volume configuration table is used to record the daily actual data of each storage area (QLC area or SLC area). The amount of writable data and the amount of physically writable data.
  • Table 2 exemplarily shows a schematic diagram of a write data volume configuration table provided by an embodiment of the present application:
  • K 0 refers to the number of times a user can write to the full disk every day according to the user capacity before re-allocation
  • K 1 refers to the number of times that the user can write to the full disk every day according to the user capacity after reconfiguration
  • PE QLC0 refers to the remaining rewritable times of the storage unit in the QLC mode before reconfiguration
  • PE QLC1 refers to the remaining rewritable times of the QLC mode storage unit after reconfiguration
  • PE SLC1 refers to the remaining rewritable times of the memory cells in the SLC mode after reconfiguration
  • X refers to the popularity of historical data.
  • each QLC-mode storage unit can store 4 bits of data, the user capacity presented by the QLC flash memory array is 4M bits; The number of times of the entire disk is K 0 , so the amount of data that the user will write to the QLC flash memory array every day is K 0 * 4M bit; under the action of write amplification WA (OP 1 ), the QLC flash memory array can actually write daily
  • the amount of data is K 0 *4M*WA(OP 1 )bit; according to the remaining lifespan of the QLC flash memory array (assuming Y years, 365 days per year), the total data that the QLC flash memory array can actually write during the remaining lifespan The amount is K 0 *4M*WA(OP 1 )*Y*365bit;
  • each memory cell in QLC mode can store 4 bits of data, the theoretical amount of data that can be written once by the QLC flash memory array is 4 (M+N) bit; the remaining rewritable times PE QLC0 of the storage unit in the QLC mode before the reconfiguration, so the physically writable data volume of the QLC flash memory array is 4(M+N)*PE QLC0 bit;
  • the total amount of data that can actually be written by the QLC flash array during the remaining lifetime before reconfiguration should be the same as the amount of data that the QLC flash array can physically write.
  • the degree K 0 satisfies the following formula (2.3):
  • the user capacity presented by the QLC flash memory array is still 4M bits; the number of times the user writes to the entire disk per day according to the user capacity is K 1 , so the amount of data that the user writes to the QLC flash memory array every day is K 1 *4M bit; the QLC area after reconfiguration is only used to store cold data, and the heat calculated according to the historical data is X, then the coldness of the historical data (such as the writing frequency of cold data in the historical data) is 1-X, so the amount of data that the user writes to the QLC area every day is K 1 *4M*(1-X)bit; under the action of write amplification WA(OP 2 ), the QLC area can actually be written every day The amount of data is K 1 *4M*(1-X)*WA(OP 2 )bit; according to the remaining life of the QLC flash array (assuming Y years, 365 days per year), the QLC area actually The total amount of data that can be written is K 1 *4M*(1-
  • A+B memory cells in QLC mode in the QLC flash memory array There are A+B memory cells in QLC mode in the QLC flash memory array. Since each memory cell in QLC mode can store 4 bits of data, the theoretical amount of data that can be written once by erasing and writing in the QLC area is 4 (A+B) bits. ; The remaining rewritable times of the storage unit of the QLC mode after the reconfiguration is PE QLC1 (the type has not changed, it is still the same as the remaining rewritable times PE QLC0 of the storage unit of the QLC type before the reconfiguration), so the QLC area is physically The amount of data that can be written is 4(A+B)*PE QLC1 bit;
  • the total amount of data that can actually be written in the QLC area during the remaining lifetime after relocation needs to be less than the amount of data that can be written physically in the QLC area, that is, K 1 *4M*(1-X)*WA(OP 2 )* Y*365 ⁇ 4(A+B)*PE QLC1 , so the daily full disk write times K 1 calculated according to the QLC area after re-allocation satisfies the following formula (2.4):
  • the user capacity presented by the QLC flash memory array is still 4M bits; the number of times the user writes to the entire disk per day according to the user capacity is K 1 , so the amount of data that the user writes to the QLC flash memory array every day is K 1 *4M bit; the reconfigured SLC area is only used to store hot data, and the hotness calculated according to the historical data is X, so the amount of data written to the SLC area by the user every day is K 1 *4M*X bit ;Under the action of write amplification WA(OP 3 ), the daily amount of data that can be written in the SLC area is K 1 *4M*X*WA(OP 3 )bit; according to the remaining life of the QLC flash memory array (assuming Y years, there are 365 days per year), then the total amount of data that can actually be written in the SLC area during the remaining life period is K 1 *4M*X*WA(OP 3 )*Y*365bit;
  • S+Q memory cells in SLC mode in the QLC flash memory array There are S+Q memory cells in SLC mode in the QLC flash memory array. Since each memory cell in SLC mode can store 1 bit of data, the theoretical amount of data that can be written once by erasing and writing in the SLC area is (S+Q)bit; The remaining rewritable times of the SLC type storage unit after reassignment is PE SLC1 (type change can be calculated on the basis of the remaining rewritable times PE QLC0 of the QLC type storage unit before reassignment), so SLC The physical writable data volume of the area is (S+Q)*PE SLC1 bit;
  • the total amount of data that can actually be written in the SLC area during the remaining lifetime after reconfiguration needs to be smaller than the amount of data that can be written physically in the SLC area, that is, K 1 *4M*X*WA(OP 3 )*Y*365 ⁇ (S+Q)*PE SLC1 , so the daily full disk write times K 1 calculated according to the SLC area after reconfiguration satisfies the following formula (2.5):
  • the daily full disk write times K 1 after reconfiguration should be the QLC after reconfiguration
  • the maximum value of the daily full disk write times K 1 obtained by the region calculation and the daily full disk full times K 1 calculated by the SLC region after relocation, that is, the daily full disk full times K 1 after re-allocation satisfies The following formula (2.6):
  • the storage controller can calculate the write amplification WA(OP 2 ) and the write amplification WA(OP 3 ) according to the above formula (1.1) or (1.2), and can calculate the reconfigured QLC user space according to the above formula (2.1).
  • A the first association relationship between the reconfigured QLC redundant space B, the reconfigured SLC user space S, and the reconfigured SLC redundant space Q, the reconfiguration can be calculated according to the above formula (2.2)
  • the storage controller can find the A, B, S and Q that maximize the reconfigured DWPD (ie K 1 ) The value of , as the target allocation ratio of the SLC area and the QLC area.
  • the IOPS under random 4K is related to information such as the heat of historical data, the topology of the QLC flash memory array, the tR of the storage unit, the tProg of the storage unit, and the number of concurrent channels of the QLC flash memory array.
  • IOPS rand_4K can satisfy the following formula (3.1):
  • X is the heat of historical data
  • SLC perf is used to characterize the performance of the SLC area, which can be calculated from various parameters related to the performance of the SLC area, such as the following formula (3.2) can be satisfied:
  • DieNum refers to the number of concurrent channels of the QLC flash memory array; le6 refers to 10 6 ; a 1 is a constant less than 1, which is called the discount rate corresponding to the SLC area, considering that the performance of the SLC area may not be completely due to loss.
  • a discount ratio given by the play; GC Sr refers to an estimate of the average read delay required to move data for garbage collection operations in the SLC area; WA(OP 3 ) refers to the write amplification of the SLC area; ratio is Refers to the proportion occupied by data brushing due to limited system bandwidth; le3 refers to 10 3 .
  • QLC perf is used to characterize the performance of the QLC area, which can be calculated from various parameters related to the performance of the QLC area, such as the following formula (3.3):
  • a 2 is a constant less than 1, which is called the discount rate corresponding to the QLC area, which is a discount ratio given considering that the performance of the QLC area may not be fully exerted due to loss;
  • WA(OP 2 ) refers to the QLC area Region write amplification,
  • GC Qr is an estimate of the average read latency required for garbage collection operations in QLC regions to move data.
  • the storage controller can calculate the write amplification WA(OP 2 ) and the write amplification WA(OP 3 ) according to the above formula (1.1) or (1.2), and according to the above formula (2.1), the reconfigured QLC user space A,
  • the first association relationship between the reconfigured QLC redundant space B, the reconfigured SLC user space S, and the reconfigured SLC redundant space Q can be calculated according to the above formula (2.2) to obtain the reconfigured For the second association relationship between the QLC user space A and the reconfigured SLC user space S, the calculated write amplification WA(OP 2 ), write amplification WA(OP 3 ), the first association relationship, and the second association relationship , and the heat X of the historical data calculated in the above step 402 is substituted into the above formula (3.2), the storage controller can calculate the performance SLC perf of the SLC area, and the calculated write amplification WA (OP 2 ), write amplification WA After (OP 3 ), the first association relationship, the second association relationship, and the heat X of the historical data calculated in the above
  • the storage controller may further synthesize the two performance indicators to select a target allocation ratio that can make both performance indicators better.
  • Step 404 the storage controller determines whether the SLC area indicated in the target allocation ratio of the SLC area to the QLC area is larger than the current SLC area, if so, executes step 405, and if not, executes step 406.
  • Step 405 the storage controller reconfigures some of the storage cells in the QLC mode in the QLC flash memory array to the SLC mode according to the target allocation ratio between the SLC area and the QLC area.
  • the memory controller considering that the same data corresponds to different level states when the memory cells are configured in different modes (for example, "0" corresponds to the first voltage difference in the memory cells in the QLC mode, while in The memory cell in the SLC mode corresponds to the second voltage difference), therefore, if the memory cell mode is directly reconfigured under the condition that a large amount of data is stored in the memory cell, the memory controller also needs to simultaneously adjust the stored data in a short period of time. The voltage difference of a large amount of data increases the probability that the memory cell loses data.
  • the storage controller can also judge whether the storage unit of the QLC mode stores data, if there is data or stored data. If there is a large amount of data, the storage controller may not perform reconfiguration first, but wait for the data stored in the storage unit of the QLC type to be cleared (such as clearing or clearing parts), and then reconfigure the storage unit of the QLC mode as SLC mode to take into account the accuracy of data storage when reconfiguring the type of memory cells.
  • step 406 the storage controller maintains the current allocation ratio between the SLC area and the QLC area in the QLC flash memory array.
  • the space unit is a storage unit and the capacity unit is 4 bits.
  • the space is 2 means “including 2 storage units”
  • the capacity is 4" means “the capacity is 16 bits” .
  • the space unit and the capacity unit may also use other data measurement values, for example, the space unit may also be 50 storage units or 100 storage units, etc., and the capacity unit may also be 4MB or 8MB, etc. limited.
  • FIG. 6 exemplarily shows a schematic diagram of an optimization result provided by an embodiment of the present application , where (a) in Figure 6 shows the optimization results after optimizing the allocation ratio of the SLC area and the QLC area according to the optimal DWPD index scheme, and (b) in Figure 6 shows the situation when the DWPD remains unchanged.
  • the optimization results after optimizing the allocation ratio of the SLC area and the QLC area according to the optimal scheme of the IDPS rand_4K indicator Referring to (a) in Figure 6:
  • the write amplification WA of the QLC area is calculated to be 4.46; since all storage cells are in QLC mode, the hot data written to the QLC area accounts for 100% of the historical data, and the average write amplification of each area is That is, the write amplification of the QLC area is 4.46; the rewritable times PE of each QLC mode storage unit is 1500 times, and the theoretically writable data volume per erasing is 3207 user capacity (because a QLC type storage unit Stores 4bit data, which is exactly the sum of the capacity unit 4bit) and the redundant capacity 403, that is, 3207+403, so the theoretical writable data volume is the product of the number of erasable and rewritable times PE and the theoretically w
  • All storage units are divided into QLC mode and SLC mode.
  • the rewritable times of each storage unit in QLC mode are 1500 times, which are used to store cold data. Cold data accounts for 45% of historical data, while The rewritable times of each memory cell in SLC mode are 50,000 times, which are used to store hot data, and the hot data accounts for 55% of the historical data; based on the above formulas (1.1), (1.2), (2.1), (2.2) , and (2.6), it is calculated that the maximum allocation ratio of DWPD is: QLC user space is 3175, QLC redundant space is 265, SLC user space is 128, and SLC redundant space is 42.
  • the total space of QLC user space 3175, QLC redundant space 265, SLC user space 128 and SLC redundant space 42 is 3610, which conforms to the principle of consistency in the number of storage units;
  • the QLC user capacity is 3175, while the SLC user space is 3175.
  • the user capacity is 128/4 (because a storage unit in SLC mode only stores 1 bit of data, it needs to be divided by 4 to convert it into a capacity unit of 4 bits), so the sum of the QLC user capacity and the SLC user capacity can still remain 3207, which is in line with the user capacity Consistency principle.
  • the write amplification of the QLC area is 6.66.
  • the write amplification of the SLC area is calculated to be 2.22.
  • the stored cold data accounts for 45% of the historical data, and the hot data stored in the SLC region accounts for 55% of the historical data. Therefore, the average write amplification of each region after reconfiguration is 6.66 for the QLC region and 2.22 for the SLC region.
  • the amount of data entered is the sum of the user capacity and the redundant capacity, that is, 3175+295.
  • the number of write times PE is 50,000 times.
  • the theoretically writeable data volume in the SLC area is the sum of the user capacity and the redundant capacity, that is, 128/4+42/4.
  • the total write volume of the QLC flash memory array after reconfiguration is the sum of the theoretical writable volume of the QLC area of 5,205,000 and the theoretical writable volume of the SLC area of 2,125,000, that is, 7,330,000, which is 7,330,000.
  • the allocation ratio that maximizes IOPS rand_4K is calculated as: QLC user space is 3175, and QLC redundant space is 279, SLC user space is 128, SLC redundancy space is 28. Under this allocation ratio, the total space of QLC user space 3175, QLC redundant space 279, SLC user space 128 and SLC redundant space 28 is 3610, which conforms to the principle of consistency in the number of storage units; the QLC user capacity is 3175, while the SLC user space is 3175.
  • the user capacity is 128/4, so the sum of the QLC user capacity and the SLC user capacity can still be kept at 3207, which conforms to the principle of user capacity consistency.
  • the write amplification of the QLC area is 6.36
  • the write amplification of the SLC area is calculated to be 2.97 according to the SLC user capacity of 128/4 and the SLC redundancy capacity of 28/4.
  • the maximum IOPS rand_4K value is 39.04, which is 51.91 higher than the IOPS rand_4K value before the re-allocation of 25.70. %.
  • FIG. 7 exemplarily shows the performance change graph of the QLC flash memory array in this scenario, wherein:
  • Figure (a) in Figure 7 shows the curve of the DWPD performance changing with the SLC redundancy space, where the ordinate corresponds to the DWPD performance, the unit is thousand times, and the abscissa corresponds to the number of storage cells occupied by the SLC redundancy space .
  • the node line corresponds to the DWPD performance line before reconfiguration. Since there is only a QLC region before reconfiguration and the configuration remains unchanged, the DWPD performance is always consistent, about 200 times.
  • the solid line corresponds to the reconfigured DWPD performance line.
  • Figure (b) in Figure 7 shows the curve of the IOPS rand_4K performance changing with the SLC redundancy space, where the ordinate corresponds to the IOPS rand_4K performance in thousands, and the abscissa corresponds to the storage unit occupied by the SLC redundancy space quantity. It can be seen from the performance line of (b) in Figure 7 that when the SLC redundancy space gradually becomes larger, the IOPS rand_4K performance will also become larger and then smaller, and the peak point V 12 of the IOPS rand_4K performance corresponds to the SLC redundancy With the space configuration set to 28, the peak IOPS rand_4K performance is around 390400.
  • the storage controller can find the value of the SLC redundancy space that makes the DWPD performance reach the peak value V 11 from the graph (a) in FIG. 7 .
  • the storage controller can find the value of the SLC redundancy space that makes the IOPS rand_4K performance reach the peak value of V 12 from (b) in Figure 7.
  • the storage controller can find a solution that can not only make DWPD performance better but also IOPS from (a) in Figure 7 and (b) in Figure 7
  • the value of the SLC redundancy space with better performance of rand_4K such as a value in the interval R. It can be seen that, by optimizing the allocation ratio of SLC and QLC according to the data processing method in the second embodiment, the DWPD performance and the IOPS rand_4K performance can be basically the same. When the DWPD performance is better, the IOPS rand_4K performance is also better.
  • this solution can also set the preset performance of the QLC flash memory array according to the business scenario to calculate the allocation ratio that best meets the current business scenario, thus helping to improve the QLC flash memory array's ability to match various business scenarios.
  • FIG. 8 exemplarily shows a schematic flowchart of another data processing method provided by an embodiment of the present application, and the method is applicable to a storage controller, such as the storage controller 210 shown in FIG. 1 .
  • the method includes:
  • Step 801 the storage controller detects the number of storage units included in the QLC flash memory array:
  • step 802 is performed;
  • step 803 is executed.
  • Step 802 the storage controller divides the storage cells included in the QLC flash memory array into at least two storage cell blocks, and each storage cell block in the at least two storage cell blocks includes at least two storage cells.
  • the storage controller may perform block processing on the storage units when the number of storage units is large. By dividing a large number of storage units into a small number of storage unit blocks, it is convenient for the storage controller to follow Data processing is performed based on fewer memory cell blocks, instead of data processing based on a large number of memory cells, thereby helping to reduce the working pressure of the storage controller.
  • the storage controller may divide the storage units in various ways. For example, any location and any number of storage units may be divided into one storage unit block according to a random algorithm, or a fixed number of adjacent storage units may be divided into one block of storage units. It is divided into one storage unit block, etc., which is not specifically limited.
  • each row of memory cells may be divided into a memory cell block. For example, continuing to refer to FIG.
  • the memory controller can divide these 1000 memory cells into memory cell block 1 to memory cell block 10
  • the 10 memory cell blocks wherein the memory cell block 1 includes 100 memory cells D 11 ⁇ D 1100 located in the first row, and the memory cell block 2 includes 100 memory cells D 21 ⁇ D 2100 located in the second row.
  • the memory cell block 10 includes 100 memory cells D 101 to D 10100 located in the 10th row.
  • the storage controller can directly count the number of writes of the storage unit block where the row of storage units is located based on the bus messages connected to each row of storage units, thereby improving the flexibility and convenience of the count.
  • Step 803 the storage controller treats each storage unit as a storage unit block.
  • the storage controller can directly perform data processing based on the storage unit without performing block operation.
  • "taking the storage unit as a storage unit block” is only for the convenience of introducing the data processing scheme by taking "storage unit block” as an example below, and the storage controller does not actually perform block operation. That is to say, when the number of storage units is not greater than the preset number threshold, the storage controller can process each storage unit in the manner described below, and the following "storage unit block" can be directly replaced with " storage unit".
  • Step 804 the storage controller counts in real time the total write times of data written to the QLC flash memory array and the write times of each storage unit block.
  • the storage controller may also maintain a dual-mode statistics table, and the dual-mode statistics table includes parameters such as the total number of writes of the QLC flash memory array and the number of writes of each storage unit block. and the corresponding values of these parameters.
  • the dual-mode statistics table includes parameters such as the total number of writes of the QLC flash memory array and the number of writes of each storage unit block. and the corresponding values of these parameters.
  • Table 3 exemplarily shows a schematic diagram of a dual-mode statistical table. As shown in Table 3, it is assumed that there are a total of 10 storage unit blocks from storage unit block 1 to storage unit block 10 as introduced in the above step 802. The following five data are written into these 10 memory cell blocks: the first write is to write to memory cells D 11 to D 1100 in memory cell block 1 and memory cells D 61 to D 6100 in memory cell block 6 respectively "1" is entered, the second write is to write "0" to the memory cells D 11 to D 1100 in the memory cell block 1 and the memory cells D 21 to D 2100 of the memory cell block 2, respectively, and the third write "1" is written into the memory cells D 11 to D 1100 in the memory cell block 1 respectively, and the fourth write is to the memory cells D 11 to D 1100 in the memory cell block 1 and the memory cells in the memory cell block 6 Each memory cell in cells D 61 to D 6100 is written with "0" respectively, and the fifth write operation is performed to memory cells D 21 to D 2100 in memory cell block 2 and
  • the total number of writes in the five write operations is 900, the number of writes of the memory cell block 1 where the memory cells D 11 to D 1100 are located is 400, and the number of writes of the memory cell block 2 where the memory cells D 21 to D 2100 are located is 400.
  • the number of times of writing is 300, the number of times of writing in the memory cell block 6 where the memory cells D 61 to D 6100 are located is 200, and the number of times of writing in other memory cells is 0.
  • the total number of writes of the QLC flash memory array is updated to 900
  • the total number of writes of the storage unit 1 is updated to 400
  • the total number of writes of the storage unit 2 is updated to 400.
  • the total write times are updated to 200
  • the total write times of the storage unit 6 are updated to 300
  • the total write times of other storage units are still 0.
  • step 805 the storage controller determines whether the reconfiguration condition is currently satisfied, and if it is satisfied, the execution of step 806 is performed, and if not, the execution of step 804 is continued.
  • the reconfiguration conditions may include that the total number of writes to the QLC flash memory array is greater than the preset number of writes, the total write duration is greater than the preset write duration, or the total write data volume is greater than the preset write data volume, etc. , other conditions may also be included, which are not specifically limited.
  • the reconfiguration condition as the total number of writes of the QLC flash memory array is greater than or equal to 3/5PE as an example, if all the QLC flash memory arrays are in the QLC area before the reconfiguration, and the PE of the QLC area is 1500, then 900 is exactly equal to 3/5PE, Indicates that the conditions for reconfiguring the storage area are currently met, and the storage controller can start the reconfiguration process.
  • Step 806 the storage controller obtains the first K storage unit blocks obtained by sorting the number of writes from more to less from at least two storage unit blocks, and the number of writes of each storage unit block in the previous K storage unit blocks is taken as The preset times of the heat data are divided, and K heat degrees corresponding to the K preset times are calculated.
  • K is a positive integer greater than or equal to 2.
  • K may be a fixed value set by those skilled in the art based on experience, or may be a variable value having a correlation with the total number of storage unit blocks, such as 20% of the total number of storage unit blocks.
  • the storage controller can also select different numbers of storage unit blocks to perform hot data division operations based on different business scenarios, which helps to make the hot data division result better match the current business Scenes.
  • the storage controller may acquire the top K storage unit blocks with the most writes from the at least two storage unit blocks in various manners. For example:
  • the storage controller may first find the top K storage unit blocks with the largest number of writes from at least two storage unit blocks according to an unsorted TOP_K algorithm, and then select the top K storage unit blocks with the most writes according to the number of writes. Sort the found K storage unit blocks in the order of more to less (or from less to more), and the number of writes of the storage unit blocks located in the front in the sorted sequence is more than that of the storage unit blocks located at the back. After that, the storage controller can sequentially take the writing times of each storage unit block in the sequence as the preset times of dividing hot data in order from front to back, and execute the subsequent allocation ratio calculation process. This method first roughly finds the first K storage unit blocks and then performs precise sorting, which can complete the sorting based on a smaller amount of data, which helps to save the processing resources of the storage controller;
  • the storage controller may first use a sorting algorithm to sort all the storage unit blocks according to the number of writes in descending order, and then select from all the sorted storage unit blocks according to The first K storage unit blocks obtained by sorting from most to least or the last K storage unit blocks obtained by sorting from less to more, then the storage controller can follow the writing times of these K storage unit blocks from more to less.
  • the number of writes of each storage unit block is sequentially used as the preset number of times for dividing hot data, and the subsequent allocation ratio calculation process is performed. This method can directly obtain the sorted K storage unit blocks through a sorting algorithm, which can effectively save the processing steps of the storage controller.
  • the sorting algorithm may be the TOP_K algorithm, or may be the bubble algorithm or other algorithms, etc., which is not limited in the present application.
  • the storage controller will first find the eligible storage unit block 1 and storage unit block 1 from storage unit block 1 to storage unit block 10 according to the sorting algorithm.
  • the number of writes of storage unit block 1 is 400
  • the number of writes of storage unit block 2 is 300.
  • the storage controller will analyze the storage unit 1 and the storage unit 2 in turn:
  • the storage controller will use the number of writes of the storage unit block 1 to be 400 as the preset number of times to divide the hot data, that is, the data written in the storage unit block with the number of writes greater than or equal to 400 is regarded as the hot data, The data written in the storage unit block whose number of writes is less than 400 is regarded as cold data.
  • the storage controller will use the number of writes of the storage unit block 2 as the preset number of times to divide the hot data, that is, the data written in the storage unit block with the number of writes greater than or equal to 300 as the hot data,
  • the data written in the storage unit block whose number of writes is less than 300 is regarded as cold data.
  • Step 807 the storage controller uses the K heats, the remaining space of the QLC flash memory array, and the allocation ratio of the SLC area to the QLC area to characterize the preset performance of the QLC flash memory array.
  • the user capacity consistency principle and the storage unit quantity consistency principle Calculate the K allocation ratios of the SLC area and the QLC area that maximize the preset performance, and use the allocation ratio of the K allocation ratios of the SLC area to the QLC area with the largest preset performance as the target allocation of the SLC area and the QLC area Proportion.
  • step 807 for the calculation process of the allocation ratio of the SLC area and the QLC area corresponding to each heat level, please refer to the above step 403 for details, which will not be repeated in this application.
  • Step 808 the storage controller determines whether the SLC area indicated by the target allocation ratio is larger than the current SLC area, if so, executes step 809, and if not, executes step 810.
  • Step 809 The storage controller reconfigures some of the storage cells in the QLC mode in the QLC flash memory array to the SLC mode according to the target allocation ratio of the SLC area to the QLC area.
  • step 810 the storage controller maintains the current allocation ratio between the SLC area and the QLC area in the QLC flash memory array.
  • the space unit is the storage unit block
  • the capacity unit is the bit occupied by the storage unit block in the SLC mode.
  • the space is 2 means “including 2 memory cell blocks”
  • the capacity is 4" means “the capacity is 4 bits occupied by the memory cell blocks in SLC mode”.
  • the space unit and the capacity unit may also use other data metric values, for example, the space unit may also be a storage unit, etc., and the capacity unit may also be 4MB or 8MB, etc., which are not specifically limited.
  • the storage controller divides storage unit blocks based on logical addresses (logical block addresses, LBAs), and the command information included in a data processing request may include command information for one LBA, or command information for multiple LBAs, There is also no specific limitation on this.
  • QLC user space is 3397
  • QLC redundant space is 404
  • total space is 3801
  • user capacity is QLC user capacity 3397*4 (ie 13588)
  • redundant capacity It is the QLC redundancy capacity of 404*4 (ie 2828)
  • the redundancy ratio of the QLC area is about 11.89% (ie 404/3397).
  • All storage units are divided into QLC mode and SLC mode.
  • the rewritable times of each QLC mode storage unit are 1500 times, which are used to store cold data. Cold data occupies 32% of historical data, while The rewritable times of each memory cell in SLC mode are 50,000 times, which are used to store hot data, and the hot data occupies 68% of the historical data; based on the above formulas (1.1), (1.2), (2.1), (2.2) , and (2.6), it is calculated that the maximum allocation ratio of DWPD is: QLC user space is 3363, QLC redundant space is 235, SLC user space is 136, and SLC redundant space is 67.
  • the total space of QLC user space 3363, QLC redundant space 235, SLC user space 136 and SLC redundant space 67 is 3801, which conforms to the principle of consistency in the number of storage units; the QLC user capacity is 3363*4, While the SLC user capacity is 136, the sum of the QLC user capacity and the SLC user capacity of 3363*4+136 remains at 13588, which conforms to the principle of user capacity consistency.
  • the redundancy ratio of the QLC area is about 6.99% (ie 235/3363). After substituting the redundancy ratio into the above formula (1.1), the write amplification of the QLC area is calculated. WA is about 8.74.
  • the redundancy ratio of the SLC area is calculated to be about 49.26%.
  • the write amplification WA of the SLC area is calculated to be about 1.93.
  • the calculated DWPD 1 after reassignment is about 0.311, which is about 0.311 compared to the DWPD 0 before the reassignment ( 0.184) by about 87.3%.
  • the rewritable times PE of each storage unit in QLC mode is 1500 times
  • the theoretically writable amount of data that can be written once in the QLC area is the sum of the user capacity of 3363*4 and the redundant capacity of 235*4. Therefore,
  • the actual daily writable data volume of the QLC area is the number of times of erasing and writing per day DWPD 1 (about 0.311), the user capacity of the QLC flash memory array (3397*4), the proportion of cold data occupying historical data (32%) and QLC
  • the rewritable times PE of each storage unit in SLC mode is 50,000 times.
  • the theoretically writable amount of data that can be written once in the SLC area is the sum of the user capacity of 136 and the redundant capacity of 67.
  • the actual daily writable data volume of the SLC area is the daily rewritable times DWPD 1 (about 0.311), the user capacity of the QLC flash array (3397*4), the proportion of hot data in historical data (68%), and SLC
  • Table 5 exemplarily shows a schematic table of configuration results obtained by performing data processing in a fixed configuration manner. It is assumed that the fixed configuration sets the SLC user space to account for 1% of the total user space, and the SLC redundant space to account for 20% of the total redundant space. , then refer to Table 5:
  • the QLC flash memory array has the following fixed configuration: the QLC area includes 3363 memory cell blocks in QLC mode as user space and 274 memory cell blocks in QLC mode as redundant space, so the redundancy ratio of the QLC area is about 8.15% (ie 274/3363), after substituting the redundancy ratio into the above formula (1.1), the write amplification WA of the QLC area is calculated to be about 7.65; the SLC area includes 136 SLC mode storage unit blocks as user space, and 28 SLC modes The storage unit block is used as the redundant space, so the redundancy ratio of the SLC area is about 20.59% (ie 28/136).
  • the write amplification WA of the SLC area is calculated to be about is 3.57; after substituting the write amplification of the QLC area (about 7.65) and the write amplification of the SLC area (about 3.57) into the above formula (2.3), the DWPD 2 of the fixed configuration is calculated to be about 0.136.
  • this fixed configuration method not only cannot improve the DWPD performance of the QLC flash memory array, but also reduces the DWPD performance.
  • the rewritable times PE of each storage unit in QLC mode are 1500 times
  • the theoretically writable data volume of one QLC area erasing and rewriting is the user capacity of 3363*4 and the redundant capacity of 274*
  • the actual daily writable data volume of the QLC area is the number of times of erasing and writing per day DWPD 2 (about 0.136), the user capacity of the QLC flash memory array (3397*4), the proportion of cold data in historical data (32%) and the QLC
  • the rewritable times PE of each storage unit in SLC mode is 50,000 times.
  • the theoretically writable amount of data that can be written once in the SLC area is the sum of the user capacity of 136 and the redundant capacity of 28.
  • the actual daily writable data volume of the SLC area is the daily rewritable times DWPD 2 (about 0.136), the user capacity of the QLC flash memory array (3397*4), the proportion of hot data in historical data (68%) and SLC
  • the reconfigured DWPD performance (about 0.311) is at least 2.3 times better than the fixed configuration DWPD performance (about 0.136).
  • the calculation workload can be effectively reduced and the optimization efficiency can be improved.
  • the hot data is divided based on the number of writes of different storage unit blocks, and the optimal configuration is calculated under each division basis, and finally the optimal configuration under each division basis is selected as the final target configuration, not only The configuration with the best performance can be found in the case of unknown data types, and it can also be better applied to the current business scenario.
  • the storage controller 210 may include a heat sensing module 211 and an optimization decision-making module 212.
  • the heat-sensing module 211 is connected to the host 100 and the optimization decision module 212 respectively, and the optimization decision Module 212 is also connected to QLC flash array 220 .
  • the operation steps of recognizing the hot and cold data and calculating the heat of the historical data in the above-mentioned Embodiments 1 to 3 can be specifically performed by the heat-sensing module 211, such as step 301 in the above-mentioned Embodiment 1, and the above-mentioned embodiments. Steps 401 and 402 in the second, and steps 804 to 806 in the third embodiment above.
  • the heat sensing module 211 After the heat sensing module 211 recognizes the heat data and the heat, it can notify the optimization decision module 212 of the heat, so that the optimization decision module 212 decides the optimal allocation ratio based on the heat, and the storage controller 210 is configured according to the allocation ratio.
  • Each memory cell in the QLC flash memory array 220 That is to say, the operation steps related to the allocation ratio of the decision target in the above-mentioned first embodiment to third embodiment may be specifically executed by the optimization decision-making module 212, such as step 302 in the above-mentioned embodiment 1, and steps 403 and 404 in the above-mentioned embodiment 2. , and steps 807 to 808 in the third embodiment.
  • each component in the storage controller 210 refers to functional components, and these components may be configured as separate devices, or implemented in one device, or may be configured in at least two devices in any combination. , this application does not specifically limit it.
  • the above-mentioned embodiments of the present application only take the mixed configuration of the QLC mode and the SLC mode as an example to describe the manner of determining the allocation ratio.
  • This solution can also be applied to any other two or more particle mixing configurations, such as mixing QLC mode and TLC mode, or mixing QLC mode and MLC mode, or mixing QLC mode, TLC mode and SLC mode, etc. This application This is not specifically limited.
  • the medium of the QLC flash memory array in the storage system may be SSD particles or any other storage medium in subsequent development, which is not limited in this application.
  • FIG. 9 is a schematic structural diagram of a memory controller provided by an embodiment of the present application.
  • the memory controller may be a chip or a circuit, such as a chip or a circuit that may be provided in a memory.
  • the storage controller 900 may include a processor 901 and a storage interface 902 coupled to the processor 901, and the processor 901 and the storage interface 902 may be specifically coupled through a bus system.
  • Storage interface 902 is also used to couple to the QLC flash memory array.
  • the processor 901 may implement, through the storage interface 902, any one of the foregoing embodiments 1 to 3 or the method executed by the storage controller in any of the foregoing solutions in FIG. 1 to FIG. 8 .
  • the processor 901 can detect the heat of the historical data of the QLC flash memory array through the storage interface 902, and adaptively adjust the configuration in the QLC flash memory array according to the heat of the historical data of the QLC flash memory array and the remaining space of the QLC flash memory array Space allocation for memory cells in QLC mode and memory cells configured in SLC mode.
  • the storage units configured in the SLC mode in the QLC flash memory array are used for storing hot data, and the storage units configured in the QLC mode in the QLC flash memory array are used for storing cold data.
  • the above-mentioned processor 901 may be a chip.
  • the processor 901 may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), or a system on chip (SoC). It can be a central processing unit (CPU), a network processor (NP), a digital signal processing circuit (DSP), or a microcontroller (microcontroller). unit, MCU), it can also be a programmable logic device (PLD) or other integrated chips.
  • FPGA field programmable gate array
  • ASIC application specific integrated circuit
  • SoC system on chip
  • SoC system on chip
  • SoC system on chip
  • MCU microcontroller
  • MCU programmable logic device
  • PLD programmable logic device
  • each step of the above-mentioned method may be completed by an integrated logic circuit of hardware in the processor 901 or an instruction in the form of software.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware processor, or executed by a combination of hardware and software modules in the processor 901 .
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the QLC flash memory array, and the processor 901 reads the information in the QLC flash memory array, and completes the steps of the above method in combination with its hardware.
  • processor 901 in this embodiment of the present application may be an integrated circuit chip, which has a signal processing capability.
  • each step of the above method embodiment may be completed by a hardware integrated logic circuit in a processor or an instruction in the form of software.
  • the aforementioned processors may be general purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components .
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGAs field programmable gate arrays
  • the methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the methods disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software module may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.
  • the memory in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be random access memory (RAM), which acts as an external cache.
  • RAM random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous DRAM
  • SDRAM double data rate synchronous dynamic random access memory
  • ESDRAM enhanced synchronous dynamic random access memory
  • SLDRAM synchronous link dynamic random access memory
  • direct rambus RAM direct rambus RAM
  • the present application also provides a computer program product, the computer program product includes: computer program code, when the computer program code is run on a computer, the computer is made to execute the steps shown in FIGS. 1 to 8 .
  • the present application further provides a computer-readable storage medium, where the computer-readable medium stores program codes, when the program codes are executed on a computer, the computer is made to execute FIGS. 1 to 8 .
  • the storage medium may be any available medium that the computer can access, such as SSD, PCM, and the like.
  • the present application further provides a data processing system, where the data processing system includes the host described in any one of the foregoing contents, a storage controller, and a QLC flash memory array.
  • the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory 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 memory result in an article of manufacture comprising instruction means, the instructions
  • the apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

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)
  • Read Only Memory (AREA)

Abstract

一种数据处理方法、装置及系统,用以优化QLC闪存阵列的颗粒排布方式。其中方法包括:存储控制器检测QLC闪存阵列的历史数据的热度,根据该热度及QLC闪存阵列的剩余空间,自适应地调整QLC闪存阵列中配置为QLC模式的存储单元与配置为单层式存储单元SLC模式的存储单元的空间分配,配置为SLC模式的存储单元用于存储热数据,配置为QLC模式的存储单元用于存储冷数据。该方案能在不超过QLC闪存阵列的剩余空间的情况下使空间分配更加匹配当前的业务场景,以优化QLC闪存阵列中的颗粒排布方式,提高QLC闪存阵列对不同业务场景的通用性,保障业务处理效果和QLC闪存阵列的存储性能。

Description

一种数据处理方法、装置及系统 技术领域
本申请涉及计算机技术领域,尤其涉及一种数据处理方法、装置及系统。
背景技术
随着存储技术的不断发展,以快闪记忆体(NAND Flash)为存储介质的固态硬盘(solid state drive,SSD)逐渐成为主流存储形态。通常,SSD会包含多个NAND Flash颗粒。多个NAND Flash颗粒可以配置为单层式存储单元(single-level cell,SLC)模式或四层式存储单元(single-level cell,QLC)模式的单一形态,也可以配置为SLC模式与QLC模式的混合形态。混合形态下的SSD既能兼顾到QLC模式所具有的高存储密度与低成本的优点,又能结合SLC模式所具有的快写入速度与高刷写次数的优点,因此成为目前最常用的SSD配置方式。
现有技术中,在混合形态下的SSD中,SLC模式的NAND Flash颗粒与QLC模式的NAND Flash颗粒会由生产商在出厂SSD之前进行预配置,如将作为SLC模式的NAND Flash颗粒和作为QLC模式的NAND Flash颗粒各配置为50%。在这种情况下,一旦SSD出厂,SSD中作为SLC模式的NAND Flash颗粒与作为QLC模式的NAND Flash颗粒就无法再更改,导致SSD只能使用固定的SLC-QLC分配空间执行数据存储业务。然而,不同的业务场景可能会需要不同的SLC-QLC分配空间,现有技术中的这种固定分配方式显然无法满足不同业务场景的需求,导致SSD的通用性较差。更甚者,使用不合适的SLC-QLC分配空间执行数据存储业务,不仅会影响到数据存储业务的处理效果,还会影响到SSD自身的存储性能。
因此,如何针对SSD内的颗粒排布方式进行优化,以提高SSD的通用性,从而保障业务处理效果和SSD的存储性能,成为目前亟需解决的一个问题。
发明内容
本申请提供一种数据处理方法、装置及系统,通过使用QLC闪存阵列的历史数据的热度和剩余空间自适应地调整QLC闪存阵列中的SLC模式的存储单元与QLC模式的存储单元的空间分配,以便优化SSD内的颗粒排布方式,能提高SSD的通用性,保障业务处理效果和SSD的存储性能。
第一方面,本申请提供一种数据处理方法,该方法可以可由存储控制器实现,该存储控制器例如可以为SSD中的存储控制器。该方法可以包括:存储控制器检测QLC闪存阵列的历史数据的热度,根据历史数据的热度及QLC闪存阵列的剩余空间,自适应地调整QLC闪存阵列中配置为QLC模式的存储单元与配置为SLC模式的存储单元的空间分配。其中,QLC闪存阵列中配置为SLC模式的存储单元用于存储热数据,QLC闪存阵列中配置为QLC模式的存储单元用于存储冷数据。
在上述方案中,QLC闪存阵列的历史数据的热度能表征QLC闪存阵列当前所处的业务场景,而QLC闪存阵列的剩余空间能用于表征QLC闪存阵列的剩余能力,该方案基于QLC闪存阵列的历史数据的热度以及QLC闪存阵列的剩余空间调整SLC模式的存储单元 与QLC模式的存储单元的空间分配,能在不超过QLC闪存阵列的剩余能力的情况下使空间分配更加匹配当前的业务场景,以提高QLC闪存阵列对不同业务场景的通用性,保障业务处理效果和QLC闪存阵列的存储性能。更进一步的,通过使用低擦写次数但低成本的QLC模式的存储单元服务于低写入频率的冷数据,使用高擦写次数的SLC模式的存储单元服务于高写入频率的冷数据,还能在充分利用各种模式的存储单元的性能的情况下,兼顾降低QLC闪存阵列的成本。其中,以SSD为例,SSD中的每个NAND Flash存储颗粒可以对应为QLC闪存阵列中的一个存储单元,通过调整配置为QLC模式的NAND Flash存储颗粒的数量与配置为SLC模式的NAND Flash存储颗粒的数量,还能优化SSD中的颗粒排布方式。
在一种可能的设计中,存储控制器可以通过如下任一方式检测QLC闪存阵列的历史数据的热度:
方式一,存储控制器可以将历史数据中具有热数据标签的历史数据作为热数据,之后综合历史数据的写入次数得到历史数据的总写入次数,综合具有热数据标签的历史数据的写入次数得到热数据的总写入次数,然后根据历史数据的总写入次数和热数据的总写入次数,确定历史数据的热度。通过在写入数据时携带数据对应的冷热标签,有助于使存储控制器直接按照历史数据的标签检测热度,而无需再额外识别冷热,有效提高处理效率。
方式二,QLC闪存阵列中的存储单元可以被划分为N个存储单元块,N个存储单元块中的每个存储单元块中包括至少一个存储单元,N为大于或等于2的正整数。在这种情况下,存储控制器可以先统计历史数据写入每个存储单元块的写入次数,然后将N个存储单元块中写入次数大于预设次数的存储单元块作为热数据所写入的目标存储单元块,之后综合历史数据的写入次数得到历史数据的总写入次数,并综合目标存储单元块的写入次数得到热数据的总写入次数,根据历史数据的总写入次数和热数据的总写入次数,确定历史数据的热度。更进一步的,通过在存储单元数量较多的情况下对存储单元进行分块处理,便于存储控制器后续基于较少的存储单元块进行数据处理,有助于减轻存储控制器的工作压力。通过统计历史数据写入存储单元的次数,能在未知数据类型的情况下识别历史数据的冷热,该种识别结果参照真实数据写入情况,从而能更匹配真实的业务场景。
在上述方式二的一种可能的设计中,存储控制器可以先从N个存储单元块中获取写入次数从多到少排序得到的前K个存储单元块,再分别以前K个存储单元块中的每个存储单元块的写入次数为预设次数,计算得到K个历史数据的热度。之后根据K个历史数据的热度和QLC闪存阵列的剩余空间,计算出K个历史数据的热度分别对应的K个备选空间分配,使用K个备选空间分配中使QLC闪存阵列的预设性能达到最大的目标备选空间分配,调整QLC闪存阵列中配置为QLC模式的存储单元和配置为QLC模式的存储单元。如此,通过以不同存储单元块的写入次数为基准划分热数据,并在每个划分依据下计算得到最优配置,最后选择各个划分依据下的最优配置作为最终的目标配置,有助于在未知数据类型的情况下找到性能最好的配置,提高空间分配对当前的业务场景的适应能力。
在一种可能的设计中,空间分配可以包括QLC空间和SLC空间,QLC空间用于指示配置为QLC模式的存储单元的数量,SLC空间用于指示配置为SLC模式的存储单元的数量。在这种情况下,存储控制器根据QLC闪存阵列的历史数据的热度及QLC闪存阵列的剩余空间,自适应地调整QLC闪存阵列中配置为QLC模式的存储单元与配置为单层式存储单元SLC模式的存储单元的空间分配,包括:存储控制器先使用QLC闪存阵列的历史 数据的热度、QLC闪存阵列的剩余空间、QLC空间和SLC空间表征QLC闪存阵列的预设性能,再按照用户容量一致性原则及存储单元数量一致性原则,确定出使QLC闪存阵列的预设性能达到最大的QLC空间的取值和SLC空间的取值,根据QLC空间的取值和SLC空间的取值,调整QLC闪存阵列中的各存储单元的模式。其中,用户容量为用户能看到的QLC闪存阵列的可写入数据量。如此,通过遵循用户容量一致性原则来计算空间分配,能使存储控制器呈现给用户的容量始终保持一致,而不是一个变化的值,有助于提高用户的写入体验。更进一步的,该方案还能根据业务场景设置QLC闪存阵列的预设性能,以计算出最满足当前业务场景的分配比例,因此还有助于提高QLC闪存阵列对各种业务场景的匹配能力。
在一种可能的设计中,QLC空间中可以包括QLC用户空间和QLC冗余空间,SLC空间中可以包括SLC用户空间和SLC冗余空间,其中,QLC用户空间用于指示配置为用户空间的QLC模式的存储单元的数量,QLC冗余空间用于指示配置为冗余空间的QLC模式的存储单元的数量,SLC用户空间用于指示配置为用户空间的SLC模式的存储单元的数量,SLC冗余空间用于指示配置为冗余空间的SLC模式的存储单元的数量。在这种情况下,存储控制器按照用户容量一致性原则及存储单元数量一致性原则,确定出使QLC闪存阵列的预设性能达到最大的QLC空间的取值和SLC空间的取值,包括:存储控制器根据用户容量一致性原则及存储单元数量一致性原则,计算得到QLC用户空间、QLC冗余空间、SLC用户空间和SLC冗余空间之间的第一关联关系,再计算出使QLC闪存阵列的预设性能达到最大的QLC用户空间、QLC冗余空间、SLC用户空间和SLC冗余空间之间的第二关联关系,之后基于第一关联关系和第二关联关系,确定出QLC用户空间的取值、QLC冗余空间的取值、SLC用户空间的取值和SLC冗余空间的取值。该设计还考虑到用于实现用户数据存储的用户空间及为实现用户数据存储所需执行的垃圾回收的冗余空间,有助于从QLC用户空间、QLC冗余空间、SLC用户空间和SLC冗余空间的更细粒度上调整空间分配。
在一种可能的设计中,QLC闪存阵列的预设性能包括QLC闪存阵列的每日全盘写满次数DWPD性能和/或QLC闪存阵列的每秒写入数量IOPS性能,以解决QLC闪存阵列目前存在的DWPD性能瓶颈和IOPS性能瓶颈,尽量提高QLC闪存阵列的存储能力。
在一种可能的设计中,QLC闪存阵列的剩余空间可以包括QLC闪存阵列的剩余可擦写次数、QLC闪存阵列的写放大、QLC闪存阵列的单日可写入数据量、以及QLC闪存阵列的剩余可写入数据量中的一项或多项。通过参照全面的剩余空间参数分配空间,有助于使分配结果更满足QLC闪存阵列的剩余可用存储性能。
在一种可能的设计中,存储控制器自适应地调整QLC闪存阵列中配置为QLC模式的存储单元与配置为单层式存储单元SLC模式的存储单元的空间分配,包括:若空间分配指示配置的SLC模式的存储单元的数量大于QLC闪存阵列中SLC模式的存储单元的当前数量,说明现阶段的SLC模式的存储单元不足以存储热数据,因此存储控制器可以将QLC闪存阵列中的部分或全部QLC模式的存储单元配置为SLC模式,以提高QLC闪存阵列存储热数据的能力。若空间分配中指示配置的SLC模式的存储单元的数量不大于QLC闪存阵中SLC模式的存储单元的当前数量,则存储控制器可以不更改QLC闪存阵列中的各存储单元的当前模式,以避免重配QLC模式的存储单元为SLC模式后已到SLC模式的存储单元的可擦写次数极限所导致的存储单元不可用的现象,提高QLC闪存阵列的可用性。
第二方面,本申请提供一种存储控制器,包括处理器以及耦合至处理器的存储接口,存储接口用于耦合至四层式存储单元QLC闪存阵列。其中,处理器用于:检测QLC闪存阵列的历史数据的热度,根据QLC闪存阵列的历史数据的热度及QLC闪存阵列的剩余空间,自适应地调整QLC闪存阵列中配置为QLC模式的存储单元与配置为单层式存储单元SLC模式的存储单元的空间分配。其中,QLC闪存阵列中配置为SLC模式的存储单元用于存储热数据,QLC闪存阵列中配置为QLC模式的存储单元用于存储冷数据。
在一种可能的设计中,处理器可以通过如下任一方式检测QLC闪存阵列的历史数据的热度:
方式一,处理器可以将历史数据中具有热数据标签的历史数据作为热数据,之后综合历史数据的写入次数得到历史数据的总写入次数,综合具有热数据标签的历史数据的写入次数得到热数据的总写入次数,然后根据历史数据的总写入次数和热数据的总写入次数,确定历史数据的热度。
方式二,QLC闪存阵列中的存储单元划分为N个存储单元块,N个存储单元块中的每个存储单元块中包括至少一个存储单元,N为大于或等于2的正整数。在这种情况下,处理器具体用于:先统计历史数据写入每个存储单元块的写入次数,再将N个存储单元块中写入次数大于预设次数的存储单元块作为热数据所写入的目标存储单元块,之后综合历史数据的写入次数得到历史数据的总写入次数,综合目标存储单元块的写入次数得到热数据的总写入次数,根据历史数据的总写入次数和热数据的总写入次数,确定历史数据的热度。
在方式二的一种可能的设计中,处理器还用于:从N个存储单元块中获取写入次数从多到少排序得到的前K个存储单元块,以前K个存储单元块中的每个存储单元块的写入次数为预设次数,计算得到K个历史数据的热度,根据K个历史数据的热度和QLC闪存阵列的剩余空间,计算出K个历史数据的热度分别对应的K个备选空间分配,使用K个备选空间分配中使QLC闪存阵列的预设性能达到最大的目标备选空间分配,调整QLC闪存阵列中配置为QLC模式的存储单元和配置为QLC模式的存储单元。
在一种可能的设计中,空间分配可以包括QLC空间和SLC空间,QLC空间指示配置为QLC模式的存储单元的数量,SLC空间指示配置为SLC模式的存储单元的数量。在这种情况下,处理器具体用于:先使用QLC闪存阵列的历史数据的热度、QLC闪存阵列的剩余空间、QLC空间和SLC空间表征QLC闪存阵列的预设性能,再按照用户容量一致性原则及存储单元数量一致性原则,确定出使QLC闪存阵列的预设性能达到最大的QLC空间的取值和SLC空间的取值,最后根据QLC空间的取值和SLC空间的取值,调整QLC闪存阵列中的各存储单元的模式。其中,用户容量为用户能看到的QLC闪存阵列的可写入数据量。
在一种可能的设计中,QLC空间中包括QLC用户空间和QLC冗余空间,SLC空间中包括SLC用户空间和SLC冗余空间,QLC用户空间指示配置为用户空间的QLC模式的存储单元的数量,QLC冗余空间指示配置为冗余空间的QLC模式的存储单元的数量,SLC用户空间指示配置为用户空间的SLC模式的存储单元的数量,SLC冗余空间指示配置为冗余空间的SLC模式的存储单元的数量。在这种情况下,处理器具体用于:先根据用户容量一致性原则及存储单元数量一致性原则,计算得到QLC用户空间、QLC冗余空间、SLC用户空间和SLC冗余空间之间的第一关联关系,再计算出使QLC闪存阵列的预设性能达到最大的QLC用户空间、QLC冗余空间、SLC用户空间和SLC冗余空间之间的第二关联 关系,之后基于第一关联关系和第二关联关系,确定出QLC用户空间的取值、QLC冗余空间的取值、SLC用户空间的取值和SLC冗余空间的取值。
在一种可能的设计中,QLC闪存阵列的预设性能可以包括QLC闪存阵列的每日全盘写满次数DWPD性能和/或QLC闪存阵列的每秒写入数量IOPS性能。
在一种可能的设计中,QLC闪存阵列的剩余空间可以包括QLC闪存阵列的剩余可擦写次数、QLC闪存阵列的写放大、QLC闪存阵列的单日可写入数据量、以及QLC闪存阵列的剩余可写入数据量中的一项或多项。
在一种可能的设计中,处理器具体用于:若空间分配指示配置的SLC模式的存储单元的数量大于QLC闪存阵列中SLC模式的存储单元的当前数量,则可以将QLC闪存阵列中的部分或全部QLC模式的存储单元配置为SLC模式,若空间分配中指示配置的SLC模式的存储单元的数量不大于QLC闪存阵中SLC模式的存储单元的当前数量,则不更改QLC闪存阵列中的各存储单元的当前模式。
在一种可能的设计中,存储控制器可以为固态存储设备SSD中的存储控制器,存储单元为快闪NAND闪存颗粒。
第三方面,本申请提供一种存储控制器,包括热度感知模块和优化决策模块,热度感知模块和优化决策模块分别连接QLC闪存阵列。热度感知模块用于检测QLC闪存阵列的历史数据的热度,优化决策模块用于根据QLC闪存阵列的历史数据的热度及QLC闪存阵列的剩余空间,自适应地调整QLC闪存阵列中配置为QLC模式的存储单元与配置为单层式存储单元SLC模式的存储单元的空间分配。其中,QLC闪存阵列中配置为SLC模式的存储单元用于存储热数据,QLC闪存阵列中配置为QLC模式的存储单元用于存储冷数据。
在一种可能的设计中,热度感知模块可以通过如下任一方式检测QLC闪存阵列的历史数据的热度:
方式一,热度感知模块可以将历史数据中具有热数据标签的历史数据作为热数据,之后综合历史数据的写入次数得到历史数据的总写入次数,综合具有热数据标签的历史数据的写入次数得到热数据的总写入次数,然后根据历史数据的总写入次数和热数据的总写入次数,确定历史数据的热度。
方式二,QLC闪存阵列中的存储单元划分为N个存储单元块,N个存储单元块中的每个存储单元块中包括至少一个存储单元,N为大于或等于2的正整数。在这种情况下,热度感知模块可以先统计历史数据写入每个存储单元块的写入次数,再将N个存储单元块中写入次数大于预设次数的存储单元块作为热数据所写入的目标存储单元块,之后综合历史数据的写入次数得到历史数据的总写入次数,综合目标存储单元块的写入次数得到热数据的总写入次数,根据历史数据的总写入次数和热数据的总写入次数,确定历史数据的热度。
在方式二的一种可能的设计中,热度感知模块还可以从N个存储单元块中获取写入次数从多到少排序得到的前K个存储单元块,以前K个存储单元块中的每个存储单元块的写入次数为预设次数,计算得到K个历史数据的热度。优化决策模块还可以根据K个历史数据的热度和QLC闪存阵列的剩余空间,计算出K个历史数据的热度分别对应的K个备选空间分配,使用K个备选空间分配中使QLC闪存阵列的预设性能达到最大的目标备选空间分配,调整QLC闪存阵列中配置为QLC模式的存储单元和配置为QLC模式的存储单元。
在一种可能的设计中,空间分配可以包括QLC空间和SLC空间,QLC空间指示配置 为QLC模式的存储单元的数量,SLC空间指示配置为SLC模式的存储单元的数量。在这种情况下,优化决策模块具体用于:先使用QLC闪存阵列的历史数据的热度、QLC闪存阵列的剩余空间、QLC空间和SLC空间表征QLC闪存阵列的预设性能,再按照用户容量一致性原则及存储单元数量一致性原则,确定出使QLC闪存阵列的预设性能达到最大的QLC空间的取值和SLC空间的取值,最后根据QLC空间的取值和SLC空间的取值,调整QLC闪存阵列中的各存储单元的模式。其中,用户容量为用户能看到的QLC闪存阵列的可写入数据量。
在一种可能的设计中,QLC空间中包括QLC用户空间和QLC冗余空间,SLC空间中包括SLC用户空间和SLC冗余空间,QLC用户空间指示配置为用户空间的QLC模式的存储单元的数量,QLC冗余空间指示配置为冗余空间的QLC模式的存储单元的数量,SLC用户空间指示配置为用户空间的SLC模式的存储单元的数量,SLC冗余空间指示配置为冗余空间的SLC模式的存储单元的数量。在这种情况下,优化决策模块具体用于:先根据用户容量一致性原则及存储单元数量一致性原则,计算得到QLC用户空间、QLC冗余空间、SLC用户空间和SLC冗余空间之间的第一关联关系,再计算出使QLC闪存阵列的预设性能达到最大的QLC用户空间、QLC冗余空间、SLC用户空间和SLC冗余空间之间的第二关联关系,之后基于第一关联关系和第二关联关系,确定出QLC用户空间的取值、QLC冗余空间的取值、SLC用户空间的取值和SLC冗余空间的取值。
在一种可能的设计中,QLC闪存阵列的预设性能可以包括QLC闪存阵列的每日全盘写满次数DWPD性能和/或QLC闪存阵列的每秒写入数量IOPS性能。
在一种可能的设计中,QLC闪存阵列的剩余空间可以包括QLC闪存阵列的剩余可擦写次数、QLC闪存阵列的写放大、QLC闪存阵列的单日可写入数据量、以及QLC闪存阵列的剩余可写入数据量中的一项或多项。
在一种可能的设计中,优化决策模块具体用于:若空间分配指示配置的SLC模式的存储单元的数量大于QLC闪存阵列中SLC模式的存储单元的当前数量,则可以将QLC闪存阵列中的部分或全部QLC模式的存储单元配置为SLC模式,若空间分配中指示配置的SLC模式的存储单元的数量不大于QLC闪存阵中SLC模式的存储单元的当前数量,则不更改QLC闪存阵列中的各存储单元的当前模式。
在一种可能的设计中,存储控制器可以为固态存储设备SSD中的存储控制器,存储单元为快闪NAND闪存颗粒。
第四方面,本申请提供一种存储器,包括QLC闪存阵列以及如上述第二方面或第三方面中任一项所述的存储控制器,其中,存储控制器用于读写QLC闪存阵列中的数据。
第五方面,本申请提供一种数据处理系统,包括主机以及如上述第四方面任一项所述的存储器,其中,主机用于向存储器发送数据处理请求,存储器被配置为执行存储的指令,存储器通过执行指令来实现如上述第一方面任一项所述的数据处理方法。
第六方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当计算机程序在计算机上运行时,使得计算机执行如上述第一方面中任一项所述的数据处理方法。
第七方面,本申请提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如上述第一方面中任一项所述的数据处理方法。
上述第二方面至第七方面中的各项设计所对应的有益效果,具体请参照上述第一方面 中的各项设计所对应的有益效果,此处不再一一重复赘述。
附图说明
图1示例性示出本申请实施例适用的一种系统架构示意图;
图2示例性示出一种数据处理方法的执行流程图;
图3示例性示出本申请实施例提供的一种数据处理方法的流程示意图;
图4示例性示出本申请实施例提供的另一种数据处理方法的流程示意图;
图5示例性示出一种重配前后的QLC闪存阵列划分关系图;
图6示例性示出本申请实施例提供的一种优化结果示意图;
图7示例性示出本申请实施例提供的一种QLC闪存阵列的性能变化曲线图;
图8示例性示出本申请实施例提供的又一种数据处理方法的流程示意图;
图9示例性示出本申请实施例提供的一种存储控制器的结构示意图。
具体实施方式
本申请中的数据处理方案可以适用于具有数据存储功能的设备,例如可以适用于只具有数据存储功能的存储设备,如存储器,也可以适用于具有数据存储功能且还具有其它功能的电子设备。在本申请一些实施例中,数据处理装置可以是一个独立的单元,该单元可以嵌入在电子设备中,并能对该电子设备的存储器进行读写控制。在本申请另一些实施例中,数据处理装置也可以是封装在电子设备内部的单元,用于实现该电子设备的存储器的数据存储功能。电子设备可以是包含诸如个人数字助理和/或音乐播放器等功能的便携式电子设备,诸如手机、平板电脑、具备无线通讯功能的可穿戴设备(如智能手表)、或车载设备等。便携式电子设备的示例性实施例包括但不限于搭载
Figure PCTCN2021074558-appb-000001
或者其它操作系统的便携式电子设备。上述便携式电子设备也可以是诸如具有触敏表面(例如触控面板)的膝上型计算机(Laptop)等。还应当理解的是,在本申请其他一些实施例中,上述电子设备也可以是具有触敏表面(例如触控面板)的台式计算机。
示例性地,存储器可以是易失性存储器,也可以是非易失性存储器,或可包括易失性和非易失性存储器两者。还可以是由这些易失性存储器或非易失性存储器所构成的硬盘,如SSD。其中,易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。应注意,本申请描述的存储器旨在包括但不限于这些和任意其它适合类型的存储器。
下面将结合附图对本申请作进一步地详细描述。需要说明的是,在本申请的描述中“至 少一个”是指一个或多个,其中,多个是指两个或两个以上。鉴于此,本发明实施例中也可以将“多个”理解为“至少两个”。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,字符“/”,如无特殊说明,一般表示前后关联对象是一种“或”的关系。
为便于理解,下文将以存储器为SSD为例进行介绍。应理解,下文中所出现的“SSD”也可以替换为与SSD具有相似特性的任一其它存储器,如铁电存储器(ferroelectric memory,FeM)、相变存储器(phase change memory,PCM)、磁性随机存取存储器(magnetic memory,MM)或阻变存储器(resistive memory,ReM)等,本申请对此不做限定。
图1示例性示出本申请实施例适用的一种系统架构示意图,如图1所示,该系统架构中包括主机100和SSD 200,SSD 200可以包括存储控制器210和闪存阵列220。闪存阵列220也可以称为磁盘阵列(redundant arrays of independent disks,RAID)。主机100与存储控制器210之间、以及存储控制器210与闪存阵列220之间可以如图1所示的通过总线连接,也可以通过互连或其它方式连接,以实现通信。其中,闪存阵列220是由多个存储单元(即NAND Flash颗粒)按照行列方式排列而成,如图1中的闪存阵列220共包括按照M行N列排列而成的M×N个存储单元(M、N均为正整数),从M行上来看:D 11~D 1N这N个存储单元并列于第一行,D 21~D 2N这N个存储单元并列于第二行,……,D M1~D MN这N个存储单元并列于第M行。从N列上来看:D 11~D M1这M个存储单元并排于第一列,D 12~D M2这M个存储单元并排于第二列,……,D 1N~D MN这N个存储单元并排于第N列。位于同一行上的N个存储单元还通过同一总线连通至存储控制器210。
在实施中,主机100用于与上层的应用程序(application,APP)进行交互,获取APP下发的输入/输出(input/output,I/O)接口命令,并实时向存储控制器210发送对应的数据处理请求。数据处理请求中携带有待读写的数据。存储控制器210按照内部的预设逻辑为待读写的数据分配目标地址,并译码出该目标地址在闪存阵列220中所在的目标行和目标列,然后通过与各行存储单元之间的总线开启该目标行并关闭其它行,之后在开启的目标行中找到位于目标列处的目标存储单元,以执行读写操作。
需要说明的是,图1中所示出的各部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现,在此不予赘述。
先示例性介绍下本申请的下列实施例所涉及到的部分术语:
(1)冷数据和热数据。
在实际业务场景中,由于对不同的数据的写入频率不同,导致不同的数据还具有不同的“冷热”程度。“冷”和“热”属于一个相对概念,相对于其它数据而言较“热”的数据称为热数据,而相对其它数据而言较“冷”的数据称为冷数据。热数据的写入频率要高于冷数据的写入频率。判断一个数据到底属于冷数据还是热数据,不仅与该数据的写入频率相关,还与实际所处的业务场景相关。例如,针对于同一写入频率的数据,如果在某一业务场景下该写入频率比其它大部分数据的写入频率小,则该数据在该业务场景下可以被划归为冷数据,而如果在另一业务场景下该写入频率比其它大部分数据的写入频率大,则该数据在另一业务场景下则可以被划归为热数据。
(2)、存储单元的模式。
存储单元(cell)为NAND Flash颗粒的最小存储单位。根据存储密度的不同,一个存储单元可以被配置为如下模式的一种:
单层式存储单元(single-level cell,SLC),具有单层电子结构,存储密度为1bit/cell(其中,bit为数据量单位,即比特),即每个SLC模式的存储单元中可以存放1bit的数据。SLC模式的存储单元可存储的数据量较少,因此该存储单元在写入数据时所受的电压冲击也较小,存储单元能具有较长的编程和擦除(program and erase,PE)寿命。一般来说,SLC模式的存储单元的理论可擦写次数能达到10万次甚至更多。然而,如果要实现大容量的存储功能,则SSD中势必要配置大量SLC模式的存储单元,导致SSD的成本较高。
双层式存储单元(multi-level cell,MLC),基于高低电压不同而构建的双层电子结构,存储密度为2bit/cell,即每个MLC模式的存储单元中可以存放2bit的数据。MLC模式的存储单元也具有较长的PE寿命,如理论可擦写次数位于3000-5000次之间,其成本相对较高。
三层式存储单元(trinary-level cell,TLC),目前主流的闪存颗粒,是基于MLC模式的存储单元延伸而成的三层电子结构,存储密度为3bit/cell,即每个TLC模式的存储单元中可以存放3bit的数据。TLC模式的存储单元容量理论上是MLC模式的存储单元容量的1.5倍,且能具有更低的成本,但PE寿命相对也更低,如理论可擦写次数位于1000-3000次之间。
四层式存储单元(quad-level cell,QLC),是基于TLC模式的存储单元延伸而成的四层电子结构,存储密度为4bit/cell,即每个QLC模式的存储单元可以存放4bit的数据。QLC模式的存储单元容量比TLC模式的存储单元容量更高,成本也更低,但其PE寿命更短,如理论可擦写次数仅1500次左右。
(3)SSD的存储空间与SSD的存储容量。
本申请实施例中的SSD具有先擦除才能再写入的特性。与该特性相对应的,SSD的存储空间可以划分为用户空间和冗余空间,SSD的存储容量可以划分为用户容量和冗余容量。其中,用户空间是指用于存储用户数据的空间,冗余空间是指为实现该用户空间的写入操作而额外开辟出来的空间。用户容量是指SSD对外呈现给用户的全盘写满数据量,而冗余容量则是指为实现用户容量所对应的全盘写满操作而额外开辟出来的冗余空间所对应的数据量。举例来说,当用户容量为10兆(MByte,MB)时,用户理论上可以一次向SSD中写入10MB数据,然而,如果SSD中当前已经有1MB的用户容量中写了其它数据,则要实现该次全盘写满的操作,控制器还需要先将用户空间中已经写入的1MB的垃圾数据迁移到冗余空间,在执行完该垃圾回收(garbage collection,GC)操作以清空用户空间之后,再将用户本次写入的10MB数据写入用户空间。SSD的这种先擦除才能再写入的特性会带来额外的数据拷贝,称为写放大(write amplification,WA)。WA可以基于冗余空间与用户空间的比值以及其它一些参数计算得到。当WA越大时,SSD中的额外数据拷贝操作就越多,导致SSD中的各存储单元的可用擦写次数就越少,SSD的寿命缩短。因此,SSD中需要尽量降低WA。
(4)衡量SSD性能的指标。
本申请实施例中,衡量SSD的存储性能好坏的指标可以包括但不限于:
总写入字节数(total byte write,TBW),是指在SSD的寿命期间内SSD可支持的最大写入数据量;
PE次数,是指存储单元(或SSD)的可擦写次数,每编程(即写入)一次或擦除一次存储单元,则该存储单元(或SSD)的PE次数就减少一次;
每日全盘写满次数(disk write per day,DWPD),是指在SSD的寿命期间内用户每天可以把SDD的用户空间写满的次数;
每秒写入次数(input operations per second,IOPS),是指在写入固定数据量的文件时每秒可写入的文件数量;
IOPS rand_4K,是指在写入随机4KB的文件时每秒可写入的文件数量。
其中,SSD的各性能指标之间还会具有一定的关联,例如PE次数可以由TBW除以用户容量所得到的值(即寿命期间内总共可写满的次数)来进行表征,DWPD可以由TBW除以用户容量所得到的值再除以寿命期间所对应的总天数来进行表征,也可以由PE次数除以寿命期间所对应的总天数来进行表征。
需要说明的是,上述只是简单地列出常用的几种SSD性能衡量指标,SSD还可以具有其它性能衡量指标,本申请对此不作具体限定。
现阶段,由于QLC模式的存储单元支持以较低成本设置较高TBW的存储空间,因此目前已逐渐取代SLC模式的存储单元或磁盘驱动器(hard disk drive,HDD)等来设置闪存阵列,即闪存阵列中的全部存储单元均配置为QLC模式,闪存阵列也称为QLC闪存阵列。然而,相比于SLC模式的存储单元来说,QLC模式的存储单元会具有更低的PE次数(QLC模式的存储单元约1500次,而SLC模式的存储单元可达到50000次)、更低的DWPD(QLC模式的存储单元约为200次,而TLC模式的存储单元可达到1000次)和更低的IOPS(尤其是4KB IOPS,QLC模式的存储单元的4KB IOPS约为18K~35K,而TLC模式的存储单元可达到125K,QLC模式的存储单元的4KB IOPS仅为SLC模式的存储单元的1/7,已成为QLC闪存阵列设置中的一个性能瓶颈)。因此,纯QLC模式的QLC闪存阵列的配置方式显然也会降低到SSD自身的DWPD性能和IOPS性能。基于此,考虑到SSD的TBW需求、QLC模式的存储单元的低成本以及SLC模式的存储单元的高PE、高DWPD和高IOPS,还可以将QLC闪存阵列中的部分QLC模式的存储单元切换为SLC模式。如此,虽然SLC模式的存储单元的存储密度只为QLC模式的存储单元的存储密度的3/4,但是SLC模式的存储单元的PE却为QLC模式的存储单元的PE的50000/1500,这使得切换之后的QLC闪存阵列实际上比切换之前的QLC闪存阵列容纳更多的数据量,从而切换之后的SSD的TBW实际比切换之前的SSD的TBW更高。且,切换之后的SSD还能利用SLC模式的存储单元在读操作典型时延(time of read,tR)与写操作典型时延(time of program,tProg)等方面的优势,进一步提高SSD自身的DWPD性能和IOPS性能,在一定程度上解决纯QLC闪存阵列配置方式所存在的DWPD较低和IOPS rand_4K较低的技术问题。
为了实现切换之后的SSD的数据处理,业内提出了两种解决方案,如图2所示:
方案一:
如图2中的(a)图所示,在该方案中,SSD不对外呈现用户容量,且SSD中的SLC区域(即配置为SLC模式的存储单元所在的区域)设置为缓存(cache)区域。SSD中的存储控制器会先将待写入数据写入到SLC区域,然后再从SLC区域下刷到QLC区域(即配置为QLC模式的存储单元所在的区域)。且,在下刷数据时,QLC区域会先利用自己的冗余空间进行垃圾回收,再将下刷数据写入自己的用户空间。采用该方案,由于SLC模式的存储单元具有较快的写入速度,因此SSD能在短时间内实现大带宽和高IOPS。然而,随着写入时间的变长,SLC区域中写入的数据量相应增多,如果大量数据被积压在SLC区域中未来得及下刷到QLC区域中,则会导致SSD的对外容量和TBW直线下降。在SLC 区域写满时,如果继续写入数据,甚至会引发断崖式的性能跌落。
方案二:
如图2中的(b)图所示,在该方案中,SSD中的SLC区域设置为闪存(disk)区域。SSD中的存储控制器会先按照冷热识别机制确定出待写入数据的冷热类型,然后将冷数据写入QLC区域,将热数据写入SLC区域。且,在写入数据时,SLC区域会先利用自己的冗余空间进行垃圾回收,再将待写入的热数据写入自己的用户空间。相应地,QLC区域也会先利用自己的冗余空间进行垃圾回收,再将待写入的冷数据写入自己的用户空间。SLC区域与QLC区域各自的数据不流通。相比于方案一来说,方案二中使用互不流通的SLC区域和QLC区域分别存储热数据和冷数据,能为用户提高较为稳定的带宽和IOPS,虽然该性能不如方案一中刚开始写入SLC区域时的性能高,但却比方案一中经过长时间写入后的性能要高,从而更加符合大容量SSD的稳定性需求。
本申请的下列实施例基于方案二中的数据处理方法进行介绍。
现阶段,生产商通常会根据自己对SSD未来所应用的业务场景的理解,自行为QLC闪存阵列中的SLC模式的存储单元与QLC模式的存储单元分配空间,以使SSD出厂后该QLC闪存阵列中的该空间分配能够适应于所对应的业务场景。但是,用户在实际操作中不可能只使用SSD来处理一种业务。当SSD切换到另一业务场景时,其内部配置的这种固定空间分配的方式不仅无法在新的业务场景下实现提升SSD相关存储性能的目的,甚至还可能会不如采用纯QLC模式的QLC闪存阵列进行数据存储时的性能好。
为使SSD能适应更多的业务场景,在一种可选地实施方式中,存储控制器可以实时监控SLC区域和QLC区域中的每个区域的数据写入次数,并根据每个区域的数据写入次数和每个区域的理论可擦写次数确定出每个区域的已写入程度。当这两个区域的已写入程度基本相同时,说明这两个区域的剩余写入能力也较为均衡,因此存储控制器可以不调节这两个区域的分配比例。当这两个区域的已写入程度相差较大时,说明存在某一区域的剩余写入能力非常差,该区域磨损较为严重,因此,存储控制器可以增加当前磨损较为严重的区域所占的比例,并降低磨损较轻的另一区域所占的比例,以尽量均衡各个区域的剩余写入能力。然而,这种方式是在两个区域的剩余写入能力出现偏差以后才开始调节分配比例,实际上属于一种后反馈方式,即使后续为剩余写入能力较差的区域分配了新的存储单元,该区域中之前所存在的各存储单元的性能也已经产生了不可逆的伤害。在后反馈延时较长的情况下,已经磨损的这些存储单元甚至还会出现不可用的现象(如理论可擦写次数都已用完),降低SSD的整体性能。且,该实施方式只基于两个区域的剩余写入能力来调整分配比例,而并没有考虑到用户容量是否一致的问题,因此调整后的SSD中的用户容量很可能与调整之前的SSD中的用户容量不同,导致SSD对外呈现的用户容量不断变化,影响用户的写入体验。此外,该实施方式只要出现剩余写入能力不均衡的现象就会调节空间分配,而没有考虑到任何与所处理的业务相关的因素,随着空间分配的调整,每个区域中的WA也会相应发生变化,导致SSD在处理同一业务时的性能表现差异较大。
有鉴于此,本申请提出一种数据处理方法,用以根据历史数据的热度和QLC闪存阵列的剩余空间自适应地调整QLC闪存阵列中的QLC模式的存储单元和SLC模式的存储单元的分配空间,以在避免磨损的情况下提高QLC闪存阵列与业务场景的匹配程度,在同一业务场景下尽量表现出相同的性能,并进而实现对外呈现的用户容量的一致性。
下面通过具体的实施例来介绍本申请中的数据处理方法的具体实现过程。
【实施例一】
图3示例性示出本申请实施例提供的一种数据处理方法的流程示意图,该方法适用于控制器,如图1所示意的存储控制器210。如图3所示,该方法包括:
步骤301,存储控制器检测QLC闪存阵列的历史数据的热度。
在一种可选地实施方式中,存储控制器可以根据一段时间内写入QLC闪存阵列的历史数据,确定其历史数据的热度。其中,一段时间可以是指如下任一时段:
当存储控制器按照周期方式执行数据处理时,一段时间可以是指一个周期的周期时段。在这种情况下,存储控制器每隔一个固定的时间间隔就可以根据当前的数据写入情况以及QLC闪存阵列的剩余空间重配QLC闪存阵列中的各存储单元的分区,以避免QLC闪存阵列出现性能极度恶化的现象;
当存储控制器按照不同的业务类型执行数据处理时,一段时间可以是指自一个业务的开始执行时刻至结束执行时刻之间的整个时段。在这种情况下,存储控制器在每开始执行一个新的业务之前,都可以先根据待执行业务的特性和QLC闪存阵列的剩余空间重配QLC闪存阵列中的各存储单元的分区,以提高QLC闪存阵列适应待执行业务的能力;
当存储控制器根据已写入次数执行数据处理时,一段时间可以是指自开始统计写入次数的时刻至所统计的写入次数大于预设写入次数的时刻之间的时段。其中,预设写入次数可以是本领域技术人员根据经验设置的固定值,也可以是与QLC闪存阵列的剩余可擦写次数具有相关关系的某个值,如剩余可擦写次数的1/6。如此,存储控制器能在QLC闪存阵列的剩余可擦写次数每达到一个明显的变化程度时就重配一次存储单元,如通过配置更多的存储单元为SLC模式以提高QLC闪存阵列的可擦写次数,尽量延缓QLC闪存阵列的剩余可擦写次数恶化的倾向;
当存储控制器根据已写入数据量执行数据处理时,一段时间可以是指自开始统计写入数据量的时刻至所统计的写入数据量大于预设写入数据量的时刻之间的时段。其中,预设写入数据量可以是本领域技术人员根据经验设置的固定值,也可以是与QLC闪存阵列的剩余可写入数据量具有相关关系的某个值,如剩余可写入数据量的1/3。如此,存储控制器能在QLC闪存阵列的剩余可写入数据量每达到一个明显的变化程度时就重配一次存储单元,如通过配置更多的存储单元为SLC模式来增加可擦写次数的方式提高QLC闪存阵列的可写入数据量,尽量延缓QLC闪存阵列的剩余可写入数据量恶化的倾向。
应理解,上述只是示例性地给出几种重配空间的判决条件。在其它示例中,还可以使用其它判决条件来决定何时重配空间,本申请对此不作具体限定。
本申请实施例中,历史数据的热度用于表征历史数据中的热数据的写入活跃程度。历史数据的热度越大,说明热数据的写入活跃程度越高,热数据越频繁地写入存储单元。历史数据的热度越小,说明热数据的写入活跃程度越低,热数据越不频繁地写入存储单元。在一种可选地实施方式中,历史数据的热度可以根据历史数据的总写入次数和历史数据中的热数据的总写入次数来确定,例如可以直接将历史数据中的热数据的总写入次数与历史数据的总写入次数的比值作为历史数据的热度,也可以将历史数据中的热数据的总写入次数与历史数据中的冷数据的总写入次数的差值和历史数据的总写入次数的比值作为历史数据的热度等。其中,历史数据的总写入次数和历史数据中的热数据的总写入次数可以由存储控制器在每次执行写入时进行实时统计,也可以由存储控制器在判决出要重配空间时 基于一段时间内的全部历史数据进行集中统计,具体不作限定。
关于存储控制器如何识别一个历史数据为热数据还是冷数据的具体实现方式,请参照下列实施例二和实施例三,此次先不作介绍。
步骤302,存储控制器根据QLC闪存阵列的历史数据的热度及剩余空间,自适应地调整QLC闪存阵列中配置为QLC模式的存储单元与配置为SLC模式的存储单元的空间分配。
在上述步骤302中,存储控制器可以先根据QLC闪存阵列的历史数据的热度及剩余空间,确定出QLC闪存阵列中的SLC区域与QLC区域的目标分配,再按照该目标分配调整各存储单元的模式。其中,SLC区域是指被配置为SLC模式的存储单元所占的区域,QLC闪存阵列中被配置为SLC模式的存储单元用于存储热数据。QLC区域是指被配置为QLC模式的存储单元所占的区域,QLC闪存阵列中被配置为QLC模式的存储单元用于存储冷数据。
本申请实施例中,存储控制器可以通过多种方式确定SLC区域与QLC区域的目标分配,示例性介绍两种可能的实现方式:
在一种可能的实现方式中,历史数据的热度越高,说明热数据在前一段时间内写入QLC闪存阵列的次数越频繁,意味着热数据在未来一段时间内也很可能会频繁地写入QLC闪存阵列。在这种情况下,如果QLC闪存阵列中现有的SLC区域的剩余空间(如剩余可写入次数、或剩余可写入数据容量)越弱,说明QLC闪存阵列中现有的SLC模式的存储单元很可能无法承担后续频繁的热数据写入业务。因此,存储控制器可以将部分QLC模式的存储单元配置为SLC模式,以提供更多的存储单元来存储热数据,提高QLC闪存阵列对未来业务的支撑能力。对应的,历史数据的热度越低,说明热数据在前一段时间内写入QLC闪存阵列的次数越不频繁。在这种情况下,如果QLC闪存阵列中现有的SLC区域的剩余空间(如剩余可写入次数、或剩余可写入数据容量)越强,说明QLC闪存阵列中现有的SLC模式的存储单元可能还比较空闲,现有的SLC区域足够支持后续的业务。因此,存储控制器可以维持当前配置,或者将部分SLC模式的存储单元配置为QLC模式,以提供更多的存储单元来存储冷数据。
在另一种可能的实现方式中,存储控制器还可以使用QLC闪存阵列的历史数据的热度、QLC闪存阵列的剩余空间、以及SLC区域与QLC区域的分配比例来表征当前业务场景所关心的预设性能指标,进而通过枚举或其它计算方式找到能使当前业务场景所关心的预设性能指标达到较好效果的SLC区域与QLC区域的目标分配比例,以提高QLC闪存阵列满足不同业务需求的能力。其中,存储控制器在计算时还可以遵循某些原则,如用户容量一致性原则或存储单元数量一致性原则等。
在一种可选地实施方式中,考虑到SLC模式的存储单元的理论可擦写次数远大于QLC模式的存储单元的理论可擦写次数,因此存储控制器可以按照如下方式重配存储单元:
当目标分配比例指示要配置的SLC区域大于SLC的当前区域时,说明现阶段的SLC模式的存储单元不够,还要将部分或全部QLC模式的存储单元配置为SLC模式。在这种情况下,存储控制器可以从QLC的当前区域中找到已擦写次数较多的QLC模式的存储单元以重配为SLC模式。如此,已擦写次数较多的QLC模式的存储单元重配为SLC模式后所对应的剩余可擦写次数相应变大,而留下的已擦写次数较少的QLC模式的存储单元也能具有较多的剩余可擦写次数,无论是QLC区域的寿命还是SLC区域的寿命,都能得到较好地维持;
当目标分配比例指示要配置的SLC区域小于SLC的当前区域时,说明现阶段的QLC模式的存储单元不够,还要将部分或全部SLC模式的存储单元配置为QLC模式。然而,SLC模式的存储单元的理论可擦写次数远大于QLC模式的存储单元的理论可擦写次数,因此,如果待重配的SLC模式的存储单元本身已经擦写的次数就超过了QLC模式的理论可擦写次数,则该重配操作显然会使重配后所得到的QLC模式的存储单元的擦写次数已达寿命导致该存储单元不可用,降低QLC闪存阵列的整体存储性能。在这种情况下,存储控制器可以先从SLC的当前区域中找到已擦写次数少于QLC模式的存储单元的理论可擦写次数的全部SLC模式的存储单元,然后从这些存储单元中选择满足目标分配比例所指示的重配数量的存储单元进行重配操作,若这些存储单元的数量小于目标分配比例所指示的重配数量,则存储控制器可以将这些全部的存储单元都重配为QLC模式。或者,考虑到即使将未超过QLC模式的存储单元的理论可擦写次数的SLC模式的存储单元重配为QLC模式,重配后的QLC模式的存储单元也可以只具有较少的剩余可擦写次数,导致QLC闪存阵列的存储能力降低,因此存储控制器也可以直接不再重配SLC模式的存储单元。
步骤303,存储控制器确定待写入数据的类型:
当待写入数据为热数据时,执行步骤304;
当待写入数据为冷数据时,执行步骤305。
在上述步骤303中,存储控制器可以通过如下任一方式确定待写入数据的类型:
方式一,存储控制器根据待写入数据所具有的数据标签确定待写入数据的类型。其中,待写入数据所具有的数据标签由上层APP或主机指定并通过数据处理请求发送给存储控制器,用于指示待写入数据为热数据或冷数据。
方式二,存储控制器使用本地存储的预设分类模型预测待写入数据的类型。其中,预设分类模型由存储控制器预先基于已知数据类型的大量的训练数据训练得到,预设分类模型中包含热数据所具有的特征信息以及冷数据所具有的特征信息。在获取待写入数据后,存储控制器先提取待写入数据的特征信息,基于待写入数据的特征信息与热数据所具有的特征信息的匹配程度对待写入数据属于热数据类型的分类进行评分,基于待写入数据的特征信息与冷数据所具有的特征信息的匹配程度对待写入数据属于冷数据类型的分类进行评分,然后将两种分类中评分更高的分类作为待写入数据的类型。其中,预设分类模型可以为二分类模型、机器学习模型或神经网络模型等,具体不作限定。
方式三,存储控制器先识别待写入数据所属的业务场景,再使用该业务场景所对应的业务模型识别待写入数据的类型。此处的业务模型可以是指上述预设分类模型,也可以是指能划分冷热数据的其它模型。举例来说,在待写入数据所属的业务场景下,若业务模型基于预设的写入频率阈值划分冷数据和热数据,则:如果待写入数据的写入频率大于或等于预设的写入频率阈,则存储控制器可以判定该待写入数据为热数据,否则判定该待写入数据为冷数据。
方式四,存储控制器判断待写入数据是否是对历史数据中的热数据的更新,若是,则确定待写入数据为热数据,否则确定待写入数据为冷数据。
应理解,除这几种识别冷热数据的方式之外,存储控制器还可以通过其它方式识别冷热数据,如聚类算法等,本申请对此不再一一赘述。
步骤304,存储控制器将待写入数据写入至QLC闪存阵列中配置为SLC模式的存储单元。
在上述步骤304中,存储控制器可以从SLC区域所包含的各存储单元中找到一个剩余可擦写次数较多的存储单元,并将待写入数据写入该存储单元。由于SLC模式的存储单元的理论可擦写次数约为50000次,远远大于QLC模式的存储单元的1500次,因此使用SLC模式的存储单元来存储热数据,能充分利用SLC模式的存储单元的高可擦写次数服务于高写入活跃程度的热数据。
步骤305,存储控制器将待写入数据写入至QLC闪存阵列中配置为QLC模式的存储单元。
在上述步骤305中,存储控制器可以从QLC区域所包含的各存储单元中找到一个剩余可擦写次数较多的存储单元,并将待写入数据写入该存储单元。如此,不仅能利用QLC模式的存储单元满足低写入活跃程度的冷数据的擦写次数需求,还能尽量减少SSD的成本,提高QLC闪存阵列的资源利用率。
在上述实施例一中,通过使用QLC闪存阵列的历史数据的热度以及剩余空间自适应地调整SLC模式的存储单元与QLC模式的存储单元的空间分配,能在不超过QLC闪存阵列的可用能力的情况下使空间分配更加匹配当前的业务场景,以避免存储单元的磨损,优化QLC闪存阵列中的颗粒排布方式,提高QLC闪存阵列对不同业务场景的通用性,保障业务处理效果和QLC闪存阵列的存储性能。更进一步的,通过配置与业务场景相匹配的空间分配,还能在同一业务场景下尽量表现出相同的性能,有效提高用户的使用体验。
下面基于实施例二和实施例三,介绍实施例一中分配空间的两种具体实现方式。
【实施例二】
图4示例性示出本申请实施例提供的另一种数据处理方法的流程示意图,该方法适用于存储控制器,如图1所示意的存储控制器210。在该示例中,存储控制器可以按照周期方式执行数据处理,下面以其中一个周期为例进行介绍。如图4所示,该方法包括:
步骤401,存储控制器根据写入QLC闪存阵列的历史数据的数据标签,从历史数据中确定出热数据。
示例来说,上层APP或主机提前将数据划分为元数据和用户数据两种,元数据属于热数据,而用户数据属于冷数据。在一个周期内,主机同时将数据和对应的数据标签下发给存储控制器。如此,存储控制器若查询到数据对应的数据标签为元数据,则可确定该数据为热数据,若查询到数据对应的数据标签为用户数据,则可确定该数据为冷数据。存储控制器通过查询该周期内的全部数据对应的数据标签,可将具有元数据标签的数据作为该周期内写入QLC闪存阵列的热数据。
步骤402,存储控制器统计热数据的总写入次数和历史数据的总写入次数,将热数据的总写入次数与历史数据的总写入次数的比值作为历史数据的热度。
步骤403,存储控制器使用历史数据的热度、QLC闪存阵列的剩余空间以及SLC区域与QLC区域的分配比例表征QLC闪存阵列的预设性能,按照用户容量一致性原则和存储单元数量一致性原则,计算得到使该预设性能达到最大的SLC区域与QLC区域的目标分配比例。
在一种可选地实施方式中,SSD的整个存储空间被划分为用户空间和冗余空间,在这种情况下:
SLC区域也可以由SLC用户空间和SLC冗余空间构成,SLC用户空间是指被配置为 SLC模式的存储单元中用于存储用户数据的存储单元,SLC冗余空间是被配置为SLC模式的存储单元中用于在SLC用户空间的用户数据存储过程中实现垃圾回收功能的存储单元;
QLC区域也可以由QLC用户空间和QLC冗余空间构成,QLC用户空间是指被配置为QLC模式的存储单元中用于存储用户数据的存储单元,QLC冗余空间是被配置为QLC模式的存储单元中用于在QLC用户空间的用户数据存储过程中实现垃圾回收功能的存储单元。
如此,SLC用户空间和QLC用户空间统一构成了SSD中的用户空间,这两部分用户空间共同用于存储写入SSD中的用户数据,因此SSD对外呈现的用户容量为SLC用户空间所对应的SLC用户容量和QLC用户空间所对应的SLC用户容量之和。例如,当SLC用户空间包括4个存储单元、QLC用户空间包括3个存储单元时,SLC用户空间所对应的SLC用户容量为4bit,而QLC用户空间所对应的QLC用户容量为(4×3)bit,因此SSD对外呈现的用户容量为16bit。对应的,SLC冗余空间和QLC冗余空间统一构成了SSD中的冗余空间,这两部分冗余空间共同用于在向SSD中的用户空间写入用户数据时执行垃圾收集,因此SSD中的冗余容量为SLC冗余空间所对应的SLC冗余容量和QLC冗余空间所对应的SLC冗余容量之和。例如,当SLC冗余空间包括2个存储单元、QLC冗余空间包括1个存储单元时,SLC冗余空间所对应的SLC冗余容量为2bit,而QLC冗余空间所对应的QLC冗余容量为(4×1)bit,因此SSD中的冗余容量为6bit。
在这种情况下,SLC区域与QLC区域的分配比例包括SLC用户空间所对应的存储单元数量、SLC冗余空间所对应的存储单元数量、QLC用户空间所对应的存储单元数量、以及QLC冗余空间所对应的存储单元数量。在实施中,存储控制器可以先根据用户容量一致性原则及存储单元数量一致性原则,计算得到SLC用户空间所对应的存储单元数量、SLC冗余空间所对应的存储单元数量、QLC用户空间所对应的存储单元数量、以及QLC冗余空间所对应的存储单元数量之间的第一关联关系,再使用历史数据的热度、QLC闪存阵列的剩余空间、SLC用户空间所对应的存储单元数量、SLC冗余空间所对应的存储单元数量、QLC用户空间所对应的存储单元数量、以及QLC冗余空间所对应的存储单元数量表征QLC闪存阵列的预设性能,并计算出使QLC闪存阵列的预设性能达到最大的SLC用户空间所对应的存储单元数量、SLC冗余空间所对应的存储单元数量、QLC用户空间所对应的存储单元数量、以及QLC冗余空间所对应的存储单元数量之间的第二关联关系,之后基于第一关联关系和第二关联关系,解析出SLC用户空间所对应的目标存储单元数量、SLC冗余空间所对应的目标存储单元数量、QLC用户空间所对应的目标存储单元数量、以及QLC冗余空间所对应的目标存储单元数量。
下面具体介绍存储控制器如何根据用户容量一致性原则及存储单元数量一致性原则,计算得到使预设性能指标达到最大的目标分配比例。在下文中,假设QLC闪存阵列在初始状态下内部的各存储单元都配置为QLC,且用户空间和冗余空间均以存储单元为单位。应理解,用户空间和冗余空间还可以以其它指标为单位,如存储单元块。关于存储单元块的相关内容,请参照实施例三,此处先不做介绍。
在一种可选地实施方式中,存储控制器中还可以设置有一个双模配置表,双模配置表用于记录QLC闪存阵列的基本配置信息以及重配前后的分配比例配置信息。其中,QLC闪存阵列的基本配置信息可以包括:QLC闪存阵列的初始QLC用户空间、QLC闪存阵列 的初始QLC冗余空间、QLC闪存阵列的初始DWPD、QLC闪存阵列的理论可擦写次数及寿命等。重配前的分配比例配置信息包括:重配前的QLC用户空间、重配前的QLC冗余空间、重配前的QLC空间冗余比、重配前的QLC空间的写放大、重配前的SLC用户空间、重配前的SLC冗余空间、重配前的SLC空间冗余比和重配前的SLC空间的写放大等。重配后的分配比例配置信息包括:重配后的QLC用户空间、重配后的QLC冗余空间、重配后的QLC空间冗余比、重配后的QLC空间的写放大、重配后的SLC用户空间、重配后的SLC冗余空间、重配后的SLC空间冗余比和重配后的SLC空间的写放大等。
表1示例性示出本申请实施例提供的一种双模配置表的示意:
Figure PCTCN2021074558-appb-000002
表1
先对表1中的各个术语进行介绍:
DWPD是指按照SSD所呈现的用户容量,用户每天可写满全盘的次数;
PE QLC是指QLC模式的存储单元的理论可擦写次数,一般为1500次左右;
PE SLC是指SLC模式的存储单元的理论可擦写次数,一般为50000次左右;
寿命是指按照用户每天可写满全盘的次数DWPD 0,QLC闪存阵列的可使用年限;
QLC 0是指QLC闪存阵列重配之前所包含的QLC区域,包括QLC用户空间和QLC冗余空间;
QLC 1是指QLC闪存阵列重配之后所包含的QLC区域,包括QLC用户空间和QLC冗余空间;
SLC 1是指QLC闪存阵列重配之后所包含的SLC区域,包括SLC用户空间和SLC冗余空间;
空间冗余比OP是指作为冗余空间的存储单元数量和作为用户空间的存储单元数量的比值;
写放大WA(OP)是指SSD按照先擦除才能再写入的特性所带来的额外的数据拷贝,写放大WA(OP)与空间冗余比OP具有关联关系,该关联关系可以由本领域技术人员根据经验进行设置,也可以根据实验验证得到。示例性地,本申请设置写放大WA(OP)与空间冗余比OP之间的关联关系可以满足如下公式(1.1)或如下公式(1.2):
Figure PCTCN2021074558-appb-000003
其中,W为朗伯W函数,又称为欧米加函数或乘积对数函数。
Figure PCTCN2021074558-appb-000004
应理解,写放大WA(OP)与空间冗余比OP之间的关联关系还可以满足其它公式,本申请对此不作限定。
按照表1所示意的双模配置表,QLC闪存阵列中共存在M+N个存储单元:
在重配之前:M+N个存储单元都配置为QLC模式,其中的M个存储单元作为QLC用户空间,剩余的N个存储单元作为QLC冗余空间,空间冗余比为OP 1,对应的写放大为WA(OP 1)。
在重配之后:M+N个存储单元中的A+B个存储单元被配置为QLC模式,A+B个QLC模式的存储单元中存在A个存储单元作为用户空间,剩余的B个存储单元作为冗余空间,QLC区域的空间冗余比为OP 2,对应的写放大为WA(OP 2);M+N个存储单元中的S+Q个存储单元被配置为SLC模式,S+Q个SLC模式的存储单元中存在S个存储单元作为用户空间,剩余的Q个存储单元作为冗余空间,SLC区域的空间冗余比为OP 3,对应的写放大为WA(OP 3)。
图5示例性示出一种重配前后的QLC闪存阵列划分关系图,其中,图5中的(a)图示意出重配前的QLC闪存阵列中各存储空间的划分关系,图5中的(b)图示意出重配前后的QLC闪存阵列中各存储容量的划分关系:
参照图5中的(a)图所示,按照存储单元数量一致性原则,无论是在重配之前还是在重配之后,QLC闪存阵列所包含的存储单元的数量都相同。重配之前共存在M+N个存储单元,而重配之后共存在A+B+S+Q个存储单元,因此重配后的QLC用户空间A、重配后的QLC冗余空间B、重配后的SLC用户空间S、以及重配后的SLC冗余空间Q满足如下公式(2.1):
A+B+S+Q=M+N.................(2.1)
参照图5中的(b)图所示,按照用户容量一致性原则,重配之前存在M个QLC模式的存储单元作为用户空间,由于每个QLC模式的存储单元可以存储4bit数据,因此重配之前的用户容量为4Mbit;重配之后存在A个QLC模式的存储单元和S个SLC模式的存储单元共同作为用户空间,由于每个QLC模式的存储单元可以存储4bit数据、每个SLC模式的存储单元可以存储1bit数据,因此重配之后的用户容量为(4A+S)bit。基于此,重配后的QLC用户空间A、重配后的QLC冗余空间B、重配后的SLC用户空间S、以及重配后的SLC冗余空间Q还满足如下公式(2.2):
4A+S=4M.................(2.2)
更进一步的,QLC闪存阵列的预设性能指标可以包括上述内容所介绍的任意一种或任意多种衡量性能的指标,如TBW指标、PE次数指标、DWPD指标、IOPS指标或IOPS rand_4K指标等。考虑到QLC闪存阵列的DWPD性能和IOPS rand_4K性能是目前影响QLC闪存阵列写入能力的两个瓶颈性能,因此下面从DWPD指标最优和IOPS rand_4K指标最优这两个方面分别介绍确定目标分配比例的具体实现过程。
DWPD指标最优
在一种可选地实施方式中,存储控制器中还可以设置有一个写入数据量配置表,写入数据量配置表用于记录每个存储区域(QLC区域或SLC区域)的每日实际可写入数据量和物理可写入数据量。
表2示例性示出本申请实施例提供的一种写入数据量配置表的示意:
Figure PCTCN2021074558-appb-000005
表2
先对表2中的各个术语进行介绍:
K 0是指按照重配之前的用户容量,用户每天可写满全盘的次数;
K 1是指按照重配之后的用户容量,用户每天可写满全盘的次数;
PE QLC0是指重配之前的QLC模式的存储单元的剩余可擦写次数;
PE QLC1是指重配之后的QLC模式的存储单元的剩余可擦写次数;
PE SLC1是指重配之后的SLC模式的存储单元的剩余可擦写次数;
X是指历史数据的热度。
按照表2所示意的写入数据量配置表,在重配之前:
QLC闪存阵列中存在M个QLC模式的存储单元作为用户空间,由于每个QLC模式的存储单元可以存储4bit数据,因此QLC闪存阵列所呈现的用户容量为4M bit;用户按照该用户容量每天写满全盘的次数为K 0,因此用户每天会向QLC闪存阵列中写入的数据量为K 0*4M bit;在写放大WA(OP 1)的作用下,QLC闪存阵列每日实际可写入的数据量为K 0*4M*WA(OP 1)bit;按照QLC闪存阵列的剩余寿命(假设为Y年,每年有365天),则QLC闪存阵列在剩余寿命期间内实际可写入的总数据量为K 0*4M*WA(OP 1)*Y*365bit;
QLC闪存阵列中共存在M+N个QLC模式的存储单元,由于每个QLC模式的存储单元可以存储4bit数据,因此QLC闪存阵列理论上擦写一次可写入的数据量为4(M+N)bit;重配之前的QLC模式的存储单元的剩余可擦写次数PE QLC0,因此QLC闪存阵列物理可写入的数据量为4(M+N)*PE QLC0bit;
QLC闪存阵列在重配之前的剩余寿命期间内实际可写入的总数据量与QLC闪存阵列物理可写入的数据量应该相同,因此重配之前的QLC模式的存储单元的每日全盘写满次数K 0满足如下公式(2.3):
K 0*4M*WA(OP 1)*Y*365=4(M+N)*PE QLC0.................(2.3)
按照表2所示意的写入数据量配置表,针对于重配之后的QLC区域:
按照用户容量一致性原则,QLC闪存阵列所呈现的用户容量仍为4M bit;用户按照该用户容量每天写满全盘的次数为K 1,因此用户每天会向QLC闪存阵列中写入的数据量为K 1*4M bit;重配之后的QLC区域只用于存储冷数据,而按照历史数据计算出来的热度为X,则历史数据的冷度(如历史数据中的冷数据的写入频率)为1-X,因此用户每天向QLC区域中写入的数据量为K 1*4M*(1-X)bit;在写放大WA(OP 2)的作用下,QLC区域中每日实际可写入的数据量为K 1*4M*(1-X)*WA(OP 2)bit;按照QLC闪存阵列的剩余寿命(假设 为Y年,每年有365天),则QLC区域在剩余寿命期间内实际可写入的总数据量为K 1*4M*(1-X)*WA(OP 2)*Y*365bit;
QLC闪存阵列中共存在A+B个QLC模式的存储单元,由于每个QLC模式的存储单元可以存储4bit数据,因此QLC区域理论上擦写一次可写入的数据量为4(A+B)bit;重配之后的QLC模式的存储单元的剩余可擦写次数为PE QLC1(类型未变,仍与重配之前的QLC类型的存储单元的剩余可擦写次数PE QLC0相同),因此QLC区域物理可写入的数据量为4(A+B)*PE QLC1bit;
QLC区域在重配之后的剩余寿命期间内实际可写入的总数据量需要小于QLC区域物理剩余可写入的数据量,即K 1*4M*(1-X)*WA(OP 2)*Y*365≤4(A+B)*PE QLC1,因此按照重配之后的QLC区域计算得到的每日全盘写满次数K 1满足如下公式(2.4):
Figure PCTCN2021074558-appb-000006
按照表2所示意的写入数据量配置表,针对于重配之后的SLC区域:
按照用户容量一致性原则,QLC闪存阵列所呈现的用户容量仍为4M bit;用户按照该用户容量每天写满全盘的次数为K 1,因此用户每天会向QLC闪存阵列中写入的数据量为K 1*4M bit;重配之后的SLC区域只用于存储热数据,而按照历史数据计算出来的热度为X,因此用户每天向SLC区域中写入的数据量为K 1*4M*X bit;在写放大WA(OP 3)的作用下,SLC区域中每日实际可写入的数据量为K 1*4M*X*WA(OP 3)bit;按照QLC闪存阵列的剩余寿命(假设为Y年,每年有365天),则SLC区域在剩余寿命期间内实际可写入的总数据量为K 1*4M*X*WA(OP 3)*Y*365bit;
QLC闪存阵列中共存在S+Q个SLC模式的存储单元,由于每个SLC模式的存储单元可以存储1bit数据,因此SLC区域理论上擦写一次可写入的数据量为(S+Q)bit;重配之后的SLC类型的存储单元的剩余可擦写次数为PE SLC1(类型变化,可在重配之前的QLC类型的存储单元的剩余可擦写次数PE QLC0的基础上计算得到),因此SLC区域物理可写入的数据量为(S+Q)*PE SLC1bit;
SLC区域在重配之后的剩余寿命期间内实际可写入的总数据量需要小于SLC区域物理剩余可写入的数据量,即K 1*4M*X*WA(OP 3)*Y*365≤(S+Q)*PE SLC1,因此按照重配之后的SLC区域计算得到的每日全盘写满次数K 1满足如下公式(2.5):
Figure PCTCN2021074558-appb-000007
根据上述公式(2.4)和(2.5),如果要使重配之后的每日全盘写满次数K 1最大,则重配之后的每日全盘写满次数K 1应该取值为重配之后的QLC区域计算得到的每日全盘写满次数K 1和重配之后的SLC区域计算得到的每日全盘写满次数K 1之中的最大值,即重配之后的每日全盘写满次数K 1满足如下公式(2.6):
Figure PCTCN2021074558-appb-000008
因此,存储控制器根据上述公式(1.1)或(1.2)可以计算得到写放大WA(OP 2)和写放大WA(OP 3),根据上述公式(2.1)可以计算得到重配后的QLC用户空间A、重配后的QLC冗余空间B、重配后的SLC用户空间S、以及重配后的SLC冗余空间Q之间的 第一关联关系,根据上述公式(2.2)可以计算得到重配后的QLC用户空间A和重配后的SLC用户空间S之间的第二关联关系,将计算得到的写放大WA(OP 2)、写放大WA(OP 3)、第一关联关系、第二关联关系、以及上述步骤402所计算出的历史数据的热度X代入上述公式(2.6)之后,存储控制器能找到使重配后的DWPD(即K 1)达到最大的A、B、S和Q的取值,作为SLC区域和QLC区域的目标分配比例。
IOPS rand_4K指标最优
本申请实施例中,随机4K下的IOPS与历史数据的热度、QLC闪存阵列的拓扑结构、存储单元的tR、存储单元的tProg以及QLC闪存阵列的通道并发数等信息相关。示例来说,在一种可选地实施方式中,IOPS rand_4K可以满足如下公式(3.1):
Figure PCTCN2021074558-appb-000009
其中,X为历史数据的热度;SLC perf用于表征SLC区域的性能,可以由与SLC区域的性能相关的各项参数计算得到,如可以满足如下公式(3.2):
Figure PCTCN2021074558-appb-000010
其中,DieNum是指QLC闪存阵列的通道并发数;le6是指10 6;a 1为小于1的一个常数,称为SLC区域对应的打折率,是考虑到SLC区域的性能可能由于损耗导致无法完全发挥而给出的一个折扣比例;GC Sr是指对SLC区域中的垃圾回收操作搬移数据所需的平均读时延的一个估计值;WA(OP 3)是指SLC区域的写放大;ratio是指由于有限的系统带宽影响导致数据下刷所占去的比例;le3是指10 3
对应的,QLC perf用于表征QLC区域的性能,可以由与QLC区域的性能相关的各项参数计算得到,如可以满足如下公式(3.3):
Figure PCTCN2021074558-appb-000011
其中,a 2为小于1的一个常数,称为QLC区域对应的打折率,是考虑到QLC区域的性能可能由于损耗导致无法完全发挥而给出的一个折扣比例;WA(OP 2)是指QLC区域的写放大,GC Qr是指对QLC区域中的垃圾回收操作搬移数据所需的平均读时延的一个估计值。
存储控制器根据上述公式(1.1)或(1.2)可以计算得到写放大WA(OP 2)和写放大WA(OP 3),根据上述公式(2.1)可以计算得到重配后的QLC用户空间A、重配后的QLC冗余空间B、重配后的SLC用户空间S、以及重配后的SLC冗余空间Q之间的第一关联关系,根据上述公式(2.2)可以计算得到重配后的QLC用户空间A和重配后的SLC用户空间S之间的第二关联关系,将计算得到的写放大WA(OP 2)、写放大WA(OP 3)、第一关联关系、第二关联关系、以及上述步骤402所计算出的历史数据的热度X代入上述公式(3.2)之后,存储控制器能计算出SLC区域的性能SLC perf,将计算得到的写放大WA(OP 2)、写放大WA(OP 3)、第一关联关系、第二关联关系、以及上述步骤402所计算出的历史数据的热度X代入上述公式(3.3)之后,存储控制器能计算出QLC区域的性能QLC perf,将计算得到的SLC perf和QLC perf代入上述公式(3.1)之后,存储控制器可以计算得到使随机4K下的每秒写入数量IOPS rand_4K(单位为千)最大的取值。
需要说明的是,上述实际上是以实现一种性能指标最大为例介绍分配比例的计算过程。当同时关心至少两个性能指标时,存储控制器还可以综合两个性能指标选择出一个能使这两个性能指标都较好的目标分配比例。
步骤404,存储控制器判断SLC区域与QLC区域的目标分配比例中所指出的SLC区域是否大于当前SLC区域,若是,则执行步骤405,若否,则执行步骤406。
步骤405,存储控制器按照SLC区域与QLC区域的目标分配比例,将QLC闪存阵列中的部分QLC模式的存储单元重配为SLC模式。
在一种可选地实施方式中,考虑到同一数据在存储单元配置为不同模式时会对应不同的电平状态(例如,“0”在QLC模式的存储单元中对应第一电压差,而在SLC模式的存储单元中对应第二电压差),因此,如果直接在存储单元中存储有大量数据的情况下重配存储单元的模式,则存储控制器还需要在短时间内同时调整所存储的大量数据的电压差,增大了存储单元丢失数据的概率。为避免该问题,存储控制器在确定要将某一QLC模式的存储单元重配为SLC类型之前,还可以先判断该QLC模式的存储单元中是否存储有数据,若存储有数据或存储的数据量很多,则存储控制器可以先不执行重配,而是等待该QLC类型的存储单元内部所存储的数据被清理(如清空或清理部分)之后,再将该QLC模式的存储单元重配为SLC模式,以在重配存储单元的类型时兼顾数据存储的准确性。
步骤406,存储控制器保持QLC闪存阵列中的SLC区域与QLC区域的当前分配比例。
下面以一个具体的场景示例性介绍实施例二中的数据处理方法的应用。在如下示例中,假设空间单位为存储单元,容量单位为4bit,在这种情况下,“空间为2”是指“包括2个存储单元”,“容量为4”是指“容量为16bit”。应理解,在其它示例中,空间单位和容量单元也可以使用其它数据度量值,如空间单位还可以为50个存储单元或100个存储单元等,容量单位还可以为4MB或8MB等,具体不作限定。
在该场景中,QLC闪存阵列中共存在3610个存储单元,每个QLC模式的存储单元的可擦写次数均为1500次,每个SLC模式的存储单元的可擦写次数均为50000次。假设主机在一个周期内向QLC闪存阵列中写入55%的元数据(热数据)和45%的用户数据(冷数据),则图6示例性示出本申请实施例提供的一种优化结果示意图,其中,图6中的(a)图示出按照DWPD指标最优方案优化SLC区域和QLC区域的分配比例后的优化结果,图6中的(b)图示出在保证DWPD不变的情况下,按照IDPS rand_4K指标最优方案优化SLC区域和QLC区域的分配比例后的优化结果。参照图6中的(a)图所示:
在重配之前:全部的存储单元都为QLC模式,QLC用户空间为3207,QLC冗余空间为403,空间总数量为3610,且QLC区域的冗余比为403/3207,将该冗余比代入上述公式(1.1)后,计算得到QLC区域的写放大WA为4.46;由于全部的存储单元都为QLC模式,因此写入QLC区域的热数据占历史数据的100%,各区域的平均写放大即为QLC区域的写放大4.46;每个QLC模式的存储单元的可擦写次数PE均为1500次,擦写一次理论上可写入的数据量为用户容量3207(因为一个QLC类型的存储单元存储4bit数据,恰好符合容量单位4bit)与冗余容量403的和,即3207+403,因此理论可写入数据量为可擦写次数PE与擦写一次理论上可写入的数据量的乘积,即1500*(3207+403)=5415000,实际可写入据量为理论可写入数据量与写放大的比值,即5415000/4.46=1214126,QLC闪存阵列的可写入数据量TWB也为1214126。
在重配之后:全部的存储单元分为QLC模式和SLC模式,每个QLC模式的存储单元 的可擦写次数均为1500次,用于存储冷数据,冷数据占历史数据的45%,而每个SLC模式的存储单元的可擦写次数均为50000次,用于存储热数据,热数据占历史数据的55%;基于上述公式(1.1)、(1.2)、(2.1)、(2.2)、和(2.6),计算出使DWPD达到最大的分配比例为:QLC用户空间为3175,QLC冗余空间为265,SLC用户空间为128,SLC冗余空间为42。在这种分配比例下,QLC用户空间3175、QLC冗余空间265、SLC用户空间128和SLC冗余空间42的空间总和为3610,符合存储单元数量一致性原则;QLC用户容量为3175,而SLC用户容量为128/4(因为一个SLC模式的存储单元只存储1bit数据,需要除以4才能转化为容量单位4bit),因此QLC用户容量和SLC用户容量的和仍能保持为3207,符合用户容量一致性原则。根据QLC用户容量3175和QLC冗余容量295计算得到QLC区域的写放大为6.66,根据SLC用户容量128/4和SLC冗余容量42/4计算得到SLC区域的写放大为2.22,由于QLC区域所存储的冷数据占历史数据的45%,SLC区域所存储的热数据占历史数据的55%,因此重配后的各区域的平均写放大为QLC区域的写放大6.66和SLC区域的写放大2.22的加权平均值6.66*45%+2.22*55%(即4.22);按照该分配比例,每个QLC模式的存储单元的可擦写次数PE均为1500次,QLC区域擦写一次理论上可写入的数据量为用户容量与冗余容量的和,即3175+295,因此QLC区域理论可写入数据量为可擦写次数PE与QLC区域擦写一次理论上可写入的数据量的乘积,即1500*(3175+295)=5205000,QLC区域实际可写入据量为理论可写入数据量与写放大的比值,即5205000/6.66=781530;每个SLC模式的存储单元的可擦写次数PE均为50000次,SLC区域擦写一次理论上可写入的数据量为用户容量与冗余容量的和,即128/4+42/4,因此SLC区域理论可写入数据量为可擦写次数PE与SLC区域擦写一次理论上可写入的数据量的乘积,即50000*(128/4+42/4)=2125000,SLC区域实际可写入据量为理论可写入数据量与写放大的比值,即2125000/2.22=957207;
综上所述,重配后的QLC闪存阵列的总写入量为QLC区域理论可写入量5205000与SLC区域理论可写入量2125000的和值,即7330000,相比于重配前的总写入量5415000提升了(7330000-5415000)/5415000=35.36%。重配后的可写入量TWB为QLC区域可写入量781530与SLC区域可写入量957207的和值,即1736737,相比于重配前的可写入量1214126提升了(1736737-1214126)/1214126=43.04%,即DWPD性能提升了43.04%。
参照图6中的(b)图所示:
基于上述公式(1.1)、(1.2)、(2.1)、(2.2)、(3.1)至(3.3),计算出使IOPS rand_4K达到最大的分配比例为:QLC用户空间为3175,QLC冗余空间为279,SLC用户空间为128,SLC冗余空间为28。在这种分配比例下,QLC用户空间3175、QLC冗余空间279、SLC用户空间128和SLC冗余空间28的空间总和为3610,符合存储单元数量一致性原则;QLC用户容量为3175,而SLC用户容量为128/4,因此QLC用户容量和SLC用户容量的和仍能保持为3207,符合用户容量一致性原则。根据QLC用户容量3175和QLC冗余容量279计算得到QLC区域的写放大为6.36,根据SLC用户容量128/4和SLC冗余容量28/4计算得到SLC区域的写放大为2.97。按照该分配比例下的QLC相关的各项性能参数和SLC相关的各项性能参数,最大的IOPS rand_4K取值为39.04,相比于重配前的IOPS rand_4K取值25.70来说,性能提升了51.91%。
图7示例性示出该场景下QLC闪存阵列的性能变化曲线图,其中:
图7中的(a)图示意出DWPD性能随SLC冗余空间变化而变化的曲线,其中纵坐标 对应为DWPD性能,单位为千次,横坐标对应为SLC冗余空间所占的存储单元数量。在图7中的(a)图中,节点线对应为重配前的DWPD性能线,由于重配之前只存在QLC区域且配置不变,因此DWPD性能始终保持一致,大约为200次左右。实线对应为重配后的DWPD性能线,由该性能线可知,当SLC冗余空间逐渐变大时,DWPD性能会先变大再变小,且DWPD性能的峰值点V 11对应为SLC冗余空间配置被为42的情况,DWPD性能的峰值大约为300次。
图7中的(b)图示意出IOPS rand_4K性能随SLC冗余空间变化而变化的曲线,其中纵坐标对应为IOPS rand_4K性能,单位为千,横坐标对应为SLC冗余空间所占的存储单元数量。由图7中的(b)图的性能线可知,当SLC冗余空间逐渐变大时,IOPS rand_4K性能也会先变大再变小,且IOPS rand_4K性能的峰值点V 12对应为SLC冗余空间配置被为28的情况,IOPS rand_4K性能的峰值大约为390400。
当业务场景更关注DWPD性能时,存储控制器可以从图7中的(a)图中找到使DWPD性能达到峰值V 11的SLC冗余空间取值。当业务场景更关注IOPS rand_4K性能时,存储控制器可以从图7中的(b)图中找到使IOPS rand_4K性能达到峰值V 12的SLC冗余空间取值。当业务场景既关心DWPD性能又关心IOPS rand_4K性能时,存储控制器可以从图7中的(a)图和图7中的(b)图中找到一个既能使DWPD性能较好又能使IOPS rand_4K性能较好的SLC冗余空间取值,如区间R中的一个值。可知,按照上述实施例二中的数据处理方法优化SLC和QLC的分配比例,DWPD性能和IOPS rand_4K性能基本能保持一致,当DWPD性能较好时,IOPS rand_4K性能也较好。
在上述实施例二中,通过遵循用户容量一致性原则计算分配比例,能使存储控制器呈现给用户的容量始终保持一致,而不是一个变化的值,从而有助于提高用户的写入体验。更进一步的,该方案还能根据业务场景设置QLC闪存阵列的预设性能,以计算出最满足当前业务场景的分配比例,因此还有助于提高QLC闪存阵列对各种业务场景的匹配能力。
【实施例三】
图8示例性示出本申请实施例提供的又一种数据处理方法的流程示意图,该方法适用于存储控制器,如图1所示意的存储控制器210。如图8所示,该方法包括:
步骤801,存储控制器检测QLC闪存阵列中包含的存储单元的数量:
若存储单元的数量大于或等于预设的数量阈值,则执行步骤802;
若存储单元的数量小于预设的数量阈值,则执行步骤803。
步骤802,存储控制器将QLC闪存阵列中包含的存储单元划分为至少两个存储单元块,至少两个存储单元块中的每个存储单元块包含至少两个存储单元。
在上述步骤801和步骤802中,存储控制器可以在存储单元数量较多的情况下对存储单元进行分块处理,通过将大量的存储单元划分为少量的存储单元块,能便于存储控制器后续基于较少的存储单元块进行数据处理,而无需基于大量的存储单元进行数据处理,从而有助于减轻存储控制器的工作压力。
本申请实施例中,存储控制器可以按照多种方式划分存储单元,例如可以按照随机算法将任意位置和任意数量的存储单元划分为一个存储单元块,也可以将固定数量的相邻的存储单元划分为一个存储单元块等,具体不作限定。示例性地,为便于维护QLC闪存阵列的行列结构,可以将每行存储单元划分为一个存储单元块。例如,继续参照图1所示, 假设M为10、N为100,则QLC闪存阵列中共存在1000个存储单元,存储控制器可以将这1000个存储单元划分为存储单元块1至存储单元块10这10个存储单元块,其中存储单元块1包括位于第一行中的100个存储单元D 11~D 1100,存储单元块2包括位于第二行中的100个存储单元D 21~D 2100,……,存储单元块10包括位于第10行中的100个存储单元D 101~D 10100。采用该示例,存储控制器能直接以每一行存储单元所连接的总线消息为依据,统计该行存储单元所在的存储单元块的写入次数,提高次数统计的灵活性和便捷性。
步骤803,存储控制器将每个存储单元作为一个存储单元块。
在上述步骤801和步骤803中,当存储单元的数量较少时,存储控制器可以直接以存储单元为基准进行数据处理,而无需再进行分块操作。在这种情况下,“将存储单元作为一个存储单元块”只是为了便于在下文中以“存储单元块”为例介绍数据处理方案,存储控制器实际上并没有进行分块操作。也就是说,当存储单元的数量不大于预设的数量阈值时,存储控制器可以按照下文所介绍的方式对各个存储单元进行处理,且下文中的“存储单元块”可以直接被替换为“存储单元”。
步骤804,存储控制器实时统计数据写入QLC闪存阵列的总写入次数和每个存储单元块的写入次数。
在一种可选地实施方式中,存储控制器中还可以维护有一个双模统计表,双模统计表中包括QLC闪存阵列的总写入次数和每个存储单元块的写入次数等参数和这些参数所对应的取值。存储控制器每根据主机发送的数据处理请求向QLC闪存阵列中写入数据后,都可以根据本次写入操作更新QLC闪存阵列的总写入次数所对应的取值,并根据这一个或多个数据所写入的存储单元块更新本次写入的存储单元块的写入次数所对应的取值,以实现对上述各项数据的实时统计。
表3示例性示出一种双模统计表的示意,如表3所示,假设一共存在如上述步骤802中所介绍的存储单元块1至存储单元块10这10个存储单元块,并向这10个存储单元块中写入如下五次数据:第一次写入向存储单元块1中的存储单元D 11~D 1100、以及存储单元块6中的存储单元D 61~D 6100分别写入“1”,第二次写入向存储单元块1中的存储单元D 11~D 1100、以及存储单元块2中的存储单元D 21~D 2100分别写入“0”,第三次写入向存储单元块1中的存储单元D 11~D 1100分别写入“1”,第四次写入向存储单元块1中的存储单元D 11~D 1100、以及存储单元块6中的存储单元D 61~D 6100中的每个存储单元分别写入“0”,第五次写操作向存储单元块2中的存储单元D 21~D 2100、以及存储单元块6中的存储单元D 61~D 6100分别写入“1”。则这五次写入操作中的总写入次数为900,存储单元D 11~D 1100所在的存储单元块1的写入次数为400,存储单元D 21~D 2100所在的存储单元块2的写入次数为300,而存储单元D 61~D 6100所在的存储单元块6的写入次数为200,其它存储单元的写入次数为0。
Figure PCTCN2021074558-appb-000012
Figure PCTCN2021074558-appb-000013
表3
如表3所示,经过上述五次操作后,在双模统计表的记录中,QLC闪存阵列的总写入次数更新为900,存储单元1的总写入次数更新为400,存储单元2的总写入次数更新为200,存储单元6的总写入次数更新为300,其它存储单元的总写入次数仍为0。
步骤805,存储控制器判断当前是否满足重配条件,若满足,则执行步骤806,若不满足,则继续执行步骤804。
在上述步骤805中,重配条件可以包括QLC闪存阵列的总写入次数大于预设写入次数、总写入时长大于预设写入时长或总写入数据量大于预设写入数据量等,还可以包括其它条件,具体不作限定。以重配条件为QLC闪存阵列的总写入次数大于或等于3/5PE为例,如果重配之前QLC闪存阵列全部为QLC区域,且QLC区域的PE为1500,则900刚好等于3/5PE,说明当前满足重配存储区域的条件,存储控制器可以启动重配流程。
步骤806,存储控制器从至少两个存储单元块获取写入次数从多到少排序得到的前K个存储单元块,分别以前K个存储单元块中的每个存储单元块的写入次数作为划分热数据的预设次数,计算得到K个预设次数分别对应的K个热度。其中,K为大于或等于2的正整数。
在上述步骤806中,K可以为本领域技术人员根据经验设置的固定值,也可以是与存储单元块的总数量具有相关关系的一个可变值,如存储单元块总数量的20%。当K与存储单元块的总数量具有相关关系时,存储控制器还能基于不同的业务场景选择不同数量的存储单元块执行热数据的划分操作,有助于使热度划分结果更匹配当前的业务场景。
本申请实施例中,存储控制器可以按照多种方式从至少两个存储单元块中获取写入次数最多的前K个存储单元块。示例来说:
在一种可选地实施方式中,存储控制器可以先按照不排序的TOP_K算法,从至少两个存储单元块中找到写入次数最多的前K个存储单元块,然后再按照写入次数从多到少(或从少到多)的顺序对找到的这K个存储单元块进行排序,排序得到的序列中位于前面的存储单元块的写入次数多于位于后面的存储单元块的写入次数,之后存储控制器可以按照从前到后的顺序依次将该序列中的每个存储单元块的写入次数作为划分热数据的预设次数,执行后续的分配比例计算过程。该方式先粗略地找到前K个存储单元块再进行精确排序,能基于更少的数据量完成排序,有助于节省存储控制器的处理资源;
在另一种可选地实施方式中,存储控制器可以先使用排序算法,按照写入次数从多到少对全部的存储单元块进行排序,再在排好序的全部存储单元块中选取按照从多到少排序得到的前K个存储单元块或从少到多排序得到的后K个存储单元块,之后存储控制器可以依次按照这K个存储单元块的写入次数从多到少的顺序将每个存储单元块的写入次数作为划分热数据的预设次数,执行后续的分配比例计算过程。该方式能通过一次排序算法直接得到排好序的K个存储单元块,能有效节省存储控制器的处理步骤。
需要说明的是,本申请实施例中,排序算法可以为TOP_K算法,也可以为冒泡算法或其它算法等,本申请对此不作限定。
继续以上述表3中的示例进行介绍。在该示例中,假设K为写入次数占前50%的存储单元块,则存储控制器会先按照排序算法从存储单元块1至存储单元块10中找到符合条件的存储单元块1和存储单元块2,存储单元块1的写入次数为400,存储单元块2的写入次数为300。之后,存储控制器会依次对存储单元1和存储单元2进行分析:
针对于存储单元1,存储控制器会将存储单元块1的写入次数400作为划分热数据的预设次数,即将写入次数大于或等于400的存储单元块中写入的数据作为热数据,将写入次数小于400的存储单元块中写入的数据作为冷数据。这种情况下,只有存储单元块1的写入次数大于或等于400,因此只有存储单元块1的写入次数400属于热数据的写入次数,历史数据的热度为400/900=4/9;
针对于存储单元2,存储控制器会将存储单元块2的写入次数300作为划分热数据的预设次数,即将写入次数大于或等于300的存储单元块中写入的数据作为热数据,将写入次数小于300的存储单元块中写入的数据作为冷数据。这种情况下,存储单元块1的写入次数400和存储单元2的写入次数300都大于或等于300,因此只有存储单元块1的写入次数400和存储单元2的写入次数300都属于热数据的写入次数,历史数据的热度为(400+300)/900=7/9。
步骤807,存储控制器分别使用K个热度、QLC闪存阵列的剩余空间以及SLC区域与QLC区域的分配比例表征QLC闪存阵列的预设性能,按照用户容量一致性原则和存储单元数量一致性原则,计算得到K个使该预设性能达到最大的SLC区域与QLC区域的分配比例,将K个SLC区域与QLC区域的分配比例中的预设性能最大的分配比例作为SLC区域与QLC区域的目标分配比例。
在上述步骤807中,每个热度所对应的SLC区域与QLC区域的分配比例的计算过程,请具体参照上述步骤403,本申请对此不再一一重复赘述。
步骤808,存储控制器判断目标分配比例所指出的SLC区域是否大于当前SLC区域,若是,则执行步骤809,若否,则执行步骤810。
步骤809,存储控制器按照SLC区域与QLC区域的目标分配比例,将QLC闪存阵列中的部分QLC模式的存储单元重配为SLC模式。
步骤810,存储控制器保持QLC闪存阵列中的SLC区域与QLC区域的当前分配比例。
下面以CEPH典型场景为例示例性介绍实施例三中的数据处理方法的应用。在如下示例中,假设空间单位为存储单元块,容量单位为SLC模式的存储单元块所占的bit。在这种情况下,“空间为2”是指“包括2个存储单元块”,“容量为4”是指“容量为4个SLC模式的存储单元块所占的bit”。应理解,在其它示例中,空间单位和容量单元也可以使用其它数据度量值,如空间单位还可以为存储单元等,容量单位还可以为4MB或8MB等,具体不作限定。存储控制器基于逻辑地址(logical block address,LBA)划分存储单元块,在一个数据处理请求所包括的命令信息中,可以包括针对一个LBA的命令信息,也可以包括针对多个LBA的命令信息,对此也不作具体限定。
在该场景中,QLC闪存阵列中共存在3801个存储单元,每个QLC模式的存储单元的可擦写次数均为1500次,每个SLC模式的存储单元的可擦写次数均为50000次,QLC闪存阵列的寿命为5年。假设LBA默认设置SLC用户空间占全部用户空间的1%,历史数据 的热度为68%,则表4示例性示出按照上述实施例三中的方法进行数据处理所得到的优化结果示意表,参照表4所示:
Figure PCTCN2021074558-appb-000014
表4
在重配之前:全部的存储单元都为QLC模式,QLC用户空间为3397,QLC冗余空间为404,空间总数量为3801,用户容量为QLC用户容量3397*4(即13588),冗余容量为QLC冗余容量404*4(即2828),且QLC区域的冗余比约为11.89%(即404/3397),将该冗余比代入上述公式(1.1)后,计算得到QLC区域的写放大WA约为5.55,将该写放大WA代入上述公式(2.3)后,计算得到QLC区域的DWPD 0约为0.166。
在重配之后:全部的存储单元划分为QLC模式和SLC模式,每个QLC模式的存储单元的可擦写次数均为1500次,用于存储冷数据,冷数据占据历史数据的32%,而每个SLC模式的存储单元的可擦写次数均为50000次,用于存储热数据,热数据占据历史数据的68%;基于上述公式(1.1)、(1.2)、(2.1)、(2.2)、和(2.6),计算出使DWPD达到最大的分配比例为:QLC用户空间为3363,QLC冗余空间为235,SLC用户空间为136,SLC冗余空间为67。在这种分配比例下,QLC用户空间3363、QLC冗余空间235、SLC用户空间136和SLC冗余空间67的空间总和为3801,符合存储单元数量一致性原则;QLC用户容量为3363*4,而SLC用户容量为136,QLC用户容量和SLC用户容量的和3363*4+136仍保持 为13588,符合用户容量一致性原则。根据QLC用户空间3363和QLC冗余空间235计算得到QLC区域的冗余比约为6.99%(即235/3363),将该冗余比代入上述公式(1.1)后,计算得到QLC区域的写放大WA约为8.74。根据SLC用户空间136和SLC冗余空间67计算得到SLC区域的冗余比约为49.26%,将该冗余比代入上述公式(1.1)后,计算得到SLC区域的写放大WA约为1.93。按照该分配比例,将计算出的QLC区域的写放大和SLC区域的写放大代入上述公式(2.3)后,计算得到重配后的DWPD 1约为0.311,相比于重配前的DWPD 0(0.184)提升了约87.3%。
此外,每个QLC模式的存储单元的可擦写次数PE均为1500次,QLC区域擦写一次理论上可写入的数据量为用户容量3363*4与冗余容量235*4的和,因此QLC用户空间理论可写入数据量为可擦写次数PE与QLC区域擦写一次理论上可写入的数据量的乘积,即1500*(3363*4+235*4)=21588000,分配到5年的寿命中,QLC区域每日理论可写入数据量为21588000/(5*365)=11829.0。QLC区域每日实际可写入据量为每日可擦写次数DWPD 1(约为0.311)、QLC闪存阵列的用户容量(3397*4)、冷数据占据历史数据的比例(32%)和QLC区域的写放大(约为8.74)的乘积,按照公式计算为11829.0(按照各项估算出来的值计算约为0.311*3397*4*32%*8.74=11818.9)。每个SLC模式的存储单元的可擦写次数PE均为50000次,SLC区域擦写一次理论上可写入的数据量为用户容量136与冗余容量67的和,因此SLC用户空间理论可写入数据量为可擦写次数PE与SLC区域擦写一次理论上可写入的数据量的乘积,即50000*(136+67)=10150000,分配到5年的寿命中,SLC区域每日理论可写入数据量为10150000/(5*365)=5564.6。SLC区域每日实际可写入据量为每日可擦写次数DWPD 1(约为0.311)、QLC闪存阵列的用户容量(3397*4)、热数据占据历史数据的比例(68%)和SLC区域的写放大(约为1.93)的乘积,按照公式计算为5553.7(按照各项估算出来的值计算约为0.311*3397*4*68%*1.93=5546.0)。可见,在实施例三中的数据处理方式中,各个区域的每日实际可写入数据量基本等同于各自的每日理论可写入数据量,QLC闪存阵列的性能得到极大提升。
表5示例性示出按照固定配置方式进行数据处理所得到的配置结果示意表,假设该固定配置设置SLC用户空间占全部用户空间的1%,而SLC冗余空间占全部冗余空间的20%,则参照表5所示:
Figure PCTCN2021074558-appb-000015
Figure PCTCN2021074558-appb-000016
表5
QLC闪存阵列具有如下固定配置:QLC区域包括3363个QLC模式的存储单元块作为用户空间、以及274个QLC模式的存储单元块作为冗余空间,因此QLC区域的冗余比约为8.15%(即274/3363),将该冗余比代入上述公式(1.1)后,计算得到QLC区域的写放大WA约为7.65;SLC区域包括136个SLC模式的存储单元块作为用户空间、以及28个SLC模式的存储单元块作为冗余空间,因此SLC区域的冗余比为约为20.59%(即28/136),将该冗余比代入上述公式(1.1)后,计算得到SLC区域的写放大WA约为3.57;将QLC区域的写放大(约为7.65)和SLC区域的写放大(约为3.57)代入上述公式(2.3)后,计算得到固定配置的DWPD 2约为0.136,按照公式计算相比于重配前的DWPD 0(约0.166)提升了-17.8%(按照各项估算出来的值计算约为(0.136-0.166)/0.166=-18.1%)。显然,这种固定配置的方式不但不能提升QLC闪存阵列的DWPD性能,反而还会降低DWPD性能。
此外,按照固定配置方式,每个QLC模式的存储单元的可擦写次数PE均为1500次,QLC区域擦写一次理论上可写入的数据量为用户容量3363*4与冗余容量274*4的和,因此QLC用户空间理论可写入数据量为可擦写次数PE与QLC区域擦写一次理论上可写入的数据量的乘积,即1500*(3363*4+274*4)=21822000,分配到5年的寿命中,QLC区域每日理论可写入数据量为21822000/(5*365)=11957.26。QLC区域每日实际可写入据量为每日可擦写次数DWPD 2(约为0.136)、QLC闪存阵列的用户容量(3397*4)、冷数据占据历史数据的比例(32%)和QLC区域的写放大(约为7.65)的乘积,按照公式计算为4532.44(按照各项估算出来的值计算约为0.136*3397*4*32%*7.65=4523.83)。每个SLC模式的存储单元的可擦写次数PE均为50000次,SLC区域擦写一次理论上可写入的数据量为用户容量136与冗余容量28的和,因此SLC用户空间理论可写入数据量为可擦写次数PE与SLC区域擦写一次理论上可写入的数据量的乘积,即50000*(136+28)=8200000,分配到5年的寿命中,SLC区域每日理论可写入数据量为8200000/(5*365)=4493.15。SLC区域每日实际可写入据量为每日可擦写次数DWPD 2(约为0.136)、QLC闪存阵列的用户容量(3397*4)、热数据占据历史数据的比例(68%)和SLC区域的写放大(约为3.57)的乘积,按照公式计算为4493.15(按照各项估算出来的值计算约为0.136*3397*4*68%*3.57=4486.13)。
综上所述,重配后的DWPD性能(约为0.311)相比于固定配置的DWPD性能(约为0.136)至少好2.3倍。
在上述实施例三中,通过在存储单元的数量较多时划分存储单元块以简化优化流程, 能有效减少计算工作量,提高优化的效率。更进一步的,通过以不同存储单元块的写入次数为基准划分热数据,并在每个划分依据下计算得到最优配置,最后选择各个划分依据下的最优配置作为最终的目标配置,不仅能在未知数据类型的情况下找到性能最好的配置,还能较好地适用于当前的业务场景。
在一种可选地实施方式中,继续参照图1所示,存储控制器210中可以包括热度感应模块211和优化决策模块212,热度感应模块211分别连接主机100和优化决策模块212,优化决策模块212还连接QLC闪存阵列220。在这种情况下,上述实施例一至实施例三中关于识别冷热数据及计算历史数据的热度的操作步骤具体可以由热度感应模块211执行,如上述实施例一中的步骤301、上述实施例二中的步骤401和步骤402、以及上述实施例三中的步骤804至步骤806。热度感应模块211识别出热度数据及热度后,可以将该热度通知给优化决策模块212,以使优化决策模块212基于该热度决策出最优分配比例,并便存储控制器210按照该分配比例配置QLC闪存阵列220中的各存储单元。也就是说,上述实施例一至实施例三中关于决策目标分配比例的操作步骤具体可以由优化决策模块212执行,如上述实施例一中的步骤302、上述实施例二中的步骤403和步骤404、以及上述实施例三中的步骤807至步骤808。
需要说明的是,存储控制器210中的各个部件是指功能部件,这些部件可以作为单独的器件分别进行设置,也可以在一个器件中实现,还可以按照任意组合的方式设置在至少两个器件中,本申请对此不作具体限定。
需要说明的是,本申请的上述实施例只是以QLC模式和SLC模式混合配置为例介绍确定分配比例的方式。该方案也可以适用于其它任意两个或两个以上的颗粒混合配置方式,如QLC模式和TLC模式混合,或QLC模式与MLC模式混合,或QLC模式、TLC模式和SLC模式混合等,本申请对此不作具体限定。
可以理解的是,随着存储技术的不断发展,存储系统中的QLC闪存阵列的介质可以为SSD颗粒,也可以为后续发展时的任何其它存储介质,本申请对此不做限定。
根据前述方法,图9为本申请实施例提供的一种存储控制器的结构示意图,该存储控制器可以为芯片或电路,比如可设置于存储器中的芯片或电路。如图9所示,该存储控制器900可以包括处理器901以及耦合至处理器901的存储接口902,处理器901和存储接口902具体可通过总线系统实现耦合。存储接口902还用于耦合至QLC闪存阵列。处理器901可通过存储接口902实现上述实施例一至实施例三中任一实施例或上述图1至图8中任一方案中存储控制器所执行的方法。
在执行实施例一时,处理器901可以通过存储接口902检测QLC闪存阵列的历史数据的热度,根据QLC闪存阵列的历史数据的热度及QLC闪存阵列的剩余空间,自适应地调整QLC闪存阵列中配置为QLC模式的存储单元与配置为SLC模式的存储单元的空间分配。其中,QLC闪存阵列中配置为SLC模式的存储单元用于存储热数据,QLC闪存阵列中配置为QLC模式的存储单元用于存储冷数据。
应理解,上述处理器901可以是一个芯片。例如,该处理器901可以是现场可编程门阵列(field programmable gate array,FPGA),可以是专用集成芯片(application specific integrated circuit,ASIC),还可以是系统芯片(system on chip,SoC),还可以是中央处理器(central processor unit,CPU),还可以是网络处理器(network processor,NP),还可以是数字信号处理电路(digital signal processor,DSP),还可以是微控制器(micro controller  unit,MCU),还可以是可编程控制器(programmable logic device,PLD)或其他集成芯片。
在实现过程中,上述方法的各步骤可以通过处理器901中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器901中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于QLC闪存阵列,处理器901读取QLC闪存阵列中的信息,结合其硬件完成上述方法的步骤。
应注意,本申请实施例中的处理器901可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。
可以理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。应注意,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。
该存储控制器所涉及的与本申请实施例提供的技术方案相关的概念,解释和详细说明及其他步骤请参见前述方法或其他实施例中关于这些内容的描述,此处不做赘述。
根据本申请实施例提供的方法,本申请还提供一种计算机程序产品,该计算机程序产品包括:计算机程序代码,当该计算机程序代码在计算机上运行时,使得该计算机执行图1至图8所示实施例中任意一个实施例的方法。
根据本申请实施例提供的方法,本申请还提供一种计算机可读存储介质,该计算机可读介质存储有程序代码,当该程序代码在计算机上运行时,使得该计算机执行图1至图8所示实施例中任意一个实施例的方法。其中,存储介质可以是计算机能够存取的任何可用介质,例如SSD、PCM等。
根据本申请实施例提供的方法,本申请还提供一种数据处理系统,该数据处理系统包 括上述内容任一所述的主机、存储控制器和QLC闪存阵列。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的保护范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (23)

  1. 一种数据处理方法,其特征在于,包括:
    检测四层式存储单元QLC闪存阵列的历史数据的热度;
    根据所述QLC闪存阵列的历史数据的热度及所述QLC闪存阵列的剩余空间,自适应地调整所述QLC闪存阵列中配置为QLC模式的存储单元与配置为单层式存储单元SLC模式的存储单元的空间分配;
    其中,所述QLC闪存阵列中配置为SLC模式的存储单元用于存储热数据,所述QLC闪存阵列中配置为QLC模式的存储单元用于存储冷数据。
  2. 如权利要求1所述的方法,其特征在于,所述检测四层式存储单元QLC闪存阵列的历史数据的热度,包括:
    将所述历史数据中具有热数据标签的历史数据作为热数据;
    综合所述历史数据的写入次数得到所述历史数据的总写入次数,综合所述具有热数据标签的历史数据的写入次数得到所述热数据的总写入次数;
    根据所述历史数据的总写入次数和所述热数据的总写入次数,确定所述历史数据的热度。
  3. 如权利要求1所述的方法,其特征在于,所述QLC闪存阵列中的存储单元划分为N个存储单元块,所述N个存储单元块中的每个存储单元块中包括至少一个存储单元,N为大于或等于2的正整数;
    所述检测四层式存储单元QLC闪存阵列的历史数据的热度,包括:
    统计所述历史数据写入所述每个存储单元块的写入次数;
    将所述N个存储单元块中写入次数大于预设次数的存储单元块作为热数据所写入的目标存储单元块;
    综合所述历史数据的写入次数得到所述历史数据的总写入次数,综合所述目标存储单元块的写入次数得到热数据的总写入次数;
    根据所述历史数据的总写入次数和所述热数据的总写入次数,确定所述历史数据的热度。
  4. 如权利要求3所述的方法,其特征在于,所述方法还包括:
    从所述N个存储单元块中获取写入次数从多到少排序得到的前K个存储单元块;
    以所述前K个存储单元块中的每个存储单元块的写入次数为所述预设次数,计算得到K个历史数据的热度;
    根据所述K个历史数据的热度和所述QLC闪存阵列的剩余空间,计算出所述K个历史数据的热度分别对应的K个备选空间分配;
    使用所述K个备选空间分配中使所述QLC闪存阵列的预设性能达到最大的目标备选空间分配,调整所述QLC闪存阵列中配置为QLC模式的存储单元和配置为QLC模式的存储单元。
  5. 如权利要求1至4中任一项所述的方法,其特征在于,所述空间分配包括QLC空间和SLC空间,所述QLC空间指示配置为QLC模式的存储单元的数量,所述SLC空间指示配置为SLC模式的存储单元的数量;
    所述根据所述QLC闪存阵列的历史数据的热度及所述QLC闪存阵列的剩余空间,自 适应地调整所述QLC闪存阵列中配置为QLC模式的存储单元与配置为单层式存储单元SLC模式的存储单元的空间分配,包括:
    使用所述QLC闪存阵列的历史数据的热度、所述QLC闪存阵列的剩余空间、所述QLC空间和所述SLC空间表征所述QLC闪存阵列的预设性能;
    按照用户容量一致性原则及存储单元数量一致性原则,确定出使所述QLC闪存阵列的预设性能达到最大的QLC空间的取值和SLC空间的取值;其中,所述用户容量为用户能看到的所述QLC闪存阵列的可写入数据量;
    根据所述QLC空间的取值和所述SLC空间的取值,调整所述QLC闪存阵列中的各存储单元的模式。
  6. 如权利要求5所述的方法,其特征在于,所述QLC空间中包括QLC用户空间和QLC冗余空间,所述SLC空间中包括SLC用户空间和SLC冗余空间;所述QLC用户空间指示配置为用户空间的QLC模式的存储单元的数量,所述QLC冗余空间指示配置为冗余空间的QLC模式的存储单元的数量,所述SLC用户空间指示配置为用户空间的SLC模式的存储单元的数量,所述SLC冗余空间指示配置为冗余空间的SLC模式的存储单元的数量;
    所述按照用户容量一致性原则及存储单元数量一致性原则,确定出使所述QLC闪存阵列的预设性能达到最大的QLC空间的取值和SLC空间的取值,包括:
    根据用户容量一致性原则及存储单元数量一致性原则,计算得到所述QLC用户空间、所述QLC冗余空间、所述SLC用户空间和所述SLC冗余空间之间的第一关联关系;
    计算出使所述QLC闪存阵列的预设性能达到最大的所述QLC用户空间、所述QLC冗余空间、所述SLC用户空间和所述SLC冗余空间之间的第二关联关系;
    基于所述第一关联关系和所述第二关联关系,确定出所述QLC用户空间的取值、所述QLC冗余空间的取值、所述SLC用户空间的取值和所述SLC冗余空间的取值。
  7. 如权利要求4至6中任一项所述的方法,其特征在于,所述QLC闪存阵列的预设性能包括所述QLC闪存阵列的每日全盘写满次数DWPD性能和/或所述QLC闪存阵列的每秒写入数量IOPS性能。
  8. 如权利要求1至7中任一项所述的方法,其特征在于,所述QLC闪存阵列的剩余空间包括所述QLC闪存阵列的剩余可擦写次数、所述QLC闪存阵列的写放大、所述QLC闪存阵列的单日可写入数据量、以及所述QLC闪存阵列的剩余可写入数据量中的一项或多项。
  9. 如权利要求1至8中任一项所述的方法,其特征在于,所述自适应地调整所述QLC闪存阵列中配置为QLC模式的存储单元与配置为单层式存储单元SLC模式的存储单元的空间分配,包括:
    若所述空间分配指示配置的SLC模式的存储单元的数量大于所述QLC闪存阵列中SLC模式的存储单元的当前数量,则将所述QLC闪存阵列中的部分或全部QLC模式的存储单元配置为SLC模式;
    若所述空间分配中指示配置的SLC模式的存储单元的数量不大于所述QLC闪存阵中SLC模式的存储单元的当前数量,则不更改所述QLC闪存阵列中的各存储单元的当前模式。
  10. 一种存储控制器,其特征在于,包括:
    处理器以及耦合至所述处理器的存储接口;
    所述存储接口用于耦合至四层式存储单元QLC闪存阵列;
    所述处理器用于:
    检测所述QLC闪存阵列的历史数据的热度;
    根据所述QLC闪存阵列的历史数据的热度及所述QLC闪存阵列的剩余空间,自适应地调整所述QLC闪存阵列中配置为QLC模式的存储单元与配置为单层式存储单元SLC模式的存储单元的空间分配;
    其中,所述QLC闪存阵列中配置为SLC模式的存储单元用于存储热数据,所述QLC闪存阵列中配置为QLC模式的存储单元用于存储冷数据。
  11. 如权利要求10所述的存储控制器,其特征在于,所述处理器具体用于:
    将所述历史数据中具有热数据标签的历史数据作为热数据;
    综合所述历史数据的写入次数得到所述历史数据的总写入次数,综合所述具有热数据标签的历史数据的写入次数得到所述热数据的总写入次数;
    根据所述历史数据的总写入次数和所述热数据的总写入次数,确定所述历史数据的热度。
  12. 如权利要求10所述的存储控制器,其特征在于,所述QLC闪存阵列中的存储单元划分为N个存储单元块,所述N个存储单元块中的每个存储单元块中包括至少一个存储单元,N为大于或等于2的正整数;
    所述处理器具体用于:
    统计所述历史数据写入所述每个存储单元块的写入次数;
    将所述N个存储单元块中写入次数大于预设次数的存储单元块作为热数据所写入的目标存储单元块;
    综合所述历史数据的写入次数得到所述历史数据的总写入次数,综合所述目标存储单元块的写入次数得到热数据的总写入次数;
    根据所述历史数据的总写入次数和所述热数据的总写入次数,确定所述历史数据的热度。
  13. 如权利要求12所述的存储控制器,其特征在于,所述处理器还用于:
    从所述N个存储单元块中获取写入次数从多到少排序得到的前K个存储单元块;
    以所述前K个存储单元块中的每个存储单元块的写入次数为所述预设次数,计算得到K个历史数据的热度;
    根据所述K个历史数据的热度和所述QLC闪存阵列的剩余空间,计算出所述K个历史数据的热度分别对应的K个备选空间分配;
    使用所述K个备选空间分配中使所述QLC闪存阵列的预设性能达到最大的目标备选空间分配,调整所述QLC闪存阵列中配置为QLC模式的存储单元和配置为QLC模式的存储单元。
  14. 如权利要求10至13中任一项所述的存储控制器,其特征在于,所述空间分配包括QLC空间和SLC空间,所述QLC空间指示配置为QLC模式的存储单元的数量,所述SLC空间指示配置为SLC模式的存储单元的数量;
    所述处理器具体用于:
    使用所述QLC闪存阵列的历史数据的热度、所述QLC闪存阵列的剩余空间、所述QLC 空间和所述SLC空间表征所述QLC闪存阵列的预设性能;
    按照用户容量一致性原则及存储单元数量一致性原则,确定出使所述QLC闪存阵列的预设性能达到最大的QLC空间的取值和SLC空间的取值;其中,所述用户容量为用户能看到的所述QLC闪存阵列的可写入数据量;
    根据所述QLC空间的取值和所述SLC空间的取值,调整所述QLC闪存阵列中的各存储单元的模式。
  15. 如权利要求14所述的存储控制器,其特征在于,所述QLC空间中包括QLC用户空间和QLC冗余空间,所述SLC空间中包括SLC用户空间和SLC冗余空间;所述QLC用户空间指示配置为用户空间的QLC模式的存储单元的数量,所述QLC冗余空间指示配置为冗余空间的QLC模式的存储单元的数量,所述SLC用户空间指示配置为用户空间的SLC模式的存储单元的数量,所述SLC冗余空间指示配置为冗余空间的SLC模式的存储单元的数量;
    所述处理器具体用于:
    根据用户容量一致性原则及存储单元数量一致性原则,计算得到所述QLC用户空间、所述QLC冗余空间、所述SLC用户空间和所述SLC冗余空间之间的第一关联关系;
    计算出使所述QLC闪存阵列的预设性能达到最大的所述QLC用户空间、所述QLC冗余空间、所述SLC用户空间和所述SLC冗余空间之间的第二关联关系;
    基于所述第一关联关系和所述第二关联关系,确定出所述QLC用户空间的取值、所述QLC冗余空间的取值、所述SLC用户空间的取值和所述SLC冗余空间的取值。
  16. 如权利要求13至15中任一项所述的存储控制器,其特征在于,所述QLC闪存阵列的预设性能包括所述QLC闪存阵列的每日全盘写满次数DWPD性能和/或所述QLC闪存阵列的每秒写入数量IOPS性能。
  17. 如权利要求10至16中任一项所述的存储控制器,其特征在于,所述QLC闪存阵列的剩余空间包括所述QLC闪存阵列的剩余可擦写次数、所述QLC闪存阵列的写放大、所述QLC闪存阵列的单日可写入数据量、以及所述QLC闪存阵列的剩余可写入数据量中的一项或多项。
  18. 如权利要求10至17中任一项所述的存储控制器,其特征在于,所述处理器具体用于:
    若所述空间分配指示配置的SLC模式的存储单元的数量大于所述QLC闪存阵列中SLC模式的存储单元的当前数量,则将所述QLC闪存阵列中的部分或全部QLC模式的存储单元配置为SLC模式;
    若所述空间分配中指示配置的SLC模式的存储单元的数量不大于所述QLC闪存阵中SLC模式的存储单元的当前数量,则不更改所述QLC闪存阵列中的各存储单元的当前模式。
  19. 根据权利要求10-18中任一项所述的存储控制器,其特征在于,所述存储控制器为固态存储设备SSD中的存储控制器,所述存储单元为快闪NAND闪存颗粒。
  20. 一种存储器,其特征在于,包括QLC闪存阵列以及如上述权利要求10-19中任一项所述的存储控制器,其中,所述存储控制器用于读写所述QLC闪存阵列中的数据。
  21. 一种数据处理系统,其特征在于,包括主机以及如权利要求20所述的存储器,其中,所述主机用于向所述存储器发送数据处理请求,所述存储器被配置为执行存储的指 令,所述存储器通过执行指令来实现如权利要求1-9中任一项所述的数据处理方法。
  22. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,当所述计算机程序在计算机上运行时,使得计算机执行权利要求1-9中任一项所述的方法。
  23. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行权利要求1-9中任一项所述的方法。
PCT/CN2021/074558 2021-01-30 2021-01-30 一种数据处理方法、装置及系统 WO2022160317A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202180076377.3A CN116457885A (zh) 2021-01-30 2021-01-30 一种数据处理方法、装置及系统
PCT/CN2021/074558 WO2022160317A1 (zh) 2021-01-30 2021-01-30 一种数据处理方法、装置及系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/074558 WO2022160317A1 (zh) 2021-01-30 2021-01-30 一种数据处理方法、装置及系统

Publications (1)

Publication Number Publication Date
WO2022160317A1 true WO2022160317A1 (zh) 2022-08-04

Family

ID=82652897

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/074558 WO2022160317A1 (zh) 2021-01-30 2021-01-30 一种数据处理方法、装置及系统

Country Status (2)

Country Link
CN (1) CN116457885A (zh)
WO (1) WO2022160317A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117369735A (zh) * 2023-12-08 2024-01-09 荣耀终端有限公司 数据存储方法、电子设备及存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116627355B (zh) * 2023-07-21 2023-10-13 北京得瑞领新科技有限公司 冷热数据标定方法、装置及电子设备
CN116627360B (zh) * 2023-07-24 2023-11-03 苏州浪潮智能科技有限公司 数据下发方法、数据管理系统、服务器及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105551522A (zh) * 2016-01-14 2016-05-04 深圳市硅格半导体股份有限公司 闪存存储设备的管理方法及装置
CN106843762A (zh) * 2017-01-17 2017-06-13 北京联想核芯科技有限公司 管理存储区域的方法及固态硬盘
CN107466418A (zh) * 2015-03-27 2017-12-12 英特尔公司 用于多级别单元模式非易失性存储器的成本优化单级别单元模式非易失性存储器
CN110569002A (zh) * 2019-09-18 2019-12-13 深圳市得一微电子有限责任公司 一种基于混合模式的闪存设备可变容量装置和方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107466418A (zh) * 2015-03-27 2017-12-12 英特尔公司 用于多级别单元模式非易失性存储器的成本优化单级别单元模式非易失性存储器
CN105551522A (zh) * 2016-01-14 2016-05-04 深圳市硅格半导体股份有限公司 闪存存储设备的管理方法及装置
CN106843762A (zh) * 2017-01-17 2017-06-13 北京联想核芯科技有限公司 管理存储区域的方法及固态硬盘
CN110569002A (zh) * 2019-09-18 2019-12-13 深圳市得一微电子有限责任公司 一种基于混合模式的闪存设备可变容量装置和方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117369735A (zh) * 2023-12-08 2024-01-09 荣耀终端有限公司 数据存储方法、电子设备及存储介质
CN117369735B (zh) * 2023-12-08 2024-05-10 荣耀终端有限公司 数据存储方法、电子设备及存储介质

Also Published As

Publication number Publication date
CN116457885A (zh) 2023-07-18

Similar Documents

Publication Publication Date Title
WO2022160317A1 (zh) 一种数据处理方法、装置及系统
US11586357B2 (en) Memory management
US10387243B2 (en) Managing data arrangement in a super block
WO2021008220A1 (en) Systems and methods for data storage system
US9778855B2 (en) System and method for precision interleaving of data writes in a non-volatile memory
US10133490B2 (en) System and method for managing extended maintenance scheduling in a non-volatile memory
US10120613B2 (en) System and method for rescheduling host and maintenance operations in a non-volatile memory
US10802733B2 (en) Methods and apparatus for configuring storage tiers within SSDs
US20170123666A1 (en) System and method for managing maintenance scheduling in a non-volatile memory
US10635335B2 (en) Storage system and method for efficient pipeline gap utilization for background operations
CN106951186B (zh) 数据程序化方法、存储器存储装置及存储器控制电路单元
TW202018513A (zh) 固態硬碟及其資料存取的方法
US20200401353A1 (en) Resource allocation in memory systems based on operation modes
US11175847B2 (en) Data merging method, control circuit unit and storage device for flash memory
US11775191B2 (en) Host load based dynamic storage system for configuration for increased performance
TWI786288B (zh) 儲存裝置、儲存裝置的控制方法及記錄媒體
WO2021035555A1 (zh) 一种固态硬盘的数据存储方法、装置及固态硬盘ssd
CN115390746A (zh) 主机设备、存储设备以及电子设备
US10042553B2 (en) Method and system for programming a multi-layer non-volatile memory having a single fold data path
CN110471612B (zh) 存储器管理方法以及存储控制器
CN113867640A (zh) 存储器轮询方法、存储器存储装置及存储器控制电路单元
CN107688435B (zh) Io流调节方法与装置
TW202314471A (zh) 儲存裝置及其操作方法
TWI760697B (zh) 記憶體之資料整理方法、記憶體儲存裝置及記憶體控制電路單元
CN110364207B (zh) 解码方法以及储存控制器

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: 21921918

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180076377.3

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21921918

Country of ref document: EP

Kind code of ref document: A1