WO2024078012A1 - 固态硬盘配置方法、垃圾回收方法以及相关设备 - Google Patents

固态硬盘配置方法、垃圾回收方法以及相关设备 Download PDF

Info

Publication number
WO2024078012A1
WO2024078012A1 PCT/CN2023/102661 CN2023102661W WO2024078012A1 WO 2024078012 A1 WO2024078012 A1 WO 2024078012A1 CN 2023102661 W CN2023102661 W CN 2023102661W WO 2024078012 A1 WO2024078012 A1 WO 2024078012A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
garbage collection
stream
solid
data partition
Prior art date
Application number
PCT/CN2023/102661
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 华为技术有限公司
Publication of WO2024078012A1 publication Critical patent/WO2024078012A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation

Definitions

  • the present application relates to the field of storage technology, and in particular to a solid state drive configuration method, a garbage collection method, and related equipment.
  • the redirect-on-write (ROW) mechanism is usually used to update the data already stored in the SSD. For example, to update data a to data b, data a is stored in location A of the storage medium, and the updated data b is written to another free location B on the storage medium, while the data a before the update is set to invalid data (garbage).
  • the present application provides a solid-state drive configuration method, a garbage collection method, and related equipment, which customize corresponding garbage collection strategies according to data types, so that different types of data can be recycled using corresponding different garbage collection strategies, fully considering that data may be updated and invalidated, thereby solving the problem of invalid movement caused by unified recycling based on a greedy algorithm, and then causing write amplification and other problems.
  • the present application provides a solid-state hard disk configuration method, which is applied to a storage controller.
  • the method includes: obtaining a data type corresponding to a stream supported by the solid-state hard disk; a partition of the solid-state hard disk corresponding to the stream; determining a garbage collection strategy corresponding to the stream based on the data type corresponding to the stream, and sending the garbage collection strategy corresponding to the stream to the solid-state hard disk.
  • the stream corresponds to the partition of the solid-state drive, that is, the same stream of data is stored in the same data partition of the solid-state drive.
  • the data type stored in the same data partition is the same.
  • the solid-state drive can support more than one stream, and the solid-state drive can include more than one data partition.
  • Different streams are used to transmit data of different data types, and the data partitions corresponding to the streams transmitting different data types are different, that is, data of different data types are stored in different data partitions.
  • different data partitions store different data types, and the configured garbage collection strategies are different.
  • garbage collection is uniformly performed according to the greedy algorithm, without considering that data may be updated or invalidated, which results in invalid migration and causes problems such as write amplification.
  • the idea of this application is to customize the corresponding garbage collection strategy according to the data type, so that different types of data can be recycled using different garbage collection strategies, fully considering that data may be updated or invalidated, thereby solving the problems such as invalid migration caused by uniform recycling according to the greedy algorithm and causing write amplification.
  • the storage controller obtains the data type corresponding to the stream supported by the solid-state drive, and the storage controller can correspond to different data partitions according to the streams of different data types, so as to write the data in the stream to the corresponding data partition according to the data type corresponding to the stream in the subsequent.
  • the storage controller determines the garbage collection strategy corresponding to the stream according to the data type corresponding to the stream, and sends the garbage collection strategy corresponding to the stream to the solid-state drive. Then the data partition corresponding to the stream is determined according to the stream, and the corresponding garbage collection strategy is configured for the data partition corresponding to the stream according to the data type corresponding to the stream.
  • the solid-state drive can perform garbage collection according to the garbage collection strategy corresponding to the data of each stream (that is, the data partition corresponding to each stream). In this way, invalid movement in the solid-state drive can be reduced, thereby reducing the number of write amplifications of the solid-state drive, reducing the long-tail delay of the solid-state drive, optimizing the performance of the solid-state drive, and increasing the service life of the solid-state drive.
  • the two or more streams correspond to different data types, and the two or more streams correspond to different garbage collection strategies.
  • Different garbage collection strategies are configured for streams that transmit different data types, that is, different garbage collection strategies are configured for data of different data types. This avoids the above-mentioned garbage collection being uniformly performed according to the greedy algorithm, without considering that the data may be updated and become invalid, thereby causing invalid migration and further causing problems such as write amplification.
  • determining the garbage collection strategy corresponding to the stream according to the data type corresponding to the stream includes: when the data type corresponding to the stream is periodically updated data, determining the garbage collection strategy corresponding to the stream to be the first garbage collection strategy, wherein the first garbage collection strategy is not to perform garbage collection on the first physical block, and to set an exclusive reserved space, wherein the first physical block is used to store periodically updated data; when the data type corresponding to the stream is data with a high update frequency, determining the garbage collection strategy corresponding to the stream to be the second garbage collection strategy, wherein the second garbage collection strategy is to perform garbage collection on the second physical block when the amount of garbage in the second physical block reaches a preset high threshold, wherein the second physical block is used to store data with a high update frequency; when the data type corresponding to the stream is data with a low update frequency, determining the garbage collection strategy corresponding to the stream to be the third garbage collection strategy, wherein the third garbage collection strategy is to perform garbage collection on the third physical block in descending order of garbage amount,
  • the number of the first physical block, the second physical block and the third physical block can be multiple, and multiple means two or more.
  • the first physical block storing periodically updated data includes multiple
  • the multiple first physical blocks constitute a first data partition
  • the garbage collection strategy corresponding to the first data partition is the first garbage collection strategy.
  • the second physical block storing data with a high update frequency includes multiple
  • the multiple second physical blocks constitute a second data partition
  • the garbage collection strategy corresponding to the second data partition is the second garbage collection strategy.
  • the third physical block storing data with a low update frequency includes multiple
  • the multiple third physical blocks constitute a third data partition
  • the garbage collection strategy corresponding to the third data partition is the third garbage collection strategy.
  • the solid-state drive includes K second physical blocks, then the K second physical blocks are taken as a whole, and the whole corresponds to the second garbage collection strategy.
  • garbage collection is performed on the K second physical blocks.
  • the solid-state drive includes K third physical blocks, then the K third physical blocks are taken as a whole, and the garbage collection strategy corresponding to the whole is the third garbage collection strategy, then the third garbage collection strategy is executed on the K third physical blocks, and the garbage amount of the K third physical blocks is obtained respectively, and garbage collection is performed on the K third physical blocks in order of garbage amount from high to low.
  • the garbage collection strategy may be targeted at individuals. For example, if a solid state drive includes K second physical blocks, when the amount of garbage in a second physical block among the K second physical blocks reaches a preset high threshold, garbage collection is performed on the second physical block.
  • garbage collection is not performed on the first physical block storing periodically updated data, because the periodically updated data is fixedly updated, that is, the data on the first physical block will inevitably be invalidated.
  • the data on the first physical block is updated, After all data on the first physical block becomes invalid data, the first physical block can be directly released without moving the periodically updated data, which greatly reduces the data movement.
  • the number of write amplifications in the solid-state drive is reduced to a minimum, reducing the long-tail delay of the solid-state drive, thereby optimizing the performance of the solid-state drive and increasing the service life of the solid-state drive.
  • garbage collection is performed when the garbage volume of the second physical block storing the data with high update frequency reaches a preset high threshold. Based on the high data update frequency, the garbage volume of the second physical block is more likely to reach the high threshold. Setting a high threshold can reduce the number of times data with high update frequency is moved, reduce the number of write amplifications, reduce the long-tail delay of the SSD, optimize the performance of the SSD, and increase the service life of the SSD.
  • the third physical block storing data with low update frequency to perform garbage collection according to the garbage amount from high to low, it can be ensured that when performing garbage collection, there must be a storage unit that can perform garbage collection.
  • obtaining the data type corresponding to the stream supported by the solid-state drive includes: obtaining the total number of streams supported by the solid-state drive; creating a stream according to the total number, and setting the corresponding data type for the stream.
  • the corresponding data type is set for the stream so that a corresponding garbage collection strategy can be configured for data of different streams later.
  • the present application provides a storage controller, which includes a processor and a memory, wherein the processor executes computer instructions in the memory to obtain the data type corresponding to a stream supported by a solid-state drive; the stream corresponds to a partition of the solid-state drive; based on the data type corresponding to the stream, a garbage collection strategy corresponding to the stream is determined; and the garbage collection strategy corresponding to the stream is sent to the solid-state drive.
  • the two or more streams correspond to different data types, and the two or more streams correspond to different garbage collection strategies.
  • determining the garbage collection strategy corresponding to the stream according to the data type corresponding to the stream includes: when the data type corresponding to the stream is periodically updated data, determining the garbage collection strategy corresponding to the stream to be the first garbage collection strategy, wherein the first garbage collection strategy is not to perform garbage collection on the first physical block, and to set an exclusive reserved space, wherein the first physical block is used to store periodically updated data; when the data type corresponding to the stream is data with a high update frequency, determining the garbage collection strategy corresponding to the stream to be the second garbage collection strategy, wherein the second garbage collection strategy is to perform garbage collection on the second physical block when the amount of garbage in the second physical block reaches a preset high threshold, wherein the second physical block is used to store data with a high update frequency; when the data type corresponding to the stream is data with a low update frequency, determining the garbage collection strategy corresponding to the stream to be the third garbage collection strategy, wherein the third garbage collection strategy is to perform garbage collection on the third physical block in descending order of garbage amount
  • obtaining the data type corresponding to the stream supported by the solid-state drive includes: obtaining the total number of streams supported by the solid-state drive; creating a stream according to the total number, and setting a corresponding data type for the stream.
  • the present application provides a solid-state hard drive configuration method, which is applied to a solid-state hard drive, the method comprising: determining a data partition, wherein the data partition is used to store data of corresponding data types; and configuring a garbage collection strategy corresponding to the data partition according to the data type corresponding to the data partition.
  • a data partition for storing different data types is determined for the solid-state drive, and then the garbage collection strategy corresponding to the data partition is configured according to the data type corresponding to each data partition. That is, the corresponding garbage collection strategy is customized according to the data type, so that different types of data can be recycled using different garbage collection strategies, taking into account that data may be updated and invalidated, thereby solving the problem of invalid movement caused by unified recycling based on the greedy algorithm, and then causing write amplification.
  • the two or more data partitions correspond to different data types, and the two or more data partitions correspond to different garbage collection strategies.
  • Different garbage collection strategies are configured for data partitions storing different data types, that is, different garbage collection strategies are configured for data of different data types, which avoids the above garbage collection being uniformly performed according to the greedy algorithm without considering that data will be updated. The new one will fail, resulting in invalid migration, which in turn causes problems such as write amplification.
  • the data partition includes one or more of a first data partition, a second data partition, and a third data partition; wherein the first data partition is used to store periodically updated data, the second data partition is used to store data with a high update frequency, and the third data partition is used to store data with a low update frequency.
  • configuring the garbage collection strategy corresponding to the data partition includes: configuring the garbage collection strategy corresponding to the first data partition as the first garbage collection strategy, wherein the first garbage collection strategy is not to perform garbage collection on the first data partition and to set an exclusive reserved space; configuring the garbage collection strategy corresponding to the second data partition as the second garbage collection strategy, wherein the second garbage collection strategy is to perform garbage collection on the second data partition when the amount of garbage in the second data partition reaches a preset high threshold; configuring the garbage collection strategy corresponding to the third data partition as the third garbage collection strategy, wherein the third garbage collection strategy is to perform garbage collection on the third data partition in descending order of garbage amount.
  • garbage collection is not performed on the first physical block storing periodically updated data, because the periodically updated data is updated fixedly, that is, the data on the first physical block will inevitably be invalidated.
  • the first physical block can be released directly without moving the periodically updated data, thereby greatly reducing the movement of data.
  • the number of write amplifications in the solid-state drive is reduced to a minimum, reducing the long-tail delay of the solid-state drive, thereby optimizing the performance of the solid-state drive and increasing the service life of the solid-state drive.
  • garbage collection is performed when the garbage volume of the second physical block storing the data with high update frequency reaches a preset high threshold. Based on the high data update frequency, the garbage volume of the second physical block is more likely to reach the high threshold. Setting a high threshold can reduce the number of times data with high update frequency is moved, reduce the number of write amplifications, reduce the long-tail delay of the SSD, optimize the performance of the SSD, and increase the service life of the SSD.
  • the third physical block storing data with low update frequency to perform garbage collection according to the garbage amount from high to low, it can be ensured that when performing garbage collection, there must be a storage unit that can perform garbage collection.
  • determining the data partition includes: obtaining the total number of streams supported by the solid state drive; and determining N data partitions according to the total number, where N is less than or equal to the total number.
  • a data partition includes one or more physical blocks.
  • the present application provides a solid-state hard drive, which includes a flash memory controller and a flash memory chip; the flash memory controller is used to determine a data partition from the flash memory chip, wherein the data partition is used to store data of a corresponding data type; the flash memory controller is also used to configure a garbage collection strategy corresponding to the data partition according to the data type corresponding to the data partition.
  • the two or more data partitions correspond to different data types, and the two or more data partitions correspond to different garbage collection strategies.
  • the data partition includes one or more of a first data partition, a second data partition, and a third data partition; wherein the first data partition is used to store periodically updated data, the second data partition is used to store data with a high update frequency, and the third data partition is used to store data with a low update frequency.
  • configuring the garbage collection strategy corresponding to the data partition includes: the flash memory controller configures the garbage collection strategy corresponding to the first data partition as the first garbage collection strategy, wherein the first garbage collection strategy is not to perform garbage collection on the first data partition and to set an exclusive reserved space; the flash memory controller configures the garbage collection strategy corresponding to the second data partition as the second garbage collection strategy, wherein the second garbage collection strategy is to perform garbage collection on the second data partition when the amount of garbage in the second data partition reaches a preset high threshold; the flash memory controller configures the garbage collection strategy corresponding to the third data partition as the third garbage collection strategy, wherein the third garbage collection strategy is to perform garbage collection on the third data partition in descending order of garbage amount.
  • the flash memory controller is used to determine data partitions from the flash memory chip, including: the flash memory controller is used to obtain the total number of streams supported by the solid state drive, and determine N data partitions based on the total number, where N is less than or equal to the total number.
  • a data partition includes one or more physical blocks.
  • the present application provides a data writing method, which is applied to a flash memory storage system
  • the flash memory storage system includes a storage controller and a solid-state hard disk
  • the solid-state hard disk includes a data partition
  • the data partition is configured with a corresponding garbage collection strategy, wherein the garbage collection strategy is configured according to the data type corresponding to the data partition
  • the storage controller obtains the data to be written
  • the storage controller determines the stream ID according to the data type of the data to be written
  • the storage controller puts the data to be written into the stream corresponding to the stream ID, and sends the stream to the solid-state hard disk
  • the solid-state hard disk writes the data to be written in the stream to the corresponding data partition, wherein the data type corresponding to the data partition is the same as the data type of the data to be written.
  • the solid-state drive has been divided into data partitions, and the garbage collection strategies configured for data partitions storing different data types are different.
  • the storage control writes the data of different streams into the corresponding data partitions, specifically, according to the data type transmitted by the stream, the data in the stream is written into the data partition with the same data type as the data transmitted by the stream.
  • the solid-state drive can perform garbage collection according to the garbage collection strategy corresponding to each data partition. This can reduce invalid movement within the solid-state drive, thereby reducing the number of write amplifications of the solid-state drive, reducing the long-tail delay of the solid-state drive, optimizing the performance of the solid-state drive, and increasing the service life of the solid-state drive.
  • the data partition includes one or more of a first data partition, a second data partition, and a third data partition; when the data to be written is periodically updated data, the storage controller determines that the stream ID is the first ID, puts the data to be written into the first stream corresponding to the first ID, and sends the first stream to the solid-state hard disk; then the solid-state hard disk writes the data to be written in the stream into the corresponding data partition, including: the solid-state hard disk writes the data to be written in the first stream into the first data partition, the first data partition is associated with the first stream, and the garbage collection strategy corresponding to the first data partition is the first garbage collection strategy, wherein the first garbage collection strategy is not to perform garbage collection on the first data partition, and to set an exclusive reserved space; when the data to be written is data with a high update frequency, the storage controller determines that the stream ID is the second ID, puts the data to be written into the second stream corresponding to the second ID, and sends the second stream to the solid-state hard disk; then the solid
  • the first data partition is associated with the first stream, that is, the first data partition is used to store data of the same data type as that transmitted by the first stream.
  • the data type stored in the first data partition is the same as the data type transmitted by the first stream.
  • the second data partition is associated with the second stream, that is, the data type stored in the second data partition is the same as the data type transmitted by the second stream.
  • the third data partition is associated with the third stream, that is, the data type stored in the third data partition is the same as the data type transmitted by the third stream.
  • the present application provides a garbage collection method applied to a solid-state hard drive, the solid-state hard drive including a data partition, the data partition being configured with a corresponding garbage collection strategy, wherein the garbage collection strategy is configured according to the data type corresponding to the data partition, the garbage collection method comprising: performing garbage collection on the data partition according to the garbage collection strategy corresponding to the data partition.
  • data partitions are divided for storing different data types, and then each data partition is used to store The corresponding garbage collection strategy is configured for the data type stored. Then, garbage collection is performed on the data partition according to the garbage collection strategy corresponding to the data partition. This can reduce invalid movement within the SSD, thereby reducing the number of write amplifications of the SSD, reducing the long-tail latency of the SSD, optimizing the performance of the SSD, and increasing the service life of the SSD.
  • the data partition includes one or more of a first data partition, a second data partition and a third data partition; the first data partition is used to store periodically updated data, and the garbage collection strategy corresponding to the first data partition is a first garbage collection strategy, wherein the first garbage collection strategy is not to perform garbage collection on the first data partition, and to set an exclusive reserved space; the second data partition is used to store data with a high update frequency, and the garbage collection strategy corresponding to the second data partition is a second garbage collection strategy, wherein the second garbage collection strategy is to perform garbage collection on the second data partition when the amount of garbage in the second data partition reaches a preset high threshold; the third data partition is used to store data with a low update frequency, and the garbage collection strategy corresponding to the third data partition is a third garbage collection strategy, wherein the third garbage collection strategy is to perform garbage collection on the third data partition in descending order of garbage amount.
  • the method further includes: performing garbage collection on the data partitions according to priority from high to low, wherein the priority of the first data partition is higher than the priority of the second data partition, and the priority of the second data partition is higher than the priority of the third data partition.
  • the first garbage collection strategy when performing garbage collection, is first executed on the first data partition. If garbage collection still needs to be continued, the second garbage collection strategy is continued to be executed on the second data partition. Otherwise, garbage collection is terminated. If garbage collection still needs to be continued, the third garbage collection strategy is continued to be executed on the third data partition. If the first physical block on the first data partition is released and the recovered resources have reached the requirements of this garbage collection task, the garbage collection is terminated.
  • the solid-state hard disk recycles resources
  • the data on the first data partition is not moved, which reduces the number of moves, reduces the number of write amplifications of the solid-state hard disk, reduces the long-tail delay of the solid-state hard disk, optimizes the performance of the solid-state hard disk, and increases the service life of the solid-state hard disk.
  • the second physical block on the second data partition continues to be garbage collected according to the second garbage collection strategy.
  • the solid-state hard drive recycles resources, it recycles the second physical block whose garbage amount reaches a preset high threshold based on the second garbage collection strategy.
  • the present application provides a flash memory array comprising M solid-state drives and a storage controller as described above, wherein the storage controller and the M solid-state drives communicate with each other, M is an integer greater than or equal to 1, and the solid-state drive comprises a data partition.
  • the present application provides a flash memory array, including a storage controller and M solid-state hard disks as described above, the storage controller and the M solid-state hard disks communicate with each other, and M is an integer greater than or equal to 1.
  • the present application provides an electronic device, which includes a host and a flash memory storage system, the host and the flash memory storage system communicate with each other, and the flash memory storage system executes any of the data writing methods described above.
  • the present application provides a computer storage medium comprising computer instructions.
  • the computer instructions When the computer instructions are executed on an electronic device, the electronic device executes any one of the above-mentioned solid-state hard disk configuration methods, or any one of the above-mentioned solid-state hard disk configuration methods, or any one of the above-mentioned garbage collection methods.
  • the present application provides a computer program product, which, when running on a computer, enables the computer to execute any of the above-mentioned solid-state drive configuration methods, or any of the above-mentioned solid-state drive configuration methods, or any of the above-mentioned garbage collection methods.
  • the technical effect obtained by the second aspect is similar to the technical effect obtained by the corresponding technical means in the first aspect
  • the technical effect obtained by the fourth aspect is similar to the technical effect obtained by the corresponding technical means in the third aspect
  • the technical effects obtained by the fifth, sixth, seventh, eighth, ninth and tenth aspects are similar to the technical effects obtained by the corresponding technical means in the first aspect.
  • the technical effects are similar and will not be described here.
  • FIG1 is a schematic diagram of a data writing method provided by the present application.
  • FIG2 is a schematic diagram of the structure of the flash memory storage system provided in the present application.
  • FIG3 is a schematic diagram of the storage controller structure provided in the present application.
  • FIG. 4 is a schematic diagram of the structure of a solid state drive provided in this application.
  • FIG5 is a schematic diagram of a flow chart of a solid state drive configuration method provided in the present application.
  • FIG6 is a schematic diagram of the storage controller and the solid-state drive provided in the present application cooperating to set data types and corresponding garbage collection strategies.
  • FIG. 7 is a schematic flow chart of a data writing method provided in the present application.
  • the term “plurality” refers to two or more.
  • the terms “first”, “second”, etc. are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
  • FIG. 1 exemplarily introduces a method for writing data provided in an embodiment of the present application.
  • the storage system 10 includes a storage controller 20 and a solid state drive 30.
  • the solid state drive 30 includes a flash memory controller 31 and a flash memory chip 32.
  • the flash memory chip 32 includes a plurality of physical blocks (such as Block0, Block1, Block2, Block3).
  • the flash memory controller 31 includes a recycling module 33, wherein the recycling module 33 is used to perform garbage collection operations.
  • the storage controller 20 and the solid-state drive 30 transmit data via a multi-stream protocol, and the solid-state drive 30 provides a multi-stream interface (not shown) that supports multiple streams, and the data transmitted by the storage controller 20 is written into the solid-state drive 30 based on the multi-stream (MS) technology.
  • the multi-stream technology is a technology that writes different types of data to different physical blocks of the solid-state drive 30 through a multi-stream interface.
  • the storage controller 20 or the host side can write data with different update frequencies into different data streams through the multi-stream interface according to the update frequency of the data. As shown in FIG1 , data with a high update frequency is written into stream A, data with a moderate update frequency is written into stream B, and data with a low update frequency is written into stream C.
  • the data on stream A is written into Block 0 of the flash memory chip 32
  • the data on stream B is written into Block 1 of the flash memory chip 32
  • the data on stream C is written into Block 2 of the flash memory chip 32, thereby realizing the function of writing data into different physical blocks in the solid state drive 30.
  • the definition or division of data with high update frequency, data with moderate update frequency and data with low update frequency can be determined according to actual conditions, and this application does not make specific limitations on this.
  • stream can be used to indicate that different data are related to each other or have a similar lifespan. That is, a set of individual data Data written can be part of a collective stream, and each stream can be identified by a stream ID, and the stream ID is globally unique. Data with similar characteristics or attributes can be assigned the same unique stream ID, and data with different characteristics or attributes are assigned different stream IDs. Data with the same stream ID can be written to the same physical block of the solid state drive 30.
  • the multi-stream technology writes data with different update frequencies to different physical blocks of the solid-state drive 30, which can reduce the write amplification and erase times of the solid-state drive 30, and improve the service life and performance of the solid-state drive 30.
  • the recycling module 33 of the solid-state drive 30 will uniformly check the garbage amount of all physical blocks when performing garbage collection, and uniformly perform garbage collection according to the greedy algorithm, and there is a situation where the solid-state drive 30 is invalidly moved.
  • the solid-state drive 30 chooses to perform garbage collection on the physical block Block1, and moves the valid data on Block1, such as data A, to the new physical block Block2.
  • the storage controller 20 updates data A, and data A is invalid, resulting in invalid movement within the solid-state drive 30, which ultimately causes problems such as write amplification and long-tail latency of the solid-state drive 30, reduces the performance of the solid-state drive 30, and affects the service life of the solid-state drive 30.
  • the embodiments of the present application provide a solid-state hard disk configuration method, a data writing method, a garbage collection method, a flash memory storage system, a storage controller, and a solid-state hard disk.
  • the basic principle of the present application set the correspondence between the data type and the garbage collection strategy.
  • Set the corresponding garbage collection strategy for data of different data types For example, based on the purpose of reducing invalid migration (taking into full consideration the cycle and frequency of data updates, that is, considering the failure of data), set the corresponding garbage collection strategy for the data according to the data type. Different data types correspond to different garbage collection strategies.
  • the solid-state hard disk can perform garbage collection according to the garbage collection strategy corresponding to each data.
  • the flash storage system 100 (as shown in FIG. 2 ), the storage controller 200 (as shown in FIG. 3 ) or the flash controller 301 (as shown in FIG. 4 ) of the embodiment of the present application can set the correspondence between the data type and the garbage collection strategy.
  • the data type can be determined according to the update of the data for the purpose of reducing invalid migration.
  • the data type determined according to the update of the data can be, for example: divided into periodically updated data and non-periodically updated data according to the cycle of data update. Or: divided into data with high update frequency and data with low update frequency according to the frequency of data update.
  • the periodically updated data refers to the data being updated periodically, that is, the periodically updated data is updated based on its fixed update rules, and according to its update rules, it can be determined that it will be updated.
  • the periodically updated data has a stable period T, and when the period T comes, the data will be updated.
  • the periodically updated data can be, for example, log-type data.
  • the subject that triggers the update can be an electronic device storing the data or a user.
  • the user periodically updates the data (such as files created by the user) based on his or her own habits.
  • the user's historical data can be analyzed to obtain the law of data update, and it can be detected that the data update has a certain update law (such as a fixed update cycle), and then the data type of the historical data is determined to be periodically updated data.
  • the non-periodically updated data refers to data that is not updated regularly, for example, the update cycle is not fixed or stable, and it cannot be determined whether it will be updated.
  • the data that is updated non-periodically can be further divided into data with a high update frequency and data with a low update frequency according to the update frequency.
  • data with a moderate update frequency can also be divided.
  • the data with a high update frequency includes hot data
  • the data with a low update frequency includes any one or a combination of all data categories of warm data or cold data.
  • the data with a high update frequency includes any one or a combination of all data categories of hot data and warm data
  • the data with a low update frequency includes cold data.
  • the data category can be determined based on the access characteristics of the data.
  • the access characteristics can be the number of times the data is accessed, Or the reuse distance of data, or the access frequency of data, or the comprehensive feature of the number of accesses and the reuse distance of data.
  • the number of accesses is the number of times the data to be written is accessed.
  • the reuse distance is the number of data intervals between two accesses to the data, that is, if a piece of data is accessed, if the operating system accesses 7 pieces of data and then accesses the data again, the reuse distance of the data is 7.
  • the access feature can also be the number of times the data is read or written, etc., and the specific access feature can be set according to the actual situation.
  • the access feature Take the access feature as the access number to determine the data category as an example.
  • the data with an access number (N) greater than or equal to 15 times can be defined as hot data
  • the data with an access number less than 15 times and greater than or equal to 5 times can be defined as warm data
  • the data with an access number less than 5 times can be defined as cold data.
  • Table 1 Determine data categories based on the number of visits
  • data with a high update frequency may also include metadata, which may be a mapping relationship, a first-in-first-out (FIFO) bidirectional linked list corresponding to a write operation, etc.
  • metadata may be a mapping relationship, a first-in-first-out (FIFO) bidirectional linked list corresponding to a write operation, etc.
  • data can be classified according to different sources, such as different data update frequencies or update cycles of different applications, and data from different applications can be classified according to different applications.
  • the flash memory storage system 100, the storage controller 200 or the flash memory controller 301 can set corresponding garbage collection strategies for data of each data type based on the purpose of reducing invalid migration and taking into full consideration the cycle and frequency of data updates (i.e., considering the failure of data).
  • the flash memory storage system 100, the storage controller 200 or the flash memory controller 301 customizes a first garbage collection strategy for periodically updated data, wherein the first garbage collection strategy is not to perform garbage collection, and to set an exclusive reserved space for the periodically updated data.
  • No garbage collection is performed on the first physical block storing the periodically updated data, that is, when the solid state drive 300 (as shown in FIG. 2 ) performs garbage collection, the valid data on the first physical block storing the periodically updated data is not moved, but the first physical block is directly released after all the data on the first physical block are set to invalid.
  • the exclusive reserved space is used to store the updated periodically updated data.
  • the flash memory storage system 100, the storage controller 200 or the flash memory controller 301 customizes a second garbage collection strategy for data with a high update frequency, wherein the second garbage collection strategy performs garbage collection when the amount of garbage reaches a preset high threshold.
  • garbage collection strategy performs garbage collection when the amount of garbage reaches a preset high threshold.
  • garbage collection is performed on the second physical block, otherwise, garbage collection is not performed on the second physical block.
  • the preset high threshold may range from 60% to 100%, which is not specifically limited in this application.
  • the flash memory storage system 100, the storage controller 200 or the flash memory controller 301 customizes the third garbage collection strategy for the data with low update frequency, wherein the third garbage collection strategy is to perform garbage collection from high to low according to the amount of garbage.
  • garbage collection is performed from high to low according to the amount of garbage in the third physical block until the recovered storage unit meets the requirements of this garbage collection task.
  • the number of the first physical block, the second physical block and the third physical block can be one or more, and the embodiment of the present application does not specifically limit the number of the first physical block, the second physical block and the third physical block.
  • the two or more The first physical blocks of the two or more physical blocks form a first data partition, and the first data partition corresponds to a first garbage collection strategy.
  • the two or more second physical blocks form a second data partition, and the second data partition corresponds to a second garbage collection strategy.
  • the two or more third physical blocks form a third data partition, and the third data partition corresponds to a third garbage collection strategy.
  • the embodiment of the present application does not specifically limit the solid state disk 300 or the flash memory chip 302 (as shown in FIG. 4 ) to which the first physical block, the second physical block, and the third physical block belong, that is, when the flash memory storage system 100 includes multiple solid state disks 300, two or three of the first physical block, the second physical block, and the third physical block may all come from the same solid state disk 300, or may come from different solid state disks 300.
  • the solid state disk 300 includes multiple flash memory chips 302
  • two or three of the first physical block, the second physical block, and the third physical block may all come from the same flash memory chip 302, or may come from different flash memory chips 302.
  • the number of the third physical blocks is two or more.
  • Table 2 Set the corresponding garbage collection strategy according to the data type
  • the flash memory storage system 100, the storage controller 200 or the flash memory controller 301 sets corresponding garbage collection strategies for data of different data types.
  • the garbage collection strategies corresponding to data of different data types are different, and the cycle and frequency of data updates are fully considered, that is, the failure of data is considered, thereby avoiding invalid movement caused by unified garbage collection according to the greedy algorithm as shown in Figure 1.
  • garbage collection is not performed on the first physical block storing the periodically updated data, because the periodically updated data is updated fixedly, that is, the data on the first physical block will inevitably be invalidated.
  • the first physical block can be released directly without moving the periodically updated data, thereby greatly reducing the movement of data.
  • the number of write amplifications in the solid-state drive is reduced to a minimum, reducing the long-tail delay of the solid-state drive, thereby optimizing the performance of the solid-state drive and increasing the service life of the solid-state drive.
  • garbage collection is performed when the garbage volume of the second physical block storing the data with high update frequency reaches a preset high threshold. Based on the high data update frequency, the garbage volume of the second physical block is more likely to reach the high threshold. Setting a high threshold can reduce the number of times data with high update frequency is moved, reduce the number of write amplifications, reduce the long-tail delay of the SSD, optimize the performance of the SSD, and increase the service life of the SSD.
  • the third physical block storing data with low update frequency to perform garbage collection according to the garbage amount from high to low, it can be ensured that when performing garbage collection, there must be a storage unit that can perform garbage collection.
  • FIG. 2 exemplarily introduces the structure of a flash memory storage system 100 provided in an embodiment of the present application.
  • the flash memory storage system 100 includes a storage controller 200 and a solid state drive 300. Data can be transmitted between the storage controller 200 and the solid state drive 300 via a multi-stream protocol.
  • the storage controller 200 may be a computing device, such as a server, a desktop computer, etc.
  • the storage controller 200 is connected to a host (not shown) via a storage area network (SAN).
  • the storage controller 200 may receive input and output (I/O) requests from the host.
  • the solid state drive 300 is a memory using a flash memory chip 302 (as shown in FIG. 4 ) as a storage medium.
  • the number of storage controllers 200 and solid-state drives 300 in FIG. 2 is 1 for exemplary purposes only.
  • the flash memory storage system 100 may include two or more storage controllers 200 , and the physical structure and function of each storage controller 200 are similar.
  • the flash memory storage system 100 may include two or more solid state drives 300 , and each solid state drive 300 has similar physical structure and function.
  • connection relationship between the storage controller 200 and the solid-state drive 300 in FIG2 is only an exemplary description.
  • one storage controller 200 can be connected to two or more solid-state drives 300, that is, the storage controller 200 can communicate with two or more solid-state drives 300.
  • the embodiment of the present application does not limit the connection mode between the storage controllers 200, and between any storage controller 200 and the solid-state drive 300. As long as the storage controllers 200 and the storage controllers 200 and the solid-state drive 300 can communicate with each other.
  • FIG. 3 exemplarily introduces the structure of the storage controller 200 provided in an embodiment of the present application.
  • the storage controller 200 includes a first interface card 201 , a processor 202 and a second interface card 203 .
  • the processor 202 is connected to the first interface card 201 and the second interface card 203 .
  • the first interface card 201 is used to communicate with the host, and the storage controller 200 can receive the I/O request of the host through the first interface card 201.
  • the processor 202 can be a central processing unit (CPU).
  • the processor 202 can be used to receive the I/O request from the host and process the I/O request.
  • the I/O request can be a write data request or a read data request, and the processor 202 can also send the data in the write data request to the solid state drive 300.
  • the processor 202 can also output a configuration instruction, wherein the configuration instruction includes a data type and a garbage collection strategy set according to the data type.
  • the second interface card 203 is used to communicate with the solid state drive 300, and the storage controller 200 can send the write data request (including data and configuration instructions) to the solid state drive 300 through the second interface card 203, so that the solid state drive 300 stores the data, or performs corresponding configuration according to the configuration instruction, and saves the corresponding relationship between the data type and the garbage collection strategy.
  • the storage controller 200 may further include a memory 204.
  • the memory 204 is used to temporarily store data received from the host or data read from the solid-state drive 300.
  • the data in the multiple write data requests may be temporarily stored in the memory 204.
  • the capacity of the memory 204 reaches a certain threshold, the data stored in the memory 204 and the logical address assigned to the data are sent to the solid-state drive 300.
  • the solid-state drive 300 stores data.
  • the memory 204 includes a volatile memory, a flash memory chip, or a combination thereof. Volatile memory is, for example, a random-access memory (RAM). Flash memory chips are various machine-readable media that can store program codes, such as floppy disks, hard disks, solid-state drives, optical disks, etc.
  • FIG. 4 exemplarily introduces the structure of a solid state drive 300 provided in an embodiment of the present application.
  • the solid state drive 300 includes a flash memory controller 301 and a flash memory chip 302 .
  • the flash memory controller 301 is used to execute operations such as a write data request or a read data request sent by the storage controller 200 .
  • the flash controller 301 includes a flash translation layer (FTL) (not shown).
  • the flash translation layer is used to save the correspondence between the logical address (Logical Block Address, LBA) of the data and the physical address (Physical Block Address, PBA) in the solid state drive 300, and perform data read or write operations according to the correspondence between the logical address and the physical address.
  • the flash translation layer is used to convert the logical address in the write data request or read data request sent by the storage controller 200 into the physical address of the data in the solid state drive 300.
  • the logical address of the data is a subset of the logical address range of a segment assigned by the storage controller 200.
  • the logical address of the data includes a starting logical address and a length. The starting logical address indicates the position of the segment where the data is located, and the length represents the size of the data.
  • the solid state drive 300 generally includes a plurality of flash memory chips 302.
  • Each flash memory chip 302 includes a plurality of physical blocks 312, and each physical block 312 includes a plurality of pages (such as page 0-page n), wherein the plurality of pages may be one or more.
  • a page is the smallest data read and write unit in the solid state drive, and the size of a page may be 4KB, 8KB, or 16KB.
  • the pages are combined into a physical block 312, and each physical block 312 may have 32, 64, or 128 pages.
  • the flash memory chip 302 is divided into a data space and a reserved space (Over-Provisioning, OP).
  • the data space is a space where data has been written
  • the reserved space is an idle space, which is composed of idle pages and can be used to write data.
  • a redirection write mechanism will be used, that is, when the solid-state hard disk 300 writes new data to the logical block address to modify the stored data, the solid-state hard disk 300 will write the new data to the page of the reserved space, establish a mapping relationship between LBA and the page address of the reserved space, and mark the data in the page address of the data space originally mapped by LBA as garbage data.
  • the solid-state hard disk 300 When the reserved space is lower than a certain threshold, the solid-state hard disk 300 performs garbage collection on the physical block 312 of the page where the garbage data is located.
  • the recycling process is as follows: read the valid data in the physical block 312 of the page where the garbage data is located, write the read valid data to the reserved space, and erase the data in the physical block 312 of the page where the garbage data is located, and use the physical block 312 as a new reserved space.
  • the process of reading out valid data and writing the valid data to the reserved space is called valid data migration.
  • Garbage collection will cause write amplification, where the ratio of the sum of the valid data size V moved by garbage collection of the solid state drive 300 and the size of the newly written data W to the size of the newly written data W, that is, (V+W)/W is called write amplification.
  • the first physical block of the solid-state drive 300 is used to store periodically updated data
  • the second physical block is used to store data with a high update frequency
  • the third physical block is used to store data with a low update frequency.
  • the solid-state drive 300 executes a first garbage collection strategy for the first physical block, a second garbage collection strategy for the second physical block, and a third garbage collection strategy for the third physical block.
  • the number of the first physical block, the second physical block and the third physical block can be one or more, and the embodiment of the present application does not specifically limit the number of the first physical block, the second physical block and the third physical block.
  • the number of the third physical blocks is two or more.
  • the two or more first physical blocks constitute a first data partition, and the first data partition corresponds to a first garbage collection strategy.
  • the two or more second physical blocks constitute a second data partition, and the second data partition corresponds to a second garbage collection strategy.
  • the two or more third physical blocks constitute a third data partition, and the third data partition corresponds to a third garbage collection strategy.
  • the embodiment of the present application does not specifically limit the flash memory chip 301 or the solid state drive 300 to which the first physical block, the second physical block, and the third physical block belong.
  • the solid state drive 300 includes multiple flash memory chips 301
  • two or three of the first physical block, the second physical block, and the third physical block may all come from the same flash memory chip 301, or may come from different flash memory chips 301.
  • the flash memory storage system 100 includes multiple solid state drives 300
  • two or three of the first physical block, the second physical block, and the third physical block may all come from the same solid state drive 300, or may come from different solid state drives 300.
  • the storage controller 200 can send different configuration instructions to different solid-state hard disks 300, or perform different configurations on different solid-state hard disks 300 in advance, so that each solid-state hard disk 300 saves the data type and the corresponding garbage collection strategy.
  • the solid-state hard disk 300A (not shown) is set to be used only for storing periodic data
  • the storage controller 200 sends the periodic data and the first garbage collection strategy to the solid-state hard disk 300A, or the solid-state hard disk 300A saves the corresponding relationship between the periodic data and the first garbage collection strategy.
  • the storage controller 200 sends the data with a high update frequency and the second garbage collection strategy to the solid-state hard disk 300B, and the solid-state hard disk 300B saves the corresponding relationship between the data with a high update frequency and the second garbage collection strategy.
  • the solid-state hard disk 300A executes the first garbage collection strategy, that is, the physical block 312 therein is not garbage collected.
  • the solid state drive 300B performs garbage collection on the physical blocks 312 therein according to the second garbage collection strategy.
  • Configuration method and data writing method The configuration method and data writing method can be applied to the flash memory storage system 100 shown in FIG. 2 , and can be executed by the storage controller 200 shown in FIG. 3 .
  • FIG. 5 exemplarily introduces a solid state drive configuration method process provided in an embodiment of the present application.
  • the storage controller 200 includes a multi-stream management module 210.
  • the multi-stream management module 210 is used to manage multiple streams and set corresponding garbage collection strategies for each stream according to the data type transmitted by each stream.
  • the flash memory controller 301 includes a data partition management module 310.
  • the data partition management module 310 is used to allocate corresponding data partitions to each stream and save the relationship between streams, garbage collection strategies and data partitions.
  • step S51 the multi-stream management module 210 queries the data partition management module 310 for the total number of streams supported by the solid state drive 300 .
  • the multi-stream management module 210 on the storage controller 200 queries the data partition management module 310 for the total number of streams supported by the solid state drive 300 .
  • the number of streams supported by the solid state drive 300 can be one or more.
  • step S52 the data partition management module 310 returns the total number of streams supported by the solid state drive 300 to the multi-stream management module 210 .
  • the multi-stream management module 210 can be used to create a stream according to the total number of streams supported by the solid state drive 300, and assign a globally unique stream ID to the stream.
  • the globally unique stream ID can be a number or a letter, which is not limited in the present application. As long as the stream is distinguished, it can be used.
  • the total number of streams supported by the solid state drive 300 is 8, and the data partition management module 310 returns to the multi-stream management module 210 that the total number of streams supported by the solid state drive 300 is 8.
  • the storage controller 200 assigns corresponding stream IDs to the 8 streams, such as streams 1 to 8.
  • the storage controller 200 may issue corresponding configuration instructions to each solid-state drive 300.
  • a first configuration instruction is issued to the solid-state drive 300A
  • a second configuration instruction is issued to the solid-state drive 300B.
  • the first configuration instruction includes a first garbage collection strategy corresponding to periodically updated data
  • the second configuration instruction includes a second garbage collection strategy corresponding to data with a high update frequency.
  • the solid-state drive 300A saves the corresponding relationship between the periodically updated data and the first garbage collection strategy
  • the solid-state drive 300A saves the corresponding relationship between the data with a high update frequency and the second garbage collection strategy.
  • garbage collection is performed later, the solid-state drive 300A executes the first garbage collection strategy, and the solid-state drive 300B executes the second garbage collection strategy.
  • Step S53 the multi-stream management module 210 sets a garbage collection strategy corresponding to each stream.
  • the multi-stream management module 210 sets the corresponding data type and the corresponding garbage collection strategy for each stream according to the total number of supported streams.
  • the storage controller 200 can set each data type according to the actual situation, and then set the data type corresponding to each stream according to the total number of streams supported by the solid-state drive 300 and the set data type.
  • the storage controller 200 is provided with data types including periodically updated data, data with a high update frequency, data with a moderate update frequency, and data with a low update frequency.
  • the total number of streams supported by the solid-state drive 300 is 4, and the storage controller 200 assigns stream IDs to the 4 streams, namely, streams 1 to 4.
  • the multi-stream management module 210 sets stream 1 to correspond to periodically updated data and the first garbage collection strategy, sets stream 2 to correspond to data with a high update frequency and the second garbage collection strategy, sets stream 3 to correspond to data with a moderate update frequency (such as warm data) and the third garbage collection strategy, and sets stream 4 to correspond to data with a low update frequency (such as cold data) and the fourth garbage collection strategy (such as the Cost Benefit algorithm).
  • the total number of streams supported by the solid state drive 300 is 8, and the storage controller 200 allocates stream IDs to the 8 streams as stream 1 to stream 8, where streams 1 to 2 correspond to periodic update data and the first garbage collection strategy, and so on.
  • the multi-stream management module 210 can set the data type of the data used for transmission for each stream, and then set the garbage collection strategy corresponding to each stream according to the data type corresponding to each stream, and finally compare the set data type with the corresponding
  • the garbage collection strategy is transmitted to the data partition management module 310 (eg, in the form of a configuration command).
  • the multi-stream management module 210 can set a corresponding garbage collection strategy for each stream, and then set the data type used for transmission of each stream according to the data type corresponding to each garbage collection strategy, and finally transmit the set data type and the corresponding garbage collection strategy (such as in the form of a configuration command) to the data partition management module 310.
  • the corresponding garbage collection strategy can be derived according to the data type, and accordingly, the corresponding data type can be derived according to the garbage collection strategy.
  • the multi-stream management module 210 sets stream 1 for transmitting periodically updated data, and the garbage collection policy corresponding to stream 1 is the first garbage collection policy.
  • the multi-stream management module 210 sets stream 2 for transmitting more frequent data, and sets the garbage collection policy corresponding to stream 2 to the second garbage collection policy.
  • the multi-stream management module 210 sets stream 3 for transmitting less frequent data, and sets the garbage collection policy corresponding to stream 3 to the third garbage collection policy according to the data type of the less frequent data.
  • the communication interface between the solid-state drive 300 and the storage controller 200 is expanded to transmit the relationship between the data type set by the storage controller 200 and the corresponding garbage collection strategy, that is, the configuration instruction, through the newly expanded communication interface.
  • the storage controller 200 described above may be replaced by a host.
  • Step S54 the data partition management module 310 saves the corresponding relationship between the stream, the garbage collection strategy and the data partition.
  • the data partition management module 310 receives the data type and garbage collection strategy corresponding to each stream transmitted by the multi-stream management module 210, that is, the configuration command.
  • the data partition management module 310 responds to the configuration command and obtains the garbage collection strategy corresponding to each stream.
  • the data partition management module 310 is used to set the data partition corresponding to each stream, and record the correspondence between the stream, the garbage collection strategy, and the data partition. Based on the data partition corresponding to the stream and the corresponding garbage collection strategy, the garbage collection strategy corresponding to the data partition can be obtained.
  • the data types of the data stored in the same data partition are the same, that is, the data of the same stream can be written into the same data partition of the solid state drive 300. If the data types corresponding to multiple different streams are the same, the data of the multiple different streams can be written into the same data partition of the solid state drive 300.
  • the data partition management module 310 sets stream 1 to correspond to logical partition 1, sets stream 2 to correspond to logical partition 2, and sets stream 3 to correspond to logical partition 3.
  • the data partition management module 310 saves that stream 1 corresponds to logical partition 1, and the garbage collection policy corresponding to logical partition 1 is the first garbage collection policy.
  • the data partition management module 310 saves that stream 2 corresponds to logical partition 2, and the garbage collection policy corresponding to logical partition 2 is the second garbage collection policy.
  • the data partition management module 310 saves that stream 3 corresponds to logical partition 3, and the garbage collection policy corresponding to logical partition 3 is the third garbage collection policy.
  • logical partitions 1-3 are logical storage spaces, that is, partitions corresponding to logical addresses.
  • Logical partition 1 corresponds to the first data partition on the flash memory chip 302
  • logical partition 2 corresponds to the second data partition on the flash memory chip 302
  • logical partition 3 corresponds to the third data partition on the flash memory chip 302.
  • Logical addresses 0-6 on logical partitions 1-3 are logical addresses.
  • Logical addresses 0-6 correspond to physical blocks 0-6 on the flash memory chip 302, respectively. That is, the first data partition includes physical blocks 1-2, the second data partition includes physical blocks 3-4, and the third data partition includes physical blocks 5-6.
  • physical block 0 corresponding to logical address 0 is an exclusive reserved space.
  • the exclusive reserved space is the reserved space of the flash memory storage system 100 that is divided for the data partition corresponding to the first garbage collection strategy.
  • the storage controller 200 may set a corresponding fixed exclusive reserved space for the periodically updated data according to the historical information of the periodically updated data, or may set a fixed exclusive reserved space according to the specific amount of data. For example, if the storage controller 200 detects that the user updates the user data a after storing it to 5G, a fixed exclusive reserved space of 5G may be set for the periodically updated data (user data a).
  • the exclusive reserved space is part of the reserved space divided from the reserved space of the flash memory storage system 100. Exemplarily, if the reserved space of the flash memory storage system 100 is 20G, and the storage controller 200 sets the exclusive reserved space corresponding to the first garbage collection strategy to 5G, 5G is divided from the 20G as the exclusive reserved space, and the exclusive reserved space is used when the first data partition is updated, and the remaining 15G is used when the second data partition and the third data partition are updated.
  • the flash controller 301 stores the first data partition (logical partition 1) and the first garbage collection strategy corresponding to stream 1, the second data partition (logical partition 2) and the third garbage collection strategy corresponding to stream 2, and the third data partition (logical partition 3) and the third garbage collection strategy corresponding to stream 3.
  • the recycling module 311 can obtain the garbage collection strategy corresponding to each data partition from the data partition management module 310.
  • the recycling module 311 stores the garbage collection strategy customized by the storage controller 200, including the first garbage collection strategy, the second garbage collection strategy, and the third garbage collection strategy.
  • the recycling module 311 executes the first garbage collection strategy for the first data partition (physical block 1-2), that is, physical block 1-2 is not garbage collected.
  • the second garbage collection strategy is executed for the second data partition (physical block 3-4), that is, when the amount of garbage in physical block 3 or physical block 4 reaches a preset high threshold, the physical block is garbage collected. For example, if the amount of garbage in physical block 3 accounts for 80% of the entire physical block 3, then garbage collection is performed on physical block 3.
  • the third garbage collection strategy is executed for the third data partition (physical block 5-6). If the amount of garbage in physical block 5 is greater than that in physical block 6, physical block 5 is first garbage collected. If the storage space has reached the requirements of this garbage collection task after physical block 5 is recycled, physical block 6 is not garbage collected. Otherwise, physical block 6 is to be garbage collected.
  • the solid-state drive when the solid-state drive supports two or more streams, the data types corresponding to the two or more streams are different, and the garbage collection strategies corresponding to the two or more streams are different.
  • the storage capacity of the first data partition, the second data partition and the third data partition may be different.
  • the first data partition includes 10 physical blocks and the second data partition may include 5 physical blocks.
  • the storage capacity of the first data partition, the second data partition and the third data partition may be configured according to actual conditions, and this application does not make any specific limitations on this.
  • different streams of the storage controller 200 are bound to data partitions with different garbage collection strategies on the solid-state drive 300, thereby achieving the purpose of writing different data streams to different data partitions in the solid-state drive 300 and achieving the effect of using different garbage collection strategies for different data partitions.
  • Step S55 the data partition management module 310 returns a setting success to the multi-stream management module 210 .
  • the data partition management module 310 if the data partition management module 310 records the correspondence between the storage stream, the garbage collection strategy and the data partition, it returns a setting success to the multi-stream management module 210. Otherwise, if it returns a setting failure, the multi-stream management module 210 performs corresponding operations in response to the setting failure, such as reissuing the configuration command.
  • the storage controller 200 sets the data type and the corresponding garbage collection strategy, and configures the corresponding garbage collection strategy according to different data types. Or, according to different garbage collection strategies, configures the corresponding data type. So that when performing garbage collection later, the data type can be fully considered to avoid invalid migration.
  • the storage controller 200 has configured the solid state drive 300 , and the following describes how to write data to the solid state drive 300 .
  • Fig. 7 exemplarily introduces a data writing method process provided by an embodiment of the present application.
  • the data writing method can be applied to the flash memory storage system 100 shown in Fig. 1.
  • the storage controller 200 may further include a data feature management module 211, which is used to determine the data type of the data to be written.
  • the content of the multi-stream management module 210 in FIG7 can refer to the relevant content of the above-mentioned FIG5 and FIG6 , which will not be repeated here.
  • the content of the flash memory chip 302 and the multi-stream interface 303 in FIG7 can refer to the relevant content of the above-mentioned FIG1 , which will not be repeated here.
  • Step S70 the data feature management module 211 obtains the data type of the data to be written.
  • the data feature management module 211 receives the data to be written and determines the data type of the data to be written. For example, the data type of the data to be written can be determined according to the access feature of the data to be written.
  • Step S71 the data feature management module 211 applies for a stream ID from the multi-stream management module 210 according to the data type.
  • the data feature management module 211 can obtain the stream ID corresponding to each data type from the multi-stream management module 210. After the data feature management module 211 determines the data type of each data to be written, based on the stream ID corresponding to each data type, it applies to the multi-stream management module 210 for the stream ID corresponding to the data type of the data to be written.
  • the storage controller determines the stream ID to be the first ID.
  • the storage controller determines the stream ID to be the second ID.
  • the storage controller determines the stream ID to be the third ID.
  • the data to be written is log data, it is determined that the data to be written is periodically updated data, and then the stream ID corresponding to the data to be written can be determined to be stream 1 (first ID), and the data feature management module 211 applies for stream 1 to the multi-stream management module 210.
  • the data to be written is metadata, it is determined that the data to be written is data with a high update frequency, and then the stream ID corresponding to the data to be written can be determined to be stream 2 (second ID), and the data feature management module 211 applies for stream 2 to the multi-stream management module 210.
  • the stream ID corresponding to the data to be written can be determined to be stream 3 (third ID), and the data feature management module 211 applies for stream 3 to the multi-stream management module 210.
  • Step S72 the multi-stream management module 210 returns the stream ID to the data feature management module 211 .
  • the multi-stream management module 210 returns the stream ID requested by the data feature management module 211 in step S71 to the data feature management module 211. For example, if the data feature management module 211 requests stream 1 from the multi-stream management module 210, the multi-stream management module 210 returns stream 1 to the data feature management module 211.
  • step S73 the data feature management module 211 puts the data to be written into the stream corresponding to the stream ID, and sends the stream to the multi-stream interface 303 of the solid state drive 300 .
  • the data feature management module 211 puts the data to be written into the stream corresponding to the stream ID according to the stream ID returned by the feature management module 211, and sends the stream to the multi-stream interface 303 of the solid-state drive 300.
  • the data feature management module 211 puts the periodically updated data into the first stream corresponding to the first ID, and sends the first stream to the multi-stream interface 303.
  • the data feature management module 211 puts the data with high update frequency into the second stream corresponding to the second ID, and sends the second stream to the multi-stream interface 303.
  • the data feature management module 211 puts the data with low update frequency into the third stream corresponding to the third ID, and sends the third stream to the multi-stream interface 303.
  • Step S74 the multi-stream interface 303 writes the data to be written in the stream into the corresponding data partition in the flash memory chip 302 .
  • the multi-stream interface 303 can obtain the data partition corresponding to each stream from the flash memory controller 301, and record the corresponding relationship between each stream and the data partition.
  • the multi-stream interface 303 writes the data to be written in the first stream into the first data partition in the flash memory chip 302, writes the data to be written in the second stream into the second data partition in the flash memory chip 302, and writes the data to be written in the third stream into the third data partition in the flash memory chip 302.
  • the flash memory controller 301 of the solid state drive 300 has saved the data partitions corresponding to each stream and the garbage collection strategy corresponding to each data partition.
  • the data feature management module 211 writes data to the corresponding data partitions in the solid state drive 300 through the multi-stream interface 303 based on the multi-stream technology, wherein each data partition is configured with the corresponding garbage collection strategy of the data partition according to the data type of the data stored therein.
  • the data in the flash storage system 100 is written into the corresponding data partition in the solid state drive 300.
  • data can be roughly divided into periodic update data, data with high update frequency, and data with low update frequency according to the characteristics of data access to the disk.
  • the periodic update data is written to the first data partition of the first garbage collection strategy in the solid state drive 300 through multi-stream technology, and the data with high update frequency is written to the second data partition of the second garbage collection strategy in the solid state drive 300.
  • the data with low update frequency is written to the third data partition of the third garbage collection strategy in the solid state drive 300.
  • the erase operation is directly performed without generating any additional write amplification.
  • the write amplification of the data in this first data partition is optimal.
  • garbage collection is performed only for the physical block 312 that reaches the preset high garbage amount, which greatly reduces the write amplification of the second data partition.
  • setting the third data partition can ensure that there must be a physical block 312 that can be recycled when garbage collection is performed.
  • the storage controller 200 configures the solid state drive 300 .
  • the solid-state drive 300 may be pre-configured. Before the solid-state drive 300 leaves the factory, the solid-state drive 300 may be pre-configured based on the correspondence between the data type and the garbage collection strategy.
  • the flash memory controller 301 determines N data partitions from the flash memory chip 302, where the data partitions are used to store data of the corresponding data type, N is an integer greater than or equal to 1, and then records the garbage collection strategy and data type corresponding to the data partition.
  • the flash memory controller 301 can refer to the above-mentioned multi-stream management module 210 to set a corresponding garbage collection strategy for each stream.
  • the flash memory controller 301 sets N data partitions according to the total number of streams supported by the solid-state drive 300, and sets the data type and garbage collection strategy corresponding to the N data partitions.
  • the total number of streams supported by the solid-state drive 300 is 4, and the flash memory controller 301 sets N data partitions, N is less than or equal to 4, and greater than or equal to 1.
  • the flash memory controller 301 sets the data type for each data partition to store and the garbage collection strategy corresponding to each data partition.
  • the flash memory controller 301 sets the first data partition to store periodically updated data, and the first data partition corresponds to the first garbage collection strategy.
  • the second data partition is set to store data with a high update frequency, and the second data partition corresponds to the second garbage collection strategy.
  • the third data partition is set to store data with a low update frequency, and the third data partition corresponds to the third garbage collection strategy.
  • the data partition management module 310 of the solid-state drive 300 has divided the flash memory chip 302 into data partitions, and recorded the stream ID corresponding to each data partition, as well as the data type corresponding to each stream ID.
  • the manufacturer of the solid-state drive 300 can inform the user of the data type corresponding to each stream ID of the solid-state drive 300.
  • the user informs the storage controller 200 of the data type corresponding to each stream ID.
  • the stream ID is determined according to the data type of the data, and the data is written to the corresponding stream according to the stream ID, so that the data is written to the corresponding data partition of the solid-state drive 300 through the corresponding stream.
  • the following describes how to perform garbage collection on the configured solid state drive 300.
  • the garbage collection method provided in the embodiment of the present application is exemplarily introduced.
  • the garbage collection method is applied to the solid state drive 300.
  • the flash memory controller 301 performs garbage collection according to the garbage collection strategy corresponding to each data partition.
  • the condition for triggering the flash memory controller 301 to perform garbage collection may be receiving a garbage collection processing instruction sent by a host connected to the solid state drive 300.
  • the flash memory controller 301 detects that the flash memory chip 302 stores a lot of invalid data or the flash memory chip 302 has less storage space, and it is necessary to use the garbage collection mechanism to release resources.
  • the present application does not specifically limit the timing of performing garbage collection.
  • the flash memory chip 302 in the solid-state drive 300 includes a first data partition for storing periodically updated data (corresponding to the first data partition of the first garbage collection strategy), a second data partition for storing data with a high update frequency (corresponding to the second data partition of the second garbage collection strategy), and a third data partition for storing data with a low update frequency (corresponding to the third data partition of the third garbage collection strategy).
  • priorities can be assigned to the N data partitions, and the priority of the first data partition is higher than the priority of the second data partition, and the priority of the second data partition is higher than the priority of the third data partition. Then, when performing garbage collection, garbage collection is performed on the N data partitions according to the priority from high to low. That is, the first garbage collection strategy is first executed on the first data partition. If garbage collection still needs to be continued, the second garbage collection strategy is continued to be executed on the second data partition. Otherwise, garbage collection is terminated. If garbage collection still needs to be continued, the third garbage collection strategy is continued to be executed on the third data partition.
  • the solid state drive 300 (recycling module 311) first determines whether the data on the first physical block in the first data partition are all invalid data. If so, the first physical block is directly released. If not, and garbage collection needs to be continued, the solid state drive 300 determines whether garbage collection can be performed on the second data partition. If so, the solid state drive 300 performs garbage collection on the second physical block on the second data partition according to the second garbage collection strategy. If not, the solid state drive 300 performs garbage collection on the third physical block on the third data partition according to the third garbage collection strategy.
  • the solid state drive 300 performs garbage collection on the second physical block on the second data partition according to the second garbage collection strategy, including the solid state drive 300 determining the second physical block on the second data partition whose garbage amount reaches a preset high threshold, and performing garbage collection on the second physical block whose garbage amount reaches the preset high threshold.
  • the solid state drive 300 performs garbage collection on the third physical block on the third data partition according to the third garbage collection strategy, including that the solid state drive 300 sorts the garbage amount of the third physical block on the third data partition from high to low, and performs garbage collection on the third physical block on the third data partition according to the garbage amount from high to low, until the recovered resources meet the requirements of this garbage collection task.
  • the garbage collection is terminated.
  • the solid-state drive 300 recycles resources, the data on the first data partition is not moved, which reduces the number of moves, reduces the number of write amplifications of the solid-state drive 300, reduces the long-tail delay of the solid-state drive 300, optimizes the performance of the solid-state drive 300, and increases the service life of the solid-state drive 300.
  • the second physical block on the second data partition continues to be garbage collected according to the second garbage collection strategy.
  • the solid-state drive 300 recycles resources, the second physical block whose garbage volume reaches a preset high threshold is recycled based on the second garbage collection strategy, which can reduce the number of data moves, reduce the number of write amplifications of the solid-state drive 300, reduce the long-tail delay of the solid-state drive 300, optimize the performance of the solid-state drive 300, and increase the service life of the solid-state drive 300.
  • garbage collection is terminated. If after garbage collection is performed on the second physical block on the second data partition according to the second garbage collection strategy, the recovered resources do not reach the requirements of this garbage collection task, then garbage collection is continued on the third physical block on the third data partition according to the third garbage collection strategy.
  • the present application also provides a flash memory array, including M solid state hard disks and storage devices as shown in FIGS.
  • the controller, the storage controller and the M solid state drives communicate with each other, M is an integer greater than or equal to 1, the solid state drive includes N data partitions, and N is an integer greater than or equal to 1.
  • An embodiment of the present application also provides a flash memory array, including a storage controller and M solid-state hard disks as shown in Figures 2, 3, 5, 6, and 7.
  • the storage controller and the M solid-state hard disks communicate with each other, M is an integer greater than or equal to 1, and the solid-state hard disk includes N data partitions, N is an integer greater than or equal to 1.
  • An embodiment of the present application also provides an electronic device, which includes a host and a flash memory storage system, and the host and the flash memory storage system communicate with each other, wherein the flash memory storage system has a data writing method as shown in FIG. 7 .
  • An embodiment of the present application also provides a computer storage medium, including computer instructions.
  • the computer instructions When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned solid-state hard disk configuration method or the above-mentioned garbage collection method.
  • the embodiment of the present application also provides a computer program product.
  • the computer program product When the computer program product is run on a computer, the computer executes the above-mentioned solid-state hard disk configuration method or the above-mentioned garbage collection method.
  • the electronic device, computer storage medium, computer program product or chip system provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
  • the disclosed devices and methods can be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.
  • Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
  • the unit described as a separate component may or may not be physically separated, and the component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or processor 202 (processor) to perform all or part of the steps of the methods of each embodiment of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Refuse Collection And Transfer (AREA)
  • Memory System (AREA)

Abstract

本申请公开一种固态硬盘配置方法、垃圾回收方法以及相关设备,涉及存储技术领域,固态硬盘配置方法包括:获取固态硬盘支持的流对应的数据类型,流对应固态硬盘的分区,然后根据流对应的数据类型,确定流对应的垃圾回收策略,最后将流对应的垃圾回收策略发送给固态硬盘。以在后进行垃圾回收时,可以根据分区对应的垃圾回收策略对分区进行垃圾回收,充分考虑数据会更新会失效,由此解决统一根据贪婪算法进行回收造成无效搬移,进而引起写放大等问题。

Description

固态硬盘配置方法、垃圾回收方法以及相关设备
本申请要求于2022年10月11日提交中国专利局、申请号为202211243242.4,发明名称为“固态硬盘配置方法、垃圾回收方法以及相关设备”的中国专利的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及存储技术领域,尤其涉及一种固态硬盘配置方法、垃圾回收方法以及相关设备。
背景技术
由于固态硬盘(solid-state drives,SSD)的存储介质(如闪存(Flash memory))不支持覆盖写,通常采用写时重定向(redirect-on-write,ROW)机制对固态硬盘中已经存储的数据进行更新。例如,将数据a更新为数据b,数据a存储在存储介质的位置A,将更新后的数据b写入存储介质上另外一个空闲的位置B,而把更新前的数据a设置为无效数据(垃圾)。
为了将垃圾占用的空间释放出来,需要对有一定垃圾量的物理块(Block)进行垃圾回收。在对物理块上的数据进行擦除之前,需要将该物理块中的有效数据搬移到另外空闲的物理块。然,将有效数据重新拷贝到另外空闲的物理块,额外增加了数据的写入,即引起了固态硬盘的写放大(Write amplification,WA)。固态硬盘的写放大会降低固态硬盘的性能,缩短固态硬盘的寿命。
发明内容
本申请提供一种固态硬盘配置方法、垃圾回收方法以及相关设备,根据数据类型定制对应的垃圾回收测策略,以使得可以对不同类型的数据使用对应不同的垃圾回收策略进行回收,充分考虑数据会更新会失效,由此解决统一根据贪婪算法进行回收造成无效搬移,进而引起写放大等问题。
本申请提供一种固态硬盘配置方法,应用于存储控制器,该方法包括:获取固态硬盘支持的流对应的数据类型;流对应固态硬盘的分区;根据流对应的数据类型,确定流对应的垃圾回收策略,将流对应的垃圾回收策略发送给固态硬盘。
其中,流对应固态硬盘的分区也即固态硬盘的同一数据分区内存储的是同一流的数据,换句话说,同一数据分区内存储的数据的数据类型相同。固态硬盘可以支持一个以上的流,固态硬盘可以包括一个以上的数据分区。不同的流分别用于传输不同数据类型的数据,则传输不同数据类型的流对应的数据分区不同,也即不同数据类型的数据分别存储于不同的数据分区,相应地,不同的数据分区存储的数据类型不同,则配置的垃圾回收策略不同。
如上述进行垃圾回收时是统一根据贪婪算法进行回收,未考虑数据会更新会失效,由此造成无效搬移,进而引起写放大等问题。为此,本申请的思想是根据数据类型定制对应的垃圾回收测策略,以使得可以对不同类型的数据使用对应不同的垃圾回收策略进行回收,充分考虑数据会更新会失效,由此解决统一根据贪婪算法进行回收造成无效搬移,进而引起写放大等问题。
在本申请实施例中,存储控制器获取固态硬盘支持的流所对应的数据类型,存储控制器可以根据不同数据类型的流对应不同的数据分区,以在后续根据流对应的数据类型将流内的数据写入至对应的数据分区。存储控制器根据流对应的数据类型,确定流对应的垃圾回收策略,并将流对应的垃圾回收策略发送给固态硬盘。则实现根据流确定其对应的数据分区,且根据流对应的数据类型,为该流对应的数据分区配置对应的垃圾回收策略。在进行垃圾回收时,固态硬盘可以根据各个流的数据(也即各个流对应的数据分区)所对应的垃圾回收策略进行垃圾回收。由此可以减少固态硬盘内无效搬移,进而减少固态硬盘的写放大的次数,减少固态硬盘的长尾延时,优化固态硬盘的性能,增加固态硬盘的使用寿命。
在一种可能的实现方式中,当固态硬盘支持两个或两个以上的流时,该两个或两个以上的流对应的数据类型不同,且该两个或两个以上的流对应的垃圾回收策略不同。
为传输不同数据类型的流配置不同的垃圾回收策略,也即对不同数据类型的数据配置不同的垃圾回收策略,避免了上述进行垃圾回收时是统一根据贪婪算法进行回收,未考虑数据会更新会失效,由此造成无效搬移,进而引起写放大等问题。
在一种可能的实现方式中,根据流对应的数据类型,确定流对应的垃圾回收策略包括:当流对应的数据类型为周期性更新数据时,确定流对应的垃圾回收策略为第一垃圾回收策略,其中第一垃圾回收策略为对第一物理块不进行垃圾回收,并设置专属预留空间,其中第一物理块用于存储周期性更新数据;当流对应的数据类型为更新频率高的数据时,确定流对应的垃圾回收策略为第二垃圾回收策略,其中第二垃圾回收策略为当第二物理块的垃圾量达到预设高阈值时,对第二物理块进行垃圾回收,其中第二物理块用于存储更新频率高的数据;当流对应的数据类型为更新频率低的数据时,确定流对应的垃圾回收策略为第三垃圾回收策略,其中第三垃圾回收策略为按垃圾量由高至低对第三物理块进行垃圾回收,其中第三物理块用于存储更新频率低的数据。
其中,第一物理块、第二物理块以及第三物理块的数量可以为多个,多个即两个或两个以上。当存储周期性更新数据的第一物理块包括多个时,该多个第一物理块组成第一数据分区,第一数据分区对应的垃圾回收策略为第一垃圾回收策略。当存储更新频率高的第二物理块包括多个时,该多个的二物理块组成第二数据分区,第二数据分区对应的垃圾回收策略为第二垃圾回收策略。当存储更新频率低的数据的第三物理块包括多个时,该多个第三物理块组成第三数据分区,第三数据分区对应的垃圾回收策略为第三垃圾回收策略。
以固态硬盘所包括的所有的第一物理块或所有的第二物理块或所有的第三物理块作为一个整体,垃圾回收策略是对应该整体的。例如,固态硬盘包括K个第二物理块,则该K个第二物理块作为一个整体,该整体对应第二垃圾回收策略。该K个第二物理块的总共垃圾量达到预设高阈值时,对该K个第二物理执行垃圾回收。又例如,固态硬盘包括K个第三物理块,则该K个第三物理块作为一个整体,该整体对应的垃圾回收策略第三垃圾回收策略,则对该K个第三物理块执行第三垃圾回收策略,分别获取该K个第三物理块的垃圾量,对按垃圾量由高至低对该K个第三物理块进行垃圾回收。
在另一些实施例中,垃圾回收策略可以针对个体。例如固态硬盘包括K个第二物理块,当该K个第二物理块中的某一第二物理块的垃圾量达到预设高阈值时,对该第二物理执行垃圾回收。
在本申请实施例中,对存储周期性更新数据的第一物理块不进行垃圾回收,基于周期性更新数据是固定更新的,也即第一物理块上的数据必然会被全部无效,等到第一物理块上的数据都更新, 第一物理块上的所有数据均变为无效数据后,则可以直接释放第一物理块,而无需搬移周期性更新数据,极大地减少了数据的搬移,针对该周期性更新数据,将固态硬盘内的写放大的次数降低至最低,减少固态硬盘的长尾延时,进而优化固态硬盘的性能,增加固态硬盘的使用寿命。
进一步地,对存储该更新频率高的数据的第二物理块设置其垃圾量达到预设高阈值时进行垃圾回收,基于数据更新频率高,第二物理块的垃圾量比较容易达到高阈值。而设置高阈值则可以减少更新频率高的数据的搬移次数,降低写放大次数,减少固态硬盘的长尾延时,优化固态硬盘的性能,增加固态硬盘的使用寿命。
进一步地,对存储更新频率低的数据的第三物理块设置根据垃圾量由高至低进行垃圾回收,则可以保证在进行垃圾回收时,必然存在可以进行垃圾回收的存储单元。
在一种可能的实现方式中,获取固态硬盘支持的流对应的数据类型包括:获取固态硬盘所支持的流的总数;根据总数创建流,并为流设置对应的数据类型。为流设置对应的数据类型,以在后续可以为不同流的数据配置对应的垃圾回收策略。
第二方面,本申请提供一种存储控制器,存储控制器包括处理器和存储器,处理器执行存储器中的计算机指令,用于获取固态硬盘支持的流对应的数据类型;流对应固态硬盘的分区;根据流对应的数据类型,确定流对应的垃圾回收策略;将流对应的垃圾回收策略发送给固态硬盘。
在一种可能的实现方式中,当固态硬盘支持两个或两个以上的流时,该两个或两个以上的流对应的数据类型不同,且该两个或两个以上的流对应的垃圾回收策略不同。
在一种可能的实现方式中,根据流对应的数据类型,确定流对应的垃圾回收策略包括:当流对应的数据类型为周期性更新数据时,确定流对应的垃圾回收策略为第一垃圾回收策略,其中第一垃圾回收策略为对第一物理块不进行垃圾回收,并设置专属预留空间,其中第一物理块用于存储周期性更新数据;当流对应的数据类型为更新频率高的数据时,确定流对应的垃圾回收策略为第二垃圾回收策略,其中第二垃圾回收策略为当第二物理块的垃圾量达到预设高阈值时,对第二物理块进行垃圾回收,其中第二物理块用于存储更新频率高的数据;当流对应的数据类型为更新频率低的数据时,确定流对应的垃圾回收策略为第三垃圾回收策略,其中第三垃圾回收策略为按垃圾量由高至低对第三物理块进行垃圾回收,其中第三物理块用于存储更新频率低的数据。
在一种可能的实现方式中,获取固态硬盘支持的流对应的数据类型包括:获取固态硬盘所支持的流的总数;根据总数创建流,并为流设置对应的数据类型。
第三方面,本申请提供一种固态硬盘配置方法,应用于固态硬盘,该方法包括:确定数据分区,其中数据分区用于存储对应数据类型的数据;根据数据分区对应的数据类型,配置数据分区对应的垃圾回收策略。
在本申请实施例中,为固态硬盘确定用于存储不同数据类型的数据分区,进而根据各个数据分区对应的数据类型,配置数据分区对应的垃圾回收策略。也即根据数据类型定制对应的垃圾回收测策略,以使得可以对不同类型的数据使用对应不同的垃圾回收策略进行回收,充分考虑数据会更新会失效,由此解决统一根据贪婪算法进行回收造成无效搬移,进而引起写放大等问题。
在一种可能的实现方式中,当数据分区的总数为两个或两个以上时,该两个或两个以上的数据分区对应的数据类型不同,且该两个或两个以上的数据分区对应的垃圾回收策略不同。
为存储不同数据类型的数据分区配置不同的垃圾回收策略,也即对不同数据类型的数据配置不同的垃圾回收策略,避免了上述进行垃圾回收时是统一根据贪婪算法进行回收,未考虑数据会更 新会失效,由此造成无效搬移,进而引起写放大等问题。
在一种可能的实现方式中,数据分区包括第一数据分区、第二数据分区和第三数据分区中的一个或多个;其中,第一数据分区用于存储周期性更新数据,第二数据分区用于存储更新频率高的数据,第三数据分区用于存储更新频率低的数据。
在一种可能的实现方式中,配置数据分区对应的垃圾回收策略包括:配置第一数据分区对应的垃圾回收策略为第一垃圾回收策略,其中第一垃圾回收策略为对第一数据分区不进行垃圾回收,并设置专属预留空间;配置第二数据分区对应的垃圾回收策略为第二垃圾回收策略,其中第二垃圾回收策略为当第二数据分区的垃圾量达到预设高阈值时,对第二数据分区进行垃圾回收;配置第三数据分区对应的垃圾回收策略为第三垃圾回收策略,其中第三垃圾回收策略为按垃圾量由高至低对第三数据分区进行垃圾回收。
在本申请实施例中,对存储周期性更新数据的第一物理块不进行垃圾回收,基于周期性更新数据是固定更新的,也即第一物理块上的数据必然会被全部无效,等到第一物理块上的数据都更新,第一物理块上的所有数据均变为无效数据后,则可以直接释放第一物理块,而无需搬移周期性更新数据,极大地减少了数据的搬移,针对该周期性更新数据,将固态硬盘内的写放大的次数降低至最低,减少固态硬盘的长尾延时,进而优化固态硬盘的性能,增加固态硬盘的使用寿命。
进一步地,对存储该更新频率高的数据的第二物理块设置其垃圾量达到预设高阈值时进行垃圾回收,基于数据更新频率高,第二物理块的垃圾量比较容易达到高阈值。而设置高阈值则可以减少更新频率高的数据的搬移次数,降低写放大次数,减少固态硬盘的长尾延时,优化固态硬盘的性能,增加固态硬盘的使用寿命。
进一步地,对存储更新频率低的数据的第三物理块设置根据垃圾量由高至低进行垃圾回收,则可以保证在进行垃圾回收时,必然存在可以进行垃圾回收的存储单元。
在一种可能的实现方式中,确定数据分区包括:获取固态硬盘所支持的流的总数;根据总数确定N个数据分区,其中N小于或等于总数。
在一种可能的实现方式中,数据分区包括一个或一个以上的物理块。
第四方面,本申请提供一种固态硬盘,固态硬盘包括闪存控制器和闪存芯片;闪存控制器用于从闪存芯片中确定出数据分区,其中数据分区用于存储对应数据类型的数据;闪存控制器还用于根据数据分区对应的数据类型,配置数据分区对应的垃圾回收策略。
在一种可能的实现方式中,当数据分区的总数为两个或两个以上时,该两个或两个以上的数据分区对应的数据类型不同,且该两个或两个以上的数据分区对应的垃圾回收策略不同。
在一种可能的实现方式中,数据分区包括第一数据分区、第二数据分区和第三数据分区中的一个或多个;其中,第一数据分区用于存储周期性更新数据,第二数据分区用于存储更新频率高的数据,第三数据分区用于存储更新频率低的数据。
在一种可能的实现方式中,配置数据分区对应的垃圾回收策略包括:闪存控制器配置第一数据分区对应的垃圾回收策略为第一垃圾回收策略,其中第一垃圾回收策略为对第一数据分区不进行垃圾回收,并设置专属预留空间;闪存控制器配置第二数据分区对应的垃圾回收策略为第二垃圾回收策略,其中第二垃圾回收策略为当第二数据分区的垃圾量达到预设高阈值时,对第二数据分区进行垃圾回收;闪存控制器配置第三数据分区对应的垃圾回收策略为第三垃圾回收策略,其中第三垃圾回收策略为按垃圾量由高至低对第三数据分区进行垃圾回收。
在一种可能的实现方式中,闪存控制器用于从闪存芯片中确定出数据分区包括:闪存控制器用于获取固态硬盘所支持的流的总数,并根据总数确定N个数据分区,N为小于或等于总数。
在一种可能的实现方式中,数据分区包括一个或一个以上的物理块。
第五方面,本申请提供一种数据写入方法,应用于闪存存储系统,闪存存储系统包括存储控制器与固态硬盘,固态硬盘包括数据分区,数据分区配置有对应的垃圾回收策略,其中垃圾回收策略根据数据分区对应的数据类型配置;存储控制器获取待写入数据;存储控制器根据待写入数据的数据类型确定流ID;存储控制器将待写入数据放入流ID对应的流,并将流发送给固态硬盘;固态硬盘将流中的待写入数据写入对应的数据分区,其中数据分区对应的数据类型与待写入数据的数据类型相同。
在本申请实施例中,固态硬盘已划分出数据分区,存储不同数据类型的数据分区所配置的垃圾回收策略不同。存储控制将不同流的数据写入对应的数据分区,具体是根据该流传输的数据类型,将流内的数据写入与该流传输的数据类型相同的数据分区中。在进行垃圾回收时,固态硬盘可以根据各个数据分区所对应的垃圾回收策略进行垃圾回收。由此可以减少固态硬盘内无效搬移,进而减少固态硬盘的写放大的次数,减少固态硬盘的长尾延时,优化固态硬盘的性能,增加固态硬盘的使用寿命。
在一种可能的实现方式中,数据分区包括第一数据分区、第二数据分区和第三数据分区中的一个或多个;当待写入数据为周期性更新数据时,存储控制器确定流ID为第一ID,将待写入数据放入第一ID对应的第一流,并将第一流发送给固态硬盘;则固态硬盘将流中的待写入数据写入对应的数据分区包括:固态硬盘将第一流中的待写入数据写入第一数据分区,第一数据分区关联第一流,第一数据分区对应的垃圾回收策略为第一垃圾回收策略,其中第一垃圾回收策略为对第一数据分区不进行垃圾回收,并设置专属预留空间;当待写入数据为更新频率高的数据时,存储控制器确定流ID为第二ID,将待写入数据放入第二ID对应的第二流,并将第二流发送给固态硬盘;则固态硬盘将流中的待写入数据写入对应的数据分区包括:固态硬盘将第二流中的待写入数据写入第二数据分区,第二数据分区关联第二流,第二数据分区对应的垃圾回收策略为第二垃圾回收策略,其中第二垃圾回收策略为当第二数据分区的垃圾量达到预设高阈值时,对第二数据分区进行垃圾回收;当待写入数据为更新频率低的数据时,存储控制器确定流ID为第三ID,将待写入数据放入第三ID对应的第三流,并将第三流发送给固态硬盘;则固态硬盘将流中的待写入数据写入对应的数据分区包括:固态硬盘将第三流中的待写入数据写入第三数据分区,第三数据分区关联第三流,第三数据分区对应的垃圾回收策略为第三垃圾回收策略,其中第三垃圾回收策略为按垃圾量由高至低对第三数据分区进行垃圾回收。
其中,第一数据分区关联第一流,即该第一数据分区用于存储与第一流所传输的数据类型相同的数据,换句话说,第一数据分区所存储的数据类型与第一流所传输的数据类型相同。相应,第二数据分区关联第二流,即该第二数据分区所存储的数据类型与第二流所传输的数据类型相同。第三数据分区关联第三流,即该第三数据分区所存储的数据类型与第三流所传输的数据类型相同。
第六方面,本申请提供一种垃圾回收方法,应用于固态硬盘,固态硬盘包括数据分区,数据分区配置有对应的垃圾回收策略,其中垃圾回收策略根据数据分区对应的数据类型配置,垃圾回收方法包括:根据数据分区对应的垃圾回收策略对数据分区进行垃圾回收。
在本申请实施例中,划分出用于存储不同数据类型的数据分区,然后根据各个数据分区用于存 储的数据类型配置对应的垃圾回收策略。则后续根据数据分区对应的垃圾回收策略对数据分区进行垃圾回收。由此可以减少固态硬盘内无效搬移,进而减少固态硬盘的写放大的次数,减少固态硬盘的长尾延时,优化固态硬盘的性能,增加固态硬盘的使用寿命。
在一种可能的实现方式中,数据分区包括第一数据分区、第二数据分区和第三数据分区中的一个或多个;第一数据分区用于存储周期性更新数据,第一数据分区对应的垃圾回收策略为第一垃圾回收策略,其中第一垃圾回收策略为对第一数据分区不进行垃圾回收,并设置专属预留空间;第二数据分区用于存储更新频率高的数据,第二数据分区对应的垃圾回收策略为第二垃圾回收策略,其中第二垃圾回收策略为当第二数据分区的垃圾量达到预设高阈值时,对第二数据分区进行垃圾回收;第三数据分区用于存储更新频率低的数据,第三数据分区对应的垃圾回收策略为第三垃圾回收策略,其中第三垃圾回收策略为按垃圾量由高至低对第三数据分区进行垃圾回收。
在一种可能的实现方式中,当固态硬盘包括第一数据分区、第二数据分区和第三数据分区中的两个或三个时,方法还包括:根据优先级由高至低对数据分区进行垃圾回收,其中,第一数据分区的优先级高于第二数据分区的优先级,第二数据分区的优先级高于第三数据分区的优先级。
在本申请实施例中,在进行垃圾回收时,即先对第一数据分区执行第一垃圾回收策略,若还需要继续进行垃圾回收,则继续对第二数据分区执行第二垃圾回收策略。反之,结束垃圾回收。若还需要继续进行垃圾回收,则继续对第三数据分区执行第三垃圾回收策略。若对第一数据分区上的第一物理块进行释放后,回收资源已达到此次垃圾回收任务要求则结束垃圾回收。固态硬盘回收资源时,对第一数据分区上的数据不进行搬移,减少了搬移次数,减少固态硬盘的写放大的次数,减少固态硬盘的长尾延时,优化固态硬盘的性能,增加固态硬盘的使用寿命。若对第一数据分区上的第一物理块进行释放后,回收资源未达到此次垃圾回收任务要求,则继续根据第二垃圾回收策略对第二数据分区上的第二物理块进行垃圾回收。固态硬盘回收资源时,基于第二垃圾回收策略中对垃圾量达到预设高阈值的第二物理块进行回收,则可以减少数据搬移次数,减少固态硬盘的写放大的次数,减少固态硬盘的长尾延时,优化固态硬盘的性能,增加固态硬盘的使用寿命。
第七方面,本申请提供一种闪存阵列,包括M个固态硬盘以及如上述任一项的存储控制器,存储控制器与M个固态硬盘之间相互通信,M为大于或等于1的整数,固态硬盘包括数据分区。
第八方面,本申请提供一种闪存阵列,包括存储控制器以及M个如上述任一项的固态硬盘,存储控制器与M个固态硬盘之间相互通信,M为大于或等于1的整数。
第九方面,本申请提供一种电子设备,其中,包括主机以及闪存存储系统,主机与闪存存储系统之间相互通信,其中闪存存储系统执行如上述任一项的数据写入方法。
第十方面,本申请提供一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如上述任一项固态硬盘配置方法,或上述任一项固态硬盘配置方法,或上述任一项的垃圾回收方法。
第十一方面,本申请提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如上述任一项固态硬盘配置方法,或上述任一项固态硬盘配置方法,或如上述任一项的垃圾回收方法。
上述第二方面所获得的技术效果与第一方面中对应的技术手段获得的技术效果近似,第四方面所获得的技术效果与第三方面中对应的技术手段获得的技术效果近似,第五方面、第六方面、第七方面、第八方面、第九方面以及第十方面所获得的技术效果与第一方面中对应的技术手段获得的 技术效果近似,在这里不再赘述。
本申请提供的技术方案带来的有益效果至少包括:
根据数据类型定制对应的垃圾回收测策略,以使得可以对不同类型的数据使用对应不同的垃圾回收策略进行回收,充分考虑数据会更新会失效,由此解决统一根据贪婪算法进行回收造成无效搬移,进而引起写放大等问题。
附图说明
图1为本申请提供的一种数据写入方法示意图。
图2为本申请提供的闪存存储系统结构示意图。
图3为本申请提供的存储控制器结构示意图。
图4为本申请提供的固态硬盘结构示意图。
图5为本申请提供的一种固态硬盘配置方法流程示意图。
图6为本申请提供的存储控制器与固态硬盘配合设置数据类型与对应垃圾回收策略的示意图。
图7为本申请提供的一种数据写入方法流程示意图。
具体实施方式
本申请中所涉及的多个,是指两个或两个以上。另外,需要理解的是,在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。
本申请中所涉及的多个,是指两个或两个以上。在本申请实施例中,“示例性”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性”或者“例如”等词旨在以具体方式呈现相关概念。
请参阅图1,示例性介绍本申请实施例提供的一种数据写入的方法。
如图1所示,存储系统10包括存储控制器20和固态硬盘30。固态硬盘30包括闪存控制器31和闪存芯片32。闪存芯片32包括多个物理块(如Block0、Block1、Block2、Block3)。闪存控制器31包括回收模块33,其中回收模块33用于执行垃圾回收操作。
存储控制器20和固态硬盘30之间通过多流协议传输数据,由固态硬盘30提供支持多流的多流接口(图未示),基于多流(Multi Stream,MS)技术将存储控制器20所传输的数据写入固态硬盘30。其中,多流技术是将不同类型数据通过多流接口分流写入到固态硬盘30的不同物理块的技术。
存储控制器20或者主机侧可以根据数据的更新频率把不同更新频率的数据通过多流接口写入不同的数据流。如图1所示,将更新频率高的数据写入流A,将更新频率适中的数据写入流B,将更新频率低的数据写入流C。流A上的数据写入闪存芯片32的Block 0,流B上的数据写入闪存芯片32的Block 1,流C上的数据写入闪存芯片32的Block 2,从而实现将数据写入到固态硬盘30内的不同物理块上的功能。
其中,更新频率高的数据、更新频率适中的数据和更新频率低的数据的定义或以及划分可以根据实际情况确定,本申请对此不作具体限定。
其中,“流”可用于指示不同的数据彼此相关联或具有相似的寿命。也就是说,一组单独的数 据写入可以是集体流的一部分,并且每个流可以由流ID来标识,且该流ID全局唯一。具有类似特性或属性的数据可被分配相同的唯一的流ID,不同特性或属性的数据所分配的流ID不同。同一流ID的数据可被写入固态硬盘30的相同物理块。
虽然多流技术将不同更新频率的数据写入到固态硬盘30不同物理块上,这样能降低固态硬盘30的写放大和擦除次数,提高固态硬盘30的使用寿命和性能。但是发明人在实施本申请实施例时发现,固态硬盘30的回收模块33做垃圾回收时会统一查看所有物理块的垃圾量,根据贪婪算法来统一做垃圾回收,存在固态硬盘30无效搬移的情况。例如,固态硬盘30选择对物理块Block1做垃圾回收,将Block1上的有效数据如数据A搬移到新的物理块Block2上。在数据A搬移到新的物理块Block2上后,存储控制器20更新了数据A,则数据A无效,从而导致固态硬盘30内无效搬移,最终造成固态硬盘30写放大以及长尾时延等问题,降低固态硬盘30的性能,并影响固态硬盘30的使用寿命。
鉴于此,本申请实施例提供一种固态硬盘配置方法、数据写入方法、垃圾回收方法、闪存存储系统、存储控制器以及固态硬盘。本申请的基本原理:设置数据类型与垃圾回收策略之间的对应关系。为不同数据类型的数据,设置对应的垃圾回收策略。如,基于减少无效搬移的目的(充分考虑数据更新的周期与频率,即考虑数据的失效),根据数据的数据类型为其设置对应的垃圾回收策略。不同的数据类型所对应的垃圾回收策略不同。在进行垃圾回收时,固态硬盘可以根据各个数据对应的垃圾回收策略进行垃圾回收。由此可以减少固态硬盘内无效搬移,进而减少固态硬盘的写放大的次数,减少固态硬盘的长尾延时,优化固态硬盘的性能,增加固态硬盘的使用寿命。
本申请实施例的闪存存储系统100(如图2所示)、存储控制器200(如图3所示)或闪存控制器301(如图4所示)可以设置数据类型与垃圾回收策略之间的对应关系。其中,可以基于减少无效搬移的目的,根据数据的更新确定数据类型。根据数据的更新确定数据类型例如可以为:根据数据更新的周期划分为周期性更新的数据与非周期性更新的数据。又或者为:根据数据更新的频率划分为更新频率高的数据与更新频率低的数据。
其中,周期性更新的数据即指该数据周期性更新,即周期性更新的数据是基于其固定的更新规律进行数据更新,根据其更新的规律可以确定其必然会更新。例如周期性更新的数据有一个稳定的周期T,到了周期T,该数据必然会更新。周期性更新的数据例如可以为日志型数据。
对于周期性更新的数据,触发其进行更新的主体可以为存储该数据的电子设备,也可以为用户。例如,用户基于其自身习惯周期性去更新数据(如用户创建的文件)。在一些实施例中,可以对用户的历史数据进行分析,获取数据更新的规律,检测到数据更新具有一定的更新规律(如有固定的更新周期),进而确定该历史数据的数据类型为周期性更新的数据。
其中,非周期性更新的数据即指该数据更新不具有规律,例如其更新的周期不固定或不稳定,无法确定其必然会更新。
在本申请实施例中,对于非周期性更新的数据可以进一步根据其更新频率的高低划分出更新频率高的数据以及更新频率低的数据。在一些实施例中,还可以划分出更新频率适中的数据。其中,更新频率高的数据包括热数据,更新频率低的数据包括温数据或冷数据中的任意一种或全部数据类别的组合。在另一些实施例中,更新频率高的数据包括热数据与温数据中的任意一种或全部数据类别的组合,更新频率低的数据包括冷数据。
在一些实施例中,可以根据数据的访问特征确定数据类别。访问特征可以为数据的访问次数、 或者数据的重用距离、或者数据的访问频率、或者数据的访问次数与重用距离的综合特征。访问次数为待写入数据被访问的次数。重用距离为数据的两次访问之间所间隔的数据的数量,即若一个数据被访问后,若操作系统访问了7个数据后,再次访问了这个数据,则这个数据的重用距离即为7。访问特征还可以是数据被读、写的次数等,具体可根据实际情况设定访问特征。
以访问特征为访问次数确定数据类别为例。如表1所示,可定义访问次数(N)大于等于15次的数据为热数据,访问次数小于15次且大于等于5次的数据为温数据,而当访问次数小于5次的数据为冷数据。
表1根据访问次数确定数据类别
在一些实施例中,更新频率高的数据还可以包括元数据,元数据可以为映射关系、写操作对应的先入先出(First Input First Output,FIFO)双向链表等。
上述对所述数据类型或数据类别的划分及定义只是举例说明,在实际应用中,并不限于此。例如,可以根据数据的来源不同进行分类,如基于不同应用其数据更新频率或更新周期不同,对来自不同应用的数据按照不同的应用进行分类。
在本申请实施例中,请一并参阅表2,闪存存储系统100、存储控制器200或闪存控制器301可以基于减少无效搬移的目的,充分考虑数据更新的周期与频率(即考虑数据的失效),为各个数据类型的数据设置对应的垃圾回收策略。
如,闪存存储系统100、存储控制器200或闪存控制器301为周期性更新数据定制第一垃圾回收策略,其中,第一垃圾回收策略为不进行垃圾回收,且为该周期性更新数据设置专属预留空间。对存储周期性更新数据的第一物理块不进行垃圾回收,也即在固态硬盘300(如图2所示)进行垃圾回收时,不搬移存储周期性更新数据的第一物理块上的有效数据,而是等该第一物理块上的数据均被设置无效后,直接释放该第一物理块。在周期性更新数据进行数据更新时,使用专属预留空间存储更新后的周期性更新数据。
闪存存储系统100、存储控制器200或闪存控制器301为更新频率高的数据定制第二垃圾回收策略,其中,第二垃圾回收策略为垃圾量达到预设高阈值时进行垃圾回收。对存储更新频率高的数据的第二物理块进行垃圾回收时,检测到该第二物理块的垃圾量达到预设高阈值时,则对该第二物理块进行垃圾回收,否则,不对该第二物理块进行垃圾回收。其中,预设高阈值的范围可以为60%-100%,本申请对此不作具体限定。
闪存存储系统100、存储控制器200或闪存控制器301为更新频率低的数据定制第三垃圾回收策略,其中,第三垃圾回收策略为根据垃圾量由高至低进行垃圾回收。对存储更新频率低的数据的第三物理块进行垃圾回收时,依据第三物理块垃圾量由高至低进行垃圾回收,直至回收的存储单元达到此次垃圾回收任务的要求。
其中,第一物理块、第二物理块以及第三物理块的数量均可以为一个或一个以上,本申请实施例对第一物理块、第二物理块以及第三物理块的数量不作具体限定。
在第一物理块、第二物理块以及第三物理块的数量均为两个或两个以上时,该两个或两个以上 的第一物理块组成第一数据分区,第一数据分区对应第一垃圾回收策略。该两个或两个以上的第二物理块组成第二数据分区,第二数据分区对应第二垃圾回收策略。该两个或两个以上的第三物理块组成第三数据分区,第三数据分区对应第三垃圾回收策略。
本申请实施例对第一物理块、第二物理块以及第三物理块所属的固态硬盘300或闪存芯片302(如图4所示)不作具体限定,也即在闪存存储系统100包括多个固态硬盘300时,第一物理块、第二物理块以及第三物理块中的两个或三个可以均来自同一固态硬盘300,也可以来自不同固态硬盘300。在固态硬盘300包括多个闪存芯片302时,第一物理块、第二物理块以及第三物理块中的两个或三个可以均来自同一闪存芯片302,也可以来自不同闪存芯片302。
优选地,第三物理块的数量为两个或两个以上。
表2根据数据类型设置对应的垃圾回收策略
在本申请实施例中,闪存存储系统100、存储控制器200或闪存控制器301为不同数据类型的数据设置对应的垃圾回收策略,不同的数据类型的数据对应的垃圾回收策略不同,充分考虑数据更新的周期与频率,即考虑数据的失效,避免了如图1所示根据贪婪算法来统一做垃圾回收所带来无效搬移。
进一步地,对存储周期性更新数据的第一物理块不进行垃圾回收,基于周期性更新数据是固定更新的,也即第一物理块上的数据必然会被全部无效,等到第一物理块上的数据都更新,第一物理块上的所有数据均变为无效数据后,则可以直接释放第一物理块,而无需搬移周期性更新数据,极大地减少了数据的搬移,针对该周期性更新数据,将固态硬盘内的写放大的次数降低至最低,减少固态硬盘的长尾延时,进而优化固态硬盘的性能,增加固态硬盘的使用寿命。
进一步地,对存储该更新频率高的数据的第二物理块设置其垃圾量达到预设高阈值时进行垃圾回收,基于数据更新频率高,第二物理块的垃圾量比较容易达到高阈值。而设置高阈值则可以减少更新频率高的数据的搬移次数,降低写放大次数,减少固态硬盘的长尾延时,优化固态硬盘的性能,增加固态硬盘的使用寿命。
进一步地,对存储更新频率低的数据的第三物理块设置根据垃圾量由高至低进行垃圾回收,则可以保证在进行垃圾回收时,必然存在可以进行垃圾回收的存储单元。
请参阅图2,示例性介绍本申请实施例提供的闪存存储系统100结构。
如图2所示,闪存存储系统100包括存储控制器200和固态硬盘300。存储控制器200和固态硬盘300之间可以通过多流协议传输数据。
存储控制器200可以是一种计算设备,如服务器、台式计算机等。存储控制器200通过存储区域网络(storage area network,SAN)与主机(图未示)连接。存储控制器200可以接收来自主机的输入输出(I/O)请求。
固态硬盘300是以闪存芯片302(如图4所示)为存储介质的存储器。
图2中存储控制器200与固态硬盘300的数量为1仅是示例性说明,在实际应用中闪存存储系统100可以包括两个或两个以上存储控制器200,每个存储控制器200的物理结构和功能类似。 闪存存储系统100可以包括两个或两个以上固态硬盘300,每个固态硬盘300的物理结构和功能类似。
图2中存储控制器200与固态硬盘300的连接关系仅是示例性说明,在实际应用中,一个存储控制器200可以连接两个或两个以上的固态硬盘300,也即存储控制器200可以与两个或两个以上的固态硬盘300进行通信。本申请实施例并不限定存储控制器200之间,以及任意一个存储控制器200与固态硬盘300之间的连接方式。只要各个存储控制器200之间,以及各个存储控制器200和固态硬盘300之间能够相互通信。
请参阅图3,示例性介绍本申请实施例提供的存储控制器200的结构。
如图3所示,存储控制器200包括第一接口卡201、处理器202和第二接口卡203。处理器202连接第一接口卡201和第二接口卡203。
第一接口卡201用于和主机通信,存储控制器200可以通过第一接口卡201接收主机的I/O请求。处理器202可以是一个中央处理器(central processing unit,CPU)。处理器202可以用于接收来自主机的I/O请求,并处理I/O请求。I/O请求可以是写数据请求或者读数据请求,处理器202还可以将写数据请求中的数据发送给固态硬盘300。处理器202还可以输出配置指令,其中配置指令包括数据类型以及根据数据类型所设置的垃圾回收策略。第二接口卡203用于和固态硬盘300通信,存储控制器200可以通过第二接口卡203将写数据请求(包括数据以及配置指令)发送给固态硬盘300,以使得固态硬盘300存储该数据,或根据该配置指令进行相应配置,保存数据类型与垃圾回收策略之间的对应关系。
可选地,存储控制器200还可以包括存储器204。存储器204用于临时存储从主机接收的数据或从固态硬盘300读取的数据。存储控制器200接收主机发送的多个写数据请求时,可以将多个写数据请求中的数据暂时保存在存储器204中。当存储器204的容量达到一定阈值时,将存储器204存储的数据以及为数据分配的逻辑地址发送给固态硬盘300。固态硬盘300存储数据。存储器204包括易失性存储器,闪存芯片或其组合。易失性存储器例如为随机访问存储器(random-access memory,RAM)。闪存芯片例如软盘、硬盘、固态硬盘、光盘等各种可以存储程序代码的机器可读介质。
请参阅图4,示例性介绍本申请实施例提供的固态硬盘300的结构。
如图4所示,固态硬盘300包括闪存控制器301和闪存芯片302。
闪存控制器301用于执行存储控制器200发送的写数据请求或者读数据请求等操作。
闪存控制器301包括闪存翻译层(flash translation layer,FTL)(图未示)。闪存翻译层用于保存数据的逻辑地址(Logical Block Address,LBA)与固态硬盘300中的物理地址(Physical Block Address,PBA)的对应关系,根据逻辑地址与物理地址的对应关系执行数据的读或者写操作。闪存翻译层用于将存储控制器200发送的写数据请求或者读数据请求中的逻辑地址转化为固态硬盘300中数据的物理地址。数据的逻辑地址是由存储控制器200分配的,一个段的逻辑地址区间的子集。数据的逻辑地址包括起始逻辑地址和长度,起始逻辑地址指示数据位于的段的位置,长度代表数据的大小。
固态硬盘300通常包括若干个闪存芯片302。每个闪存芯片302包括若干个物理块312,每个物理块312包括若干个页(如页0-页n),其中若干个可以为一个或一个以上。其中,页是固态硬盘中最小的数据读写单位,页的大小可以是4KB、8KB或16KB。由页组合成物理块312,每一个物理块312可以有32、64或128个页。
一般将闪存芯片302分为数据空间和预留空间(Over-Provisioning,OP)。数据空间为已经写入数据的空间,预留空间为空闲空间,由空闲页组成,可用于写入数据。当新的数据要覆盖闪存芯片302中数据空间已经存储的数据时,会使用重定向写机制,即当固态硬盘300向逻辑块地址写入新数据以修改已经存储的数据时,固态硬盘300会将新数据写入预留空间的页,建立LBA与预留空间的页地址的映射关系,将LBA原来映射的数据空间的页地址中的数据标记为垃圾数据。当预留空间低于一定阈值后,固态硬盘300对垃圾数据所在页的物理块312进行垃圾回收。回收过程如下:读取垃圾数据所在页的物理块312中的有效数据,将读取出的有效数据写入到预留空间,并将垃圾数据所在页的物理块312中的数据擦除,将该物理块312作为新的预留空间。在垃圾回收过程中,读取出有效数据并将有效数据写入到预留空间的过程称为有效数据搬移。垃圾回收会引起写放大,其中固态硬盘300垃圾回收搬移的有效数据大小V与新写入数据大小W之和与新写入数据大小W之比,即(V+W)/W称为写放大。
在本申请实施例中,固态硬盘300的第一物理块用于存储周期性更新数据,第二物理块用于存储更新频率高的数据,第三物理块用于存储更新频率低的数据。在进行垃圾回收时,固态硬盘300对第一物理块执行第一垃圾回收策略,对第二物理块执行第二垃圾回收策略,对第三物理块执行第三垃圾回收策略。
其中,第一物理块、第二物理块以及第三物理块的数量均可以为一个或一个以上,本申请实施例对第一物理块、第二物理块以及第三物理块的数量不作具体限定。
优选地,第三物理块的数量为两个或两个以上。
在第一物理块、第二物理块以及第三物理块的数量均为两个或两个以上时,该两个或两个以上的第一物理块组成第一数据分区,第一数据分区对应第一垃圾回收策略。该两个或两个以上的第二物理块组成第二数据分区,第二数据分区对应第二垃圾回收策略。该两个或两个以上的第三物理块组成第三数据分区,第三数据分区对应第三垃圾回收策略。
本申请实施例对第一物理块、第二物理块以及第三物理块所属的闪存芯片301或固态硬盘300不作具体限定。在固态硬盘300包括多个闪存芯片301时,第一物理块、第二物理块以及第三物理块中的两个或三个可以均来自同一闪存芯片301,也可以来自不同闪存芯片301。在闪存存储系统100包括多个固态硬盘300时,第一物理块、第二物理块以及第三物理块中的两个或三个可以均来自同一固态硬盘300,也可以来自不同固态硬盘300。
在本申请实施例中,在第一物理块、第二物理块以及第三物理块中的两个或三个均来自不同固态硬盘300时,也即存储控制器200可以将不同配置指令发送至不同的固态硬盘300,或者预先对不同的固态硬盘300执行不同的配置,以使得各个固态硬盘300保存数据类型与对应的垃圾回收策略。例如设置固态硬盘300A(图未示)仅用于存储周期性数据,则存储控制器200将周期性数据与第一垃圾回收策略发送给固态硬盘300A,或固态硬盘300A保存周期性数据与第一垃圾回收策略之间对应关系。相应地,设置固态硬盘300B(图未示)仅用于存储更新频率高的数据,则存储控制器200将更新频率高的数据与第二垃圾回收策略发送给固态硬盘300B,固态硬盘300B保存更新频率高的数据与第二垃圾回收策略之间对应关系。在进行垃圾回收时,固态硬盘300A执行第一垃圾回收策略,即对其内的物理块312不进行垃圾回收。固态硬盘300B根据第二垃圾回收策略对其内的物理块312进行垃圾回收。
下面以为各个数据分区设置对应的垃圾回收策略为例,详细介绍本申请实施例中固态硬盘300 配置方法以及数据写入方法。该配置方法以及数据写入方法可以应用于图2所示的闪存存储系统100,可以由图3所示的存储控制器200执行。
请参阅图5,示例性介绍本申请实施例提供的一种固态硬盘配置方法流程。
如图5所示,存储控制器200包括多流管理模块210。多流管理模块210用于管理多流以及根据各个流所传输的数据类型为各个流设置对应的垃圾回收策略。闪存控制器301包括数据分区管理模块310。数据分区管理模块310用于为各个流分配对应的数据分区以及保存流、垃圾回收策略以及数据分区之间的关系。
步骤S51,多流管理模块210向数据分区管理模块310查询固态硬盘300支持的流的总数。
在图2所示的闪存存储系统100启动时,存储控制器200上的多流管理模块210向数据分区管理模块310查询固态硬盘300支持的流的总数。
可以理解,固态硬盘300支持的流的数量可以为一个或一个以上。
步骤S52,数据分区管理模块310向多流管理模块210返回固态硬盘300支持的流的总数。
在本申请实施例中,多流管理模块210可以用于根据固态硬盘300所支持的流的总数创建流,并为流分配全局唯一的标识流ID。全局唯一的标识流ID可以为数字或者字母,本申请对此不做限定。只要区别流即可。
示例地,固态硬盘300总共能支持的流的数量为8,则数据分区管理模块310向多流管理模块210返回固态硬盘300支持的流的总数为8。存储控制器200为这8个流分配对应的流ID,如流1至流8。
在一些实施例中,固态硬盘300支持的流的总数为1时,若闪存存储系统100中包括两个或两个以上的固态硬盘300,则存储控制器200可以为各个固态硬盘300下发对应的配置指令。例如,向固态硬盘300A下发第一配置指令,向固态硬盘300B下发第二配置指令,第一配置指令包括为周期性更新数据对应第一垃圾回收策略,第二配置指令包括为更新频率高的数据对应第二垃圾回收策略,则固态硬盘300A保存周期性更新数据与第一垃圾回收策略之间的对应关系,固态硬盘300A保存更新频率高的数据与第二垃圾回收策略之间的对应关系。后续在进行垃圾回收时,固态硬盘300A执行第一垃圾回收策略,固态硬盘300B执行第二垃圾回收策略。
步骤S53,多流管理模块210设置各个流对应的垃圾回收策略。
在本申请实施例中,多流管理模块210根据支持的流的总数为各个流设置对应的数据类型以及对应的垃圾回收策略。具体地,存储控制器200可以根据实际情况设置好各个数据类型,然后根据固态硬盘300支持的流的总数和所设置的数据类型,设置各个流对应的数据类型。例如,存储控制器200设置有数据类型包括周期性更新数据、更新频率高的数据、更新频率适中的数据以及更新频率低的数据。示例性地,固态硬盘300支持的流的总数为4,存储控制器200为该4个流分配流ID分别为流1至流4。多流管理模块210设置流1对应周期性更新数据和第一垃圾回收策略,设置流2对应更新频率高的数据和第二垃圾回收策略,设置流3对应更新频率适中的数据(如温数据)和第三垃圾回收策略,设置流4对应更新频率低的数据(如冷数据)和第四垃圾回收策略(如Cost Benefit算法)。又例如,固态硬盘300支持的流的总数为8,存储控制器200为该8个流分配的流ID分别为流1至流8,其中流1至2对应周期性更新数据和第一垃圾回收策略,以此类推。
在本申请实施例中,多流管理模块210可以为各个流设置其用于传输的数据的数据类型,然后根据各个流对应的数据类型,设置各个流对应的垃圾回收策略,最后将设置好的数据类型与对应的 垃圾回收策略(如以配置命令方式)传输给数据分区管理模块310。
在另一些实施例中,多流管理模块210可以为各个流设置其对应的垃圾回收策略,然后根据各个垃圾回收策略对应的数据类型,设置各个流用于传输的数据类型,最后将设置好数据类型与对应的垃圾回收策略(如以配置命令方式)传输给数据分区管理模块310。
本申请实施例中,基于减少无效搬移的目的,设置好数据类型与对应的垃圾回收策略后,数据类型与垃圾回收策略之间是有明确对应关系的,根据数据类型可以推导出对应的垃圾回收策略,相应地,根据垃圾回收策略可以推导出对应的数据类型。
可以理解,本申请对数据类型与垃圾回收策略之间的具体对应关系不作限定,例如更新频率低的数据也可以使用Cost Benefit算法作为其垃圾回收策略。
示例性地,请一并参阅图6,以固态硬盘300支持的流的总数为3,该三个流的流ID分别为流1、流2以及流3。多流管理模块210设置流1用于传输周期性更新数据,且流1对应的垃圾回收策略为第一垃圾回收策略。多流管理模块210设置流2用于传输更频率高的数据,且设置流2对应的垃圾回收策略为第二垃圾回收策略。多流管理模块210设置流3用于传输更频率低的数据,根据更频率低的数据的数据类型,设置流3对应的垃圾回收策略为第三垃圾回收策略。
在本申请实施例中,拓展固态硬盘300与存储控制器200之间的通信接口,以通过该新拓展的通信接口传输存储控制器200所设置的数据类型与对应的垃圾回收策略之间的关系,也即配置指令。
在一些实施例中,上述存储控制器200可以替换为主机。
步骤S54,数据分区管理模块310保存流、垃圾回收策略以及数据分区之间的对应关系。
在本申请实施例中,数据分区管理模块310接收多流管理模块210传输的各个流对应的数据类型与垃圾回收策略,即配置命令。数据分区管理模块310响应于该配置命令,获得各个流对应的垃圾回收策略。数据分区管理模块310用于设置各个流对应的数据分区,记录流、垃圾回收策略以及数据分区之间的对应关系。基于流对应的数据分区和对应的垃圾回收策略,可以获得数据分区对应的垃圾回收策略。
在本申请实施例中,存储于同一数据分区的数据的数据类型相同,也即同一流的数据可被写入固态硬盘300的相同数据分区。多个不同流对应的数据类型相同,则该多个不同流的数据可被写入固态硬盘300的相同数据分区。
如上述示例,请一并参阅图6,数据分区管理模块310设置流1对应逻辑分区1,设置流2对应逻辑分区2,设置流3对应逻辑分区3。数据分区管理模块310保存流1对应逻辑分区1,逻辑分区1对应的垃圾回收策略为第一垃圾回收策略。数据分区管理模块310保存流2对应逻辑分区2,逻辑分区2对应的垃圾回收策略为第二垃圾回收策略。数据分区管理模块310保存流3对应逻辑分区3,逻辑分区3对应的垃圾回收策略为第三垃圾回收策略。
其中,逻辑分区1-3为逻辑存储空间,即对应逻辑地址上的分区。逻辑分区1对应闪存芯片302上的第一数据分区,逻辑分区2对应闪存芯片302上的第二数据分区,逻辑分区3对应闪存芯片302上的第三数据分区。逻辑分区1-3上的逻辑地址0-6为逻辑地址。逻辑地址0-6分别对应闪存芯片302上的物理块0-6。也即第一数据分区包括物理块1-2,第二数据分区包括物理块3-4,第三数据分区包括物理块5-6。其中,逻辑地址0对应的物理块0为专属预留空间。其中专属预留空间为闪存存储系统100的预留空间中划分出给第一垃圾回收策略对应的数据分区所使用的。
在本申请实施例中,存储控制器200在设置第一垃圾回收策略时,可以根据周期性更新数据的历史信息为周期性更新数据设置对应的固定的专属预留空间,或,针对可以根据具体数据量的多少来设置固定的专属预留空间。示例性,若存储控制器200检测到用户在用户数据a存储至5G后就更新,则可以为该周期性更新数据(用户数据a)设置固定的专属预留空间为5G。
其中,专属预留空间为闪存存储系统100的预留空间中所划分出的部分预留空间。示例性地,若闪存存储系统100的预留空间为20G,存储控制器200设置第一垃圾回收策略对应的专属预留空间为5G,则从该20G中划分出5G用作专属预留空间,该专属预留空间用于第一数据分区进行数据更新时使用,而第二数据分区和第三数据分区进行数据更新时则使用剩下的15G。
闪存控制器301保存了流1对应第一数据分区(逻辑分区1)与第一垃圾回收策略,流2对应第二数据分区(逻辑分区2)与第三垃圾回收策略,流3对应第三数据分区(逻辑分区3)与第三垃圾回收策略。回收模块311从数据分区管理模块310处可获得各个数据分区对应的垃圾回收策略。在回收模块311中存储着存储控制器200所定制的垃圾回收策略,包括第一垃圾回收策略、第二垃圾回收策略以及第三垃圾回收策略。
进行垃圾回收时,回收模块311对第一数据分区(物理块1-2)执行第一垃圾回收策略,即对物理块1-2不进行垃圾回收。对第二数据分区(物理块3-4)执行第二垃圾回收策略,即当物理块3或物理块4的垃圾量达到预设高阈值时,对该物理块进行垃圾回收。例如物理块3中垃圾量占整个物理块3的80%,则对该物理块3进行垃圾回收。对第三数据分区(物理块5-6)执行第三垃圾回收策略,若物理块5的垃圾量大于物理块6,则先对物理块5进行垃圾回收,若回收物理块5后,存储空间已达到此次垃圾回收任务要求,则不对物理块6进行垃圾回收,反之则要对物理块6进行垃圾回收。
在本申请实施例中,当固态硬盘支持两个或两个以上的流时,该两个或两个以上的流对应的数据类型不同,且该两个或两个以上的流对应的垃圾回收策略不同。
需要说明的是,第一数据分区、第二数据分区以及第三数据分区的存储容量大小可不同,例如,第一数据分区包括10个物理块,第二数据分区可以包括5个物理块,具体可以根据实际情况配置第一数据分区、第二数据分区以及第三数据分区的存储容量大小,本申请对此不作具体限定。
在本申请实施例中,将存储控制器200的不同流与固态硬盘300上的不同垃圾回收策略的数据分区进行绑定,从而既实现了不同数据流写入到固态硬盘300内不同数据分区的目的,又达到了针对不同数据分区使用不同垃圾回收策略的效果。
步骤S55,数据分区管理模块310向多流管理模块210返回设置成功。
在本申请实施例中,数据分区管理模块310若记录存流、垃圾回收策略以及数据分区之间的对应关系,则向多流管理模块210返回设置成功。反之,返回设置失败,则多流管理模块210响应于设置失败,进行相应操作,如重新下发配置命令等。
在本申请实施例中,存储控制器200设置数据类型与对应的垃圾回收策略,根据不同数据类型,配置对应的垃圾回收策略。或者根据不同的垃圾回收策略,配置对应的数据类型。以使得后续在进行垃圾回收时,可以充分考虑数据类型,避免无效搬移。
如上述示例存储控制器200已经配置好固态硬盘300,接下来介绍将数据写入至固态硬盘300。
请参阅图7,示例性介绍本申请实施例提供的一种数据写入方法流程。该数据写入方法可以应用于图1所示闪存存储系统100。
如图7所示,存储控制器200还可以包括数据特征管理模块211,数据特征管理模块211用于确定待写入数据的数据类型。图7中多流管理模块210的内容可以参考上述图5、图6相关内容,在此不再赘述。图7中闪存芯片302和多流接口303的内容可以参考上述图1相关内容,在此不再赘述。
步骤S70,数据特征管理模块211获取待写入数据的数据类型。
在本申请实施例中,当待写入数据(如用户数据)写入至存储控制器200,数据特征管理模块211接收到待写入数据,确定该待写入数据的数据类型。如可以根据待写入数据的访问特征确定该待写入数据的数据类型。
步骤S71,数据特征管理模块211根据数据类型向多流管理模块210申请流ID。
如图6所示,多流管理模块210设置各个流对应的数据类型后,数据特征管理模块211可以从多流管理模块210处获得各个数据类型对应的流ID。在数据特征管理模块211确定各个待写入数据的数据类型后,基于各个数据类型对应的流ID,向多流管理模块210申请该待写入数据的数据类型所对应的流ID。
当待写入数据为周期性更新数据时,存储控制器确定流ID为第一ID,当待写入数据为更新频率高的数据时,存储控制器确定流ID为第二ID,当待写入数据为更新频率低的数据时,存储控制器确定流ID为第三ID。
如上述示例,请一并参阅图6,若该待写入数据为日志数据,确定该待写入数据为周期性更新数据,进而可以确定该待写入数据对应的流ID为流1(第一ID),数据特征管理模块211向多流管理模块210申请流1。若该待写入数据为元数据,确定该待写入数据为更新频率高的数据,进而可以确定该待写入数据对应的流ID为流2(第二ID),数据特征管理模块211向多流管理模块210申请流2。若该待写入数据为冷数据,确定该待写入数据为更新频率低的数据,进而可以确定该待写入数据对应的流ID为流3(第三ID),数据特征管理模块211向多流管理模块210申请流3。
步骤S72,多流管理模块210向数据特征管理模块211返回流ID。
在本申请实施例中,多流管理模块210向数据特征管理模块211返回步骤S71中数据特征管理模块211所申请的流ID。如,数据特征管理模块211向多流管理模块210申请流1,则多流管理模块210向数据特征管理模块211返回流1。
步骤S73,数据特征管理模块211将待写入数据放入流ID对应的流,并将流发送给固态硬盘300的多流接口303。
在本申请实施例中,数据特征管理模块211根据特征管理模块211返回的流ID,将待写入数据放入流ID对应的流,并将该流发送给固态硬盘300的多流接口303。数据特征管理模块211将周期性更新数据放入第一ID对应的第一流,并将第一流发送给多流接口303。数据特征管理模块211将更新频率高的数据放入第二ID对应的第二流,并将第二流发送给多流接口303。数据特征管理模块211将更新频率低的数据放入第三ID对应的第三流,并将第三流发送给多流接口303。
步骤S74,多流接口303将流中的待写入数据写入闪存芯片302中对应的数据分区。
在本申请实施例中,多流接口303可以从闪存控制器301处获得各个流对应的数据分区,记录每个流及数据分区的对应关系。多流接口303将第一流中的待写入数据写入闪存芯片302中的第一数据分区,将第二流中的待写入数据写入闪存芯片302中的第二数据分区,将第三流中的待写入数据写入闪存芯片302中的第三数据分区。
在本申请实施例中,固态硬盘300的闪存控制器301已保存各个流对应的数据分区以及各个数据分区对应的垃圾回收策略。数据特征管理模块211基于多流技术,通过多流接口303将数据写入至固态硬盘300中的对应数据分区,其中每一数据分区根据其所存储的数据的数据类型配置有该数据分区的对应的垃圾回收策略。
在本申请实施例中,闪存存储系统100内的数据分流写入固态硬盘300内相应数据分区。在存储控制器200根据数据访盘特征可以大致分为周期性更新数据、更新频率高的数据、更新频率低的数据,通过多流技术实现将周期性更新数据写入到固态硬盘300内的第一垃圾回收策略的第一数据分区,将更新频率高的数据写入固态硬盘300内的第二垃圾回收策略的第二数据分区,将更新频率低的数据写入固态硬盘300内的第三垃圾回收策略的第三数据分区。固态硬盘300内启动垃圾回收时,针对第一数据分区,不需要搬移数据,当第一数据分区内的数据失效后直接做擦除操作,不产生任何额外的写放大,此第一数据分区内数据的写放大达到最优。针对第二数据分区,对达到预设高垃圾量的物理块312才做垃圾回收,极大的降低了第二数据分区的写放大。并设置第三数据分区可以保证在进行垃圾回收时必然存在可以回收的物理块312。
上述实施例是存储控制器200对固态硬盘300进行配置。
在一些实施例中,可以预先对固态硬盘300进行配置,在固态硬盘300出厂前,可以预先根据数据类型与垃圾回收策略之间的对应关系,配置好固态硬盘300。
需要说明的是,上述预先对固态硬盘300进行配置的实施例中的相关内容也适用到本申请实施例,如数据分区、数据类型以及垃圾回收策略等,在此不再赘述。
闪存控制器301从闪存芯片302中确定出N个数据分区,其中数据分区用于存储对应数据类型的数据,N为大于或等于1的整数,然后记录数据分区所对应的垃圾回收策略与数据类型。具体地,闪存控制器301可以参考上述多流管理模块210为各个流设置对应的垃圾回收策略。闪存控制器301根据固态硬盘300支持的流的总数设置N个数据分区,并设置该N个数据分区对应的数据类型以及垃圾回收策略。示例性地,固态硬盘300支持的流的总数为4,闪存控制器301设置N个数据分区,N小于或等于4,且大于或等于1。
在本申请实施例中,闪存控制器301设置各个数据分区用于存储的数据类型以及各个数据分区对应的垃圾回收策略。示例性地,闪存控制器301设置第一数据分区用于存储周期性更新数据,第一数据分区对应第一垃圾回收策略。设置第二数据分区用于存储更新频率高的数据,第二数据分区对应第二垃圾回收策略。设置第三数据分区用于存储更新频率低的数据,第三数据分区对应第三垃圾回收策略。
在一些实施例中,在固态硬盘300出厂前,固态硬盘300的数据分区管理模块310已对闪存芯片302划分数据分区,并记录各个数据分区对应的流ID,以及各个流ID对应的数据类型。生产固态硬盘300的厂商可告知用户固态硬盘300各个流ID对应的数据类型,则用户要使用该固态硬盘300时,告知存储控制器200各个流ID对应的数据类型,则存储控制器200向固态硬盘300写入数据时,根据数据的数据类型确定流ID,根据流ID将数据写入对应的流,以通过对应流将数据写入固态硬盘300对应的数据分区。
下面介绍配置好的固态硬盘300如何进行垃圾回收。
示例性介绍本申请实施例提供的垃圾回收方法。该垃圾回收方法应用于固态硬盘300。闪存控制器301根据各个数据分区对应的垃圾回收策略进行垃圾回收。
在本申请实施例中,触发闪存控制器301进行垃圾回收的条件可以为接收到与固态硬盘300相连接的主机发送的垃圾回收处理指令。又或者,闪存控制器301检测到闪存芯片302存储较多的无效数据或闪存芯片302的存储空间较少等情况下,需要利用垃圾回收机制释放资源。本申请对进行垃圾回收的时机不做具体限定。
在本申请实施例中,固态硬盘300中的闪存芯片302包括用于存储周期更新数据的第一数据分区(对应第一垃圾回收策略的第一数据分区)、存储更新频率高的数据的第二数据分区(对应第二垃圾回收策略的第二数据分区)以及存储更新频率低的数据的第三数据分区(对应第三垃圾回收策略的第三数据分区)。
在本申请实施例中,可以为该N个数据分区分配优先级,第一数据分区的优先级高于第二数据分区的优先级,第二数据分区的优先级高于第三数据分区的优先级。则,在进行垃圾回收时,根据优先级由高至低对N个数据分区进行垃圾回收。也即先对第一数据分区执行第一垃圾回收策略,若还需要继续进行垃圾回收,则继续对第二数据分区执行第二垃圾回收策略。反之,结束垃圾回收。若还需要继续进行垃圾回收,则继续对第三数据分区执行第三垃圾回收策略。
具体地,固态硬盘300(回收模块311)首先确定第一数据分区中第一物理块上的数据是否全为无效数据,若是,直接释放第一物理块。若否,且还需继续进行垃圾回收,则固态硬盘300确定是否可对第二数据分区进行垃圾回收,若是,固态硬盘300根据第二垃圾回收策略对第二数据分区上的第二物理块进行垃圾回收。若否,固态硬盘300根据第三垃圾回收策略对第三数据分区上的第三物理块进行垃圾回收。
其中,固态硬盘300根据第二垃圾回收策略对第二数据分区上的第二物理块进行垃圾回收包括,固态硬盘300确定第二数据分区上垃圾量达到预设高阈值的第二物理块,并对该垃圾量达到预设高阈值的第二物理块进行垃圾回收。
其中,固态硬盘300根据第三垃圾回收策略对第三数据分区上的第三物理块进行垃圾回收包括,固态硬盘300将第三数据分区上第三物理块的垃圾量由高至低进行排序,依据垃圾量高至低,对第三数据分区上的第三物理块进行垃圾回收,直至回收资源达到此次垃圾回收任务要求。
在本申请实施例中,若对第一数据分区上的第一物理块进行释放后,回收资源已达到此次垃圾回收任务要求则结束垃圾回收。固态硬盘300回收资源时,对第一数据分区上的数据不进行搬移,减少了搬移次数,减少固态硬盘300的写放大的次数,减少固态硬盘300的长尾延时,优化固态硬盘300的性能,增加固态硬盘300的使用寿命。
在本申请实施例中,若对第一数据分区上的第一物理块进行释放后,回收资源未达到此次垃圾回收任务要求,则继续根据第二垃圾回收策略对第二数据分区上的第二物理块进行垃圾回收。固态硬盘300回收资源时,基于第二垃圾回收策略中对垃圾量达到预设高阈值的第二物理块进行回收,则可以减少数据搬移次数,减少固态硬盘300的写放大的次数,减少固态硬盘300的长尾延时,优化固态硬盘300的性能,增加固态硬盘300的使用寿命。
在本申请实施例中,若根据第二垃圾回收策略对第二数据分区上的第二物理块进行垃圾回收后,回收资源已达到此次垃圾回收任务要求则结束垃圾回收。若根据第二垃圾回收策略对第二数据分区上的第二物理块进行垃圾回收后,回收资源未达到此次垃圾回收任务要求,则继续根据第三垃圾回收策略对第三数据分区上的第三物理块进行垃圾回收。
本申请实施例还提供一种闪存阵列,包括M个固态硬盘以及如图2、3、5、6、7所示的存储 控制器,存储控制器与M个固态硬盘之间相互通信,M为大于或等于1的整数,固态硬盘包括N个数据分区,N为大于或等于1的整数。
本申请实施例还提供一种闪存阵列,包括存储控制器以及M个如图2、3、5、6、7所示的固态硬盘,存储控制器与M个固态硬盘之间相互通信,M为大于或等于1的整数,固态硬盘包括N个数据分区,N为大于或等于1的整数。
本申请实施例还提供一种电子设备,其中,包括主机以及闪存存储系统,主机与闪存存储系统之间相互通信,其中闪存存储系统图7所示数据写入方法。
本申请实施例还提供一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如上述固态硬盘配置方法,或上述垃圾回收方法。
本申请实施例还提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行上述固态硬盘配置方法,或上述垃圾回收方法。
其中,本申请实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片系统均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
该作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器202(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。

Claims (30)

  1. 一种固态硬盘配置方法,其特征在于,所述方法包括:
    获取固态硬盘支持的流对应的数据类型;所述流对应所述固态硬盘的分区;
    根据所述流对应的所述数据类型,确定所述流对应的垃圾回收策略;
    将所述流对应的所述垃圾回收策略发送给所述固态硬盘。
  2. 如权利要求1所述的固态硬盘配置方法,其特征在于,当所述固态硬盘支持两个或两个以上的所述流时,该两个或两个以上的所述流对应的所述数据类型不同,且该两个或两个以上的所述流对应的所述垃圾回收策略不同。
  3. 如权利要求1或2所述的固态硬盘配置方法,其特征在于,所述根据所述流对应的所述数据类型,确定所述流对应的垃圾回收策略包括:
    当所述流对应的所述数据类型为周期性更新数据时,确定所述流对应的所述垃圾回收策略为第一垃圾回收策略,其中所述第一垃圾回收策略为对第一物理块不进行垃圾回收,并设置专属预留空间,其中所述第一物理块用于存储所述周期性更新数据;
    当所述流对应的所述数据类型为更新频率高的数据时,确定所述流对应的所述垃圾回收策略为第二垃圾回收策略,其中所述第二垃圾回收策略为当第二物理块的垃圾量达到预设高阈值时,对所述第二物理块进行垃圾回收,其中所述第二物理块用于存储所述更新频率高的数据;
    当所述流对应的所述数据类型为更新频率低的数据时,确定所述流对应的所述垃圾回收策略为第三垃圾回收策略,其中所述第三垃圾回收策略为按垃圾量由高至低对第三物理块进行垃圾回收,其中所述第三物理块用于存储所述更新频率低的数据。
  4. 如权利要求1至3任一项所述的固态硬盘配置方法,其特征在于,所述获取固态硬盘支持的流对应的数据类型包括:
    获取所述固态硬盘所支持的所述流的总数;
    根据所述总数创建所述流,并为所述流设置对应的所述数据类型。
  5. 一种存储控制器,其特征在于,所述存储控制器包括处理器和存储器,所述处理器执行所述存储器中的计算机指令,用于获取固态硬盘支持的流对应的数据类型;所述流对应所述固态硬盘的分区;根据所述流对应的所述数据类型,确定所述流对应的垃圾回收策略;将所述流对应的所述垃圾回收策略发送给所述固态硬盘。
  6. 如权利要求5所述的存储控制器,其特征在于,当所述固态硬盘支持两个或两个以上的所述流时,该两个或两个以上的所述流对应的所述数据类型不同,且该两个或两个以上的所述流对应的所述垃圾回收策略不同。
  7. 如权利要求5或6所述的存储控制器,其特征在于,所述根据所述流对应的所述数据类型, 确定所述流对应的垃圾回收策略包括:
    当所述流对应的所述数据类型为周期性更新数据时,确定所述流对应的所述垃圾回收策略为第一垃圾回收策略,其中所述第一垃圾回收策略为对第一物理块不进行垃圾回收,并设置专属预留空间,其中所述第一物理块用于存储所述周期性更新数据;
    当所述流对应的所述数据类型为更新频率高的数据时,确定所述流对应的所述垃圾回收策略为第二垃圾回收策略,其中所述第二垃圾回收策略为当第二物理块的垃圾量达到预设高阈值时,对所述第二物理块进行垃圾回收,其中所述第二物理块用于存储所述更新频率高的数据;
    当所述流对应的所述数据类型为更新频率低的数据时,确定所述流对应的所述垃圾回收策略为第三垃圾回收策略,其中所述第三垃圾回收策略为按垃圾量由高至低对第三物理块进行垃圾回收,其中所述第三物理块用于存储所述更新频率低的数据。
  8. 如权利要求5至7任一项所述的存储控制器,其特征在于,所述获取固态硬盘支持的流对应的数据类型包括:
    获取所述固态硬盘所支持的所述流的总数;
    根据所述总数创建所述流,并为所述流设置对应的所述数据类型。
  9. 一种固态硬盘配置方法,其特征在于,应用于所述固态硬盘,所述方法包括:
    确定数据分区,其中所述数据分区用于存储对应数据类型的数据;
    根据所述数据分区对应的所述数据类型,配置所述数据分区对应的垃圾回收策略。
  10. 如权利要求9所述的固态硬盘配置方法,其特征在于,当所述数据分区的总数为两个或两个以上时,该两个或两个以上的所述数据分区对应的所述数据类型不同,且该两个或两个以上的所述数据分区对应的所述垃圾回收策略不同。
  11. 如权利要求9所述的固态硬盘配置方法,其特征在于,所述数据分区包括第一数据分区、第二数据分区和第三数据分区中的一个或多个;其中,所述第一数据分区用于存储周期性更新数据,所述第二数据分区用于存储更新频率高的数据,所述第三数据分区用于存储更新频率低的数据。
  12. 如权利要求11所述的固态硬盘配置方法,其特征在于,所述配置所述数据分区对应的垃圾回收策略包括:
    配置所述第一数据分区对应的所述垃圾回收策略为第一垃圾回收策略,其中所述第一垃圾回收策略为对所述第一数据分区不进行垃圾回收,并设置专属预留空间;
    配置所述第二数据分区对应的所述垃圾回收策略为第二垃圾回收策略,其中所述第二垃圾回收策略为当所述第二数据分区的垃圾量达到预设高阈值时,对所述第二数据分区进行垃圾回收;
    配置所述第三数据分区对应的所述垃圾回收策略为第三垃圾回收策略,其中所述第三垃圾回收策略为按垃圾量由高至低对所述第三数据分区进行垃圾回收。
  13. 如权利要求9至12任一项所述的固态硬盘配置方法,其特征在于,所述确定数据分区包括:
    获取所述固态硬盘所支持的流的总数;
    根据所述总数确定N个所述数据分区,其中N小于或等于所述总数。
  14. 如权利要求9至13任一项所述的固态硬盘配置方法,其特征在于,所述数据分区包括一个或一个以上的物理块。
  15. 一种固态硬盘,其特征在于,所述固态硬盘包括闪存控制器和闪存芯片;
    所述闪存控制器用于从所述闪存芯片中确定出数据分区,其中所述数据分区用于存储对应数据类型的数据;
    所述闪存控制器还用于根据所述数据分区对应的所述数据类型,配置所述数据分区对应的垃圾回收策略。
  16. 如权利要求15所述的固态硬盘,其特征在于,当所述数据分区的总数为两个或两个以上时,该两个或两个以上的所述数据分区对应的所述数据类型不同,且该两个或两个以上的所述数据分区对应的所述垃圾回收策略不同。
  17. 如权利要求15所述的固态硬盘,其特征在于,所述数据分区包括第一数据分区、第二数据分区和第三数据分区中的一个或多个;其中,所述第一数据分区用于存储周期性更新数据,所述第二数据分区用于存储更新频率高的数据,所述第三数据分区用于存储更新频率低的数据。
  18. 如权利要求17所述的固态硬盘,其特征在于,所述配置所述数据分区对应的垃圾回收策略包括:
    所述闪存控制器配置所述第一数据分区对应的所述垃圾回收策略为第一垃圾回收策略,其中所述第一垃圾回收策略为对所述第一数据分区不进行垃圾回收,并设置专属预留空间;
    所述闪存控制器配置所述第二数据分区对应的所述垃圾回收策略为第二垃圾回收策略,其中所述第二垃圾回收策略为当所述第二数据分区的垃圾量达到预设高阈值时,对所述第二数据分区进行垃圾回收;
    所述闪存控制器配置所述第三数据分区对应的所述垃圾回收策略为第三垃圾回收策略,其中所述第三垃圾回收策略为按垃圾量由高至低对所述第三数据分区进行垃圾回收。
  19. 如权利要求15至18任一项所述的固态硬盘,其特征在于,所述闪存控制器用于从所述闪存芯片中确定出数据分区包括:
    所述闪存控制器用于获取所述固态硬盘所支持的所述流的总数,并根据所述总数确定N个所述数据分区,N为小于或等于所述总数。
  20. 如权利要求15至19任一项所述的固态硬盘,其特征在于,所述数据分区包括一个或一个以上的物理块。
  21. 一种数据写入方法,其特征在于,应用于闪存存储系统,所述闪存存储系统包括存储控制器与固态硬盘,所述固态硬盘包括数据分区,所述数据分区配置有对应的垃圾回收策略,其中所述垃圾回收策略根据所述数据分区对应的数据类型配置;
    所述存储控制器获取待写入数据;
    所述存储控制器根据所述待写入数据的所述数据类型确定流ID;
    所述存储控制器将所述待写入数据放入所述流ID对应的流,并将所述流发送给所述固态硬盘;
    所述固态硬盘将所述流中的所述待写入数据写入对应的所述数据分区,其中所述数据分区对应的所述数据类型与所述待写入数据的所述数据类型相同。
  22. 如权利要求21所述的数据写入方法,其特征在于,所述数据分区包括第一数据分区、第二数据分区和第三数据分区中的一个或多个;
    当所述待写入数据为周期性更新数据时,所述存储控制器确定所述流ID为第一ID,将所述待写入数据放入所述第一ID对应的第一流,并将所述第一流发送给所述固态硬盘;
    则所述固态硬盘将所述流中的所述待写入数据写入对应的所述数据分区包括:
    所述固态硬盘将所述第一流中的所述待写入数据写入所述第一数据分区,所述第一数据分区关联所述第一流,所述第一数据分区对应的所述垃圾回收策略为第一垃圾回收策略,其中所述第一垃圾回收策略为对所述第一数据分区不进行垃圾回收,并设置专属预留空间;
    当所述待写入数据为更新频率高的数据时,所述存储控制器确定所述流ID为第二ID,将所述待写入数据放入所述第二ID对应的第二流,并将所述第二流发送给所述固态硬盘;
    则所述固态硬盘将所述流中的所述待写入数据写入对应的所述数据分区包括:
    所述固态硬盘将所述第二流中的所述待写入数据写入所述第二数据分区,所述第二数据分区关联所述第二流,所述第二数据分区对应的所述垃圾回收策略为第二垃圾回收策略,其中所述第二垃圾回收策略为当所述第二数据分区的垃圾量达到预设高阈值时,对所述第二数据分区进行垃圾回收;
    当所述待写入数据为更新频率低的数据时,所述存储控制器确定所述流ID为第三ID,将所述待写入数据放入所述第三ID对应的第三流,并将所述第三流发送给所述固态硬盘;
    则所述固态硬盘将所述流中的所述待写入数据写入对应的所述数据分区包括:
    所述固态硬盘将所述第三流中的所述待写入数据写入所述第三数据分区,所述第三数据分区关联所述第三流,所述第三数据分区对应的所述垃圾回收策略为第三垃圾回收策略,其中所述第三垃圾回收策略为按垃圾量由高至低对所述第三数据分区进行垃圾回收。
  23. 一种垃圾回收方法,其特征在于,应用于固态硬盘,所述固态硬盘包括数据分区,所述数据分区配置有对应的垃圾回收策略,其中所述垃圾回收策略根据所述数据分区对应的数据类型配置,所述垃圾回收方法包括:
    根据所述数据分区对应的所述垃圾回收策略对所述数据分区进行垃圾回收。
  24. 如权利要求23所述的垃圾回收方法,其特征在于,所述数据分区包括第一数据分区、第二数据分区和第三数据分区中的一个或多个;
    所述第一数据分区用于存储周期性更新数据,所述第一数据分区对应的垃圾回收策略为第一垃圾回收策略,其中所述第一垃圾回收策略为对所述第一数据分区不进行垃圾回收,并设置专属预留空间;
    所述第二数据分区用于存储更新频率高的数据,所述第二数据分区对应的垃圾回收策略为第二垃圾回收策略,其中所述第二垃圾回收策略为当所述第二数据分区的垃圾量达到预设高阈值时,对所述第二数据分区进行垃圾回收;
    所述第三数据分区用于存储更新频率低的数据,所述第三数据分区对应的垃圾回收策略为第三垃圾回收策略,其中所述第三垃圾回收策略为按垃圾量由高至低对所述第三数据分区进行垃圾回收。
  25. 如权利要求24所述的垃圾回收方法,其特征在于,当所述固态硬盘包括所述第一数据分区、所述第二数据分区和所述第三数据分区中的两个或三个时,所述方法还包括:
    根据优先级由高至低对所述数据分区进行垃圾回收,其中,所述第一数据分区的所述优先级高于所述第二数据分区的所述优先级,所述第二数据分区的所述优先级高于所述第三数据分区的所述优先级。
  26. 一种闪存阵列,其特征在于,包括M个固态硬盘以及如权利要求5至8中任一项所述的存储控制器,所述存储控制器与M个所述固态硬盘之间相互通信,M为大于或等于1的整数,所述固态硬盘包括数据分区。
  27. 一种闪存阵列,其特征在于,包括存储控制器以及M个如权利要求15至20中任一项所述的固态硬盘,所述存储控制器与M个所述固态硬盘之间相互通信,M为大于或等于1的整数。
  28. 一种电子设备,其特征在于,包括主机以及闪存存储系统,所述主机与所述闪存存储系统之间相互通信,其中所述闪存存储系统执行如21至22任一项所述的数据写入方法。
  29. 一种计算机存储介质,其特征在于,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1至4中任一项所述固态硬盘配置方法,或9至14中任一项所述固态硬盘配置方法,或如权利要求23至25中任一项所述的垃圾回收方法。
  30. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1至4中任一项所述固态硬盘配置方法,或9至14中任一项所述固态硬盘配置方法,或如权利要求23至25中任一项所述的垃圾回收方法。
PCT/CN2023/102661 2022-10-11 2023-06-27 固态硬盘配置方法、垃圾回收方法以及相关设备 WO2024078012A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211243242.4 2022-10-11
CN202211243242.4A CN117909250A (zh) 2022-10-11 2022-10-11 固态硬盘配置方法、垃圾回收方法以及相关设备

Publications (1)

Publication Number Publication Date
WO2024078012A1 true WO2024078012A1 (zh) 2024-04-18

Family

ID=90668679

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/102661 WO2024078012A1 (zh) 2022-10-11 2023-06-27 固态硬盘配置方法、垃圾回收方法以及相关设备

Country Status (2)

Country Link
CN (1) CN117909250A (zh)
WO (1) WO2024078012A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170371781A1 (en) * 2015-06-30 2017-12-28 In-Hwan Choi Storage device and garbage collection method thereof
CN110531927A (zh) * 2019-08-06 2019-12-03 深圳大普微电子科技有限公司 一种基于块分级的垃圾回收方法及非易失性的存储设备
CN112631952A (zh) * 2020-12-25 2021-04-09 上海威固信息技术股份有限公司 一种固态硬盘冷热数据分离方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170371781A1 (en) * 2015-06-30 2017-12-28 In-Hwan Choi Storage device and garbage collection method thereof
CN110531927A (zh) * 2019-08-06 2019-12-03 深圳大普微电子科技有限公司 一种基于块分级的垃圾回收方法及非易失性的存储设备
CN112631952A (zh) * 2020-12-25 2021-04-09 上海威固信息技术股份有限公司 一种固态硬盘冷热数据分离方法

Also Published As

Publication number Publication date
CN117909250A (zh) 2024-04-19

Similar Documents

Publication Publication Date Title
US8959285B2 (en) Storage system with local and remote storage devices which are managed by the local storage device
US8645662B2 (en) Sub-lun auto-tiering
JP5347061B2 (ja) フラッシュメモリデータストレージデバイスにデータを格納するための方法及び装置
JP2018125025A (ja) 適応持続性システム、方法、インタフェース
CN107908571B (zh) 一种数据写入方法、闪存装置及存储设备
CN106909313A (zh) 存储器系统及控制方法
EP3382557B1 (en) Method and apparatus for persistently caching storage data in a page cache
JP2022539950A (ja) ストレージシステム、メモリ管理方法、および管理ノード
JP2019057151A (ja) メモリシステムおよび制御方法
US11409454B1 (en) Container ownership protocol for independent node flushing
WO2023125524A1 (zh) 数据存储方法、系统、存储访问配置方法及相关设备
US8769196B1 (en) Configuring I/O cache
CN113468083B (zh) 一种双端口NVMe控制器及控制方法
US20240053917A1 (en) Storage device, operation method of storage device, and storage system using the same
US20240020014A1 (en) Method for Writing Data to Solid-State Drive
WO2024078012A1 (zh) 固态硬盘配置方法、垃圾回收方法以及相关设备
CN110515861B (zh) 处理刷写命令的存储设备及其方法
WO2022021280A1 (zh) 存储控制器、存储控制方法、固态硬盘及存储系统
JP7490714B2 (ja) メモリシステムおよび制御方法
JP6200100B2 (ja) 計算機システム
US20240086110A1 (en) Data storage method, storage apparatus and host
US11782842B1 (en) Techniques for reclaiming dirty cache pages
US20230315344A1 (en) Maintaining qualiy of service of non-volatile memory devices in heterogeneous environment
JP2023137488A (ja) ストレージシステム及びデータキャッシュ方法
KR20230100522A (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: 23876222

Country of ref document: EP

Kind code of ref document: A1