WO2020248206A1 - 一种硬盘控制方法及相关设备 - Google Patents

一种硬盘控制方法及相关设备 Download PDF

Info

Publication number
WO2020248206A1
WO2020248206A1 PCT/CN2019/091189 CN2019091189W WO2020248206A1 WO 2020248206 A1 WO2020248206 A1 WO 2020248206A1 CN 2019091189 W CN2019091189 W CN 2019091189W WO 2020248206 A1 WO2020248206 A1 WO 2020248206A1
Authority
WO
WIPO (PCT)
Prior art keywords
mode
data
storage
user data
hard disk
Prior art date
Application number
PCT/CN2019/091189
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 CN201980097515.9A priority Critical patent/CN114008580A/zh
Priority to PCT/CN2019/091189 priority patent/WO2020248206A1/zh
Priority to EP19932927.7A priority patent/EP3964939A4/en
Priority to KR1020217043003A priority patent/KR20220015457A/ko
Priority to JP2021573823A priority patent/JP2022537520A/ja
Priority to TW109119837A priority patent/TWI779300B/zh
Publication of WO2020248206A1 publication Critical patent/WO2020248206A1/zh
Priority to US17/547,592 priority patent/US20220100406A1/en

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
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0634Configuration or reconfiguration of storage systems by changing the state or mode of one or more devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0616Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0688Non-volatile semiconductor memory arrays
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7206Reconfiguration of flash memory system

Definitions

  • the invention relates to the storage field, in particular to a hard disk control method and related equipment.
  • NAND flash memory is a non-volatile random access storage medium. When the power is off, the data stored in the hard disk that uses NAND flash memory will not disappear.
  • the hard disk using NAND flash memory can be divided into single-level cell (SLC), multi-level cell (MLC), and three-tier according to the amount of data stored in each storage cell. Type storage cells (triple level cell, TLC) and quad-level storage cells (quad level cell, QLC), etc.
  • SLC single-level cell
  • MLC multi-level cell
  • QLC quad-level storage cells
  • Some hard disks can adjust the data storage mode of the hard disk.
  • QLC hard disks can adjust the data storage mode to SLC mode. In this way, the data density of the QLC hard disk can be reduced, and the service life of the hard disk of the hard disk can be increased. But this way will make the hard disk lose the corresponding capacity.
  • Some hard disks can adjust the hard disk as a whole, or divide the hard disk into multiple areas, and then adjust each area separately.
  • a QLC hard disk can be adjusted to SLC mode as a whole, so that the QLC hard disk will lose 3/4 of its capacity.
  • the part configured in MLC mode will lose 1/3 of the capacity, and the TLC hard disk will lose 1/2 of the capacity in total. Therefore, after the hard disk adjusts the data storage mode, the capacity of the hard disk will be lost.
  • the first aspect of the embodiments of the present invention provides a hard disk control method, the method is applied to a storage device, the method includes: detecting whether the amount of user data stored in the storage device meets a first quantity condition, the storage device includes a A storage area, the first storage area stores data in a first mode, the first mode is one of SLC mode, MLC mode, TLC mode, and QLC mode; when the amount of stored user data meets the first quantity condition , The mode of storing data in the first sub-area in the first storage area is converted from the first mode to the second mode.
  • the second mode is one of SLC mode, MLC mode, TLC mode, and QLC mode, and the second mode is The mode is different from the first mode.
  • the storage device can switch the mode of storing data in the storage device from the first mode to the second mode.
  • the first mode is SLC mode
  • the second mode can be one of QLC mode, TLC mode, or MLC mode
  • the first mode is MLC mode
  • the second mode can be TLC mode or QLC mode
  • the first mode is the TLC mode, and the first mode may be the QLC mode. This can increase the data density of the storage device, thereby expanding the capacity of the storage space of the storage device, so that the capacity of the storage device is not lost.
  • the storage device can switch the mode in which the storage device stores data from the first mode to the second mode.
  • the second mode is one of SLC mode, MLC mode, or TLC mode; if the first mode is TLC mode, the second mode can be SLC mode or MLC mode; The mode is MLC mode, and the second mode may be SLC mode. This can reduce the data density of the storage device, thereby increasing the number of erasing and writing of the storage device and extending the service life of the storage device.
  • the method further includes: converting at least part of the user data in the user data in the first storage area Migrate to the converted first sub-area; release the area occupied by at least part of the user data in the first storage area; convert the data storage mode of the area occupied by at least a part of the user data to the second mode.
  • the modes are converted to the second mode. On the one hand, this can increase the service life of the storage device, and on the other hand, it can ensure that its capacity is not lost.
  • the method before converting the mode of storing data in the first sub-region in the first storage area from the first mode to the second mode, the method further includes: converting at least a part of user data in the user data in the first storage area Migrate to the cache of the storage device; release at least a part of the area occupied by user data; after converting the mode of storing data in the first subarea in the first storage area from the first mode to the second mode, convert at least part of the user data to the first mode The second mode is written into the converted first storage area. In this way, the cache of the storage device can be utilized and the utilization efficiency of storage resources can be improved.
  • the storage device may further include a second storage area, the second storage area stores data in a second mode, and the mode of storing data in the first sub-area in the first storage area is converted from the first mode to the second mode
  • the method further includes: migrating at least a part of the user data in the first storage area to the second storage area of the storage device; and releasing the area occupied by at least a part of the user data. In this way, user data can be migrated first, and then storage space can be released, which can ensure data security.
  • the method further includes: receiving a data write request, where the data write request includes target data; and writing the target data into the converted first sub-area in the second mode. After the mode of storing data in the first subarea in the first storage area is converted from the first mode to the second mode. If the storage device receives the data write request again, the storage device writes the target data in the second mode into the converted first sub-area.
  • the method further includes: detecting whether the data volume of the user data stored in the storage device meets the second quantity condition, the storage device includes a second storage area; when the data volume of the stored user data meets the second quantity condition, The mode of storing data in the second sub-area in the second storage area is converted from the second mode to the third mode.
  • the third mode is one of SLC mode, MLC mode, TLC mode, and QLC mode, and the third mode Different from the second mode.
  • a second aspect of the embodiments of the present invention provides a hard disk control device, the hard disk control device is applied to a hard disk, the hard disk includes a flash memory controller and a flash memory chip, the flash memory chip includes a plurality of erasing blocks, the hard disk control device is located in the flash memory controller
  • the hard disk control device includes: a detection module for detecting whether the amount of user data stored in the storage device meets a first quantity condition, the storage device includes a first storage area, and the first storage area stores data in a first mode, The first mode is one of SLC mode, MLC mode, three-layer storage unit TLC mode, and QLC mode; the processing module is used for when the detection module detects that the amount of stored user data meets the first quantity condition, Convert the mode of storing data in the first sub-area in the first storage area from the first mode to the second mode.
  • the second mode is one of SLC mode, MLC mode, TLC mode, and QLC mode, and the second mode Different from the first mode.
  • the processing module converts the data storage mode of the first sub-area in the first storage area from the first mode to the second mode. On the one hand, the service life of the storage device can be increased, and on the other hand, its capacity can be guaranteed not to be lost.
  • the hard disk control device includes: a processing module for migrating at least a part of user data in the user data in the first storage area to the converted first sub-area; and the processing module for releasing the first storage area
  • the area occupied by at least part of the user data in the processing module is also used to convert the data storage mode of the area occupied by at least part of the user data into the second mode.
  • the hard disk control device includes: a processing module, further configured to migrate at least a part of user data in the user data in the first storage area to a second storage area of the hard disk, and the second storage area stores data in a second mode;
  • the processing module is also used to release at least a part of the area occupied by user data.
  • the hard disk control device includes: a receiving module, configured to receive a data write request, where the write data request includes target data; and a processing module, further configured to write the target data into the converted first sub-region in the second mode.
  • the hard disk control device includes: a detection module, which is also used to detect whether the amount of user data stored in the storage device meets the second quantity condition, the storage device includes a second storage area; the processing module is also used for When the detection module detects that the data volume of the stored user data meets the second quantity condition, it converts the data storage mode of the second sub-region in the second storage area from the second mode to the third mode.
  • the third mode is the SLC mode, One of MLC mode, TLC mode, and QLC mode, and the third mode is different from the second mode.
  • a third aspect of the embodiments of the present invention provides a controller, the controller is located in a storage device, the storage device includes at least one hard disk and the controller, the controller includes a processor and a memory, and the memory stores program instructions ,
  • the processor is used to call program instructions in the memory to perform the following steps: detect whether the amount of user data stored in the storage device meets the first quantity condition, the storage device includes a first storage area, and the first storage area is in a first mode To store data, the first mode is one of the single-layer storage cell SLC mode, the multi-layer storage cell MLC mode, the three-layer storage cell TLC mode, and the four-layer storage cell QLC mode; when the storage device is stored When the data volume of user data meets the first quantity condition, the mode of storing data in the first subarea in the first storage area is converted from the first mode to the second mode.
  • the second mode is SLC mode, MLC mode, TLC mode, One of the QLC modes, and the second mode is different from the first mode. On the one hand, this can increase the service life of the storage device, and on the other hand, it can ensure that its capacity is not lost.
  • the processor is further configured to call program instructions in the memory to perform the following steps: migrate at least a part of the user data in the first storage area to the converted first sub-area; release the first storage area The area occupied by at least a part of the user data converts the data storage mode of the area occupied by at least a part of the user data into the second mode.
  • the processor is further configured to call program instructions in the memory to execute the following steps: migrating at least part of the user data in the user data in the first storage area to the cache of the storage device; releasing at least part of the area occupied by the user data; After the mode of storing data in the first sub-area in the first storage area is converted from the first mode to the second mode, at least part of the user data is written in the converted first storage area in the second mode.
  • the processor is further configured to call program instructions in the memory to perform the following steps: migrate at least a part of the user data in the user data in the first storage area to the second storage area of the storage device, and the second storage area is The second mode stores data; releases the area occupied by at least part of the data.
  • the controller is also used to call program instructions in the memory to perform the following steps: receive a write data request, where the write data request includes target data; write the target data in the second mode in the second storage area or the converted first A storage area.
  • the processor is further configured to call program instructions in the memory to perform the following steps: detect whether the amount of user data stored in the storage device meets the second quantity condition, the storage device includes a second storage area; when the storage device When the data volume of the stored user data meets the second quantity condition, the mode of storing data in the second subarea in the second storage area is converted from the second mode to the third mode.
  • the third mode is SLC mode, MLC mode, and TLC Mode, QLC mode, and the third mode is different from the second mode.
  • the present application also provides a computer-readable storage medium having instructions stored in the computer-readable storage medium, which when run on a computer, cause the computer to execute the methods described in the foregoing aspects.
  • the present application also provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the methods described in the above aspects.
  • the embodiment of the present invention provides a hard disk control method and related equipment.
  • the hard disk control method includes: detecting whether a data amount of user data stored in a storage device meets a first quantity condition. When the data amount of the stored user data meets the first quantity condition, the mode of storing data in the first subregion in the first storage area is converted from the first mode to the second mode, and the second mode is different from the first mode.
  • the storage device can switch the mode of storing data in the storage device from the first mode to the second mode.
  • the first mode is the SLC mode
  • the second mode is the QLC mode.
  • the storage device can switch the mode in which the storage device stores data from the first mode to the second mode.
  • the first mode is the QLC mode
  • the second mode is the SLC mode. This can reduce the data density of the storage device, thereby increasing the number of erasing and writing of the storage device and extending the service life of the storage device.
  • FIG. 1 is a composition diagram of a storage device provided by an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of a controller provided by an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a hard disk provided by an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a hard disk mode provided by an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of an embodiment of a hard disk control method provided by an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of another embodiment of a hard disk control method provided by an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of another embodiment of a hard disk control method provided by an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of another embodiment of a hard disk control method provided by an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of another embodiment of a hard disk control method provided by an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of an embodiment of a hard disk provided by an embodiment of the present invention.
  • Fig. 11 is a schematic diagram of an embodiment of a controller provided by an embodiment of the present invention.
  • FIG. 1 depicts a composition diagram of a flash memory array provided by an embodiment of the present invention.
  • the flash memory array shown in FIG. 1 includes at least one controller 11 and a plurality of hard disks 12, and the hard disk 12 may be a solid state disk (SSD).
  • a solid-state hard disk is a memory that uses flash memory (flash memory) chips as a medium, and is also known as a solid state drive (SSD).
  • the controller 11 is connected to other devices through a storage area network (SAN).
  • the controller 11 may be a computing device, such as a server, a desktop computer, and so on.
  • An operating system and application programs are installed on the controller 11.
  • the controller 11 can receive input and output (I/O) requests from the host.
  • the controller 11 may also store data carried in the I/O request, and write the data into the hard disk 12.
  • Figure 1 is only an exemplary illustration.
  • the storage system may include two or more controllers, and the physical structure and function of each controller is similar to that of the controller 11, and this embodiment does not limit the number of controllers. And the connection between any controller and the hard disk 12. As long as the controllers and the controllers and the hard disk 12 can communicate with each other.
  • the controller 11 includes an interface card 111, a memory 112 and a processor 113.
  • the interface card 111 is used to communicate with the host, and the controller 11 can receive operation instructions from the host through the interface card 111.
  • the processor 113 may be a central processing unit (CPU). In the embodiment of the present invention, the processor 113 may be used to receive an I/O request from the host and process the I/O request.
  • the I/O request may be a data write request or a data read request, and the processor 113 may also send data in the data write request to the hard disk 12.
  • the processor 113 can also be used to perform system garbage collection operations.
  • the interface card 114 is used to communicate with the hard disk 12, and the controller 11 can send a data write request to the hard disk 12 for storage through the interface card 114.
  • the controller 11 may also include a memory 112.
  • the memory 112 is used to temporarily store data received from the host or data read from the hard disk 12. When the controller 11 receives multiple write data requests sent by the host, it may temporarily store the data in the multiple write data requests in the memory 112. When the capacity of the memory 112 reaches a certain threshold, the data stored in the memory 112 and the logical address allocated for the data are sent to the hard disk 12. The hard disk 12 stores the data.
  • the memory 112 includes a volatile memory, a flash memory chip, or a combination thereof.
  • the volatile memory is, for example, random-access memory (RAM). Flash memory chips, such as floppy disks, hard disks, solid state hard disks, optical disks, and other machine-readable media that can store program codes.
  • the memory 112 has a power-saving function, which means that when the system is powered off and on again, the data stored in the memory 112 will not be lost.
  • the hard disk 12 may include a flash memory controller 121 and a plurality of flash memory chips 122.
  • the flash memory controller 121 is used to perform operations such as a write data request or a data read request sent by the controller 11. It should be noted that the controller 11 in FIG. 1 is a system controller, and the system controller is an independent device, which is different from the flash memory controller 121 in the hard disk 12.
  • the flash memory controller 121 includes a flash translation layer (FTL).
  • the flash translation layer is used to store the correspondence between the logical address of the data and the actual address. Therefore, the flash translation layer is used to convert the logical address in the data write request or the data read request sent by the system controller into the actual address of the data in the hard disk.
  • the logical address of the data is allocated by the system controller, which includes the starting logical address and length.
  • the actual address of the data may be the physical address of the data in the hard disk, or it may be an address that is virtualized on the basis of the physical address and is only visible to the flash memory controller. The actual address is not visible to the system controller.
  • Hard disks usually include one or more flash memory chips. Each flash memory chip includes several erase blocks. The hard disk is based on a page when reading or writing, but the erasing operation can only be based on an erasing block. The erasing operation refers to setting all bits of this block to "1" . Before erasing, the flash memory controller needs to copy the valid data in this erase block to a blank page in another block.
  • the valid data in the erase block refers to the data stored in the block that has not been modified. This part of the data may be read.
  • the invalid data in the erase block refers to the data stored in the block that has been modified, and this part of the data cannot be read.
  • Each erase block contains multiple pages.
  • the hard disk performs a data write request, it writes data in units of pages.
  • the controller 11 sends a data write request to the flash memory controller 121.
  • the write data request includes the logical address of the data.
  • the flash memory controller 121 continuously writes the data into one or more erase blocks according to the received time sequence. Writing one or more erase blocks continuously means that the flash memory controller 121 searches for a blank erase block and writes data into the blank erase block until the blank erase block is filled. When the size of the data exceeds the capacity of the erase block, the flash memory controller 121 searches for the next blank erase block and continues writing.
  • the flash translation layer establishes and saves the correspondence between the logical address and the actual address of the page where the data is written.
  • the read data request includes the logical address.
  • the flash memory controller 121 reads the data according to the logical address and the corresponding relationship between the logical address and the actual address, and sends the data to the controller 11.
  • a memory cell is the smallest operation unit of a page.
  • a memory cell corresponds to a floating gate transistor. It can store 1 bit or multiple bits of data, depending on the type of hard disk.
  • the memory cells on one page share one character line.
  • the storage unit includes a control gate and a floating gate.
  • the floating gate is a unit that actually stores data. Data is stored in the form of electrical charge in the storage unit. The amount of stored charge depends on the voltage applied to the control gate, which controls whether charge is charged into the floating gate or discharged. The data is expressed by whether the voltage of the stored charge exceeds a certain threshold. Writing data to the floating gate is to apply a voltage to the control gate so that there is enough charge stored in the floating gate, and if it exceeds the threshold, it means 0. To erase the floating gate is to discharge the floating gate so that the charge stored in the floating gate is lower than the threshold, which means 1.
  • the hard disk that stores one bit of data in each storage unit is called SLC hard disk.
  • the floating gate of each storage unit of SLC hard disk has a voltage threshold, so it has two states of 0 and 1, which can store one bit of data.
  • the density is relatively low.
  • SLC hard disk has the advantages of high writing speed, low power consumption, and longer battery durability, so it has faster transmission speed and longer service life.
  • the multi-layer storage unit MLC hard disk has 4 states (00, 01, 10, 11 4 states) for each storage unit, and each storage unit can store two-bit data. Compared with SLC hard drives, MLC hard drives have a higher bit error rate, higher data density, shorter service life, and lower cost.
  • a hard disk with three bits of data stored in each storage unit is called a TLC hard disk, and each storage unit of the TLC hard disk has 8 states.
  • MLC hard drives also exist and are more prominent on TLC hard drives, but TLC hard drives also benefit from higher data density and lower cost.
  • QLC hard disks with each storage unit storing four bits of data and hard disks with other multi-layer storage units.
  • Each storage unit of the QLC hard disk has 16 states, and each storage unit can store four bits of data.
  • Some hard disks can increase the rewritable times of the hard disk by reducing the data density of the hard disk, thereby increasing the service life of the hard disk.
  • the data density of the hard disk can be lowered by reducing the amount of data stored in each storage unit of the hard disk.
  • a QLC hard disk can adjust the amount of data stored in each storage unit from four bits to three bits.
  • each storage unit in the QLC hard disk stores three bits of data, which is the same as the amount of data stored in each storage unit in the TLC hard disk. It can be considered that the data storage mode of the QLC hard disk is the TLC mode.
  • QLC hard drives can also adjust the amount of data stored in each storage unit from four bits to two bits or one bit.
  • the amount of data stored in each storage unit in the MLC hard disk is the same.
  • the data storage mode of the QLC hard disk is MLC mode.
  • the amount of data stored in each storage unit in the QLC hard disk is one bit, it is the same as the amount of data stored in each storage unit in the SLC hard disk.
  • the data storage mode of the QLC hard disk is the SLC mode.
  • TLC hard disks can also adjust the data storage mode to MLC mode or SLC mode
  • MLC hard disks can also adjust the data storage mode to SLC mode.
  • the storage capacity of the QLC hard disk 401 is 1024 GB (gigabyte). If the QLC hard disk 401 adjusts the data storage mode to the TLC mode, the storage capacity of the QLC hard disk 402 in the TLC mode is 768 GB. If the QLC hard disk 401 adjusts the data storage mode to the MLC mode, the storage capacity of the QLC hard disk 403 in the MLC mode is 512GB. If the QLC hard disk 401 adjusts the data storage mode to the SLC mode, the storage capacity of the QLC hard disk 404 in the SLC mode is 256 GB. Therefore, although this adjustment method can increase the service life of the hard disk, it will cause the hard disk to lose a certain amount of capacity.
  • the first embodiment of the present invention provides a hard disk control method, which can not only increase the service life of the hard disk, but also ensure that its capacity is not lost.
  • This method can be applied to the flash memory array shown in FIG. 1. As shown in FIG. 5, the method includes:
  • the controller 11 detects whether the amount of user data stored in the flash memory array is greater than or equal to a first preset value.
  • the controller 11 in the flash memory array detects whether the amount of user data stored in the flash memory array is greater than a first preset value.
  • the first preset value may be 80% of the current capacity.
  • two hard disks are provided in the flash memory array, and the data storage mode of the two hard disks is preset to the SLC mode.
  • the two hard disks may be the QLC hard disk 404 in the SLC mode in FIG. 4, and the storage capacity of the two QLC hard disks in the SLC mode is 256GB. At this time, the storage capacity of the entire flash array is 512GB.
  • the first preset value may be 409.6GB. If the controller 11 in the flash memory array detects that the amount of user data stored in the two QLC hard disks in SLC mode in the flash memory array is greater than or equal to 409.6GB, if the flash memory array continues to write data in SLC mode, then The remaining capacity of the flash memory array is about to run out.
  • the flash memory array may only be preset with a storage space for storing data in the SLC mode, or may be preset with a storage space for storing data in the MLC, TLC or QLC mode.
  • the controller 11 in the flash memory array can detect the data amount of user data of each hard disk through the flash memory controller 121 of each hard disk in the flash memory array, so as to determine the data amount of user data of the entire flash memory array. It is determined whether the data amount of the user data in the flash memory array is greater than or equal to the first preset value.
  • the controller 11 can interact with the flash memory controller 121 of each hard disk to obtain the data volume of real-time user data of each hard disk.
  • the controller 11 converts the data storage mode of at least a part of the storage space in the flash memory array from the first mode to the first mode. Two mode.
  • the first mode takes the SLC mode as an example
  • the second mode takes the MLC mode as an example.
  • the hard disk that stores data in the second mode has a higher data density than the hard disk that stores data in the first mode. If the mode of storing data in at least a part of the storage space in the flash memory array is converted from the first mode to the second mode, the capacity of the flash memory array can be expanded and more data can be stored. It is worth noting that after switching from the first mode to the second mode, the user cannot perceive the change in the capacity of the flash memory array.
  • the controller 11 When the controller 11 detects that the amount of user data stored in the flash memory array is greater than or equal to the first preset value, the controller 11 switches the mode of storing data in at least a part of the storage space in the flash memory array from the first mode For the second mode.
  • the controller 11 may store data in the 50 GB storage space of the two QLC hard disks that store data in the SLC mode.
  • the mode is converted to MLC mode, so as to obtain 100GB of storage space for storing data in MLC mode.
  • the total storage space of the flash memory array is 462GB for storing data in SLC mode plus 100GB for storing data in MLC mode.
  • the storage space of the flash memory array can be expanded.
  • the controller 11 may continue to convert the data storage mode of the storage space storing data in the SLC mode to the MLC mode , Or convert the storage space storing data in SLC mode to TLC mode and QLC mode.
  • the second quantity condition may be greater than or equal to a certain value.
  • the controller 11 can also first convert the data storage mode of the storage space storing data in SLC mode to MLC mode, and if the data continues to be written to a certain value, then switch the mode of storing data in the storage space storing data in MLC mode It is TLC mode. Similarly, if the data volume of user data continues to rise, the mode of storing data in the storage space for storing data in TLC mode can be converted to QLC mode.
  • controller 11 converts the data storage mode of at least a part of the storage space in the flash memory array from the first mode to the second mode, if a user's request for writing data is received, the controller 11 will need to write data.
  • the imported target data is written into the flash memory array in the second mode.
  • the storage capacity of the QLC hard disks in the flash memory array can reach the maximum value, which is consistent with the original capacity of the QLC hard disk.
  • controller 11 may send a program instruction to the flash memory controller 121 of each hard disk in the flash memory array to instruct the flash memory controller 121 to switch the mode of storing data in the storage space of the corresponding hard disk.
  • the controller 11 when the amount of user data of the flash memory array is greater than or equal to the first preset value, the controller 11 can switch the mode of storing data in the storage space of the flash memory array to improve The data density of the hard disk in the flash memory array expands the capacity of the flash memory array storage space, so that the capacity of the flash memory array is not lost.
  • the controller 11 may first convert the data storage mode of at least part of the storage space in the flash memory array from the first mode to the second mode, and then migrate the user data in the flash memory array to the storage space that stores data in the second mode. Within, continue to convert the mode of the storage space occupied before the user data migration to the second mode, until the mode of storing data in all the storage spaces in the flash memory array is converted to the second mode.
  • the second embodiment includes:
  • the controller 11 detects whether the data amount of user data stored in the flash memory array is greater than or equal to a first preset value.
  • step 501 Please refer to step 501 in the first embodiment for understanding of step 601, which will not be repeated here.
  • the controller 11 converts the data storage mode of at least a part of the storage space in the flash memory array from the first mode to the first mode. Two mode.
  • step 502 Please refer to step 502 in the first embodiment for understanding of step 602, which will not be repeated here.
  • the controller 11 migrates at least a part of user data to a storage space for storing data in the second mode.
  • the controller 11 migrates at least a part of the data volume of user data in the storage space storing data in the first mode to the storage space storing data in the second mode. If the first preset value is low, for example, the storage capacity of the flash memory array is 512GB, and two hard disks storing data in the SLC mode are provided in the flash memory array, and the first preset value is 100GB.
  • the controller 11 can convert the data storage mode of the 200 GB storage space without data stored in the flash memory array to the MLC mode, thereby obtaining 400 GB storage space for storing data in the MLC mode. Then the controller 11 migrates all 100 GB of user data in the storage space in the SLC mode in the flash memory array to the storage space in the MLC mode.
  • the controller 11 may also migrate the data part in the storage space storing data in the SLC mode to the storage space storing data in the MLC mode. Then, the storage space storing data in the SLC mode is converted to MLC mode.
  • the controller 11 needs to perform this action. If data in one area of a hard disk in the flash memory array is migrated to another area, the migration process may be executed by the controller 11 or executed by the flash controller 121 of the hard disk instructed by the controller 11.
  • the controller 11 releases at least a part of the storage space occupied by user data.
  • the controller 11 releases the storage space occupied by at least part of the user data in the flash memory array, and the at least part of the user data may be user data migrated to the storage space for storing data in the second mode.
  • the at least part of the user data may be user data migrated to the storage space for storing data in the second mode.
  • the releasing process may include: deleting user data stored in this part of the storage space, and then erasing the erase block of this part of the storage space.
  • controller 11 can instruct the flash memory controller 121 of each hard disk in the flash memory array to release its own storage space.
  • the controller 11 converts the data storage mode of the storage space occupied by at least a part of the user data into the second mode.
  • the controller 11 converts the data storage mode of the storage space occupied by at least a part of the user data into the second mode, and the space occupied by the at least part of the data may be the space released in step 604.
  • the conversion process is as described in step 602, and the controller 11 may instruct the flash memory controller 121 of each hard disk to convert the mode of storing data in the storage space of the corresponding hard disk.
  • the hard disk control method provided in the second embodiment can firstly change the mode of storing data in the storage space of the flash memory array without storing data from the first mode when the amount of user data in the flash memory array is greater than or equal to the first preset value. Switching to the second mode expands the capacity of the flash memory array. Then migrate the data in the storage space storing data in the first mode to the storage space storing data in the second mode, and then release the storage space occupied by the migrated data, and then store the released storage space The data mode continues to be converted to the second mode, so that the mode for storing data in all the storage spaces in the flash memory array can be gradually converted to the second mode, so that the data storage capacity of the flash memory array can be expanded.
  • the controller 11 may first migrate a part of data in the storage space for storing data in the first mode to a preset storage space for storing data in the second mode. Then, a part of the storage space storing data in the first mode is released, and the mode of storing data in the part of the storage space storing data in the first mode is converted to the second mode.
  • the third embodiment includes:
  • the controller 11 detects whether the data amount of user data stored in the flash memory array is greater than or equal to a first preset value.
  • step 501 Please refer to step 501 in the first embodiment for understanding of step 701, which will not be repeated here.
  • the controller 11 migrates at least a part of the user data in the storage space storing data in the first mode to a preset value. Storage space for storing data in the second mode.
  • the first mode takes the SLC mode as an example
  • the second mode takes the MLC mode as an example.
  • the controller 11 detects that the amount of user data stored in the flash memory array is greater than or equal to the first preset value
  • the controller 11 selects at least a part of the user data in the storage space in the flash memory array that stores data in the first mode.
  • the data is written in the second mode into the preset storage space for storing the data in the second mode.
  • the first preset value may be 200 GB.
  • the flash memory array When the data volume of the user data of the flash memory array is less than 200GB, the flash memory array stores the written data in the storage space where the data is stored in the SLC mode. When the data amount of user data in the storage space for storing data in the SLC mode is greater than or equal to 200 GB, the controller 11 migrates at least a part of the 200 GB data to the space for storing data in the MLC mode.
  • the process of data migration can be executed by the controller 11 or executed by the controller 11 instructing the flash memory controller 121 of the hard disk in the flash memory array.
  • the controller 11 instructing the flash memory controller 121 of the hard disk in the flash memory array.
  • the controller 11 releases at least a part of the storage space occupied by user data.
  • the controller 11 releases the storage space occupied by at least part of the user data in the flash memory array, and the at least part of the user data may be user data migrated to the storage space for storing data in the second mode. For example, in step 702, the data is migrated to the storage space where the data is stored in the MLC mode.
  • the release process is as described in step 604 in the second embodiment, and will not be repeated here. This release process may instruct the controller 11 to release the storage space of the corresponding hard disk itself to the flash memory controller 121 of each hard disk in the flash memory array.
  • the controller 11 converts the data storage mode of the storage space occupied by at least a part of the user data into the second mode.
  • the controller 11 converts the data storage mode of the storage space occupied by at least a part of the user data into the second mode, and the space occupied by the at least part of the data may be the space released in step 703.
  • the conversion process is as described in step 502 of the first embodiment and step 602 of the second embodiment.
  • the controller 11 can instruct the flash memory controller 121 of each hard disk to convert the mode of storing data in the storage space of the corresponding hard disk.
  • the hard disk control method provided in the third embodiment can be applied to a situation where the first preset value is relatively high, and the storage space for storing data in the first mode in the flash memory array is nearly exhausted.
  • the flash memory array can first migrate data before converting the storage space, so that data security can be ensured while expanding the storage space of the flash memory array.
  • the controller 11 migrates user data to the storage space for storing data in the second mode, and the storage space for storing data in the second mode is located on the hard disk of the flash memory array.
  • the controller 11 may also migrate user data to the memory 112 of the controller 11 itself. After releasing a part of the storage space storing data in the first mode, the mode of storing data in the storage space storing data in the first mode is converted to the second mode. The user data migrated to the memory 112 is then written in the second mode into the storage space where the data is stored in the second mode.
  • the first quantity condition is greater than or equal to the first preset value.
  • the controller 11 may switch the mode of storing data in at least a part of the space in the flash memory array from the first mode to the second mode.
  • the hard disk that stores data in the second mode has a higher data density than the hard disk that stores data in the first mode. In this way, the capacity of the flash memory array is expanded.
  • the fourth embodiment may provide another hard disk control method. In this method, the first quantity condition may also be less than a second preset value, and the second preset value may be the same as the first one in the first to third embodiments. A preset value is the same or different.
  • the controller 11 may also switch the mode of storing data in at least a part of the space in the flash memory array from the third mode to the fourth mode.
  • the third mode takes the QLC mode as an example
  • the fourth mode takes the TLC mode as an example.
  • the hard disk storing data in the third mode has a higher data density than the hard disk storing data in the fourth mode. This method can increase the rewritable times of the hard disk without affecting the data storage, thereby increasing the service life of the hard disk.
  • the fourth embodiment includes:
  • the controller 11 detects whether the data amount of user data stored in the flash memory array is less than a second preset value.
  • the controller 11 in the flash memory array detects whether the amount of user data stored in the flash memory array is less than a second preset value.
  • the second preset value may be 50% of the current capacity.
  • the mode of storing data in the storage space occupied by user data in the flash memory array is the third mode, and the hard disk storing data in the third mode has a higher data density, but a smaller number of erasing and writing.
  • two hard disks are provided in the flash memory array, and the data storage mode of the two hard disks is preset to the QLC mode.
  • the two hard disks may be the QLC hard disk 401 in FIG. 4, and the storage capacity of the two hard disks is 1024GB. At this time, the storage capacity of the entire flash array is 2048GB.
  • the flash memory array deletes the data in the flash memory array according to the needs of the user, it is deleted until the amount of user data stored in the flash memory array is less than 1024 GB.
  • the mode of storing data in the storage space without storing data is the QLC mode, and the space for storing data in the QLC mode can be erased and written less frequently.
  • the flash memory array may only be preset with a storage space for storing data in the QLC mode, or may be preset with a storage space for storing data in the SLC, MLC or TLC mode.
  • the controller 11 in the flash memory array can detect the data amount of user data of each hard disk through the flash memory controller 121 of each hard disk in the flash memory array, so as to obtain the data amount of user data of the entire flash memory array. It is determined whether the data amount of the user data in the flash memory array is less than the second preset value.
  • the controller 11 can interact with the flash memory controller 121 of each hard disk to obtain the data volume of real-time user data of each hard disk.
  • the controller 11 switches the mode of storing data in at least a part of the storage space in the flash memory array from the third mode to the fourth mode .
  • the controller 11 When the controller 11 detects that the amount of user data stored in the flash memory array is less than the second preset value, the controller 11 switches the mode of storing data in at least a part of the flash memory array from the third mode to the fourth mode.
  • the hard disk storing data in the third mode has a higher data density than the hard disk storing data in the fourth mode. In this way, the at least part of the converted space can be increased in the number of erasing and writing. It is worth noting that the process of converting the data storage mode of at least a part of the storage space in the flash memory array from the third mode to the fourth mode is not perceptible to the user.
  • the controller 11 may store data in the 500 GB storage space that stores data in the QLC mode in the two QLC hard disks. Convert to TLC mode, so you can get 375GB of storage space to store data in TLC mode.
  • the storage space for storing data in the TLC mode has a relatively high number of erasable times.
  • the controller 11 may continue to convert the mode of the storage space for storing data in the QLC mode to TLC mode, or the mode of the storage space for storing data in QLC mode is converted to MLC mode and SLC mode.
  • the second quantity condition may be lower than a certain certain value.
  • the controller 11 can also first convert the data storage mode of the storage space storing data in QLC mode to TLC mode. If the data volume of user data continues to decrease to a certain value, the storage space storing data in TLC mode can then store data in the storage space storing data in TLC mode. The mode is converted to MLC mode. Similarly, if the amount of user data continues to decrease, the storage space storing data in the MLC mode can be converted to the SLC mode.
  • controller 11 converts the data storage mode of at least a part of the storage space in the flash memory array from the third mode to the fourth mode, if a user's request for writing data is received, the controller 11 will need to write The imported target data is written into the flash memory array in the fourth mode.
  • the number of erasable times of the QLC hard disks in the flash memory array can reach the maximum.
  • controller 11 may send a program instruction to the flash memory controller 121 of each hard disk in the flash memory array to instruct the flash memory controller 121 to switch the mode of storing data in the storage space of the corresponding hard disk.
  • the controller 11 may also store data in the storage space in the third mode. Migrate the data to the storage space that stores data in the fourth mode, and then continue to convert the mode of storing data in the third mode to the fourth mode, until the mode of storing data in all the spaces in the flash memory array Switching to the fourth mode, the flash memory array can obtain an increase in the number of erasable writes.
  • the specifics can be understood with reference to the second embodiment, which will not be repeated here.
  • the controller 11 may also first migrate the data in the storage space for storing data in the third mode to the storage space for storing data in the fourth mode. , And then convert the data storage mode of the storage space in the third mode to the fourth mode. The details can be understood with reference to the third embodiment, which will not be repeated here.
  • the controller 11 when the amount of user data of the flash memory array is less than the second preset value, the controller 11 can switch the mode of storing data in the storage space of the flash memory array to reduce the amount of data stored in the flash memory array.
  • the data density of the hard disk in the array can increase the rewritable times of the flash memory array, thereby prolonging the service life of the flash memory array.
  • the hard disk control methods provided in the first to fourth embodiments are all for the flash memory array shown in FIG. 1, and this method can also be applied to the hard disk shown in FIG. 3.
  • the fifth embodiment provides a hard disk control method. As shown in Figure 9, the method may include:
  • the flash memory controller 121 detects whether the amount of user data stored in the hard disk meets the first quantity condition.
  • the flash memory controller 121 detects whether the data amount of user data stored in the hard disk satisfies the first quantity condition.
  • the first quantity condition may be greater than or equal to the first preset value described in Embodiment 1 to Embodiment 3.
  • the amount of user data stored in the flash memory array is greater than or equal to the first preset value, if the hard disk continues to write data, the remaining capacity of the hard disk is about to be exhausted.
  • step 501 in the first embodiment for understanding which will not be repeated here.
  • the first quantity condition may also be less than the second preset value described in the fourth embodiment, and the second preset value may be equal to or not equal to the above-mentioned first preset value.
  • the flash memory controller 121 in the hard disk can reduce the data density of the hard disk, thereby increasing the number of erasable writes. For details, reference may be made to step 801 in the fourth embodiment for understanding, which will not be repeated here.
  • the flash memory controller 121 converts the data storage mode of at least a part of the storage space in the hard disk from the fifth mode to the sixth mode.
  • the fifth mode can take the MLC mode as an example. If in step 901, the flash memory controller 121 detects that the amount of user data of the hard disk is greater than or equal to the first preset value, the flash memory controller 121 may change the mode of storing data in at least a part of the storage space of the hard disk from The fifth mode is converted to the sixth mode. In this case, the TLC mode can be used as an example for the sixth mode. After the flash memory controller 121 switches the mode of storing data in at least a part of the storage space of the hard disk from the fifth mode to the sixth mode, the capacity of the hard disk can be expanded and more data can be stored. For details, reference may be made to step 502 in the first embodiment for understanding, which will not be repeated here.
  • step 902 the flash memory controller 121 detects that the amount of user data of the hard disk is less than the second preset value, the flash memory controller 121 may change the mode of storing data in at least a part of the hard disk from the fifth The mode is changed to the sixth mode.
  • the SLC mode can be used as an example for the sixth mode.
  • the flash memory controller 121 converts the mode of storing data in at least a part of the storage space of the hard disk from the fifth mode to the sixth mode, the number of erasing and writing times can be increased. For details, reference may be made to step 802 in the fourth embodiment for understanding, which will not be repeated here.
  • the flash memory controller 121 may also change the storage space for storing data in the fifth mode. Migrate the data in the storage space to the storage space where the data is stored in the sixth mode, release the storage space occupied by the data, and then continue to convert the storage space storing data in the fifth mode to the sixth mode until the The mode of storing data in all storage spaces of the hard disk is converted to the sixth mode, which can be understood with reference to the second embodiment, and will not be repeated here.
  • the flash controller 121 may also first migrate the data in the storage space for storing data in the fifth mode to the storage space for storing data in the sixth mode. , And then convert the data storage mode of the storage space storing data in the fifth mode to the sixth mode. The details can be understood with reference to the third embodiment, which will not be repeated here.
  • the flash memory controller 121 converts the mode of storing data in at least a part of the storage space of the hard disk from the fifth mode to the sixth mode, if the flash memory controller receives a data write request, the flash memory controller operates in the sixth mode. Write the target data to the hard disk.
  • Embodiment 6 provides a hard disk control device, which can be applied to the hard disk control method in Embodiment 9. As shown in FIG. 10, the hard disk control device includes:
  • the detection module 1001 is used to detect whether the data amount of user data stored in the hard disk meets the first quantity condition. It can be understood with reference to step 901 of the fifth embodiment, which will not be repeated here.
  • the processing module 1002 when the data amount of the stored user data meets the first quantity condition, converts the mode of storing data in at least a part of the storage space in the hard disk from the fifth mode to the sixth mode. For details, reference may be made to step 902 in the fifth embodiment, which will not be repeated here.
  • the processing module 1002 is also used to migrate data in the storage space storing data in the fifth mode to the storage space storing data in the sixth mode. For details, reference may be made to step 902 in the fifth embodiment, which will not be repeated here.
  • the processing module 1002 is also used to release at least part of the storage space occupied by user data. For details, reference may be made to step 902 in the fifth embodiment for understanding, which will not be repeated here.
  • the receiving module 1003 is configured to receive a write data request, and the write data request includes target data.
  • the hard disk control device may be located in the hard disk, and the flash memory controller 121 performs its specific functions. In another implementation, the hard disk control device may be located in a controller of a flash memory array, and each module is executed by a processor in the controller calling program codes in a memory.
  • the seventh embodiment provides a controller 11, and the controller 11 is applied to the flash memory array described in the first to the fourth embodiments.
  • the seventh embodiment of the present invention provides a controller 11, which 11 can include:
  • the controller 11 is a device with a hardware structure and can be used to execute the steps executed by the controller in the flash memory array described in the first to the fourth embodiments. For example, those skilled in the art can think of step 501 in the first embodiment.
  • the controller 11 can send signaling through the transceiver 1103 to query the data volume of the user data of each hard disk in the flash memory array, and then receive each data through the transceiver 1103.
  • the data volume of the user data of the hard disk calls the program in the memory 1102 to add the data volume of the user data of all the hard disks to obtain the data volume of the user data in the flash memory array, and the data volume of the user data is A preset value is compared to determine whether the amount of user data in the flash memory array is greater than or equal to the first preset value.
  • the processor 1101 can also send a command to each hard disk in the flash memory array through the transceiver 1103, instructing the flash controller in the hard disk to change the mode of storing data in the corresponding area of the hard disk from the first mode to the second mode.
  • the mode can be understood with reference to step 502 in the first embodiment.
  • processor 1101 may be one or more central processing units (CPU), microprocessors, application-specific integrated circuits (ASICs), or one or more An integrated circuit that controls the execution of the program of the present invention.
  • CPU central processing units
  • ASICs application-specific integrated circuits
  • An integrated circuit that controls the execution of the program of the present invention.
  • the processor 1101, the memory 1102, and the transceiver 1103 are connected by a bus 1104.
  • the bus 1104 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Pinball Game Machines (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种硬盘控制方法及相关设备,该硬盘控制方法包括:检测存储设备中存储的用户数据的数据量是否满足第一数量条件。当存储的用户数据的数据量满足第一数量条件时,将第一存储区域中的第一子区域存储数据的模式由第一模式转换为第二模式,第一模式与第二模式为SLC模式、MLC模式、TLC模式和QLC模式中不相同的两种。当以第二模式存储数据的存储设备比以第一模式存储数据的存储设备的数据密度高时,该存储设备可以扩大存储空间的容量,使得容量不受损失。当以第二模式存储数据的存储设备比以第一模式存储数据的存储设备的数据密度低时,该存储设备可以提高存储设备的可擦写次数,延长存储设备的使用寿命。

Description

一种硬盘控制方法及相关设备 技术领域
本发明涉及存储领域,具体涉及一种硬盘控制方法及相关设备。
背景技术
硬盘多使用与非门闪存。该与非门闪存是一种非易失性随机访问存储介质。当断电之后,该使用与非门闪存的硬盘存储的数据不会消失。该使用与非门闪存的硬盘根据每一个存储单元存储的数据量大小不同可以分为单层式存储单元(single level cell,SLC)、多层式存储单元(multi level cell,MLC)、三层式存储单元(triple level cell,TLC)以及四层式存储单元(quad level cell,QLC)等。该SLC硬盘每一个存储单元只存储1比特数据,MLC硬盘每一个存储单元存储2比特数据,TLC硬盘每一个存储单元存储3比特数据,QLC硬盘每一个存储单元存储4比特数据。
目前使用与非门闪存的硬盘中每一个存储单元存储的数据量越大,则该硬盘的数据密度越高,可擦写次数越少,寿命越短。一些硬盘可以调整硬盘存储数据的模式,如QLC硬盘可以将存储数据的模式调整为SLC模式。这样可以将QLC硬盘的数据密度降低,可以提高硬盘的硬盘的使用寿命。但是这种方式会使得该硬盘损失相应的容量。
一些硬盘可以将该硬盘整体进行调整,也可以先将该硬盘划分为多个区域,再将每个区域分别进行调整。比如,可以将一个QLC硬盘整体调整为SLC模式,这样该QLC硬盘会损失3/4的容量。也可以将一个TLC硬盘的1/2的空间配置为SLC模式,剩下1/2的空间配置为MLC模式,这样该TLC硬盘被配置为SLC模式的部分会损失2/3的容量,该被配置为MLC模式的部分会损失1/3的容量,则该TLC硬盘总共会损失1/2的容量。所以,该硬盘调整存储数据的模式之后,该硬盘的容量会受到损失。
发明内容
本发明实施例第一方面提供了一种硬盘控制方法,该方法应用于存储设备中,该方法包括:检测存储设备中存储的用户数据的数据量是否满足第一数量条件,该存储设备包括第一存储区域,第一存储区域以第一模式存储数据,第一模式是SLC模式、MLC模式、TLC模式、QLC模式中的其中一种;当存储的用户数据的数据量满足第一数量条件时,将第一存储区域中的第一子区域存储数据的模式由第一模式转换为第二模式,第二模式是SLC模式、MLC模式、TLC模式、QLC模式中的其中一种,并且第二模式不同于第一模式。
当该第一数量条件为大于或等于第一预设值时,该存储设备可以将存储设备存储数据的模式由第一模式转换为第二模式。若第一模式为SLC模式,第二模式可以为QLC模式、TLC模式或MLC模式中的一种;若该第一模式为MLC模式,该第二模式可以为TLC模式或QLC模式;若该第一模式为TLC模式,该第一模式可以为QLC模式。这样可以提高存储设备的数据密度,从而扩大存储设备存储空间的容量,使得存储设备的容量不受损失。当该第一数量条件为小于第二预设值时,该存储设备可以将存储设备存储数据的模式由第一模式转换为第二模式。若第一模式为QLC模式,第二模式为SLC模式、MLC模式或TLC模式 中的一种;若该第一模式为TLC模式,该第二模式可以为SLC模式或MLC模式;若该第一模式为MLC模式,该第二模式可以为SLC模式。这样可以降低存储设备的数据密度,从而可以提高存储设备的可擦写次数,延长存储设备的使用寿命。
可选的,在将第一存储区域中的第一子区域存储数据的模式由第一模式转换为第二模式之后,该方法还包括:将第一存储区域的用户数据中的至少一部分用户数据迁移至转换后的第一子区域;释放第一存储区域中至少一部分用户数据所占用的区域;将至少一部分用户数据所占用的区域存储数据的模式转换成第二模式。这种情况下,可以先将未存储数据的第一子区域存储数据的模式由第一模式转换为第二模式,然后再将以第一模式存储数据的空间内的用户数据迁移至转换后的第一子区域内。这样可以释放出用户数据迁移之前以第一模式存储数据的空间,然后再将该以第一模式存储数据的空间存储数据的模式转换为第二模式,从而逐步将该存储设备所有存储空间存储数据的模式都转换为第二模式。这样一方面可以提高存储设备的使用寿命,另一方面可以保证其容量不受损失。
可选的,在将第一存储区域中的第一子区域存储数据的模式由第一模式转换为第二模式之前,该方法还包括:将第一存储区域的用户数据中的至少一部分用户数据迁移至存储设备的缓存;释放至少一部分用户数据占用的区域;在将第一存储区域中的第一子区域存储数据的模式由第一模式转换为第二模式之后,将至少一部分用户数据以第二模式写入转换后的第一存储区域。这种方式可以将存储设备的缓存利用起来,提高存储资源的利用效率。
可选的,存储设备还可以包括第二存储区域,第二存储区域以第二模式存储数据,在将第一存储区域中的第一子区域存储数据的模式由第一模式转换为第二模式之前,该方法还包括:将第一存储区域的用户数据中的至少一部分用户数据迁移至存储设备的第二存储区域;释放至少一部分用户数据所占用的区域。这种方式可以先将用户数据进行迁移,再释放存储空间,这样可以保证数据的安全性。
可选的,该方法还包括:接收写数据请求,写数据请求包括目标数据;将目标数据以第二模式写入转换后的第一子区域。在将第一存储区域中的第一子区域存储数据的模式由第一模式转换为第二模式之后。若该存储设备再收到写数据请求,该存储设备将目标数据以第二模式写入转换后的第一子区域。
可选的,该方法还包括:检测存储设备中存储的用户数据的数据量是否满足第二数量条件,存储设备包括第二存储区域;当存储的用户数据的数据量满足第二数量条件时,将第二存储区域中的第二子区域存储数据的模式由第二模式转换为第三模式,第三模式是SLC模式、MLC模式、TLC模式、QLC模式中的其中一种,并且第三模式不同于第二模式。在满足第一数量条件之后,若存储设备中存储的用户数据的数据量继续发生变化,直至该存储设备中存储的用户数据的数据量满足第二数量条件,该存储设备可以将第二存储区域中的第二子区域存储数据的模式由第二模式转换为第三模式。这样一方面可以提高存储设备的使用寿命,另一方面可以保证其容量不受损失。
本发明实施例第二方面提供了一种硬盘控制装置,该硬盘控制装置应用于硬盘中,该硬盘包括闪存控制器和闪存芯片,闪存芯片包括多个擦除块,硬盘控制装置位于闪存控制 器中,该硬盘控制装置包括:检测模块,用于检测存储设备中存储的用户数据的数据量是否满足第一数量条件,存储设备包括第一存储区域,第一存储区域以第一模式存储数据,第一模式是SLC模式、MLC模式、三层式存储单元TLC模式、QLC模式中的其中一种;处理模块,用于当检测模块检测到存储的用户数据的数据量满足第一数量条件时,将第一存储区域中的第一子区域存储数据的模式由第一模式转换为第二模式,第二模式是SLC模式、MLC模式、TLC模式、QLC模式中的其中一种,并且第二模式不同于第一模式。该处理模块将第一存储区域中的第一子区域存储数据的模式由第一模式转换为第二模式,一方面可以提高存储设备的使用寿命,另一方面可以保证其容量不受损失。
可选的,该硬盘控制装置包括:处理模块,用于将第一存储区域的用户数据中的至少一部分用户数据迁移至转换后的第一子区域;处理模块,还用于释放第一存储区域中至少一部分用户数据所占用的区域;处理模块,还用于将至少一部分用户数据所占用的区域存储数据的模式转换成第二模式。
可选的,该硬盘控制装置包括:处理模块,还用于将第一存储区域的用户数据中的至少一部分用户数据迁移至硬盘的第二存储区域,第二存储区域以第二模式存储数据;处理模块,还用于释放至少一部分用户数据所占用的区域。
可选的,该硬盘控制装置包括:接收模块,用于接收写数据请求,写数据请求包括目标数据;处理模块,还用于将目标数据以第二模式写入转换后的第一子区域。
可选的,该硬盘控制装置包括:检测模块,还用于检测存储设备中存储的用户数据的数据量是否满足第二数量条件,该存储设备包括第二存储区域;处理模块,还用于当检测模块检测到存储的用户数据的数据量满足第二数量条件时,将第二存储区域中的第二子区域存储数据的模式由第二模式转换为第三模式,第三模式是SLC模式、MLC模式、TLC模式、QLC模式中的其中一种,并且第三模式不同于第二模式。
本发明实施例第三方面提供了一种控制器,该控制器位于存储设备中,该存储设备包括至少一个硬盘和该控制器,该控制器包括处理器和存储器,该存储器中存储有程序指令,该处理器用于调用存储器中的程序指令执行如下步骤:检测存储设备中存储的用户数据的数据量是否满足第一数量条件,该存储设备包括第一存储区域,第一存储区域以第一模式存储数据,第一模式是单层式存储单元SLC模式、多层式存储单元MLC模式、三层式存储单元TLC模式、四层式存储单元QLC模式中的其中一种;当存储设备中存储的用户数据的数据量满足第一数量条件时,将第一存储区域中的第一子区域存储数据的模式由第一模式转换为第二模式,第二模式是SLC模式、MLC模式、TLC模式、QLC模式中的其中一种,并且第二模式不同于第一模式。这样一方面可以提高存储设备的使用寿命,另一方面可以保证其容量不受损失。
可选的,该处理器还用于调用存储器中的程序指令执行如下步骤:将第一存储区域的用户数据中的至少一部分用户数据迁移至转换后的第一子区域;释放第一存储区域中至少一部分用户数据所占用的区域将至少一部分用户数据所占用的区域存储数据的模式转换成第二模式。
可选的,该处理器还用于调用存储器中的程序指令执行如下步骤:将第一存储区域的 用户数据中的至少一部分用户数据迁移至存储设备的缓存;释放至少一部分用户数据占用的区域;在将第一存储区域中的第一子区域存储数据的模式由第一模式转换为第二模式之后,将至少一部分用户数据以第二模式写入转换后的第一存储区域。
可选的,该处理器还用于调用存储器中的程序指令执行如下步骤:将第一存储区域的用户数据中的至少一部分用户数据迁移至存储设备的第二存储区域,第二存储区域以第二模式存储数据;释放至少一部分数据所占用的区域。
可选的,该控制器还用于调用存储器中的程序指令执行如下步骤:接收写数据请求,写数据请求包括目标数据;将目标数据以第二模式写入第二存储区域或转换后的第一存储区域。
可选的,该处理器还用于调用存储器中的程序指令执行如下步骤:检测存储设备中存储的用户数据的数据量是否满足第二数量条件,存储设备包括第二存储区域;当存储设备中存储的用户数据的数据量满足第二数量条件时,将第二存储区域中的第二子区域存储数据的模式由第二模式转换为第三模式,第三模式是SLC模式、MLC模式、TLC模式、QLC模式中的其中一种,并且第三模式不同于第二模式。
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。
本申请还提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。
本发明实施例提供了一种硬盘控制方法及相关设备,该硬盘控制方法包括:检测存储设备中存储的用户数据的数据量是否满足第一数量条件。当存储的用户数据的数据量满足第一数量条件时,将第一存储区域中的第一子区域存储数据的模式由第一模式转换为第二模式,第二模式不同于第一模式。当该第一数量条件为大于或等于第一预设值时,该存储设备可以将存储设备存储数据的模式由第一模式转换为第二模式。例如,该第一模式为SLC模式,第二模式为QLC模式。这样可以提高存储设备的数据密度,从而扩大存储设备存储空间的容量,使得存储设备的容量不受损失。当该第一数量条件为小于第二预设值时,该存储设备可以将存储设备存储数据的模式由第一模式转换为第二模式。例如,该第一模式为QLC模式,第二模式为SLC模式。这样可以降低存储设备的数据密度,从而可以提高存储设备的可擦写次数,延长存储设备的使用寿命。
附图说明
图1为本发明实施例提供的存储设备的组成图;
图2为本发明实施例提供的控制器的结构示意图;
图3为本发明实施例提供的硬盘的结构示意图;
图4为本发明实施例提供的硬盘模式的示意图;
图5为本发明实施例提供的硬盘控制方法的一个实施例示意图;
图6为本发明实施例提供的硬盘控制方式的另一个实施例示意图;
图7为本发明实施例提供的硬盘控制方式的另一个实施例示意图;
图8为本发明实施例提供的硬盘控制方式的另一个实施例示意图;
图9为本发明实施例提供的硬盘控制方式的另一个实施例示意图;
图10为本发明实施例提供的硬盘的一个实施例示意图;
图11为本发明实施例提供的控制器的一个实施例示意图。
具体实施方式
图1描绘了本发明实施例提供的闪存阵列的组成图,图1所示的闪存阵列包括至少一个控制器11和多个硬盘12,该硬盘12可以为固态硬盘(solid state disk,SSD)。固态硬盘是以闪存(flash memory)芯片为介质的存储器,又名驱动器(solid state drive,SSD)。该控制器11通过存储区域网络(storage area network,SAN)与其他设备连接。该控制器11可以是一种计算设备,如服务器、台式计算机等。在控制器11上安装有操作系统以及应用程序。控制器11可以接收来自主机的输入输出(I/O)请求。控制器11还可以存储I/O请求中携带的数据,并且将该数据写入硬盘12中。
图1仅是示例性说明,在实际应用中存储系统可包含两个或两个以上控制器,每个控制器的物理结构和功能与控制器11类似,并且本实施例并不限定控制器之间,以及任意一个控制器与硬盘12之间的连接方式。只要各个控制器之间,以及各个控制器和硬盘12之间能够相互通信即可。
图2为图1中控制器11的结构示意图,如图2所示,控制器11包括接口卡111、存储器112和处理器113。
接口卡111用于和主机通信,控制器11可以通过接口卡111接收主机的操作指令。处理器113可能是一个中央处理器(central processing unit,CPU)。在本发明实施例中,处理器113可以用于接收来自主机的I/O请求、处理所述I/O请求。所述I/O请求可以是写数据请求或者读数据请求,处理器113还可以将写数据请求中的数据发送给硬盘12。此外,处理器113还可以用于执行系统垃圾回收操作。接口卡114,用于和硬盘12通信,控制器11可以通过接口卡114将写数据请求发送给硬盘12存储。
控制器11还可以包括存储器112。存储器112用于临时存储从主机接收的数据或从硬盘12读取的数据。控制器11接收主机发送的多个写数据请求时,可以将所述多个写数据请求中的数据暂时保存在存储器112中。当存储器112的容量达到一定阈值时,将存储器112存储的数据以及为所述数据分配的逻辑地址发送给硬盘12。硬盘12存储所述数据。存储器112包括易失性存储器,闪存芯片或其组合。易失性存储器例如为随机访问存储器(random-access memory,RAM)。闪存芯片例如软盘、硬盘、固态硬盘、光盘等各种可以存储程序代码的机器可读介质。存储器112具有保电功能,保电功能是指系统发生掉电又重新上电时,存储器112中存储的数据也不会丢失。
图3为图1中硬盘12的结构示意图,如图3所示,该硬盘12可以包括闪存控制器121和多个闪存芯片122。其中,闪存控制器121用于执行控制器11发送的写数据请求或者读数据请求等操作。需要说明的是,图1中的控制器11属于系统控制器,系统控制器是独立的设备,不同于硬盘12中的闪存控制器121。
闪存控制器121中包含闪存翻译层(flash translation layer,FTL)。闪存翻译层用于保存有数据的逻辑地址与实际地址之间的对应关系。因此,闪存翻译层用于将系统控制器发送的写数据请求或者读数据请求中的逻辑地址转化为硬盘中数据的实际地址。数据的逻辑地址是由系统控制器分配的,它包括起始逻辑地址和长度。数据的实际地址可以是硬盘中该数据的物理地址,也可以是在所述物理地址的基础上经过虚拟化,只对闪存控制器可见的地址。实际地址对系统控制器不可见。
硬盘通常包括一个或多个闪存芯片。每个闪存芯片包括若干个擦除块。硬盘在读取或写入时是以一个页(page)为基础的,但擦除操作只能以一个擦除块为基础,擦除操作是指将这个块的所有位都设置为“1”。在擦除之前,闪存控制器需要先将这个擦除块中的有效数据复制到另一个块的空白页中去。擦除块中的有效数据是指该块中保存的没有被修改过的数据,这部分数据可能会被读取。擦除块中的无效数据是指该块中保存的已经被修改过的数据,这部分数据不可能会被读取。
每个擦除块包含多个页。硬盘在执行写数据请求时,是以页为单位来写数据的。举例来说,控制器11向闪存控制器121发送一个写数据请求。所述写数据请求包括数据的逻辑地址。闪存控制器121在接收所述写数据请求之后,按照接收的时间顺序将所述数据连续写入一个或多个擦除块中。连续写入一个或多个擦除块是指,闪存控制器121查找一个空白的擦除块,将数据写入所述空白的擦除块,直至将所述空白的擦除块填满,当所述数据的大小超过擦除块的容量时,闪存控制器121再查找下一个空白的擦除块,继续写入。闪存翻译层建立并保存所述逻辑地址与写入所述数据的页的实际地址之间的对应关系。当控制器11向闪存控制器121发送读数据请求,要求读取所述数据时,所述读数据请求中包括所述逻辑地址。闪存控制器121根据所述逻辑地址、以及所述逻辑地址与实际地址之间的对应关系读取所述数据,并将该数据发送给控制器11。
存储单元(cell)是页的最小操作单元,一个存储单元对应一个浮栅晶体管,它可以存储1比特(bit)或多比特的数据,这取决于硬盘的类型。一个页上的存储单元共享一根字符线。存储单元包括控制栅极和浮置栅极,浮置栅极是真正存储数据的单元。数据在存储单元中是以电荷(electrical charge)形式存储的。存储电荷的多少取决于控制栅极所被施加的电压,其控制了向浮置栅极中冲入电荷还是使其释放电荷。而数据的表示,以所存储的电荷的电压是否超过一个特定的阈值来表示。往浮置栅极中写入数据就是对控制栅极施加电压,使得浮置栅极中存储的电荷够多,超过阈值,就表示0。对浮置栅极进行擦除操作就是对浮置栅极放电,使得浮置栅极中存储的电荷低于阈值,就表示1。
每个存储单元中存储一比特数据的硬盘称之为SLC硬盘,SLC硬盘的每个存储单元的浮置栅极有一个电压阈值,因此具有0和1两种状态,可以存储一比特数据,数据密度比较低。SLC硬盘具有高写入速度、低功耗、更长电池耐久的优点,因此具有更快的传输速度和更长使用寿命。多层式存储单元MLC硬盘每个存储单元具有4种状态(00、01、10、11四种状态),可以用每个存储单元存储二比特数据。相对于SLC硬盘来说,MLC硬盘的误码率更高,数据密度更高,使用寿命更短,但成本更低。每个存储单元存储三比特数据的硬盘被称为TLC硬盘,TLC硬盘的每个存储单元具有8种状态。MLC硬盘的缺点在TLC硬盘 上同样存在并更为突出,但TLC硬盘也受益于更高的数据密度和更低的成本。另外,还有每个存储单元存储四比特数据的QLC硬盘以及其他多层式存储单元的硬盘,QLC硬盘的每个存储单元具有16种状态,每个存储单元可以存储四比特的数据。
一些硬盘可以通过将该硬盘的数据密度调低的方式来增加该硬盘的可擦写次数,从而提高该硬盘的使用寿命。具体可以通过减少该硬盘中每个存储单元存储的数据量来调低该硬盘的数据密度。比如,QLC硬盘可以将每个存储单元存储的数据量由四比特调整为三比特。此种情况下,该QLC硬盘中每个存储单元存储三比特数据,与TLC的硬盘中每个存储单元存储的数据量相同。可以认为该QLC硬盘存储数据的模式为TLC模式。
QLC硬盘也可以将每个存储单元存储的数据量由四比特调整为二比特或一比特。当该QLC硬盘中每个存储单元存储二比特时,与MLC的硬盘中每个存储单元存储的数据量相同。可以认为该QLC硬盘存储数据的模式为MLC模式。当该QLC硬盘中每个存储单元存储的数据量为一比特时,与SLC的硬盘中每个存储单元存储的数据量相同。可以认为该QLC硬盘存储数据的模式为SLC模式。同理,TLC硬盘也可以将存储数据的模式调整为MLC模式或SLC模式,MLC硬盘也可以将存储数据的模式调整为SLC模式。
当硬盘将该硬盘的数据密度调低之后,可擦写次数会获得相应的提升,但是会损失一部分存储空间。以图4为例,QLC硬盘401的存储容量为1024GB(gigabyte)。若该QLC硬盘401将存储数据的模式调整为TLC模式,该TLC模式的QLC硬盘402的存储容量为768GB。若该QLC硬盘401将存储数据的模式调整为MLC模式,该MLC模式的QLC硬盘403的存储容量为512GB。若该QLC硬盘401将存储数据的模式调整为SLC模式,该SLC模式的QLC硬盘404的存储容量为256GB。所以,这种调整方式虽然可以提升硬盘的使用寿命,但是会使得硬盘损失一定的容量。
因此,本发明实施例一提供了一种硬盘控制的方法,既能够提高硬盘的使用寿命,又能保证其容量不受到损失。该方法可以应用在图1所示的闪存阵列中,如图5所示,该方法包括:
501、控制器11检测闪存阵列中存储的用户数据的数据量是否大于或等于第一预设值。
闪存阵列中的控制器11检测该闪存阵列中存储的用户数据的数据量是否大于第一预设值。比如该第一预设值可以为当前容量的80%。当该闪存阵列中存储的用户数据的数据量大于或等于该第一预设值时,若该闪存阵列继续以当前存储数据的模式写入数据,那么该闪存阵列剩余的容量即将耗尽。
示例性的,闪存阵列中设置有两个硬盘,该两个硬盘存储数据的模式预先设置为SLC模式。该两个硬盘可以为图4中SLC模式的QLC硬盘404,该两个SLC模式的QLC硬盘的存储容量均为256GB。此时,整个闪存阵列的存储容量为512GB。该第一预设值可以为409.6GB。若该闪存阵列中的控制器11检测到闪存阵列中两个SLC模式的QLC硬盘中存储的用户数据的数据量大于或等于409.6GB时,如果该闪存阵列继续以SLC模式写入数据,那么该闪存阵列剩余的容量即将耗尽。
该闪存阵列中可以只预先设置以SLC模式存储数据的存储空间,也可以预先设置有以MLC、TLC或QLC模式存储数据的存储空间。
需要说明的是,该闪存阵列中的控制器11可以通过闪存阵列中每个硬盘的闪存控制器121来检测每个硬盘的用户数据的数据量,从而确定整个闪存阵列的用户数据的数据量然后确定闪存阵列中用户数据的数据量是否大于或等于第一预设值。该控制器11可以与每个硬盘的闪存控制器121交互,获取到每个硬盘实时用户数据的数据量。
502、当检测到该存储阵列中存储的用户数据的数据量大于或等于第一预设值时,该控制器11将该闪存阵列中至少一部分存储空间存储数据的模式由第一模式转换为第二模式。
为了方便描述,第一模式以SLC模式为例,第二模式以MLC模式为例。以第二模式存储数据的硬盘比以第一模式存储数据的硬盘的数据密度高。若该闪存阵列中至少一部分存储空间存储数据的模式由第一模式转换为第二模式之后,该闪存阵列的容量可以扩大,可以存储更多的数据。值得注意的是,由第一模式转换为第二模式之后,用户无法感知所述闪存阵列容量的变化。
当该控制器11检测到该闪存阵列中存储的用户数据的数据量大于或等于第一预设值时,该控制器11将该闪存阵列中至少一部分存储空间存储数据的模式由第一模式转换为第二模式。示例性的,当步骤501所述的闪存阵列中存储的用户数据的数据量大于或等于409.6GB时,该控制器11可以将该两个QLC硬盘中以SLC模式存储数据的50GB存储空间存储数据的模式转换为MLC模式,从而可以获得100GB以MLC模式存储数据的存储空间。这样该闪存阵列总存储空间为462GB以SLC模式存储数据的存储空间加上100GB以MLC模式存储数据的存储空间。可以扩大该闪存阵列的存储空间。
同理,当写入的用户数据的数据量继续上升,直到用户数据的数据量满足第二数量条件,该控制器11可以继续将以SLC模式存储数据的存储空间存储数据的模式转换为MLC模式,或者将以SLC模式存储数据的存储空间存储数据的模式转换为TLC模式以及QLC模式。该第二数量条件可以为大于或等于某一个确定的值。该控制器11也可以先将以SLC模式存储数据的存储空间存储数据的模式转换为MLC模式,若继续写入数据达到一定值时,再将以MLC模式存储数据的存储空间存储数据的模式转换为TLC模式。同样,若用户数据的数据量继续上升,可以将以TLC模式存储数据的存储空间存储数据的模式转换为QLC模式。
需要说明的是,该控制器11将该闪存阵列中至少一部分存储空间存储数据的模式由第一模式转换为第二模式之后,若接收到了用户的写数据的请求,该控制器11将需要写入的目标数据以第二模式写入该闪存阵列。
当该闪存阵列中的两个QLC硬盘全部存储空间的模式都转换为QLC模式时,该闪存阵列中QLC硬盘的存储容量可以达到最大值,与该QLC硬盘原始容量一致。
需要说明的是,该控制器11可以向闪存阵列中每个硬盘的闪存控制器121发送程序指令,指示该闪存控制器121将对应的硬盘中存储空间存储数据的模式进行转换。
实施例一提供的这种硬盘控制的方法中,当闪存阵列的用户数据的数据量大于或等于第一预设值的时候,该控制器11可以转换闪存阵列中存储空间存储数据的模式,提高该闪存阵列中硬盘的数据密度,从而扩大闪存阵列存储空间的容量,使得该闪存阵列的容量不受损失。
在实施例一中,若该第一预设值比较低,当闪存阵列中的用户数据的数据量达到第一 预设值时,该闪存阵列中仍然有大量的未存储数据的存储空间。该控制器11可以先将该闪存阵列中至少一部分存储空间存储数据的模式由第一模式转换为第二模式,然后再将该闪存阵列中的用户数据迁移至以第二模式存储数据的存储空间内,再继续将用户数据迁移之前所占据的存储空间的模式转换为第二模式,直至将该闪存阵列中所有的存储空间存储数据的模式都转换为第二模式。如图6所示,实施例二包括:
601、控制器11检测闪存阵列中存储的用户数据的数据量是否大于或等于第一预设值。
步骤601请参照实施例一中的步骤501进行理解,此处不再赘述。
602、当检测到该存储阵列中存储的用户数据的数据量大于或等于第一预设值时,该控制器11将该闪存阵列中至少一部分存储空间存储数据的模式由第一模式转换为第二模式。
步骤602请参照实施例一中的步骤502进行理解,此处不再赘述。
603、该控制器11将至少一部分用户数据迁移至以第二模式存储数据的存储空间。
控制器11将以第一模式存储数据的存储空间内的至少一部分用户数据的数据量迁移至以第二模式存储数据的存储空间内。若该第一预设值较低,例如,闪存阵列的存储容量为512GB,闪存阵列中设置有两个以SLC模式存储数据的硬盘,第一预设值为100GB。该控制器11在步骤602中可以将该闪存阵列中未存储数据的200GB存储空间存储数据的模式转换为MLC模式,从而可以获得400GB以MLC模式存储数据的存储空间。然后该控制器11将该闪存阵列中以SLC模式存储数据的存储空间内的100GB用户数据全部迁移至以MLC模式的存储空间内。
可选的,该控制器11也可以将该以SLC模式存储数据的存储空间内的数据部分迁移至以MLC模式存储数据的存储空间内。然后再将该以SLC模式存储数据的存储空间存储数据的模式转换为MLC模式。
需要说明的是,若在该闪存阵列中,将一个硬盘内的数据迁移到另一个硬盘上,需要该控制器11执行该动作。若在闪存阵列中一个硬盘上一个区域的数据迁移到另一个区域,则该迁移过程可以由该控制器11执行也可以由该控制器11指示该硬盘的闪存控制器121执行。
604、该控制器11释放至少一部分用户数据占用的存储空间。
该控制器11释放该闪存阵列中至少一部分用户数据占用的存储空间,该至少一部分用户数据可以为迁移至以第二模式存储数据的存储空间的用户数据。如步骤603中迁移至以MLC模式存储数据的存储空间的100GB用户数据。该释放的过程可以包括:将这部分存储空间存储的用户数据删除,再擦除这部分存储空间的擦除块。
可以理解的是,该控制器11可以指示闪存阵列中每个硬盘的闪存控制器121释放该硬盘自己的存储空间。
605、该控制器11将至少一部分用户数据占用的存储空间存储数据的模式转换为第二模式。
该控制器11将至少一部分用户数据占用的存储空间存储数据的模式转换为第二模式,该至少一部分数据占用的空间可以为步骤604中释放出来的空间。该转换过程如步骤602所述,该控制器11可以指示每个硬盘的闪存控制器121将对应的硬盘中存储空间存储数据 的模式进行转换。
实施例二提供的这种硬盘控制的方法可以在闪存阵列中用户数据的数据量大于或等于第一预设值时,先将闪存阵列中未存储数据的存储空间存储数据的模式由第一模式转换为第二模式,使得该闪存阵列的容量扩大。然后再将以第一模式存储数据的存储空间内的数据迁移至以第二模式存储数据的存储空间内,再释放被迁移的数据所占据的存储空间之后,再将该释放出来的存储空间存储数据的模式继续转换为第二模式,这样可以逐步将该闪存阵列中所有的存储空间存储数据的模式都转换为第二模式,从而可以扩大该闪存阵列存储数据的容量。
在实施例一中,若该第一预设值设置得较高,当该闪存阵列中的用户数据的数据量达到第一预设值时,该闪存阵列中以第一模式存储数据的存储空间已经接近耗尽。该控制器11可以先将以第一模式存储数据的存储空间内的一部分数据迁移至预先设置的以第二模式存储数据的存储空间内。然后再释放一部分以第一模式存储数据的存储空间,将该一部分以第一模式存储数据的存储空间存储数据的模式转换为第二模式。如图7所示,实施例三包括:
701、控制器11检测闪存阵列中存储的用户数据的数据量是否大于或等于第一预设值。
步骤701请参照实施例一中的步骤501进行理解,此处不再赘述。
702、检测到该存储阵列中存储的用户数据的数据量大于或等于第一预设值时,该控制器11将以第一模式存储数据的存储空间内的至少一部分用户数据迁移至预先设置的以第二模式存储数据的存储空间。
为了便于描述,第一模式以SLC模式为例,第二模式以MLC模式为例。当该控制器11检测到闪存阵列中存储的用户数据的数据量大于或等于第一预设值时,该控制器11将该闪存阵列中以第一模式存储数据的存储空间内的至少一部分用户数据以第二模式写入预先设置的以第二模式存储数据的存储空间内。示例性的,若闪存阵列中设置有256GB以SLC模式存储数据的存储空间,512GB以MLC模式存储数据的空间,该第一预设值可以为200GB。当闪存阵列的用户数据的数据量低于200GB时,该闪存阵列将写入的数据存放在以SLC模式存储数据的存储空间内。当该以SLC模式存储数据的存储空间内的用户数据的数据量大于或等于200GB时,该控制器11将该200GB数据中的至少一部分数据迁移至以MLC模式存储数据的空间。
需要说明的是,数据迁移的过程可以由该控制器11执行也可以由该控制器11指示该闪存阵列中硬盘的闪存控制器121执行,具体请参考实施例二中的步骤603进行理解,此处不再赘述。
703、控制器11释放至少一部分用户数据占用的存储空间。
该控制器11释放该闪存阵列中至少一部分用户数据占用的存储空间,该至少一部分用户数据可以为迁移至以第二模式存储数据的存储空间的用户数据。如步骤702中迁移至以MLC模式存储数据的存储空间的数据。该释放过程如实施例二中步骤604所述,此处不再赘述。该释放过程可以为控制器11指示闪存阵列中每个硬盘的闪存控制器121释放对应的硬盘自身的存储空间。
704、控制器11将至少一部分用户数据占用的存储空间存储数据的模式转换为第二模式。
该控制器11将至少一部分用户数据占用的存储空间存储数据的模式转换为第二模式,该至少一部分数据占用的空间可以为步骤703中释放出来的空间。该转换过程如实施例一的步骤502与实施例二的步骤602所述,该控制器11可以指示每个硬盘的闪存控制器121将对应的硬盘中存储空间存储数据的模式进行转换。
实施例三提供的这种硬盘控制的方法可以应用于该第一预设值较高的情况,该闪存阵列中以第一模式存储数据的存储空间已经接近耗尽。该闪存阵列可以先迁移数据在转换存储空间,这样在扩大闪存阵列存储空间的同时可以保证数据安全。
在实施例二和实施例三中,该控制器11将用户数据迁移至以第二模式存储数据的存储空间内,该以第二模式存储数据的存储空间位于该闪存阵列的硬盘上。在另一种实施方式中,该控制器11也可以将用户数据迁移至该控制器11自身的存储器112上。在释放一部分以第一模式存储数据的存储空间之后,将以第一模式存储数据的存储空间存储数据的模式转换为第二模式。再将该迁移至存储器112上的用户数据以第二模式写入以第二模式存储数据的存储空间内。
在实施例一至实施例三中,第一数量条件为大于或等于第一预设值。当该闪存阵列中存储的用户数据的数据量大于或等于第一预设值时,该控制器11可以将闪存阵列中至少一部分空间存储数据的模式由第一模式转换为第二模式。以第二模式存储数据的硬盘比以第一模式存储数据的硬盘的数据密度高。通过这样的方式扩大该闪存阵列的容量。实施例四可以提供另一种硬盘控制的方法,在该方法中,该第一数量条件也可以为小于第二预设值,该第二预设值可以与实施例一至实施例三中的第一预设值相同,也可以不同。
若该闪存阵列中的用户数据的数据量小于第二预设值时,该控制器11也可以将闪存阵列中至少一部分空间存储数据的模式由第三模式转换为第四模式。为了便于描述,第三模式以QLC模式为例,第四模式以TLC模式为例。以第三模式存储数据的硬盘比以第四模式存储数据的硬盘数据密度高。这种方法可以在数据存储不受影响的情况下提高硬盘的可擦写次数,从而提高硬盘的使用寿命。如图8所示,实施例四包括:
801、控制器11检测闪存阵列中存储的用户数据的数据量是否小于第二预设值。
闪存阵列中的控制器11检测该闪存阵列中存储的用户数据的数据量是否小于第二预设值。比如该第二预设值可以为当前容量的50%。此时,该闪存阵列中被用户数据占据的存储空间存储数据的模式为第三模式,以该第三模式存储数据的硬盘数据密度较大,但是可擦写次数较少。
示例性的,闪存阵列中设置有两个硬盘,该两个硬盘存储数据的模式预先设置为QLC模式。该两个硬盘可以为图4中的QLC硬盘401,两个硬盘的存储容量均为1024GB。此时,整个闪存阵列的存储容量为2048GB。当该闪存阵列根据用户的需求删除该闪存阵列中的数据,一直删除到该闪存阵列中存储的用户数据的数据量低于1024GB。此时,该闪存阵列中至少存在1024GB的存储空间没有存储数据,该没有存储数据的存储空间存储数据的模式为QLC模式,以QLC模式存储数据的空间可擦写次数较少。
该闪存阵列中可以只预先设置以QLC模式存储数据的存储空间,也可以预先设置有以SLC、MLC或TLC模式存储数据的存储空间。
需要说明的是,该闪存阵列中的控制器11可以通过闪存阵列中每个硬盘的闪存控制器121来检测每个硬盘的用户数据的数据量,从而得到整个闪存阵列的用户数据的数据量然后确定闪存阵列中用户数据的数据量是否小于第二预设值。该控制器11可以与每个硬盘的闪存控制器121交互,获取到每个硬盘实时用户数据的数据量。
802、当检测到该存储阵列中存储的用户数据的数据量小于第二预设值时,该控制器11将该闪存阵列中至少一部分存储空间存储数据的模式由第三模式转换为第四模式。
当该控制器11检测到该闪存阵列中存储的用户数据的数据量小于第二预设值时,该控制器11将该闪存阵列中至少一部分空间存储数据的模式由第三模式转换为第四模式,以第三模式存储数据的硬盘比以第四模式存储数据的硬盘的数据密度高,这种方式可以使得转换后的该至少一部分空间获得可擦写次数的提升。值得注意的是,该闪存阵列中至少一部分存储空间存储数据的模式由第三模式转换为第四模式这个过程对于用户而言并不感知。
示例性的,当步骤801中所述的闪存阵列中存储的用户数据的数据量小于1024GB时,该控制器11可以将两个QLC硬盘中的以QLC模式存储数据的500GB存储空间存储数据的模式转换为TLC模式,从而可以获得375GB以TLC模式存储数据的存储空间。该以TLC模式存储数据的存储空间的可擦写次数较高。
同理,当该闪存阵列中存储的用户数据的数据量继续减少,直到用户数据的数据量满足第二数量条件时,该控制器11可以继续将以QLC模式存储数据的存储空间的模式转换为TLC模式,或者将以QLC模式存储数据的存储空间的模式转换为MLC模式以及SLC模式。该第二数量条件可以为低于某一个确定的值。该控制器11也可以先将以QLC模式存储数据的存储空间存储数据的模式转换为TLC模式,若用户数据的数据量继续减少至一定值,再将以TLC模式存储数据的存储空间存储数据的模式转换为MLC模式。同样,若用户数据的数据量继续减少,可以将以MLC模式存储数据的存储空间存储数据的模式转换为SLC模式。
需要说明的是,该控制器11将该闪存阵列中至少一部分存储空间存储数据的模式由第三模式转换为第四模式之后,若接收到了用户的写数据的请求,该控制器11将需要写入的目标数据以第四模式写入该闪存阵列。
当该闪存阵列中的两个QLC硬盘全部存储空间的模式都转换为SLC模式时,该闪存阵列中QLC硬盘的可擦写次数可以达到最大值。
需要说明的是,该控制器11可以向闪存阵列中每个硬盘的闪存控制器121发送程序指令,指示该闪存控制器121将对应的硬盘中存储空间存储数据的模式进行转换。
可以理解的是,该控制器11将该闪存阵列中至少一部分存储空间存储数据的模式由第三模式转换为第四模式之后,该控制器11还可以将以第三模式存储数据的存储空间内的数据迁移至以第四模式存储数据的存储空间内,然后再继续将以第三模式存储数据的空间存储数据的模式转换为第四模式,直至将该闪存阵列中所有空间存储数据的模式都转换为第四模式,该闪存阵列可以获得可擦写次数上的提高,具体可以参照实施例二进行理解,此处不再赘述。
若该闪存阵列中预先设置了以第四模式存储数据的存储空间,该控制器11也可以先将以第三模式存储数据的存储空间内的数据迁移至以第四模式存储数据的存储空间内,再将该第三模式存储数据的存储空间存储数据的模式转换为第四模式。具体可以参照实施例三进行理解,此处不再赘述。
实施例四提供的这种硬盘控制的方法中,当闪存阵列的用户数据的数据量小于第二预设值的时候,该控制器11可以转换闪存阵列中存储空间存储数据的模式,降低该闪存阵列中硬盘的数据密度,可以提高该闪存阵列的可擦写次数,从而可以延长该闪存阵列的使用寿命。
实施例一至实施例四提供的硬盘控制的方法都是针对图1所示的闪存阵列,该方法也可以应用于如图3所示的硬盘中,实施例五提供了一种硬盘控制的方法,如图9所示,该方法可以包括:
901、闪存控制器121检测硬盘中存储的用户数据的数据量是否满足第一数量条件。
闪存控制器121检测硬盘中存储的用户数据的数据量是否满足第一数量条件。该第一数量条件可以为实施例一至实施例三所述的大于或等于第一预设值。当该闪存阵列中存储的用户数据的数据量大于或等于该第一预设值时,若该硬盘继续写入数据,那么该硬盘剩余的容量即将耗尽。具体可以参照实施例一的步骤501进行理解,此处不再赘述。
该第一数量条件也可以为实施例四所述的小于第二预设值,该第二预设值可以与上述第一预设值相等,也可以不相等。当硬盘中存储的用户数据的数据量小于第二预设值时,该硬盘中的闪存控制器121可以将降低该硬盘的数据密度,从而获得可擦写次数的提升。具体可以参照实施例四的步骤801进行理解,此处不再赘述。
902、当检测到该硬盘中存储的用户数据的数据量满足第一数量条件时,该闪存控制器121将硬盘中至少一部分存储空间存储数据的模式由第五模式转换为第六模式。
为了便于描述,第五模式可以以MLC模式为例。若在步骤901中,该闪存控制器121检测到该硬盘的用户数据的数据量大于或等于第一预设值时,该闪存控制器121可以将该硬盘中至少一部分存储空间存储数据的模式由第五模式转换为第六模式,此种情况该第六模式可以以TLC模式为例。该闪存控制器121将该硬盘中至少一部分存储空间存储数据的模式由第五模式转换为第六模式之后,该硬盘的容量可以扩大,可以存储更多数据。具体可以参照实施例一中步骤502进行理解,此处不再赘述。
若在步骤902中,该闪存控制器121检测到该硬盘的用户数据的数据量小于第二预设值时,该闪存控制器121可以将该硬盘中至少一部分存储空间存储数据的模式由第五模式转换为第六模式,此种情况该第六模式可以以SLC模式为例。该闪存控制器121将该硬盘中至少一部分存储空间存储数据的模式由第五模式转换为第六模式之后,可以获得可擦写次数的提升。具体可以参照实施例四的步骤802进行理解,此处不再赘述。
可以理解的是,该闪存控制器121将该硬盘中至少一部分存储空间存储数据的模式由第五模式转换为第六模式之后,该闪存控制器121还可以将以第五模式存储数据的存储空间内的数据迁移至以第六模式存储数据的存储空间内,再释放该数据占据的存储空间,然后再继续将以第五模式存储数据的存储空间存储数据的模式转换为第六模式,直至将该硬 盘中所有存储空间存储数据的模式都转换为第六模式,具体可以参照实施例二进行理解,此处不再赘述。
若该硬盘中预先设置了以第六模式存储数据的存储空间,该闪存控制器121也可以先将以第五模式存储数据的存储空间内的数据迁移至以第六模式存储数据的存储空间内,再将该第五模式存储数据的存储空间存储数据的模式转换为第六模式。具体可以参照实施例三进行理解,此处不再赘述。
可以理解的是,闪存控制器121将硬盘中至少一部分存储空间存储数据的模式由第五模式转换为第六模式之后,若该闪存控制器接收到写数据请求,该闪存控制器以第六模式将目标数据写入该硬盘。
实施例六提供的一种硬盘控制装置,该硬盘控制装置可以应用于实施例九中硬盘控制的方法,如图10所示,该硬盘控制装置包括:
检测模块1001,用于检测硬盘中存储的用户数据的数据量是否满足第一数量条件。可以参照实施例五的步骤901进行理解,此处不再赘述。
处理模块1002,当存储的用户数据的数据量满足第一数量条件时,将该硬盘中至少一部分存储空间存储数据的模式由第五模式转换为第六模式。具体可以参照实施例五的步骤902,此处不再赘述。
该处理模块1002,还用于将以第五模式存储数据的存储空间内的数据迁移至以第六模式存储数据的存储空间内。具体可以参照实施例五的步骤902,此处不再赘述。
该处理模块1002,还用于释放至少一部分用户数据占用的存储空间。具体可以参照实施例五的步骤902进行理解,此处不再赘述。
接收模块1003,用于接收写数据请求,写数据请求包括目标数据。具体可以参照实施例五的步骤902进行理解,此处不再赘述。所述硬盘控制装置可以位于硬盘中,由闪存控制器121执行其具体功能。在另一种实现中,所述硬盘控制装置可以位于闪存阵列的控制器中,各个模块由控制器中的处理器调用存储器中的程序代码执行。
实施例七提供了一种控制器11,该控制器11应用于实施例一至实施例四所述的闪存阵列中,参见图11,本发明实施例七提供了一种控制器11,该控制器11可以包括:
处理器1101、存储器1102和收发器1103。该控制器11是一种硬件结构的设备,可以用于执行实施例一至实施例四所述闪存阵列中控制器执行的步骤。例如,本领域技术人员可以想到实施例一中步骤501,该控制器11可以通过收发器1103发送信令询问闪存阵列中每个硬盘的用户数据的数据量,然后通过该收发器1103接收每个硬盘的用户数据的数据量,该处理器1101调用存储器1102中的程序将所有硬盘的用户数据的数据量加起来得到闪存阵列中的用户数据的数据量,将所述用户数据的数据量与第一预设值进行对比,从而确定该闪存阵列中的用户数据的数据量是否大于或等于第一预设值。并且,处理器1101还可以通过该收发器1103向闪存阵列中每个硬盘发送命令,指示该硬盘中的闪存控制器将硬盘中相应的区域存储空间存储数据的模式由第一模式转换为第二模式,具体可以参照实施例一的步骤502进行理解。
可选的,上述处理器1101可以是一个或多个中央处理器(central processing unit, CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本发明方案程序执行的集成电路。
处理器1101、存储器1102和收发器1103通过总线1104相连,总线1104可以是外设部件互联标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。
以上对本申请实施例所提供的一种硬盘控制方法及相关设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本申请的限制。尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (17)

  1. 一种硬盘控制方法,其特征在于,所述方法应用于存储设备中,包括:
    检测所述存储设备中存储的用户数据的数据量是否满足第一数量条件,所述存储设备包括第一存储区域,所述第一存储区域以第一模式存储数据,所述第一模式是单层式存储单元SLC模式、多层式存储单元MLC模式、三层式存储单元TLC模式、四层式存储单元QLC模式中的其中一种;
    当所述存储的用户数据的数据量满足第一数量条件时,将所述第一存储区域中的第一子区域存储数据的模式由所述第一模式转换为第二模式,所述第二模式是SLC模式、MLC模式、TLC模式、QLC模式中的其中一种,并且所述第二模式不同于所述第一模式。
  2. 根据权利要求1所述的方法,其特征在于,在所述将所述第一存储区域中的第一子区域存储数据的模式由所述第一模式转换为第二模式之后,所述方法还包括:
    将所述第一存储区域的用户数据中的至少一部分用户数据迁移至所述转换后的第一子区域;
    释放所述第一存储区域中所述至少一部分用户数据所占用的区域;
    将所述至少一部分用户数据所占用的区域存储数据的模式转换成所述第二模式。
  3. 根据权利要求1所述的方法,其特征在于,在所述将第一存储区域中的第一子区域存储数据的模式由所述第一模式转换为第二模式之前,所述方法还包括:
    将所述第一存储区域的用户数据中的至少一部分用户数据迁移至所述存储设备的缓存;
    释放所述至少一部分用户数据所述占用的区域;
    在所述将第一存储区域中的第一子区域存储数据的模式由所述第一模式转换为第二模式之后,将所述至少一部分用户数据以所述第二模式写入所述转换后的第一存储区域。
  4. 根据权利要求1所述的方法,其特征在于,所述存储设备还包括第二存储区域,所述第二存储区域以第二模式存储数据,在所述将第一存储区域中的第一子区域存储数据的模式由所述第一模式转换为第二模式之前,所述方法还包括:
    将所述第一存储区域的用户数据中的至少一部分用户数据迁移至所述存储设备的第二存储区域;
    释放所述至少一部分用户数据所占用的区域。
  5. 根据权利要求1至4任意一项所述的方法,其特征在于,所述方法还包括:
    接收写数据请求,所述写数据请求包括目标数据;
    将所述目标数据以所述第二模式写入所述转换后的第一子区域。
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:
    检测所述存储设备中存储的用户数据的数据量是否满足第二数量条件,所述存储设备包括第二存储区域;
    当所述存储的用户数据的数据量满足第二数量条件时,将所述第二存储区域中的第二子区域存储数据的模式由所述第二模式转换为第三模式,所述第三模式是SLC模式、MLC模式、TLC模式、QLC模式中的其中一种,并且所述第三模式不同于所述第二模式。
  7. 一种硬盘控制装置,其特征在于,所述硬盘控制装置应用于硬盘中,所述硬盘控制装置包括:
    检测模块,用于检测所述存储设备中存储的用户数据的数据量是否满足第一数量条件,所述存储设备包括第一存储区域,所述第一存储区域以第一模式存储数据,所述第一模式是单层式存储单元SLC模式、多层式存储单元MLC模式、三层式存储单元TLC模式、四层式存储单元QLC模式中的其中一种;
    处理模块,用于当所述检测模块检测到存储的用户数据的数据量满足第一数量条件时,将所述第一存储区域中的第一子区域存储数据的模式由所述第一模式转换为第二模式,所述第二模式是SLC模式、MLC模式、TLC模式、QLC模式中的其中一种,并且所述第二模式不同于所述第一模式。
  8. 根据权利要求7所述的硬盘控制装置,其特征在于,所述硬盘控制装置还包括:
    所述处理模块,用于将所述第一存储区域的用户数据中的至少一部分用户数据迁移至所述转换后的第一子区域;
    所述处理模块,还用于释放所述第一存储区域中所述至少一部分用户数据所占用的区域;
    所述处理模块,还用于将所述至少一部分用户数据所占用的区域存储数据的模式转换成所述第二模式。
  9. 根据权利要求7所述的硬盘控制装置,其特征在于,所述硬盘控制装置还包括:
    所述处理模块,还用于将所述第一存储区域的用户数据中的至少一部分用户数据迁移至所述硬盘的第二存储区域,所述第二存储区域以所述第二模式存储数据;
    所述处理模块,还用于释放所述至少一部分用户数据所占用的区域。
  10. 根据权利要求7至9任一所述的硬盘控制装置,其特征在于,所述硬盘控制装置还包括:
    接收模块,用于接收写数据请求,所述写数据请求包括目标数据;
    所述处理模块,还用于将所述目标数据以所述第二模式写入转换后的第一子区域。
  11. 根据权利要求10所述的硬盘控制装置,其特征在于,所述硬盘控制装置还包括:
    所述检测模块,还用于检测所述存储设备中存储的用户数据的数据量是否满足第二数量条件,所述存储设备包括第二存储区域;
    所述处理模块,还用于当所述检测模块检测到存储的用户数据的数据量满足第二数量条件时,将所述第二存储区域中的第二子区域存储数据的模式由所述第二模式转换为第三模式,所述第三模式是SLC模式、MLC模式、TLC模式、QLC模式中的其中一种,并且所述第三模式不同于所述第二模式。
  12. 一种控制器,其特征在于,所述控制器位于存储设备中,所述存储设备包括至少一个硬盘和所述控制器,所述控制器包括处理器和存储器,所述存储器中存储有程序指令,所述处理器用于调用存储器中的程序指令执行如下步骤:
    检测所述存储设备中存储的用户数据的数据量是否满足第一数量条件,所述存储设备包括第一存储区域,所述第一存储区域以第一模式存储数据,所述第一模式是单层式存储 单元SLC模式、多层式存储单元MLC模式、三层式存储单元TLC模式、四层式存储单元QLC模式中的其中一种;
    当所述存储设备中存储的用户数据的数据量满足第一数量条件时,将所述第一存储区域中的第一子区域存储数据的模式由所述第一模式转换为第二模式,所述第二模式是SLC模式、MLC模式、TLC模式、QLC模式中的其中一种,并且所述第二模式不同于所述第一模式。
  13. 根据权利要求12所述的控制器,其特征在于,所述处理器还用于调用存储器中的程序指令执行如下步骤:
    将所述第一存储区域的用户数据中的至少一部分用户数据迁移至所述转换后的第一子区域;
    释放所述第一存储区域中所述至少一部分用户数据所占用的区域;
    将所述至少一部分用户数据所占用的区域存储数据的模式转换成所述第二模式。
  14. 根据权利要求12所述的控制器,其特征在于,所述处理器还用于调用存储器中的程序指令执行如下步骤:
    将所述第一存储区域的用户数据中的至少一部分用户数据迁移至所述存储设备的缓存;
    释放所述至少一部分用户数据所述占用的区域;
    在所述将第一存储区域中的第一子区域存储数据的模式由所述第一模式转换为第二模式之后,将所述至少一部分用户数据以所述第二模式写入所述转换后的第一存储区域。
  15. 根据权利要求12所述的控制器,其特征在于,所述处理器还用于调用所述存储器中的程序指令执行如下步骤:
    将所述第一存储区域的用户数据中的至少一部分用户数据迁移至所述存储设备的第二存储区域,所述第二存储区域以第二模式存储数据;
    释放所述至少一部分数据所占用的区域。
  16. 根据权利要求12至15任一所述的控制器,其特征在于,所述处理器还用于调用所述存储器中的程序指令执行如下步骤:
    接收写数据请求,所述写数据请求包括目标数据;
    将所述目标数据以所述第二模式写入第二存储区域或所述转换后的第一存储区域。
  17. 根据权利要求16所述的控制器,其特征在于,所述处理器还用于调用所述存储器中的程序指令执行如下步骤:
    检测所述存储设备中存储的用户数据的数据量是否满足第二数量条件,所述存储设备包括第二存储区域;
    当所述存储设备中存储的用户数据的数据量满足第二数量条件时,将所述第二存储区域中的第二子区域存储数据的模式由所述第二模式转换为第三模式,所述第三模式是SLC模式、MLC模式、TLC模式、QLC模式中的其中一种,并且所述第三模式不同于所述第二模式。
PCT/CN2019/091189 2019-06-14 2019-06-14 一种硬盘控制方法及相关设备 WO2020248206A1 (zh)

Priority Applications (7)

Application Number Priority Date Filing Date Title
CN201980097515.9A CN114008580A (zh) 2019-06-14 2019-06-14 一种硬盘控制方法及相关设备
PCT/CN2019/091189 WO2020248206A1 (zh) 2019-06-14 2019-06-14 一种硬盘控制方法及相关设备
EP19932927.7A EP3964939A4 (en) 2019-06-14 2019-06-14 HARD DISK CONTROL METHOD AND RELATED DEVICE
KR1020217043003A KR20220015457A (ko) 2019-06-14 2019-06-14 하드 디스크 제어 방법 및 관련 디바이스
JP2021573823A JP2022537520A (ja) 2019-06-14 2019-06-14 ハードディスク制御方法及び関連デバイス
TW109119837A TWI779300B (zh) 2019-06-14 2020-06-12 一種硬碟控制方法及相關設備
US17/547,592 US20220100406A1 (en) 2019-06-14 2021-12-10 Hard disk control method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/091189 WO2020248206A1 (zh) 2019-06-14 2019-06-14 一种硬盘控制方法及相关设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/547,592 Continuation US20220100406A1 (en) 2019-06-14 2021-12-10 Hard disk control method and related device

Publications (1)

Publication Number Publication Date
WO2020248206A1 true WO2020248206A1 (zh) 2020-12-17

Family

ID=73781309

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/091189 WO2020248206A1 (zh) 2019-06-14 2019-06-14 一种硬盘控制方法及相关设备

Country Status (7)

Country Link
US (1) US20220100406A1 (zh)
EP (1) EP3964939A4 (zh)
JP (1) JP2022537520A (zh)
KR (1) KR20220015457A (zh)
CN (1) CN114008580A (zh)
TW (1) TWI779300B (zh)
WO (1) WO2020248206A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114816236A (zh) * 2021-01-20 2022-07-29 美光科技公司 数据迁移技术

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111722804B (zh) * 2020-06-12 2022-07-08 浪潮电子信息产业股份有限公司 一种非易失内存调度的方法、系统、设备及可读存储介质
CN118626024A (zh) * 2024-08-14 2024-09-10 合肥康芯威存储技术有限公司 一种存储芯片的数据存储方法及数据存储系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107967121A (zh) * 2017-10-25 2018-04-27 华为技术有限公司 数据写入方法和存储设备
CN108062201A (zh) * 2016-11-09 2018-05-22 西部数据技术公司 用于固态驱动器的自虚拟化闪速存储器
CN109254926A (zh) * 2017-07-13 2019-01-22 慧荣科技股份有限公司 数据储存装置及非挥发式存储器操作方法

Family Cites Families (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8407400B2 (en) * 2008-11-12 2013-03-26 Micron Technology, Inc. Dynamic SLC/MLC blocks allocations for non-volatile memory
JP5444198B2 (ja) * 2010-12-06 2014-03-19 本田技研工業株式会社 サブフレーム構造体
KR101861170B1 (ko) * 2011-08-17 2018-05-25 삼성전자주식회사 마이그레이션 관리자를 포함하는 메모리 시스템
US9176862B2 (en) * 2011-12-29 2015-11-03 Sandisk Technologies Inc. SLC-MLC wear balancing
US8935459B2 (en) * 2012-03-08 2015-01-13 Apple Inc. Heuristics for programming data in a non-volatile memory
JP6146675B2 (ja) * 2014-06-03 2017-06-14 コニカミノルタ株式会社 画像形成装置及びフラッシュメモリの制御方法並びに制御プログラム
US10031673B2 (en) * 2014-09-26 2018-07-24 SK Hynix Inc. Techniques for selecting amounts of over-provisioning
CN105843748B (zh) * 2015-01-15 2019-06-11 华为技术有限公司 一种对内存中内存页的处理方法及装置
US9697134B2 (en) * 2015-06-10 2017-07-04 Micron Technology, Inc. Memory having a static cache and a dynamic cache
US10007458B2 (en) * 2015-12-18 2018-06-26 Microsemi Solutions (U.S.), Inc. Method of configuring memory cells in a solid state drive based on read/write activity and controller therefor
US20180165032A1 (en) * 2016-12-14 2018-06-14 Western Digital Technologies, Inc. Read write performance for nand flash for archival application
US10572388B2 (en) * 2017-08-30 2020-02-25 Micron Technology, Inc. Managed NVM adaptive cache management
JP7030463B2 (ja) * 2017-09-22 2022-03-07 キオクシア株式会社 メモリシステム
JP6805110B2 (ja) * 2017-11-06 2020-12-23 株式会社日立製作所 ストレージシステム及びその制御方法
US20190034330A1 (en) * 2017-12-01 2019-01-31 Intel Corporation Mass storage device with dynamic single level cell (slc) buffer specific program and/or erase settings
US20190034105A1 (en) * 2017-12-28 2019-01-31 Intel Corporation Storage device having programmed cell storage density modes that are a function of storage device capacity utilization
US11132133B2 (en) * 2018-03-08 2021-09-28 Toshiba Memory Corporation Workload-adaptive overprovisioning in solid state storage drive arrays
US10949355B2 (en) * 2018-06-11 2021-03-16 Western Digital Technologies, Inc. Methods and apparatus for workload based dynamic cache control in SSD
CN110795270B (zh) * 2018-08-03 2024-01-30 建兴储存科技(广州)有限公司 固态储存装置及其读取重试方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108062201A (zh) * 2016-11-09 2018-05-22 西部数据技术公司 用于固态驱动器的自虚拟化闪速存储器
CN109254926A (zh) * 2017-07-13 2019-01-22 慧荣科技股份有限公司 数据储存装置及非挥发式存储器操作方法
CN107967121A (zh) * 2017-10-25 2018-04-27 华为技术有限公司 数据写入方法和存储设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
MALVENTANO ALLYN: "Micron launches M600 SATA SSD with innovative SLC/MLC Dynamic Write Acceleration", 16 September 2014 (2014-09-16), pages 1 - 11, XP055763853, Retrieved from the Internet <URL:https://pcper.com/2014/09/micron-launches-m600-sata-ssd-with-innovative-slc-mlc-dynamic-write-acceleration/> *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114816236A (zh) * 2021-01-20 2022-07-29 美光科技公司 数据迁移技术

Also Published As

Publication number Publication date
JP2022537520A (ja) 2022-08-26
EP3964939A1 (en) 2022-03-09
CN114008580A (zh) 2022-02-01
TW202046111A (zh) 2020-12-16
EP3964939A4 (en) 2022-05-11
TWI779300B (zh) 2022-10-01
KR20220015457A (ko) 2022-02-08
US20220100406A1 (en) 2022-03-31

Similar Documents

Publication Publication Date Title
US11355197B2 (en) Memory system with nonvolatile cache and control method thereof
TWI779300B (zh) 一種硬碟控制方法及相關設備
WO2016107442A1 (zh) 将数据写入固态硬盘的方法及固态硬盘
US20210073119A1 (en) Memory system and method
CN103838676B (zh) 数据存储系统、数据存储方法及pcm桥
JP2013242908A (ja) ソリッドステートメモリ、それを含むコンピュータシステム及びその動作方法
KR20090050382A (ko) 스토리지 관리 방법 및 관리 시스템
CN112506438B (zh) 一种映射表管理方法及固态硬盘
CN114968081A (zh) 数据存储系统中的基于利用率的动态共享缓冲器
KR102276350B1 (ko) Nand 버퍼를 갖는 nand 플래시 저장 디바이스
WO2020007030A1 (zh) 一种系统控制器和系统垃圾回收方法
CN113821158A (zh) 一种快闪存储器、存储介质转换方法及计算装置
CN111752484A (zh) 一种ssd控制器、固态硬盘及数据写入方法
WO2015018305A1 (zh) 一种存储器的存储方法及存储系统
TWI718710B (zh) 資料儲存裝置以及非揮發式記憶體控制方法
CN112130749A (zh) 数据储存装置以及非挥发式存储器控制方法
CN115203079A (zh) 一种将数据写入固态硬盘的方法
TWI786288B (zh) 儲存裝置、儲存裝置的控制方法及記錄媒體
CN116364148A (zh) 一种面向分布式全闪存储系统的磨损均衡方法及系统
CN115203085A (zh) 用于存储装置的超小区域支持
CN113986773A (zh) 基于固态硬盘的写放大优化方法、装置及计算机设备
CN115543180A (zh) 一种固态硬盘的管理方法、装置及固态硬盘
KR101363422B1 (ko) 비휘발성 메모리 시스템
CN113467713A (zh) 数据分离方法及固态硬盘
KR20220052353A (ko) 조정된 파라미터를 사용한 메모리 컴포넌트의 가비지 수집

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

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2019932927

Country of ref document: EP

Effective date: 20211203

ENP Entry into the national phase

Ref document number: 2021573823

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 20217043003

Country of ref document: KR

Kind code of ref document: A