Storage resource allocation method, device, computer equipment and storage medium

By allocating free data blocks in a data block set with high garbage collection efficiency to the data stream of the solid-state drive, the write amplification problem caused by low garbage collection efficiency is solved, and the overall efficiency and service life of the solid-state drive are improved.

CN118567581BActive Publication Date: 2024-09-24INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411044604.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-09-24
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

In solid-state drives using split data streaming technology, low garbage collection efficiency leads to increased write amplification and a decrease in overall efficiency.

Method used

By allocating free data blocks in the data block set with high garbage collection efficiency to the target data flow, the effective data quantity weight is used to determine the garbage collection efficiency of the data block set, and is allocated to the target data flow to avoid garbage collection speed. And the rapid consumption of free data blocks caused by low efficiency.

Benefits of technology

It improves the overall efficiency of the solid-state drive, reduces write amplification, and extends the service life of the solid-state drive.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567581B
    Figure CN118567581B
Patent Text Reader

Abstract

The present disclosure relates to the field of computer technology, and discloses a storage resource allocation method, device, computer equipment and storage medium. The method comprises: when there is a non-idle set in multiple data block sets of a target solid-state hard disk, obtaining the effective data quantity weight of each data block set in the multiple data block sets; according to the effective data quantity weight of each data block set, determining the data block set corresponding to the target data stream from the multiple data block sets; allocating the free data blocks in the data block set corresponding to the target data stream to the target data stream.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a storage resource allocation method, apparatus, computer equipment, and storage medium. Background Art

[0002] As solid state drives (SSDs) are increasingly used, businesses and applications have put forward higher requirements for the capacity, performance, and functions of SSDs, and data stream technology has been widely used. Data stream technology stores data of different types and hot and cold attributes separately. Data stream technology can improve the performance of SSDs in multi-user and multi-application scenarios and extend the life of SSDs. When data stream technology is applied to SSDs, all superblocks of SSDs are divided into multiple superluns. For a data stream, when the superblock allocated to the data stream is used up, that is, there is no free storage space in the superblock allocated to the data stream, the data stream applies for a free superblock and allocates a free superblock to the data stream. When a data stream applies for a free superblock, determining which superlun to allocate the free superblock to the data stream is the core of the data stream technology.

[0003] In the related art, when a data stream applies for a free superblock, the superlun with the largest number of free superblocks in the SSD to which the sub-data stream is applied is determined, and the free superblocks in the superlun with the largest number of free superblocks are allocated to the data stream. However, the free superblocks of the superlun with a large number of free superblocks may be rapidly consumed due to the garbage collection speed and efficiency, which increases the burden of garbage collection and increases write amplification. This ultimately leads to a decrease in the overall efficiency of the SSD to which the sub-data stream is applied. How to improve the overall efficiency of the SSD to which the sub-data stream is applied has become a problem that needs to be solved. Summary of the invention

[0004] In view of this, embodiments of the present disclosure provide a storage resource allocation method, apparatus, computer equipment, and storage medium.

[0005] In a first aspect, an embodiment of the present disclosure provides a storage resource allocation method, the method comprising:

[0006] When there is a non-free set among the multiple data block sets of the target solid-state hard disk, obtaining a valid data quantity weight of each data block set in the multiple data block sets, wherein the non-free set is a data block set including a number of free data blocks less than a free data block threshold, and the valid data quantity weight of the data block set is determined according to the number of valid data of the first data block in the data block set and the average number of valid data of the data blocks in the data block set, wherein the first data block is a data block having a valid data quantity less than the average number of valid data of the data blocks in the data block set;

[0007] Determining a data block set corresponding to a target data stream from the plurality of data block sets according to a weight of the effective data quantity of each data block set;

[0008] Allocate the idle data blocks in the data block set corresponding to the target data stream to the target data stream.

[0009] In a second aspect, an embodiment of the present disclosure provides a storage resource allocation device, the storage resource allocation device comprising:

[0010] A first acquisition unit is used to acquire a valid data quantity weight of each data block set in the multiple data block sets when there is a non-free set in the multiple data block sets of the target solid-state hard disk, wherein the non-free set is a data block set including a number of free data blocks less than a free data block threshold, and the valid data quantity weight of the data block set is determined according to the valid data quantity of a first data block in the data block set and an average value of the valid data quantity of the data blocks in the data block set, wherein the first data block is a data block having a valid data quantity less than the average value of the valid data quantity of the data blocks in the data block set;

[0011] A first determining unit, configured to determine a data block set corresponding to a target data stream from the plurality of data block sets according to a weight of a valid data quantity of each data block set;

[0012] The first allocation unit is used to allocate idle data blocks in the data block set corresponding to the target data stream to the target data stream.

[0013] In a third aspect, an embodiment of the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0014] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding implementation manner thereof.

[0015] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method of the first aspect or any corresponding embodiment thereof.

[0016] The storage resource allocation method provided by the embodiment of the present disclosure, when there is a non-free set in the multiple data block sets of the target solid-state hard disk, obtains the effective data quantity weight of each data block set in the multiple data block sets; according to the effective data quantity weight of each data block set, determines the data block set corresponding to the target data stream from the multiple data block sets; and allocates the free data blocks in the data block set corresponding to the target data stream to the target data stream. The size of the effective data quantity weight of the data block set can be related to the garbage collection efficiency of the data block set. The free data blocks in the data block set with a larger effective data quantity weight can be allocated to the target data stream, which is equivalent to allocating the free data blocks in the data block set with a higher garbage collection efficiency to the target data stream. Improve the overall efficiency of the solid-state hard disk. Avoid the following situation: the data block set with a large number of free data blocks may cause the free data blocks in the data block set with a large number of free data blocks to be consumed sharply due to the garbage collection speed and efficiency, which increases the burden of garbage collection and increases write amplification, resulting in a decrease in the overall efficiency of the solid-state hard disk. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 It is a flowchart of a storage resource allocation method provided by an embodiment of the present disclosure;

[0019] Figure 2 is a schematic diagram of an example of a relationship between a data block set of a target solid state drive and a data block of a target solid state drive;

[0020] Figure 3 is a flowchart of another storage resource allocation method provided by an embodiment of the present disclosure;

[0021] Figure 4It is a schematic diagram of an example of the distribution of the number of write and erase times of data blocks in a data block set;

[0022] Figure 5 is a flowchart of another storage resource allocation method provided by an embodiment of the present disclosure;

[0023] Figure 6 It is a schematic diagram of the effect of selecting the idle data blocks allocated to the target data stream according to the performance requirement parameters;

[0024] Figure 7 is a flowchart of an example of allocating free data blocks to a target data stream;

[0025] Figure 8 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present disclosure.

[0027] Before describing the storage resource allocation method provided by the embodiment of the present disclosure, some concepts involved in the storage resource allocation method provided by the embodiment of the present disclosure are first described.

[0028] RAID5: RAID 5 is a storage solution that takes into account storage performance, data security, and storage cost. RAID 5 can be understood as a compromise between RAID 0 (no redundancy) and RAID 1 (1:1 redundancy). It adopts the N+1 method, that is, N copies of valid data are matched with 1 copy of redundant data. Any N of the N+1 data can be used to reversely calculate another data, which is mainly used for data redundancy protection.

[0029] FTL: Flash Translation Layer, flash translation layer.

[0030] Stream: data stream. Stream ID is used to distinguish different types of data or data of different applications or businesses.

[0031] die / NAND block / page: Command concurrency unit on NAND. Only one operation command can be run on the same die at the same time. Different dies do not affect each other and can execute the same or different operation commands at the same time. Each die is composed of a fixed number of NAND blocks, and each NAND block is composed of pages with a fixed amount of data. The basic size of each page is 16K.

[0032] superblock: A collection of NAND blocks that make up a RAID group.

[0033] superlun: A collection of superblocks. The N+1 blocks that make up a superblock are all on different N+1 dies. All superblocks on a superlun are only distributed on these N+1 dies. These N+1 dies form a superlun.

[0034] GC: garbage collection, used to reclaim space within the SSD and release valid space.

[0035] WA: Write amplification. There is a difference between the amount of writes received by the upper-layer business and the amount actually written to NAND. The amount written to NAND will be more than the business writes. The extra part mainly comes from the garbage collection writes in the disk. WA=NAND write amount ÷ user write amount.

[0036] LBA: logical block address, the address used by applications to access SSDs, and has no direct relationship with NAND addresses.

[0037] PBA: Physical Block Address, physical address, the address used for storing data inside the SSD, which corresponds one-to-one with the NAND address.

[0038] L2P: logical to physical table, mapping table, used to represent the mapping relationship between LBA and PBA. Usually, there is a large L2P table in the SSD, which uses LBA as the index and PBA as the specific value to query the storage location of the data corresponding to the LBA.

[0039] VDFC: valid data frame count (VDFC for short). Each superblock can have one VDFC. VDFC can be counted based on the number of LBAs corresponding to valid data.

[0040] Wear leveling: NAND in SSD has an upper limit on the number of erase and write times. The purpose of wear leveling is to make the erase and write times of all blocks increase approximately synchronously, ensuring that the maximum, minimum and average erase and write times of all blocks are close to each other. However, a certain difference is allowed. This difference and the maximum erase and write times of NAND are determined by the NAND manufacturer.

[0041] OP: Over-provisioning refers to reserving a portion of space in the SSD for erase and rewrite operations. It is a necessary condition for the normal operation of garbage collection. OP is mainly used to improve the performance and life of the solid-state drive.

[0042] PE: Program-Erase, the number of write-erase times. Since NAND does not allow in-situ writing, it can only be written after erasing. Erasing is performed on a block basis and writing is performed on a page basis. Each block has a fixed number of pages, so the number of erase times and the number of write times are in a fixed ratio. In this way, PE usually refers to the number of erase times alone.

[0043] NAND is composed of multiple independent blocks. NAND does not allow in-situ writing. It needs to be erased before new data can be written. Block is the smallest erase unit on NAND, and is basically 50MB~200MB in size. When a certain data (such as LBA0 data) is written to a certain block (such as saved in PBA0 position), when LBA0 data is written again, the data cannot be written directly to PBA0. A new address (such as PBA1) needs to be fully allocated for writing. At this time, PBA1 and PBA0 may or may not be in the same block. At this time, only PBA1 is valid data, and the data on PBA0 is invalid. After continuing to write a large amount of data, the number of blocks will decrease due to the mechanism of off-site update. When it decreases to a certain level, garbage collection needs to be triggered to ensure that there are continuous free blocks for user writing. What garbage collection needs to do is that when erasing a block, the valid data in the block needs to be read out and written to other blocks before the block can be erased.

[0044] refer to Figure 1 , which shows a flow chart of the storage resource allocation method provided in an embodiment of the present disclosure.

[0045] In step S101, when there is a non-free set among the multiple data block sets of the target solid state drive, a weight of the effective data quantity of each data block set in the multiple data block sets is obtained.

[0046] It should be noted that in the embodiments of the present disclosure, a superblock may be referred to as a data block, and a superlun may be referred to as a data block set.

[0047] During the use of superblocks, the VDFC of each superblock needs to be recorded in real time. For a superblock, the VDFC of the superblock in the steps involving the VDFC of the superblock may specifically refer to the current VDFC of the superblock.

[0048] refer to Figure 2 , which shows a schematic diagram of an example of the relationship between the data block set of the target solid state drive and the data blocks of the target solid state drive.

[0049] Figure 2 The data block set 0, data block set 1, data block set 2, and data block set 3 of the target solid-state drive are shown. Data block set 0 includes: data block A0, data block B0, data block C0, and data block D0. Data block set 1 includes: data block A1, data block B1, data block C1, and data block D1. Data block set 2 includes: data block A2, data block B2, data block C2, and data block D2. Data block set 3 includes: data block A3, data block B3, data block C3, and data block D3. As an example, the target solid-state drive can have 4N dies, N blocks can form a RAID 5 stripe, and each N die can form a data block set of the target solid-state drive. For each stream, when the data stream applies for a free data block, the corresponding free superblock in the corresponding superlun is allocated to the stream. The data write volume and speed of each steam are different, which may cause different usage of superblocks on each superlun.

[0050] In the embodiment of the present disclosure, the free data block may refer to a data block in an idle state, that is, a free state. The free data block may be called a freesuperblock.

[0051] Data blocks other than free data blocks may be called non-free data blocks. Non-free data blocks store data written to non-free data blocks. Non-free data blocks may be called used superblocks.

[0052] In the embodiment of the present disclosure, the non-free set is: a data block set including a number of free data blocks that is less than a free data block threshold.

[0053] In a possible implementation, the free data block threshold may be: a preset percentage of the number of data blocks in the data block set. The preset percentage may be one of 10% to 20%. Normally, the OP of an SSD is 10% to 20%. When the remaining space reaches the OP amount, garbage collection is usually about to start. At this time, relevant controls such as strict control of the write speed are required to ensure stable writing under garbage collection.

[0054] In the embodiment of the present disclosure, for a data block set, the weight of the effective data quantity of the data block set is determined according to the effective data quantity of the first data block in the data block set and the average value of the effective data quantity of the data blocks in the data block set.

[0055] For a data block set, the first data block in the data block set is a data block having a valid data quantity that is less than an average value of the valid data quantity of the data blocks in the data block set.

[0056] It should be noted that, for a data block set, the size of the VDFC weight of the data block set may be related to the garbage collection efficiency of the data block set. A larger VDFC weight of the data block set may mean that the garbage collection efficiency of the data block set is higher. A smaller VDFC weight of the data block set may mean that the garbage collection efficiency of the data block set is lower.

[0057] Garbage collection refers to aggregating the valid data of N non-free data blocks, namely used superblocks, and writing them into other M free data blocks, namely free superblocks. Then, the original N used superblocks are erased and converted into free superblocks, so that the number of free superblocks increases from M to N. The smaller the VDFC of the N used superblocks in a data block set, namely superlun, the greater the VDFC weight of the data block set, and the smaller M, the higher the garbage collection efficiency of the data block set.

[0058] In a possible implementation, for a data block set, obtaining the weight of the effective data quantity of the data block set includes steps S1011 to S1013.

[0059] In step S1011, a valid data quantity difference value of the data block set is obtained, wherein the valid data quantity difference value of the data block set includes: a difference between the valid data quantity of each first data block in the data block set and an average value of the valid data quantity of the data blocks in the data block set.

[0060] Among them, for a first data block in the data block set, the difference between the valid data quantity of the first data block and the average valid data quantity of the data blocks in the data block set can be: the average valid data quantity of the data blocks in the data block set minus the valid data quantity of the first data block.

[0061] In step S1012, the garbage collection efficiency of the data block set is determined according to the difference between the number of valid data of each first data block in the data block set and the average number of valid data of the data blocks in the data block set.

[0062] In step S1012, the sum of each item in the difference in the amount of valid data of the data block set may be determined as the garbage collection efficiency of the data block set.

[0063] In step S1013, the garbage collection efficiency of the data block set may be used to determine the weight of the effective data quantity of the data block set.

[0064] In step S102, a data block set corresponding to a target data stream is determined from a plurality of data block sets according to a weight of the effective data quantity of each data block set.

[0065] In step S102, a data block set having a larger weight of the effective data quantity may be determined as a data block set corresponding to the target data stream.

[0066] In a possible implementation, a data block set having the largest weight of the effective data quantity may be determined as the data block set corresponding to the target data stream.

[0067] In another possible implementation, multiple data block sets are sorted from high to low according to the weight of the number of valid data, and the data block set with the largest number of free data blocks among the first preset number of data block sets is determined as the data block set corresponding to the target data stream.

[0068] In step S103, free data blocks in the data block set corresponding to the target data stream are allocated to the target data stream.

[0069] Thus, the data of the target data stream can be written into the free data blocks in the data block set corresponding to the target data stream.

[0070] In step S103, an idle data block may be randomly selected from all idle data blocks in the data block set corresponding to the target data stream, and the randomly selected idle data block may be allocated to the target data stream.

[0071] For a data block set, the higher the garbage collection efficiency of the data block set, the faster and more efficiently the data block set can recycle more free superblocks, and the faster the number of free superblocks grows.

[0072] In the disclosed embodiment, the size of the VDFC weight of a data block set may be related to the garbage collection efficiency of the data block set. A data block set having a larger weight of the number of valid data may be determined as a data block set corresponding to a target data stream, and free data blocks in the data block set corresponding to the target data stream may be allocated to the target data stream, which is equivalent to allocating free data blocks in a data block set having a higher garbage collection efficiency to the target data stream. The overall efficiency of the solid-state drive is improved. The following situation may be avoided: a data block set having a large number of free data blocks may have a sharp consumption of free data blocks in a data block set having a large number of free data blocks due to the speed and efficiency of garbage collection, which in turn increases the burden of garbage collection, increases write amplification, and leads to a decrease in the overall efficiency of the solid-state drive.

[0073] refer to Figure 3 , which shows a flow chart of another storage resource allocation method provided by an embodiment of the present disclosure.

[0074] In step S301, when there is a non-free set among the multiple data block sets of the target solid state drive, a weight of the effective data quantity of each data block set in the multiple data block sets is obtained.

[0075] For a data block set, obtaining the VDFC weight of the data block set includes steps S3011 to S3015.

[0076] In step S3011, the difference in the number of valid data in the data block set is obtained.

[0077] The effective data quantity difference of the data block set includes: a difference between the effective data quantity of each first data block in the data block set and an average value of the effective data quantity of the data blocks in the data block set.

[0078] Among them, for a first data block in the data block set, the difference between the valid data quantity of the first data block and the average valid data quantity of the data blocks in the data block set can be: the average valid data quantity of the data blocks in the data block set minus the valid data quantity of the first data block.

[0079] In step S3012, the garbage collection efficiency of the data block set is determined according to the difference in the amount of valid data in the data block set.

[0080] The sum of each item in the difference in the amount of valid data of the data block set may be determined as the garbage collection efficiency of the data block set.

[0081] In step S3013, the difference in the number of data blocks in the data block set is obtained.

[0082] The difference in the number of data blocks in the data block set is: the difference between the number of non-free data blocks in the data block set and the number of free data blocks in the data block set.

[0083] The difference between the number of non-free data blocks in the data block set and the number of free data blocks in the data block set may be: the number of non-free data blocks in the data block set minus the number of free data blocks in the data block set.

[0084] In step S3014, a parameter related to the weight of the effective data quantity of the data block set is determined according to the data block quantity difference of the data block set.

[0085] The data block quantity difference of the data block set may be determined as a parameter related to the valid data quantity weight of the data block set.

[0086] In the embodiment of the present disclosure, for a data block set, the parameter related to the weight of the effective data quantity of the data block set may be related to the VDFC weight of the data block set.

[0087] If the parameter related to the effective data quantity weight of the data block set is small, the VDFC weight of the data block set can be large. If the parameter related to the effective data quantity weight of the data block set is large, the VDFC weight of the data block set can be small.

[0088] In step S3015, the weight of the valid data quantity of the data block set is determined according to the garbage collection efficiency of the data block set and parameters related to the weight of the valid data quantity of the data block set.

[0089] In a possible implementation, in step S3015, the garbage collection efficiency of the data block set may be divided by a parameter related to the valid data quantity weight of the data block set to obtain the valid data quantity weight of the data block set.

[0090] In the disclosed embodiment, the effect of the parameters related to the weight of the number of valid data of the data block set on the garbage collection efficiency of the data block set is taken into consideration. Thus, the effect of the parameters related to the weight of the number of valid data of the data block set on the overall efficiency of the target solid-state drive is taken into consideration. The overall efficiency of the target solid-state drive is further improved. The following situation can be avoided: for a data block set, the number of non-free data blocks, i.e., usedsuperblocks, in the data block set is large, and the number of free data blocks, i.e., free superblocks, in the data block set is small. If the free superblocks in the data block set are allocated to the target data stream, it may result in that the free superblocks in the data block set have been consumed before the actual effect of the recycling has been produced, resulting in the garbage collection for the data block set not being able to operate normally.

[0091] In a possible implementation, step S3011 includes: adding the square of each item in the difference of the number of valid data of the data block set to obtain an addition result, and determining the addition result as the garbage collection efficiency of the data block set.

[0092] In a possible implementation, step S3012 includes: determining the product of the data block quantity difference of the data block set and the quantity of non-free data blocks in the data block set as a parameter related to the weight of the valid data quantity of the data block set.

[0093] In a possible implementation, the following formula is used to determine the weight of the effective data quantity of the data block set:

[0094]

[0095] in, Represents the VDFC weight of the data block set, Indicates the number of non-free data blocks in the data block set. Indicates the number of free data blocks in the data block set;

[0096] A parameter representing the weight of the effective data quantity of the data block set;

[0097] represents the VDFC of the i-th data block in the data block set, Represents the average value of the VDFC of the data blocks in the data block set. When the VDFC of the i-th data block in the data block set is less than the average value of the VDFC of the data blocks in the data block set, , when the VDFC of the i-th data block in the data block set is greater than or equal to the average VDFC of the data blocks in the data block set .

[0098] In step S302, when the effective data quantity weight balancing condition is met, at least one first target data block set is determined from multiple data block sets; and a data block set corresponding to a target data stream is determined from the at least one first target data block set.

[0099] The effective data quantity weight balancing condition is that the difference between the effective data quantity weights of any two data block sets in the multiple data block sets is less than the effective data quantity weight difference threshold.

[0100] Step S302 includes steps S3021 to S3023.

[0101] In step S3021, when the weighted balance condition of the number of valid data is met, the distribution characteristics of the number of write and erase times of each data block set are obtained.

[0102] In an embodiment of the present disclosure, the write-erase count distribution characteristics of a data block set may indicate one of the following items: the weight of the cold data write-erase count of the data block set is close to the weight of the hot data write-erase count of the data block set, the data block set is suitable for storing cold data, and the data block set is suitable for storing hot data.

[0103] For a data block set, the cold data write-erase count weight of the data block set is close to the hot data write-erase count weight of the data block set, which can mean that the difference between the cold data write-erase count weight of the data block set and the hot data write-erase count weight of the data block set is less than or equal to the write-erase count weight difference threshold.

[0104] The difference between the weight of the number of cold data write-erasure times of the data block set and the weight of the number of hot data write-erasure times of the data block set is: the larger of the weight of the number of cold data write-erasure times of the data block set and the weight of the number of hot data write-erasure times of the data block set minus the smaller of the weight of the number of cold data write-erasure times of the data block set and the weight of the number of hot data write-erasure times of the data block set.

[0105] For a data block set, obtaining the write / erase times distribution characteristics of the data block set includes: step S30211 to step S30213.

[0106] In step S30211, the weight of the number of write-erase times of cold data in the data block set is determined according to the number of write-erase times of the second data block in the data block set.

[0107] The second data block in the data block set is a data block having a write-erase count that is less than an average value of the write-erase counts of the data blocks in the data block set.

[0108] In step S30211, the sum of the differences between the number of write / erase times of each second data block in the data block set and the average number of write / erase times of the data blocks in the data block set may be calculated, and the sum may be used as the first difference corresponding to the second data block in the data block set.

[0109] For a second data block in the data block set, the difference between the number of write and erase times of the second data block and the average number of write and erase times of the data blocks in the data block set can be: the number of write and erase times of the second data block minus the average number of write and erase times of the data blocks in the data block set.

[0110] In step S30211, the write / erase count of the data block with the smallest write / erase count in the data block set may be subtracted from the average write / erase count of the data blocks in the data block set to obtain a second difference value corresponding to the second data block in the data block set.

[0111] In step S30211, the first difference value corresponding to the second data block in the data block set may be divided by the second difference value corresponding to the second data block in the data block set to obtain a cold data write-erase count weight of the data block set.

[0112] In step S30212, the weight of the number of write-erase times of hot data in the data block set is determined according to the number of write-erase times of the third data block in the data block set.

[0113] The third data block in the data block set is a data block having a write-erase count greater than an average value of the write-erase counts of the data blocks in the data block set.

[0114] In step S30212, the sum of the differences between the number of write / erase times of each third data block in the data block set and the average number of write / erase times of the data blocks in the data block set may be calculated, and the sum may be used as the first difference corresponding to the third data block in the data block set.

[0115] For a third data block in the data block set, the difference between the number of write and erase times of the third data block and the average number of write and erase times of the data blocks in the data block set can be: the number of write and erase times of the third data block minus the average number of write and erase times of the data blocks in the data block set.

[0116] In step S30212, the write / erase count of the data block with the largest write / erase count in the data block set may be subtracted from the average write / erase count of the data blocks in the data block set to obtain a second difference value corresponding to the third data block in the data block set.

[0117] In step S30212, the first difference value corresponding to the third data block in the data block set may be divided by the second difference value corresponding to the third data block in the data block set to obtain the hot data write-erase count weight of the data block set.

[0118] In step S30213, the write-erase count distribution characteristics of the data block set are determined according to the cold data write-erase count weight and the hot data write-erase count weight of the data block set.

[0119] In step S30213, if the weight of the number of write-erasure times of cold data of the data block set is close to the weight of the number of write-erasure times of hot data of the data block set, then the write-erasure times distribution characteristic of the data block set indicates that the weight of the number of write-erasure times of cold data of the data block set is close to the weight of the number of write-erasure times of hot data of the data block set.

[0120] In step S30213, if the result obtained by subtracting the weight of the number of write-erase times of hot data of the data block set from the weight of the number of write-erase times of cold data of the data block set is greater than the write-erase times weight difference threshold, then the write-erase times distribution characteristics of the data block set indicate that the data block set is suitable for storing cold data.

[0121] In step S30213, if the result obtained by subtracting the weight of the number of write-erase times of cold data of the data block set from the weight of the number of write-erase times of hot data of the data block set is greater than the write-erase times weight difference threshold, then the write-erase times distribution characteristics of the data block set indicate that the data block set is suitable for storing hot data.

[0122] In one possible implementation, step S30211 includes: for a data block set, determining the cold data write-erase count weight of the data block set based on the difference between the write-erase count of each second data block in the data block set and the average write-erase count of the data blocks in the data block set, and the difference between the write-erase count of each second data block in the data block set and the first write-erase count quantile corresponding to the data block set, wherein the first write-erase count quantile is greater than the write-erase count of the data block with the smallest write-erase count in the data block set and is less than the average write-erase count of the data blocks in the data block set.

[0123] The first write-erase count quantile corresponding to the data block set is the quantile at the first quantile.

[0124] The first quantile is: the ratio of the number of data blocks in the data block set having a write-erase count less than the first write-erase count quantile corresponding to the data block set to the total number of data blocks included in the data block set.

[0125] As an example, the first write-erase count quantile corresponding to the data block set is a quantile at the 25% quantile.

[0126] In a possible implementation, the cold data write-erase times weight of the data block set may be calculated using the following formula:

[0127]

[0128] in, Indicates the weight of the number of cold data writes and erases for the data block set. Indicates the number of write and erase times of the i-th data block in the data block set. Indicates the write-erase count of the data block with the smallest write-erase count in the data block set. Indicates the average number of write and erase times of the data blocks in the data block set. Indicates the first write-erase count quantile corresponding to the data block set. When the write-erase count of the i-th data block in the data block set is less than the average write-erase count of the data blocks in the data block set When the write-erase count of the ith data block in the data block set is not less than the average write-erase count of the data blocks in the data block set, is 0.

[0129] In one possible implementation, step S30212 includes: for a data block set, determining the hot data write-erase count weight of the data block set based on the difference between the write-erase count of each third data block in the data block set and the average write-erase count of the data blocks in the data block set, and the difference between the write-erase count of each third data block in the data block set and the second write-erase count quantile corresponding to the data block set, wherein the second write-erase count quantile is greater than the average write-erase count of the data blocks in the data block set and the second write-erase count quantile is less than the write-erase count of the data block with the largest write-erase count in the data block set.

[0130] The second write-erase count quantile corresponding to the data block set is greater than the first write-erase count quantile corresponding to the data block set.

[0131] The second write-erase count quantile corresponding to the data block set is the quantile at the second quantile.

[0132] The second quantile is: the ratio of the number of data blocks in the data block set having a write-erase count less than the second write-erase count quantile corresponding to the data block set to the total number of data blocks included in the data block set.

[0133] As an example, the second write-erase count quantile corresponding to the data block set is a quantile at the 75% quantile.

[0134] In a possible implementation, the following formula may be used to calculate the weight of the number of hot data write-erase times of the data block set:

[0135]

[0136] Indicates the weight of the number of times the hot data is written and erased for this data block set. Indicates the number of write and erase times of the i-th data block in the data block set. Indicates the write and erase times of the data block with the largest write and erase times in the data block set. Indicates the average number of write and erase times of the data blocks in the data block set. Indicates the second write-erase count quantile corresponding to the data block set. When the write-erase count of the i-th data block in the data block set is greater than the average write-erase count of the data blocks in the data block set is 1, the number of write and erase times of the i-th data block in the data block set is not greater than the average number of write and erase times of the data blocks in the data block set, is 0.

[0137] refer to Figure 4 , which is a schematic diagram showing an example of the distribution of the number of write and erase times of data blocks in a data block set.

[0138] Figure 4 The horizontal axis is the axis of the number of write and erase times of a data block. Figure 4 The vertical axis shown is the axis of the number of data blocks. Figure 4 The write-erase count PE0 and the quantile PE0 at the 25% quantile of the data block with the smallest write-erase count in the data block set are shown. 25 , 75% percentile PE 75 , the write-erase count PE of the data block with the largest write-erase count in the data block set 100 PE 25 It can be considered as (PE0+PE avg ) / 2. PE 75 It can be considered as (PE 100 +PE avg ) / 2. Figure 4 The curve shown can reflect the distribution of the number of write and erase times of the data blocks in the data block set. Figure 4 The horizontal axis value of a point on the curve is a write-erase number. Figure 4The ordinate value of a point on the curve is the number of data blocks in the data block set whose number of write-erase times is the abscissa value of the point.

[0139] In step S3022, at least one first target data block set is determined from the multiple data block sets according to the write / erase times distribution characteristics of each data block set.

[0140] In step S3022, the cold and hot attributes of the target data stream may be obtained. The cold and hot attributes of the target data stream indicate one of the following items: the target data stream is a cold data stream, or the target data stream is a hot data stream.

[0141] The data type indicated by the target data stream is one of the following: cold data type, hot data type.

[0142] In step S3022, at least one first target data block set may be determined from multiple data block sets according to the hot and cold attributes of the target data stream and the write and erase times distribution characteristics of each data block set.

[0143] If there is a data block set whose write-erase times distribution characteristic indicates that the weight of the cold data write-erase times of the data block set is close to the weight of the hot data write-erase times of the data block set, the data block set whose write-erase times distribution characteristic indicates that the weight of the cold data write-erase times of the data block set is close to the weight of the hot data write-erase times of the data block set can be determined as the first target data block set.

[0144] If there is a data block set whose write-erase count distribution characteristics indicate that the data type indicated by the cold and hot attributes of the target data stream is suitable for storing data blocks, the data block set whose write-erase count distribution characteristics indicate that the data type indicated by the cold and hot attributes of the target data stream is suitable for storing data blocks is determined as the first target data block set.

[0145] In the disclosed embodiment, at least one first target data block set is determined from a plurality of data block sets, and finally a data block set corresponding to a target data stream is determined from the at least one first target data block set. The balance between the amount of cold data in the data block set and the amount of hot data in the data block set can be achieved. The overall efficiency of the target solid-state drive is further improved. It is avoided that cold data or hot data are stored in one data block set, and the overall efficiency of the target solid-state drive is reduced due to the imbalance between the amount of cold data in the data block set and the amount of hot data in the data block set.

[0146] In a possible implementation, step S3022 includes: when the write-erase times weighted balance condition is not satisfied, determining at least one second target data block set from a plurality of data block sets.

[0147] The write-erase count weight balancing condition is that the write-erase count distribution characteristics of each data block set in the multiple data block sets indicate that the write-erase count weight of the cold data of the data block set is close to the write-erase count weight of the hot data of the data block set.

[0148] That is, the weight of the number of times cold data is written and erased of any set of data blocks is close to the weight of the number of times hot data is written and erased of the any set of data blocks.

[0149] In the disclosed embodiment, the write / erase times distribution characteristic of the second target data block set indicates that the second target data block set is suitable for storing data of the data type indicated by the hot / cold attribute of the target data stream.

[0150] That is, the second target data block set is a target data block set having a write / erase times distribution characteristic indicating that the data type indicated by the hot / cold attribute of the target data stream is suitable for storing.

[0151] In step S3022, when the write-erase times weighted balance condition is not satisfied, each second target data block set may be used as a first target data block set.

[0152] In a possible implementation, step S3022 includes: when a weighted balance condition of the number of write and erase times is met, each data block set in the plurality of data block sets may be used as a first target data block set.

[0153] In step S3023, a data block set corresponding to the target data stream is determined from at least one first target data block set.

[0154] When a first target data block set is determined, the first target data block set is determined as a data block set corresponding to the target data stream.

[0155] When multiple first target data block sets are determined, one first target data block set may be randomly selected from the multiple first target data block sets, and the randomly selected first target data block set may be determined as the data block set corresponding to the target data stream.

[0156] In step S303, free data blocks in the data block set corresponding to the target data stream are allocated to the target data stream.

[0157] Thus, the data of the target data stream can be written into the free data blocks in the data block set corresponding to the target data stream.

[0158] refer to Figure 5 , which shows a flow chart of yet another storage resource allocation method provided in an embodiment of the present disclosure.

[0159] In step S501, when there is a non-free set among the multiple data block sets of the target solid state drive, a weight of the amount of valid data of each data block set among the multiple data block sets is obtained.

[0160] In step S502, when there is a non-free set among the multiple data block sets and the weighted balance condition of the number of valid data and the weighted balance condition of the number of write and erase times are met, the data block set corresponding to the target data stream is determined according to the performance requirement parameters of each first target data block set.

[0161] Step S502 includes: step S5021-step S5022.

[0162] In step S5021, when there is a non-free set among the multiple data block sets and the weighted balance condition of the number of valid data is met, it is determined whether the weighted balance condition of the number of write and erase times is met; when it is determined that the weighted balance condition of the number of write and erase times is met, each data block set in the multiple data block sets is used as the first target data block set.

[0163] In step S5022, when the write-erase times weighted balance condition is met, a data block set corresponding to the target data stream is determined according to the performance requirement parameters of each first target data block set.

[0164] Step S5022 includes: when the write-erase times weighted balance condition is met, obtaining the performance requirement parameter of each first target data block set, and determining the first target data block set with the smallest performance requirement parameter as the data block set corresponding to the target data stream.

[0165] For a first target data block set, obtaining the performance requirement parameters of the first target data block set includes: step S50221-step S50222.

[0166] In step S50221, a data writing amount parameter for each data stream corresponding to the first target data block set within a statistical time period is obtained.

[0167] The data stream corresponding to the first target data block set is: a data stream having data written into data blocks in the first target data block set within a statistical time period.

[0168] For a data stream corresponding to the first target data block set, the data writing amount of the data stream for the first target data block set within the statistical time period can be used as the data writing amount parameter of the data stream for the first target data block set within the statistical time period.

[0169] For a data stream corresponding to the first target data block set, the data write amount of the data stream to the first target data block set within a time period can be represented by: how much data of the data stream is written to the data blocks in the first target data block set within the time period.

[0170] In step S50222, the performance requirement parameters of the first target data block set are determined according to the data writing amount parameters of each data stream corresponding to the first target data block set within the statistical time period for the first target data block set.

[0171] In step S50222, the sum of the data write amount parameters for the first target data block set for each data stream corresponding to the first target data block set within the statistical time period may be calculated, and the sum may be determined as the performance requirement parameter of the first target data block set.

[0172] In a possible implementation, the statistical time period may include: multiple sub-statistical time periods. Multiple sub-statistical time periods may have the same duration. Step S50221 includes: for a first target data block set, according to the data writing amount of a data stream corresponding to the first target data block set for the first target data block set in each sub-statistical time period and the weight of the data writing amount of the data stream for the first target data block set in each sub-statistical time period, determine the data writing amount parameter of the data stream for the first target data block set in the statistical time period.

[0173] In step S50221, for a first target data block set, a weighted sum of the data write amounts of a data stream corresponding to the first target data block set for the first target data block set in each sub-statistical time period can be calculated, and the weighted sum can be divided by the sum of the weights of the data write amounts of the data stream for the first target data block set in each sub-statistical time period to obtain a data write amount parameter of the data stream for the first target data block set in the statistical time period.

[0174] In a possible implementation, for a first target data block set, the weight of the amount of data written to the first target data block set by a data stream corresponding to the first target data block set in a sub-statistical time period is: the weight of the sub-statistical time period, and the size of the weight of the sub-statistical time period is related to the early or late time of the sub-statistical time period. The earlier the sub-statistical time period, the smaller the weight of the sub-statistical time period, and the smaller the weight of the amount of data written to the first target data block set by the data stream in the sub-statistical time period. The later the sub-statistical time period, the larger the weight of the sub-statistical time period, and the larger the weight of the amount of data written to the first target data block set by the data stream in the sub-statistical time period.

[0175] In a possible implementation, step S50222 includes: for each data stream corresponding to a first target data block set, determining a data write amount fluctuation parameter of the data stream for the first target data block set within a statistical time period according to a data write amount difference of the data stream for the first target data block set in each sub-statistical time period group, wherein the sub-statistical time period group includes: two adjacent sub-statistical time periods within the statistical time period, and the data write amount difference of the data stream for the first target data block set in a sub-statistical time period group is: a difference between a data write amount of the data stream for the first target data block set in the latest sub-statistical time period in the sub-statistical time period group and a data write amount of the data stream for the first target data block set in the earliest sub-statistical time period in the sub-statistical time period group; determining a performance requirement parameter of the first target data block set according to a data write amount parameter of each data stream corresponding to the first target data block set for the first target data block set within the statistical time period and a data write amount fluctuation parameter of each data stream corresponding to the first target data block set for the first target data block set within the statistical time period.

[0176] For a data stream corresponding to a first target data block set, the difference between the amount of data written by the data stream for the first target data block set in the latest sub-statistical time period in the sub-statistical time period group and the amount of data written by the data stream for the first target data block set in the earliest sub-statistical time period in the sub-statistical time period group is: the amount of data written by the data stream for the first target data block set in the latest sub-statistical time period in the sub-statistical time period group minus the amount of data written by the data stream for the first target data block set in the earliest sub-statistical time period in the sub-statistical time period group.

[0177] In step S50222, for a data stream of a first target data block set, the sum of the data write amount differences for the first target data block set of the data stream in each sub-statistical time period group is calculated, and the sum is determined as the data write amount fluctuation parameter of the data stream for the first target data block set within the statistical time period.

[0178] In step S50222, for each data stream corresponding to a first target data block set, the sum of a data write amount parameter of the data stream for the first target data block set during the statistical time period and a data write amount fluctuation parameter of the data stream for the first target data block set during the statistical time period is calculated and determined as a performance requirement parameter of the data stream for the first target data block set during the statistical time period.

[0179] In step S50222, for a first target data block set, the sum of the performance requirement parameters for the first target data block set for each data stream corresponding to the first target data block set within the statistical time period is calculated, and the sum is determined as the performance requirement parameter of the first target data block set.

[0180] In one possible implementation, step S50222 includes: for each data stream corresponding to a first target data block set, determining the data write amount fluctuation parameter of the data stream for the first target data block set within the statistical time period according to the data write amount difference of the data stream for the first target data block set in each sub-statistical time period group and the weight of the data write amount difference of the data stream for the first target data block set in each sub-statistical time period group.

[0181] In step S50222, for a data stream corresponding to a first target data block set, a weighted sum of the data write amount differences of the data stream for the first target data block set in each sub-statistical time period group can be calculated, and the weighted sum is divided by the sum of the weights of the data write amount differences of the data stream for the first target data block set in each sub-statistical time period group to obtain a data write amount fluctuation parameter of the data stream for the first target data block set within the statistical time period.

[0182] In a possible implementation, for a data stream corresponding to a first target data block set, the weight of the data stream's data write amount difference for the first target data block set in the sub-statistical time period group is the weight of the latest sub-statistical time period in the sub-statistical time period group. The earlier the latest sub-statistical time period in the sub-statistical time period group, the smaller the weight of the latest sub-statistical time period in the sub-statistical time period group, and the smaller the weight of the data stream's data write amount difference for the first target data block set in the sub-statistical time period group. The later the latest sub-statistical time period in the sub-statistical time period group, the greater the weight of the latest sub-statistical time period in the sub-statistical time period group, and the greater the weight of the data stream's data write amount difference for the first target data block set in the sub-statistical time period group.

[0183] In a possible implementation, in step S50222, the performance requirement parameter of a data stream corresponding to a first target data block set for the first target data block set may be determined by using the following formula:

[0184]

[0185] A performance requirement parameter for a data stream corresponding to the first target data block set for the first target data block set;

[0186] Indicates a data writing amount fluctuation parameter for a data stream corresponding to the first target data block set within a statistical time period for the first target data block set;

[0187] A parameter indicating the amount of data written to the first target data block set by a data stream corresponding to the first target data block set within a statistical time period;

[0188] is the number of sub-statistical time periods within the statistical time period. represents the amount of data written to the first target data block set by the data stream in the tth sub-statistical time period indicated by the order of the statistical sub-time periods, represents the amount of data written to the first target data block set in the t-1th sub-statistical time period indicated by the order of the statistical sub-time periods, where the order of the statistical sub-time periods is obtained by sorting multiple sub-statistical time periods in the statistical time period from the earliest to the latest, represents the weight of the t-th sub-statistical time period, represents the amount of data written to the first target data block set in the t1th statistical sub-time period indicated by the order of the statistical sub-time periods of the data stream, represents the amount of data written to the first target data block set in the t1-1th statistical sub-time period indicated by the order of the statistical sub-time periods of the data stream, Indicates the weight of the t1th statistical sub-time period.

[0189] An example of the relationship between the data stream corresponding to the first target data block set and the performance requirement parameters of the first target data block set is shown in Table 1.

[0190] Table 1

[0191]

[0192] Data stream 0 and data stream 1 are both data streams corresponding to the first data block set 0. The performance requirement parameter of the first data block set 0 is: the performance requirement parameter of data stream 0 for the first target data block set 0 during the statistical time period is The performance requirement parameter of data stream 1 for the first target data block set 0 during the statistical time period is The sum.

[0193] Data stream 2 is the data stream corresponding to the first target data block set 1. The performance requirement parameter of the first target data block set 1 is: the performance requirement parameter of data stream 2 for the first target data block set 1 within the statistical time period is .

[0194] Data stream 3 is the data stream corresponding to the first target data block set 2. The performance requirement parameter of the first target data block set 2 is: the performance requirement parameter of data stream 3 for the first target data block set 2 within the statistical time period is .

[0195] Data stream 4 is the data stream corresponding to the first target data block set 3. The performance requirement parameter of the first target data block set 3 is: the data write amount parameter of data stream 4 for the first target data block set 3 within the statistical time period is .

[0196] refer to Figure 6 , which shows a schematic diagram of the effect of selecting free data blocks allocated to the target data flow according to performance requirement parameters.

[0197] Figure 6 A plurality of data block sets and data blocks in the data block sets are shown. Figure 6 The dotted box in the figure indicates that the data block has been allocated to the corresponding data stream. Assume that stream3 applies for superblock. Data block A0 in superlun 0 and data block D0 in superlun 0 are allocated to stream1 and stream4 respectively. Data block B1 in superlun 1 is allocated to stream2. Superlun 2 and superlun 3 are not allocated to streams. The performance requirements of superlun 2 and superlun 3 are small. The data block set corresponding to the target data stream is selected from superlun 2 and superlun 3, and the free data block in one of superlun 2 and superlun 3 is allocated to the target data stream.

[0198] In step S503, when there is a non-free set among multiple data block sets and the weighted balance condition of the number of valid data and the weighted balance condition of the number of write and erase times are met, the free data blocks in the data block set corresponding to the target data stream determined according to the performance requirement parameters of each first target data block set are allocated to the target data stream.

[0199] Thus, the data of the target data stream can be written into the free data blocks in the data block set corresponding to the target data stream.

[0200] In step S504, when there is no non-free set among the multiple data block sets of the target solid state drive, the performance requirement parameters of each data block set in the multiple data block sets are obtained; and the data block set with the smallest performance requirement parameters among the multiple data block sets is determined as the data block set corresponding to the target data stream.

[0201] The process of obtaining the performance requirement parameters of each data block set in the multiple data block sets refers to the above-mentioned process of obtaining the performance requirement parameters of each first target data block set.

[0202] In step S505, when there is no non-idle set in the plurality of data block sets, the idle data blocks in the data block set corresponding to the target data stream are allocated to the target data stream.

[0203] In the disclosed embodiment, the performance requirements of the data block set are considered when determining the data block set corresponding to the target data stream. The free data blocks in the data block set with smaller performance requirements are allocated to the target data stream, which can further improve the overall performance of the target solid-state drive. The following situation can be avoided: if the free data blocks in a data block set are allocated to a large number of data streams, the large number of data streams will share the same NAND concurrency unit, and wait for each other, resulting in a decrease in the overall performance of the target solid-state drive.

[0204] refer to Figure 7 , which shows a flowchart of an example of allocating free data blocks to a target data stream.

[0205] In this example, the target data stream, namely the target stream, applies for a free data block, namely a free superblock.

[0206] In this example, if multiple data block sets, ie, multiple superluns, are all idle sets, the performance requirement parameters of each data block set are obtained, and the superlun with the smallest performance requirement parameter can be determined as the data block set corresponding to the target stream.

[0207] In this example, if a non-idle set exists among the multiple data block sets, the VDFC weight of each superlun is obtained.

[0208] In this example, when the weight of the valid data quantity (VDFC) is unbalanced, that is, the valid data quantity weight balance condition is not met, the data block set with the largest VDFC weight can be used as the superlun corresponding to the target stream. The free superblock in the superlun corresponding to the target stream is allocated to the target stream.

[0209] In this example, when the weight of the valid data quantity (VDFC) is not unbalanced, that is, the valid data quantity weight balance condition is met, the write-erase times distribution feature of each superlun, that is, the PE distribution feature, is obtained. According to the PE distribution feature of each superlun, it is determined whether the PE weight is balanced.

[0210] In this example, when the PE weight is unbalanced, that is, the write-erase times weight balance condition is not met, the hot and cold attributes of the target stream are determined. At least one second target superlun is determined from multiple superluns. Among them, the PE distribution characteristics of the second target superlun indicate that the second target superlun is suitable for storing data of the data type indicated by the hot and cold attributes of the target stream. A superlun corresponding to the target stream is determined from at least one second target superlun. A free data block, i.e., a free superblock, in the superlun corresponding to the target stream is allocated to the target stream.

[0211] In this example, when the PE distribution weight is balanced, that is, the write-erase weight balance condition is met, the performance requirement parameters of each superlun are obtained, and the superlun with the smallest performance requirement parameter is determined as the superlun corresponding to the target stream. The free superblock in the superlun corresponding to the target stream is allocated to the target stream.

[0212] The embodiments of the present disclosure provide a storage resource allocation device. The storage resource allocation device is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "platform" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0213] The storage resource allocation device comprises:

[0214] A first acquisition unit is used to acquire a valid data quantity weight of each data block set in the multiple data block sets when there is a non-free set in the multiple data block sets of the target solid-state hard disk, wherein the non-free set is a data block set including a number of free data blocks less than a free data block threshold, and the valid data quantity weight of the data block set is determined according to the valid data quantity of a first data block in the data block set and an average value of the valid data quantity of the data blocks in the data block set, wherein the first data block is a data block having a valid data quantity less than the average value of the valid data quantity of the data blocks in the data block set;

[0215] A first determining unit, configured to determine a data block set corresponding to a target data stream from the plurality of data block sets according to a weight of a valid data quantity of each data block set;

[0216] The first allocation unit is used to allocate idle data blocks in the data block set corresponding to the target data stream to the target data stream.

[0217] In a possible implementation, the first acquisition unit is further used to acquire a difference in the number of valid data of the data block set, the difference in the number of valid data including: a difference between the number of valid data of each first data block in the data block set and an average value of the number of valid data of the data blocks in the data block set; determining a garbage collection efficiency of the data block set based on the difference in the number of valid data; acquiring a difference in the number of data blocks of the data block set, the difference in the number of data blocks being the difference between the number of non-free data blocks in the data block set and the number of free data blocks in the data block set; determining a parameter related to a weight of the number of valid data of the data block set based on the difference in the number of data blocks; determining the weight of the number of valid data of the data block set based on the garbage collection efficiency of the data block set and the parameter related to the weight of the number of valid data.

[0218] In a possible implementation, the first acquisition unit is further configured to add the square of each item in the valid data quantity difference to obtain an addition result, and determine the addition result as the garbage collection efficiency of the data block set.

[0219] In a possible implementation, the first acquisition unit is further configured to determine a product of the data block quantity difference and the number of non-free data blocks in the data block set as a parameter related to the valid data quantity weight of the data block set.

[0220] In a possible implementation, the first determination unit is further used to obtain the write-erase count distribution characteristics of each data block set when a valid data quantity weight balancing condition is met, wherein the valid data quantity weight balancing condition is that the difference in valid data quantity weights of any two data block sets in the multiple data block sets is less than a valid data quantity weight difference threshold, and obtaining the write-erase count distribution characteristics of the data block set includes: determining the cold data write-erase count weight of the data block set according to the write-erase count of the second data block in the data block set, the second data block having a write-erase count less than the average write-erase count of the data blocks in the data block set. The method comprises the steps of: determining a weight of the number of write-erasure times of hot data of the data block set according to the number of write-erasure times of a third data block in the data block set, wherein the third data block is a data block having a number of write-erasure times greater than an average number of write-erasure times of data blocks in the data block set; determining a distribution feature of the number of write-erasure times of cold data and a weight of the number of write-erasure times of hot data of the data block set; determining at least one first target data block set from the multiple data block sets according to the distribution feature of the number of write-erasure times of each data block set; and determining a data block set corresponding to a target data stream from the at least one first target data block set.

[0221] In one possible implementation, the first determination unit is further used to determine the cold data write-erase count weight of the data block set based on the difference between the write-erase count of each second data block in the data block set and the average write-erase count of the data blocks in the data block set, and the difference between the write-erase count of each second data block in the data block set and the first write-erase count quantile corresponding to the data block set, wherein the first write-erase count quantile is greater than the write-erase count of the data block with the smallest write-erase count in the target data block set and is less than the average write-erase count of the data blocks in the data block set.

[0222] In one possible implementation, the first determination unit is further used to determine the weight of the hot data write-erase count of the data block set based on the difference between the write-erase count of each third data block in the data block set and the average write-erase count of the data blocks in the data block set, and the difference between the write-erase count of each third data block in the data block set and the second write-erase count quantile corresponding to the data block set, wherein the second write-erase count quantile is greater than the average write-erase count of the data blocks in the data block set and less than the write-erase count of the data block with the largest write-erase count in the data block set.

[0223] In one possible implementation, the first determination unit is further used to determine at least one second target data block set from multiple data block sets when a write-erase count weight balancing condition is not met, wherein the write-erase count weight balancing condition is that the write-erase count distribution characteristics of each data block set indicate that the weight of the cold data write-erase count of the data block set is close to the weight of the hot data write-erase count of the data block set, and the write-erase count distribution characteristics of the second target data block set indicate that the second target data block set is suitable for storing data of the data type indicated by the cold and hot attributes of the target data stream; and each second target data block set is respectively used as the first target data block set.

[0224] In a possible implementation, the first determining unit is further configured to, when a weighted balance condition of the number of write and erase times is satisfied, use each of the data block sets as a first target data block set.

[0225] In one possible implementation, the first determination unit is further used to obtain performance requirement parameters of each first target data block set when a weighted balance condition for the number of write and erase times is met, wherein obtaining the performance requirement parameters of the first target data block set includes: obtaining a data write amount parameter for the first target data block set for each data stream corresponding to the first target data block set within a statistical time period, wherein the data stream corresponding to the first target data block set is a data stream having data written to data blocks in the first target data block set within a statistical time period; determining the performance requirement parameters of the first target data block set according to the data write amount parameter for the first target data block set for each data stream corresponding to the first target data block set within the statistical time period; and determining the first target data block set having the smallest performance requirement parameter as the data block set corresponding to the target data stream.

[0226] In a possible implementation, the statistical time period includes: multiple sub-statistical time periods; the first determination unit is further used to determine the data write amount parameter of the data stream corresponding to the first target data block set for the first target data block set within the statistical time period based on the data write amount of the data stream corresponding to the first target data block set for the first target data block set within each sub-statistical time period and the weight of the data write amount of the data stream corresponding to the first target data block set for the first target data block set within each sub-statistical time period.

[0227] In one possible implementation, the weight of the amount of data written to the first target data block set by the data stream corresponding to the first target data block set within the sub-statistical time period is the weight of the sub-statistical time period, and the size of the weight of the sub-statistical time period is related to the early or late stage of the sub-statistical time period.

[0228] In a possible implementation, the first determination unit is further used to determine, for each data stream corresponding to the first target data block set, a data write amount fluctuation parameter of the data stream for the first target data block set within a statistical time period according to a data write amount difference of the data stream for the first target data block set in each sub-statistical time period group, wherein the sub-statistical time period group includes: two adjacent sub-statistical time periods within a statistical time period, the data write amount difference of the data stream for the first target data block set in the sub-statistical time period group being a difference between the data write amount of the data stream for the first target data block set in the latest sub-statistical time period in the sub-statistical time period group and the data write amount of the data stream for the first target data block set in the earliest sub-statistical time period in the sub-statistical time period group; and determine the performance requirement parameters of the first target data block set according to the data write amount parameter of each data stream corresponding to the first target data block set for the first target data block set within the statistical time period and the data write amount fluctuation parameter of each data stream corresponding to the first target data block set for the first target data block set within the statistical time period.

[0229] In one possible implementation, the first determination unit is further used to determine a fluctuation parameter of the data write amount of the data stream for the first target data block set within a statistical time period based on a difference in the data write amount of the data stream for the first target data block set in each sub-statistical time period group and a weight of the difference in the data write amount of the data stream for the first target data block set in each sub-statistical time period group.

[0230] In a possible implementation, the weight of the data writing amount difference of the data stream for the first target data block set in the sub-statistical time period group is the weight of the latest sub-statistical time period in the sub-statistical time period group.

[0231] In a possible implementation, the storage resource allocation device further includes:

[0232] A second acquisition unit is used to acquire a performance requirement parameter of each data block set in the multiple data block sets when there is no non-free set in the multiple data block sets of the target solid state drive;

[0233] A second determining unit, configured to determine a data block set having a minimum performance requirement parameter among the multiple data block sets as a data block set corresponding to the target data stream;

[0234] The second allocation unit is used to allocate idle data blocks in the data block set corresponding to the target data stream to the target data stream.

[0235] In this embodiment, the device is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and a memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0236] The further functional description of each of the above units is the same as that of the above corresponding embodiments and will not be repeated here.

[0237] refer to Figure 8 , which shows a schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).

[0238] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0239] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0240] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0241] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0242] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means.

[0243] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device may be a touch screen.

[0244] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0245] A portion of the embodiments of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0246] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A storage resource allocation method, characterized in that: The method comprises: When there is a non-free set among the multiple data block sets of the target solid-state hard disk, obtaining a valid data quantity weight of each data block set in the multiple data block sets, wherein the non-free set is a data block set including a number of free data blocks less than a free data block threshold, and the valid data quantity weight of the data block set is determined according to the number of valid data of the first data block in the data block set and the average number of valid data of the data blocks in the data block set, wherein the first data block is a data block having a valid data quantity less than the average number of valid data of the data blocks in the data block set; Determining a data block set corresponding to a target data stream from the plurality of data block sets according to a weight of the effective data quantity of each data block set; Allocate the idle data blocks in the data block set corresponding to the target data stream to the target data stream.

2. The method according to claim 1, characterized in that Obtaining the effective data quantity weight of each data block set in the plurality of data block sets includes: Acquire a valid data quantity difference value of the data block set, wherein the valid data quantity difference value comprises: a difference value between the valid data quantity of each first data block in the data block set and an average value of the valid data quantity of the data blocks in the data block set; Determining the garbage collection efficiency of the data block set according to the difference in the number of valid data; Acquire a data block quantity difference value of the data block set, where the data block quantity difference value is a difference between the quantity of non-free data blocks in the data block set and the quantity of free data blocks in the data block set; Determining, according to the data block quantity difference, a parameter related to the valid data quantity weight of the data block set; The weight of the valid data quantity of the data block set is determined according to the garbage collection efficiency of the data block set and the parameter related to the weight of the valid data quantity.

3. The method according to claim 2, characterized in that Determining the garbage collection efficiency of the data block set according to the valid data quantity difference includes: The square of each item in the effective data quantity difference is added to obtain an addition result, and the addition result is determined as the garbage collection efficiency of the data block set.

4. The method according to claim 2, characterized in that: Determining the parameters related to the weight of the valid data quantity of the data block set according to the data block quantity difference includes: The product of the data block quantity difference and the quantity of non-free data blocks in the data block set is determined as a parameter related to the valid data quantity weight of the data block set.

5. The method according to claim 1, characterized in that Determining a data block set corresponding to a target data stream from the plurality of data block sets according to a weight of the effective data quantity of each data block set comprises: When the effective data quantity weight balancing condition is met, the write-erase times distribution characteristics of each data block set are obtained, wherein the effective data quantity weight balancing condition is that the difference in effective data quantity weights of any two data block sets in the multiple data block sets is less than the effective data quantity weight difference threshold, and obtaining the write-erase times distribution characteristics of the data block set includes: determining the cold data write-erase times weight of the data block set according to the write-erase times of the second data block in the data block set, the second data block being a data block having a write-erase times less than the average write-erase times of the data blocks in the data block set; determining the hot data write-erase times weight of the data block set according to the write-erase times of the third data block in the data block set, wherein the third data block is a data block having a write-erase times greater than the average write-erase times of the data blocks in the data block set; determining the write-erase times distribution characteristics of the data block set according to the cold data write-erase times weight and the hot data write-erase times weight of the data block set; Determining at least one first target data block set from the plurality of data block sets according to a distribution feature of the number of write and erase times of each data block set; A data block set corresponding to a target data stream is determined from at least one first target data block set.

6. The method according to claim 5, characterized in that Determining the cold data write-erase count weight of the data block set according to the write-erase count of the second data block in the data block set includes: The cold data write-erase count weight of the data block set is determined based on the difference between the write-erase count of each second data block in the data block set and the average write-erase count of the data blocks in the data block set, and the difference between the write-erase count of each second data block in the data block set and the first write-erase count quantile corresponding to the data block set, wherein the first write-erase count quantile is greater than the write-erase count of the data block with the smallest write-erase count in the target data block set and is less than the average write-erase count of the data blocks in the data block set.

7. The method according to claim 5, characterized in that Determining the weight of the number of times of writing and erasing hot data in the data block set according to the number of times of writing and erasing a third data block in the data block set includes: The weight of the number of write-erase times of hot data of the data block set is determined according to the difference between the number of write-erase times of each third data block in the data block set and the average number of write-erase times of the data blocks in the data block set, and the difference between the number of write-erase times of each third data block in the data block set and the second write-erase times quantile corresponding to the data block set, wherein the second write-erase times quantile is greater than the average number of write-erase times of the data blocks in the data block set and less than the write-erase times of the data block with the largest number of write-erase times in the data block set.

8. The method according to claim 5, characterized in that Determining at least one first target data block set from the plurality of data block sets according to the write / erase times distribution feature of each data block set comprises: When the write-erase times weight balancing condition is not met, at least one second target data block set is determined from the multiple data block sets, wherein the write-erase times weight balancing condition is that the write-erase times distribution characteristics of each data block set indicate that the weight of the cold data write-erase times of the data block set is close to the weight of the hot data write-erase times of the data block set, and the write-erase times distribution characteristics of the second target data block set indicate that the second target data block set is suitable for storing data of the data type indicated by the cold and hot attributes of the target data stream; Each second target data block set is used as a first target data block set.

9. The method according to claim 5, characterized in that Determining at least one first target data block set from the plurality of data block sets according to the write / erase times distribution feature of each data block set comprises: When a weighted balance condition of the number of write and erase times is met, each of the data block sets is used as a first target data block set.

10. The method according to claim 9, characterized in that Determining a data block set corresponding to a target data stream from at least one first target data block set includes: When a weighted balance condition of the number of write and erase times is met, the performance requirement parameters of each first target data block set are obtained, wherein obtaining the performance requirement parameters of the first target data block set includes: obtaining a data write amount parameter for each data stream corresponding to the first target data block set within a statistical time period for the first target data block set, wherein the data stream corresponding to the first target data block set is a data stream having data written to data blocks in the first target data block set within a statistical time period; determining the performance requirement parameters of the first target data block set according to the data write amount parameter for each data stream corresponding to the first target data block set within the statistical time period for the first target data block set; A first target data block set having the smallest performance requirement parameter is determined as the data block set corresponding to the target data stream.

11. The method according to claim 10, characterized in that The statistical time period includes: a plurality of sub-statistical time periods; and Obtaining a data writing amount parameter for each data stream corresponding to the first target data block set within a statistical time period for the first target data block set includes: Determine the data write amount parameters of the data stream corresponding to the first target data block set within the statistical time period based on the data write amount of the data stream corresponding to the first target data block set to the first target data block set within each sub-statistical time period and the weight of the data write amount of the data stream corresponding to the first target data block set to the first target data block set within each sub-statistical time period.

12. The method according to claim 11, characterized in that The weight of the data write amount for the first target data block set by the data stream corresponding to the first target data block set within the sub-statistical time period is the weight of the sub-statistical time period, and the size of the weight of the sub-statistical time period is related to the early or late time of the sub-statistical time period.

13. The method according to claim 10, characterized in that Determining the performance requirement parameter of the first target data block set according to a data write amount parameter of each data stream corresponding to the first target data block set within a statistical time period for the first target data block set includes: For each data stream corresponding to the first target data block set, determine a data write amount fluctuation parameter of the data stream for the first target data block set within a statistical time period according to a data write amount difference of the data stream for the first target data block set in each sub-statistical time period group, wherein the sub-statistical time period group includes: two adjacent sub-statistical time periods within a statistical time period, and the data write amount difference of the data stream for the first target data block set in the sub-statistical time period group is a difference between the data write amount of the data stream for the first target data block set in the latest sub-statistical time period in the sub-statistical time period group and the data write amount of the data stream for the first target data block set in the earliest sub-statistical time period in the sub-statistical time period group; The performance requirement parameters of the first target data block set are determined based on the data writing amount parameters of each data stream corresponding to the first target data block set within the statistical time period for the first target data block set and the data writing amount fluctuation parameters of each data stream corresponding to the first target data block set within the statistical time period for the first target data block set.

14. The method according to claim 13, characterized in that Determining, according to the data writing amount difference of the data stream for the first target data block set in each sub-statistical time period group, a data writing amount fluctuation parameter of the data stream for the first target data block set within the statistical time period includes: Determine a data write amount fluctuation parameter for the first target data block set of the data stream within the statistical time period based on a data write amount difference for the first target data block set of the data stream in each sub-statistical time period group and a weight of the data write amount difference for the first target data block set of the data stream in each sub-statistical time period group.

15. The method according to claim 14, characterized in that The weight of the data writing amount difference of the data stream for the first target data block set in the sub-statistical time period group is the weight of the latest sub-statistical time period in the sub-statistical time period group.

16. The method according to any one of claims 1 to 15, characterized in that The method further comprises: When there is no non-free set in the multiple data block sets of the target solid state drive, obtaining a performance requirement parameter of each data block set in the multiple data block sets; Determine a data block set having a minimum performance requirement parameter among the multiple data block sets as a data block set corresponding to the target data stream; Allocate the idle data blocks in the data block set corresponding to the target data stream to the target data stream.

17. A storage resource allocation device, characterized in that: The device comprises: A first acquisition unit is used to acquire a valid data quantity weight of each data block set in the multiple data block sets when there is a non-free set in the multiple data block sets of the target solid-state hard disk, wherein the non-free set is a data block set including a number of free data blocks less than a free data block threshold, and the valid data quantity weight of the data block set is determined according to the valid data quantity of a first data block in the data block set and an average value of the valid data quantity of the data blocks in the data block set, wherein the first data block is a data block having a valid data quantity less than the average value of the valid data quantity of the data blocks in the data block set; A first determining unit, configured to determine a data block set corresponding to a target data stream from the plurality of data block sets according to a weight of a valid data quantity of each data block set; The first allocation unit is used to allocate idle data blocks in the data block set corresponding to the target data stream to the target data stream.

18. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 16 by executing the computer instructions.

19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 16.

20. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method according to any one of claims 1 to 16.

Citation Information

Patent Citations

  • Solid state drives control device and solid state drives data access method based on learning

    CN106250064A

  • Storage equipment garbage collection method and device, target storage equipment and storage medium

    CN118113231A

  • Dynamic partitioning of data for data-parallel applications

    US20110208872A1

  • Reconfigurable processor fabric implementation using satisfiability analysis

    US20180300181A1