Data storage method, device, solid state disk and system
By dividing the QLC solid-state drive into short-term and long-term storage layers for hot and cold data and performing data migration, the problems of storage space waste and increased erase times in QLC solid-state drives are solved, and their reliability and lifespan are improved.
Patent Information
- Application Number
- CN202510795498.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-09-16
AI Technical Summary
If there are no write requests for a long time, the storage space of QLC solid-state drives will be wasted and the number of erase times will increase, affecting their reliability and lifespan.
The data migration judgment result is determined based on the storage data information of the full single-layer storage unit block and the storable data amount information of the free four-layer storage unit block, and the data in the full single-layer storage unit block is moved to the target four-layer storage unit block, which is divided into a short-term storage layer for cold data and hot data and a long-term storage layer for warm data.
This reduces the storage space waste and erase times of QLC solid-state drives, improving their reliability and lifespan.
Smart Images

Figure CN120653203A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and in particular to a data storage method, device, solid-state hard disk and system. Background Art
[0002] Currently, compared with SLC (Single-Level Cell), MLC (Multi-Level Cell) and TLC (Triple-Level Cell) solid-state drives (such as flash memory), QLC (Quad-Level Cell) solid-state drives have higher storage density and lower cost, making them particularly suitable for scenarios that require storing and processing large amounts of data, such as big data, cloud computing and artificial intelligence.
[0003] Because QLC SSDs have lower reliability and lifespan than SLC, MLC, and TLC SSDs, due to factors such as interference between adjacent flash memory layers, reduced fault tolerance, and fewer erase / write cycles, many effective methods have been proposed to improve the reliability and lifespan of QLC SSDs. For example, a related technology uses a hot and cold data separation method based on machine learning. This method accurately separates hot and cold data based on learned behavior patterns, writes cold data to storage spaces with larger Program / Erase (PE) values, and writes hot data to storage spaces with smaller PE values. This balances PE differences, reduces data movement, and ultimately reduces write amplification, thereby improving the reliability and lifespan of the SSD.
[0004] Because the application scenarios of QLC SSDs are mainly read requests with fewer write requests, but the capacity of each storage space of QLC SSDs is large, if hot and cold data are stored in different QLC storage spaces or cold data is stored directly in the QLC block, if there are no write requests for a long time, the QLC block will be kept open for too long. In order to protect the data of the last few wl (word lines) written, some dummy data will need to be filled in at regular intervals until it is full, resulting in wasted storage space and increasing the number of erase times of the storage space. Therefore, how to reduce the storage space waste and the increase in the frequency of erase times of QLC SSDs, thereby improving the reliability and lifespan of QLC SSDs, is an urgent problem that needs to be solved today. Summary of the Invention
[0005] The purpose of the present invention is to provide a data storage method, device, four-layer storage unit solid-state drive and system to reduce the storage space waste and the frequency of increased erase times of the QLC solid-state drive, thereby improving the reliability and life of the QLC solid-state drive.
[0006] To solve the above technical problems, the present invention provides a data storage method applied to a four-layer storage unit solid-state hard disk, comprising:
[0007] Determine a data migration judgment result based on the storage data information of the full single-layer storage unit block and the storable data amount information of the free four-layer storage unit block; wherein the full single-layer storage unit block is a full single-layer storage unit block in the four-layer storage unit solid state drive; the storage data information includes a valid data amount and a valid data type, the valid data type includes a first data type and a second data type, the first data type includes a cold data type and a hot data type, and the second data type includes a warm data type;
[0008] If the data migration determination result is to start data migration, obtaining the layer type of each layer in the target four-layer storage unit block; wherein the target four-layer storage unit block is any of the idle four-layer storage unit blocks, and the layer type includes a short-term storage layer corresponding to the first data type and a long-term storage layer corresponding to the second data type;
[0009] The data in the full single-layer storage unit block is moved to the target four-layer storage unit block according to the layer type and the valid data type.
[0010] On the other hand, the valid data type is the block type of the corresponding full single-layer storage unit block, and the full single-layer storage unit block includes a first single-layer storage unit block storing valid data of the first data type and a second single-layer storage unit block storing valid data of the second data type.
[0011] On the other hand, before determining the data migration result based on the storage data information of the full single-layer storage unit block and the storable data amount information of the free four-layer storage unit block, the method further includes:
[0012] Performing feature detection on a write task sent by a host device to obtain feature information corresponding to the write task; wherein the feature information includes at least one of a logical block address, a write size, a write mode, and a read count of the write task;
[0013] Determine, based on the characteristic information, a data type label of the data to be written in the write task; wherein the data type label is any preset data label, and the preset data labels include a cold data label, a warm data label, and a hot data label;
[0014] According to the data type label, a target single-layer storage unit block corresponding to the write task is allocated from a pool of free single-layer storage unit blocks, and the data to be written is written to the target single-layer storage unit block; wherein, when the data type label is the cold data label or the hot data label, the target single-layer storage unit block is the single-layer storage unit block with the smallest number of erase and write times in the pool of free single-layer storage unit blocks; when the data type label is the warm data label, the number of erase and write times of the target single-layer storage unit block is less than the average number of erase and write times of the pool of free single-layer storage unit blocks.
[0015] On the other hand, determining the data migration determination result based on the storage data information of the full single-layer storage unit block and the storable data amount information of the free four-layer storage unit block includes:
[0016] Determine whether the sum of the valid data amounts of all the full single-layer storage unit blocks reaches the overall storable data amount of the four-layer storage unit blocks to be used; wherein the storable data amount information includes the overall storable data amount;
[0017] If so, the data migration determination result is determined to be the start data migration, and the currently to-be-used four-layer storage unit block is determined as the target four-layer storage unit block.
[0018] On the other hand, obtaining the layer type of each layer in the target four-layer storage unit block includes:
[0019] pass , calculate the storage time of each layer in the target four-layer storage unit block; where T wl For the stated retention period, RBER wl is the raw bit error rate of a single word line, PE max is the preset maximum number of erase and write times of the solid-state hard disk, PE is the number of erase and write times of the target four-layer storage unit block, temp is the temperature of the solid-state hard disk of the four-layer storage unit, rd cnt is the number of reads of the target four-layer storage unit block, wl is the number of layers of the target four-layer storage unit block, and wl mean is the number of middle layers of the target four-layer storage unit block, and A, B, C and D are preset coefficients respectively;
[0020] According to the storage duration, K-means clustering is performed on all layers in the target four-layer storage unit block to obtain a layer type of each layer in the target four-layer storage unit block; wherein K is 2.
[0021] On the other hand, the step of moving the data in the full single-layer storage unit block to the target four-layer storage unit block according to the layer type and the valid data type includes:
[0022] If the number of erase / write times of the target four-layer storage unit block does not reach a first number threshold, then, based on the layer type and the valid data type, fully writing four pages of each layer in the target four-layer storage unit block using data in the full single-layer storage unit block;
[0023] If the number of erase / write times of the target four-layer storage unit block reaches the first number threshold and does not reach the second number threshold, then, based on the layer type and the valid data type, the four pages of the non-target layer and the first page, the second page, and the third page of the target layer in the target four-layer storage unit block are fully written using the data in the full single-layer storage unit block; wherein the target layer is a preset unstable layer, and the non-target layer is a layer other than the preset unstable layer in the target four-layer storage unit block;
[0024] If the number of erase / write times of the target four-layer storage unit block reaches the second number threshold and does not reach the third number threshold, then, based on the layer type and the valid data type, fully write the four pages of the non-target layer and the first and second pages of the target layer of the target four-layer storage unit block using the data in the full single-layer storage unit block;
[0025] If the number of erase and write times of the target four-layer storage unit block reaches the third number threshold, then according to the layer type and the valid data type, the four pages of the non-target layer and the first page of the target layer in the target four-layer storage unit block are filled with data in the full single-layer storage unit block; wherein the third number threshold is greater than the second number threshold and greater than the first number threshold.
[0026] In another aspect, the method further comprises:
[0027] Obtaining a next write task prediction result corresponding to a current write task sent by a host device; wherein the next write task prediction result is a result predicted by the host device based on sample features of the current write task, the sample features including at least one of a logical block address, a write size, a write mode, a write start time, and a write data type of the current write task, the write data type being any preset data type, including a cold data type, a warm data type, and a hot data type;
[0028] If the current write task and the predicted result of the next write task are write tasks of the same write data type, data of the target data type is selected from the cache and moved to the single-layer storage unit block; wherein, the target data type is two data types other than the write data type in the predicted result of the next write task.
[0029] The present invention also provides a data storage device, which is applied to a four-layer storage unit solid-state hard disk, comprising:
[0030] a determination module, configured to determine a data migration determination result based on storage data information of a full single-layer storage unit block and storable data volume information of an idle four-layer storage unit block; wherein the full single-layer storage unit block is a full single-layer storage unit block in the four-layer storage unit solid-state drive; the storage data information includes a valid data volume and a valid data type, the valid data type includes a first data type and a second data type, the first data type includes a cold data type and a hot data type, and the second data type includes a warm data type;
[0031] an acquisition module, configured to, if the data migration determination result is to initiate data migration, acquire a layer type of each layer in a target four-layer storage unit block; wherein the target four-layer storage unit block is any of the idle four-layer storage unit blocks, and the layer types include a short-term storage layer corresponding to the first data type and a long-term storage layer corresponding to the second data type;
[0032] A migration module is used to migrate the data in the full single-layer storage unit block to the target four-layer storage unit block according to the layer type and the valid data type.
[0033] The present invention also provides a four-layer storage unit solid state hard disk, comprising:
[0034] memory for storing computer programs;
[0035] A processor is used to implement the steps of the above-mentioned data storage method when executing the computer program.
[0036] In addition, the present invention also provides a data storage system, comprising: a host device and the four-layer storage unit solid state hard disk as described above.
[0037] A data storage method provided by the present invention is applied to a four-layer storage unit solid-state hard disk, including: determining a data migration judgment result based on storage data information of a full single-layer storage unit block and storable data volume information of an idle four-layer storage unit block; wherein the full single-layer storage unit block is a full single-layer storage unit block in the four-layer storage unit solid-state hard disk; the storage data information includes valid data volume and valid data type, the valid data type includes a first data type and a second data type, the first data type includes a cold data type and a hot data type, and the second data type includes a warm data type; if the data migration judgment result is to start data migration, then obtaining the layer type of each layer in the target four-layer storage unit block; wherein the target four-layer storage unit block is any idle four-layer storage unit block, and the layer type includes a short-term storage layer corresponding to the first data type and a long-term storage layer corresponding to the second data type; according to the layer type and the valid data type, the data in the full single-layer storage unit block is moved to the target four-layer storage unit block.
[0038] It can be seen that the present invention determines the result of data migration based on the storage data information of the full single-layer storage unit block and the storable data amount information of the idle four-layer storage unit block. It can perform data migration when the data can fill the idle QLC block, reducing the waste of storage space and the increase in the number of erases caused by the QLC block being filled with dummy data; and the present invention divides each layer in the QLC block into a short-term storage layer for storing cold data and hot data and a long-term storage layer for storing warm data. It can store different types of data in the appropriate layer during data migration, reduce the frequent data migration caused by storing warm data on word lines with short storage time, reduce data storage interference, and thus improve the reliability and life of the QLC solid-state hard drive. In addition, the present invention also provides a data storage device, a four-layer storage unit solid-state hard drive and a system, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0040] Figure 1 A flow chart of a data storage method provided by an embodiment of the present invention;
[0041] Figure 2 A schematic diagram of the overall architecture of another data storage method provided by an embodiment of the present invention;
[0042] Figure 3A schematic diagram of the structure of another data storage method provided by an embodiment of the present invention;
[0043] Figure 4 A schematic diagram of a word line classification process of another data storage method provided by an embodiment of the present invention;
[0044] Figure 5 A schematic diagram of a data separation process of another data storage method provided by an embodiment of the present invention;
[0045] Figure 6 A structural block diagram of a data storage device provided by an embodiment of the present invention;
[0046] Figure 7 A schematic structural diagram of a solid-state drive with four storage layers provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0048] Please refer to Figure 1 , Figure 1 This is a flow chart of a data storage method provided by an embodiment of the present invention. The method is applied to a quad-level cell (QLC) solid-state drive and may include:
[0049] Step 101: Determine a data migration decision result based on the storage data information of the full single-layer storage unit block and the storable data amount information of the idle four-layer storage unit block.
[0050] Among them, the full SLC block is the SLC block that has been filled in the QLC solid state drive; the stored data information includes the valid data volume and the valid data type, the valid data type includes the first data type and the second data type, the first data type includes the cold data type and the hot data type, and the second data type includes the warm data type.
[0051] Correspondingly, the storage data information in this embodiment may be information related to the valid data stored in the full SLC block (i.e., data that needs to be moved to the QLC block), such as the data volume (i.e., the valid data volume) and data type (i.e., the valid data type) of the valid data stored in the full SLC block.
[0052] Accordingly, this embodiment does not limit the specific division method and content of the valid data type. For example, the valid data type may include a first data type and a second data type to facilitate subsequent data migration, that is, data of the first data type (such as valid data) can be moved to a short-term storage layer, and data of the second data type can be moved to a long-term storage layer. For example, in this embodiment, each SLC block in the QLC solid-state drive can be used to store data of a corresponding valid data type, that is, the valid data type can be the block type of the corresponding full single-layer storage unit block. The full single-layer storage unit block may include a first single-layer storage unit block storing valid data of the first data type (cold data type and hot data type) and a second single-layer storage unit block storing valid data of the second data type (warm data type). Valid data types may also include cold data types, warm data types, and hot data types. For example, in the present embodiment, each SLC block in the QLC solid-state drive may be used to store data of a corresponding valid data type, that is, the valid data type may be the block type of the corresponding full single-layer storage unit block, and the full single-layer storage unit block may include a third single-layer storage unit block storing valid data of the cold data type, a fourth single-layer storage unit block storing valid data of the hot data type, and a fifth single-layer storage unit block storing valid data of the warm data type; during subsequent data migration, the data of the third single-layer storage unit block and the fourth single-layer storage unit block (that is, cold data and hot data) may be moved to a short-term storage layer, and the data of the fifth single-layer storage unit block (that is, warm data) may be moved to a long-term storage layer.
[0053] It can be understood that the idle QLC block in this embodiment can be an idle QLC block, such as Figure 2 The QLC blocks in the free QLC pool. The storable data volume information of the free QLC blocks can be information related to the storable data volume. For example, the storable data volume information can include the total data volume that can be stored in all layers of the free QLC blocks (i.e., the overall storable data volume), the data volume that can be stored in each layer of the free QLC blocks, the total storable data volume of all short-term storage layers of the free QLC blocks, and the total storable data volume of all long-term storage layers. This embodiment does not impose any restrictions on this.
[0054] Correspondingly, in this step, by determining the data migration judgment result based on the storage data information of the full single-layer storage unit block and the storable data volume information of the idle four-layer storage unit block, it is possible to determine whether data migration needs to be started at present, so that when the data migration judgment result is to start data migration, step 102 is entered to start data migration; when the data migration judgment result is not to start data migration, this process can be ended or returned to step 101 to wait for the next data migration judgment. For example, in step 101, the data migration judgment result can be determined according to the storage data information of the full single-layer storage unit block and the storable data volume information of the idle four-layer storage unit block at a preset time interval.
[0055] Accordingly, the specific method of determining the result of data migration judgment based on the storage data information of the full single-layer storage unit block and the storable data volume information of the idle four-layer storage unit block in this step can be set by the designer according to the practical scenario and user needs. For example, this step can determine whether the sum of the effective data volume of all full single-layer storage unit blocks reaches the overall storable data volume of the current QLC block to be used; wherein the storable data volume information includes the overall storable data volume; if so, the data migration judgment result is determined to start data migration, and the current QLC block to be used is determined as the target QLC block; if not, the data migration judgment result is determined to not start data migration. Figure 2 and Figure 3 As shown, the computing unit can be used to calculate the amount of data that can be stored in the free QLC block (i.e., the overall storable data amount), the effective data amount of the SLC block that stores warm data and is full, and the effective data amount of the SLC block that stores hot and cold data and is full. When the total effective data amount can fill one free QLC block currently selected for use, data is moved.
[0056] Furthermore, in order to ensure that each layer in the target four-layer storage unit block can store data of the corresponding valid data type, step 101 can also determine whether the first valid data amount reaches the first storable data amount of the currently used QLC and the second valid data amount reaches the second storable data amount of the currently used QLC block; if so, the data migration judgment result is determined to start data migration, and the currently used QLC block is determined as the target QLC block; if not, the data migration judgment result is determined to not start data migration; wherein, the first valid data amount is the sum of the valid data amount of the first data type of all full SLC blocks, and the first storable data amount is the sum of the storable data amount of the short-term storage layer in the currently used QLC block; the second valid data amount is the sum of the valid data amount of the second data type of all full SLC blocks, and the second storable data amount is the sum of the storable data amount of the long-term storage layer in the currently used QLC block.
[0057] Step 102: If the data migration determination result is to start data migration, then obtain the layer type of each layer in the target four-layer storage unit block.
[0058] The target four-layer storage unit block is any idle four-layer storage unit block, and the layer types include a short-term storage layer corresponding to a first data type and a long-term storage layer corresponding to a second data type.
[0059] It is understood that the target QLC block in this embodiment can be an idle QLC block that currently needs to store data from a full SLC block, i.e., the target to which data from the full SLC block is to be moved. In this embodiment, the layers in the QLC block (i.e., the target QLC block) are divided into short-term storage layers for storing cold and hot data, and long-term storage layers for storing warm data. This allows different types of data to be stored in appropriate layers during data migration, reducing the frequent data migration caused by storing warm data on wordlines with short storage times, reducing data storage interference, and thereby improving the reliability and lifespan of the QLC solid-state drive.
[0060] Correspondingly, the specific division method of the layer type of each layer in the target QLC block in this step can be set by the designer according to the practical scenario and user needs. For example, the layer type can be based on the storage time (T wl ), perform K-means clustering on all layers in the target four-layer storage unit block to obtain the classification results; among them, ;T wl To save the duration, RBER wl is the raw bit error rate of a single word line, that is, the maximum error rate that each wl ECC (Error Correcting Code) can correct; PE max is the preset maximum number of erase and write times of the solid-state drive, PE is the number of erase and write times of the target four-layer storage unit block, temp is the temperature of the four-layer storage unit solid-state drive, rd cnt is the number of reads of the target four-layer storage unit block, wl is the number of layers of the target four-layer storage unit block, mean The middle layer number of the target four-layer storage unit block, such as wl mean It can be the quotient of wl divided by 2, or the quotient of wl divided by 2 rounded up or down; A, B, C and D are preset coefficients, which can be set according to the characteristics of flash memory particles and experience, and can be the same or different; K is 2; the distance from each layer to the cluster center in the K-means clustering process is , the evaluation formula for clustering quality is ; m is the dimension of the input, which can be 1 in this embodiment; C ij (That is, when m is 1, C i ) is the cluster center of the i-th category, i is 1 or 2, xj (i.e., x when m is 1) is the storage duration, and SSE is the sum of squared errors of all storage durations corresponding to the current two cluster centers. In other words, during the K-means clustering process, any two storage durations can be used as cluster centers, and the evaluation scores (i.e., sum of squared errors) of the clustering quality using different cluster center settings can be calculated. The layer type of each layer is determined based on the distance from each layer to the cluster center corresponding to the cluster center setting with the highest evaluation score.
[0061] Correspondingly, the specific method for obtaining the layer type of each layer in the target four-layer storage unit block in this embodiment can be set by the designer, such as Figure 4 As shown, this step can calculate the storage time of each layer in the target four-layer storage unit block according to the number of erase and write times, read times and number of layers of the target QLC block and the temperature of the QLC solid state drive, as shown above. Formula calculation; Based on the storage duration, perform K-means clustering on all layers in the target four-layer storage unit block to obtain the layer type of each layer in the target four-layer storage unit block; where K is 2. Figure 2 and Figure 3 As shown, the Wl classification module can be used to classify all Wl (word lines, i.e., layers) into K categories based on the number of erases and writes per QLC block, the number of reads per block, the Wl, and the storage duration calculated from the disk temperature. Different Wl categories store different types of data. This step can also directly read the layer type of each layer in the previously determined target four-layer storage unit block. For example, before data migration, the layers in each idle QLC block can be classified using this method to enable direct reading and use during subsequent data migration. This embodiment does not impose any restrictions on this.
[0062] Step 103: According to the layer type and the valid data type, the data in the full single-layer storage unit block is moved to the target four-layer storage unit block.
[0063] It can be understood that in this step, the data in the full SLC block can be moved to the corresponding layer in the target QLC block for storage according to the layer type of each layer in the target QLC block and the valid data type of the data in the full SLC block; that is, when there is sufficient valid data of the first data type and the second data type, the short-term storage layer in the target QLC block stores data of the first data type (i.e., cold data and hot data), and the long-term storage layer stores data of the second data type (i.e., warm data).
[0064] Furthermore, in some embodiments, in this step, the QLC solid-state drive can use the data in the full SLC block to write the four pages of each layer in the target QLC block according to the layer type and the valid data type when the erase and write times of the target QLC block have not reached the first count threshold (TH1); when the erase and write times of the target QLC block have reached the first count threshold but have not reached the second count threshold (TH2), according to the layer type and the valid data type, use the data in the full SLC block to write the four pages of the non-target layer in the target QLC block and the first page, the second page and the third page of the target layer; when the erase and write times of the target QLC block have reached the second count threshold but have not reached the third count threshold (TH3), according to the layer type and the valid data type, use the data in the full SLC block to write the four pages of the non-target layer in the target QLC block and the first page, the second page and the third page of the target layer. The four pages of the non-target layer and the first and second pages of the target layer in the QLC block are fully written; when the number of erase and write times of the target QLC block reaches the third number threshold, the four pages of the non-target layer and the first page of the target layer in the target QLC block are fully written using the data in the full SLC block according to the layer type and the valid data type; when the number of erase and write times of the target QLC block reaches the third number threshold, the four pages of the non-target layer and the first page of the target layer in the target QLC block are fully written using the data in the full SLC block according to the layer type and the valid data type; wherein the target layer can be a pre-set unstable layer (i.e., a preset unstable layer), and the non-target layer is a layer other than the preset unstable layer in the target QLC block, and the third number threshold is greater than the second number threshold, which is greater than the first number threshold.
[0065] That is, as the PE (erase / program endurance) increases, the RBER (raw bit error rate) of each layer in the flash memory block becomes increasingly higher. When the PE of the target QLC block reaches a threshold value TH1, certain layers (pre-set unstable layers) may skip the fourth page of the QLC layer when writing data, and only write to the remaining pages to ensure the reliability of stored data and extend the life of the flash memory block. When the PE reaches a threshold value TH2, certain layers may skip the third and fourth pages of the QLC layer when writing data. When the PE reaches a threshold value TH3, certain layers may skip the second, third, and fourth pages of the QLC layer when writing data. Accordingly, the specific values of TH1, TH2, and TH3 and the number of pages to be skipped can be set by the designer, for example, based on the characteristics of the flash memory particles and experience, and this embodiment does not impose any restrictions on this.
[0066] Furthermore, when the valid data type is the block type of the corresponding full SLC block, and the full SLC block includes a first SLC block storing valid data of a first data type and a second SLC block storing valid data of a second data type, the method provided by this embodiment may further include a data classification and placement process for the write task, so as to write the to-be-written data of different data types into the corresponding SLC blocks for storage. For example, before step 101, it may further include performing feature detection on the write task sent by the host device to obtain feature information corresponding to the write task; wherein the feature information includes the logical block address (LBA) of the write task, the write size (IO len ), write mode (IO seq ) and read count (RD cnt ); determining, based on the characteristic information, a data type label of the data to be written of the write task; wherein, the data type label is any preset data label, and the preset data labels may include a cold data label, a warm data label, and a hot data label, or include a label of the above-mentioned first data type and a label of the above-mentioned second data type; according to the data type label, allocating a target SLC block corresponding to the write task from the free SLC block pool, and writing the data to be written to the target SLC block; wherein, when the data type label is a cold data label or a hot data label, the target SLC block is the SLC block with the smallest erase and write count in the free SLC block pool; when the data type label is a warm data label, the erase and write count of the target SLC block is less than the average erase and write count of the free SLC block pool.
[0067] For example, if Figure 4 As shown, after receiving the host task sent by the host device, the QLC solid-state drive can determine whether the host task is a write task (such as Figure 2 Write request in); if it is a write task, use Figure 2 and Figure 3 The data separation module shown in the figure divides the data to be written of the writing task into cold data, warm data or hot data; if the writing task is firstly extracted, the feature information of each writing task is , then preprocess the feature information (such as normalization), and then use the preprocessing to obtain samples, update the writing task sequence samples (such as the current writing task and the samples corresponding to the previous preset number of writing tasks) and use them as the input of the classification model, and output the data type label (D type ), such as (hot data label), (warm data tag) or (cold data label) to achieve the separation of hot and cold data written this time.
[0068] After data separation is completed, SLC blocks need to be allocated to different types of data, such as using Figure 2and Figure 3 The write block allocation module shown in the figure allocates appropriate SLC blocks from the free SLC block pool based on the output categories of the data separation module. It allocates SLC blocks with the smallest PE for hot and cold data, and SLC blocks with PE values below the average for warm data. Since the proportion of hot and cold data is relatively small throughout the disk's lifecycle, hot and cold data can be stored in the same SLC block with the smallest PE value during writes. Since warm data accounts for a larger proportion of cold data, warm data can be stored in SLC blocks with PE values below the average.
[0069] In this embodiment, the above separation model can be deployed in a QLC solid-state drive. The separation model can be a model based on a TCN (Temporal Convolutional Network) network and a GRU (Gate Recurrent Unit) unit, which can be trained using a training set. The input of the model can be LBA, IO, and other data types including write tasks. len ,IO seq and RD cnt The time series of these four features are output as data type labels (D type The sample set is obtained by extracting read and write tasks from the I / O (input / output) behavior log data. The data type labels are clustered according to the number of writes or reads of the LBAs recorded in the I / O behavior log data. Feature extraction is performed on the sample sequence data set, followed by preprocessing such as normalization. The preprocessed data set is used as the training set. As various loads run, the amount of I / O behavior log data continues to increase. When the span of the log data is an integer multiple of the preset separation update period (such as one week, half a month, or one month) and / or the model classification differs significantly from the actual situation, the sample set is expanded and re-clustered according to the number of writes or reads to obtain new data type labels. The separation model is then retrained to improve classification accuracy.
[0070] like Figure 2 and Figure 3 As shown, the I / O behavior log recording unit can be used to collect records of I / O behaviors received by the QLC solid-state drive from request to completion. For example, the write task behavior log can include the written logical address, write size, write type (random write or sequential write), write task start time, write completion time, number of writes, and storage time of the corresponding physical address space, etc., for subsequent updates to the separation model.
[0071] Accordingly, the QLC SSD processes the read task sent by the host device (such as Figure 2When a read request is received, the I / O behavior logging unit can be used to record the read task behavior log, such as the logical address being read, the read size, the read type (random read or sequential read), the number of reads, and the retention time of the corresponding physical address space. This is used to calculate and classify the retention time of each layer in the QLC block and to classify hot and cold data.
[0072] Furthermore, the method provided in this embodiment may also include caching (such as Figure 2 and Figure 3 The data migration process in the RAM Buffer in the host device is as follows: for example, a QLC solid-state drive can obtain the prediction result of the next write task corresponding to the current write task sent by the host device; if the current write task and the next write task prediction result are write tasks of the same write data type, the target data type is selected from the cache and moved to the single-layer storage unit block; wherein, the next write task prediction result is the result predicted by the host device based on the sample features of the current write task, and the sample features include the logical block address (LBA) and write size (IO len ), write mode (IO seq ), write start time (IO start ) and write data type (D type ), the write data type is any preset data type, the preset data types include cold data type, warm data type and hot data type; the target data type is two data types other than the write data type in the prediction result of the next write task.
[0073] That is to say, the host device can perform feature detection on the current write task sent to the QLC solid-state drive to obtain the sample features corresponding to the write task; based on the sample features, determine the prediction result of the next write task corresponding to the current write task; the next write task prediction result may include the predicted write data type of the next write task (such as cold data type, warm data type or hot data type). For example, when the host device performs write task prediction, it can filter out the newly added write task log (that is, the log of the current write task) from the I / O log data, and perform feature extraction on the write task log. Each sample feature is , then normalize the sample features, and then update the write task sequence sample and use it as the input of the write task prediction model to obtain the next write task prediction result ; You can set the start time of the next task. The amount of data that can be written for the next writing task, The write data type of the next write task can be predicted. The write task prediction model can be built based on a TCN network and trained using a write task sequence sample set. The write task sequence sample set is obtained by data screening, feature extraction, and preprocessing of I / O logs. The preprocessed sample set is used as the training set. The training set consists of sequence pairs (input sequence, target sequence). The target sequence is a sequence that is shifted forward a certain amount relative to the input sequence. That is, the target sequence and the input sequence overlap for a certain length, and the overlap length is determined by the number of upcoming write tasks to be predicted. As various loads run, the host I / O log data continues to increase. When the span of I / O data is an integer multiple of the preset prediction update period (such as one week, two weeks, or one month) and / or the start time, write data volume, and write type of the predicted write task differ significantly from the actual write task, the sample set is expanded, the model is retrained and updated, and the write task prediction model is updated.
[0074] Correspondingly, the above-mentioned write task prediction process can also be completed by the QLC solid-state drive, such as Figure 2 As shown, the QLC solid-state drive can use the write task prediction unit to predict the next write task prediction result corresponding to the current write task.
[0075] Correspondingly, for the above-mentioned QLC solid-state drive, when the current write task and the next write task predict the same write data type, the specific method of selecting data of the target data type from the cache and moving it to the single-layer storage unit block can be set by the designer. For example, when the data type of the data to be written in the current write task and the data type of the data to be written in the next write task are the same, the other two types of data in the cache (i.e., write cache) can be directly refreshed to the SLC block, and the proportion of cold, hot, and warm data in the cache can be adjusted; for example, the default initial cache size allocates a 1:1:1 ratio of cold, hot, and warm data of the three data types, and then adjusts it according to the write data type. Since the QLC solid-state drive has a large proportion of read requests, that is, a large proportion of warm data and a small proportion of hot and cold data, the proportion of warm data in the cold, hot, and warm data ratio can be higher than the proportion of hot and cold data. QLC SSDs can also determine whether to move data in the cache based on the write data type of the current write task and the predicted results of the next write task, as well as the ratio of cold, hot, and warm data in the cache. If the current write task and the next write task are predicted to be write tasks of the same write data type, and the ratio of cold, hot, and warm data meets the requirements (for example, the ratio corresponding to the write data type is less than the maximum threshold), the other two types of data in the cache are refreshed to the SLC block, and the ratio of cold, hot, and warm data in the cache is adjusted. This embodiment does not impose any restrictions on this.
[0076] Correspondingly, such as Figure 2 and Figure 3As shown in the figure, QLC solid-state drives can use internal task units to complete GC (Garbage Collection) tasks and WL (Wear Leveling) tasks to move data between SLC blocks and QLC blocks.
[0077] In this embodiment, the embodiment of the present invention determines the data migration judgment result based on the storage data information of the full single-layer storage unit block and the storable data amount information of the idle four-layer storage unit block, and can perform data migration when the data can fill the idle QLC block, thereby reducing the waste of storage space and the increase in the number of erase times caused by the QLC block being filled with dummy data; and the embodiment of the present invention divides each layer in the QLC block into a short-term storage layer for storing cold data and hot data and a long-term storage layer for storing warm data, and can store different types of data in appropriate layers during data migration, thereby reducing frequent data migration caused by storing warm data on word lines with short storage time, reducing data storage interference, and thereby improving the reliability and life of the QLC solid-state drive.
[0078] Corresponding to the above method embodiment, an embodiment of the present invention further provides a data storage device. The data storage device described below and the data storage method described above can refer to each other.
[0079] Please refer to Figure 6 , Figure 6 This is a structural block diagram of a data storage device provided by an embodiment of the present invention. The device is applied to a four-layer storage unit solid-state hard disk and may include:
[0080] The determination module 10 is configured to determine a data migration determination result based on the storage data information of the full single-layer storage unit block and the storable data amount information of the free four-layer storage unit block; wherein the full single-layer storage unit block is a full single-layer storage unit block in the four-layer storage unit solid-state drive; the storage data information includes the valid data amount and the valid data type, the valid data type includes a first data type and a second data type, the first data type includes a cold data type and a hot data type, and the second data type includes a warm data type;
[0081] an acquisition module 20 configured to acquire a layer type of each layer in a target four-layer storage unit block if the data migration determination result is to initiate data migration; wherein the target four-layer storage unit block is any idle four-layer storage unit block, and the layer type includes a short-term storage layer corresponding to a first data type and a long-term storage layer corresponding to a second data type;
[0082] The migration module 30 is used to migrate data in a full single-layer storage unit block to a target four-layer storage unit block according to the layer type and the valid data type.
[0083] In some embodiments, the valid data type is the block type of the corresponding full single-layer storage unit block, and the full single-layer storage unit block includes a first single-layer storage unit block storing valid data of the first data type and a second single-layer storage unit block storing valid data of the second data type.
[0084] In some embodiments, the apparatus may further include:
[0085] a feature detection module, configured to perform feature detection on a write task sent by a host device to obtain feature information corresponding to the write task; wherein the feature information includes at least one of a logical block address, a write size, a write mode, and a read count of the write task;
[0086] A data separation module is used to determine a data type label of the data to be written in the write task based on the characteristic information; wherein the data type label is any preset data label, and the preset data labels include cold data labels, warm data labels, and hot data labels;
[0087] The write block allocation module is used to allocate the target single-layer storage unit block corresponding to the write task from the free single-layer storage unit block pool according to the data type label, and write the data to be written to the target single-layer storage unit block; wherein, when the data type label is a cold data label or a hot data label, the target single-layer storage unit block is the single-layer storage unit block with the smallest erase and write count in the free single-layer storage unit block pool; when the data type label is a warm data label, the erase and write count of the target single-layer storage unit block is less than the average erase and write count of the free single-layer storage unit block pool.
[0088] In some embodiments, the determination module 10 can be specifically used to determine whether the sum of the valid data volumes of all full single-layer storage unit blocks reaches the overall storable data volume of the four-layer storage unit block currently in use; wherein the storable data volume information includes the overall storable data volume; if so, the data migration judgment result is determined to be to start data migration, and the four-layer storage unit block currently in use is determined as the target four-layer storage unit block.
[0089] In some embodiments, the acquisition module 20 may include:
[0090] Duration calculation submodule, used to , calculate the storage time of each layer in the target four-layer storage unit block; where T wl To save the duration, RBER wl is the raw bit error rate of a single word line, PE max is the preset maximum number of erase and write times of the solid-state drive, PE is the number of erase and write times of the target four-layer storage unit block, temp is the temperature of the four-layer storage unit solid-state drive, rd cnt is the number of reads of the target four-layer storage unit block, wl is the number of layers of the target four-layer storage unit block,mean is the number of middle layers of the target four-layer storage unit block, and A, B, C, and D are preset coefficients respectively.
[0091] The clustering submodule is used to perform K-means clustering on all layers in the target four-layer storage unit block according to the storage duration to obtain the layer type of each layer in the target four-layer storage unit block; wherein K is 2.
[0092] In some embodiments, the moving module 30 may include:
[0093] The first migration submodule is configured to fill four pages of each layer of the target four-layer storage unit block with data in a full single-layer storage unit block according to the layer type and the valid data type if the number of erase / write times of the target four-layer storage unit block has not reached a first number threshold;
[0094] The second migration submodule is configured to, if the number of erase / write times of the target four-layer storage unit block reaches a first number threshold and does not reach a second number threshold, use data in a full single-layer storage unit block to fill four pages of a non-target layer and a first page, a second page, and a third page of a target layer in the target four-layer storage unit block according to the layer type and the valid data type; wherein the target layer is a preset unstable layer, and the non-target layer is a layer other than the preset unstable layer in the target four-layer storage unit block;
[0095] a third migration submodule configured to, if the number of erase / write times of the target four-layer storage unit block reaches a second number threshold but does not reach a third number threshold, fill the four pages of the non-target layer and the first and second pages of the target layer of the target four-layer storage unit block with data in the full single-layer storage unit block according to the layer type and the valid data type;
[0096] The fourth migration submodule is used to fill the four pages of the non-target layer and the first page of the target layer in the target four-layer storage unit block with data in the full single-layer storage unit block if the number of erase and write times of the target four-layer storage unit block reaches a third number threshold, according to the layer type and the valid data type; wherein the third number threshold is greater than the second number threshold which is greater than the first number threshold.
[0097] In some embodiments, the apparatus may further include:
[0098] a prediction result receiving module, configured to obtain a prediction result of a next write task corresponding to a current write task sent by a host device; wherein the prediction result of the next write task is a result predicted by the host device based on sample features of the current write task, wherein the sample features include at least one of a logical block address, a write size, a write mode, a write start time, and a write data type of the current write task, wherein the write data type is any preset data type, including a cold data type, a warm data type, and a hot data type;
[0099] A cache update module is used to select data of a target data type from the cache and move it to a single-layer storage unit block if the current write task and the next write task prediction results are write tasks of the same write data type; wherein the target data type is two data types other than the write data type in the next write task prediction result.
[0100] In this embodiment, the embodiment of the present invention determines the data migration judgment result through the determination module 10 based on the storage data information of the full single-layer storage unit block and the storable data amount information of the idle four-layer storage unit block, and can perform data migration when the data can fill the idle QLC block, thereby reducing the waste of storage space and the increase in the number of erase times caused by the QLC block being filled with dummy data; and the embodiment of the present invention divides each layer in the QLC block into a short-term storage layer for storing cold data and hot data and a long-term storage layer for storing warm data, and can store different types of data in appropriate layers during data migration, thereby reducing frequent data migration caused by storing warm data on word lines with short storage time, reducing data storage interference, and thereby improving the reliability and life of the QLC solid-state drive.
[0101] Corresponding to the above method embodiment, an embodiment of the present invention further provides a four-layer storage unit solid state drive. The four-layer storage unit solid state drive described below and the data storage method described above can be referenced to each other.
[0102] Please refer to Figure 7 , Figure 7 This is a schematic diagram of the structure of a four-layer storage unit solid-state drive provided by an embodiment of the present invention. The solid-state drive may include:
[0103] Memory D1, for storing computer programs;
[0104] The processor D2 is configured to implement the steps of the data storage method provided in the above method embodiment when executing a computer program.
[0105] Corresponding to the above method embodiment, an embodiment of the present invention further provides a data storage system. The data storage system described below and the data storage method described above can be referred to in correspondence with each other.
[0106] A data storage system includes a host device and a solid-state hard disk with four storage layers as provided in the above embodiment.
[0107] In some embodiments, the host device may perform feature detection on a current write task sent to the QLC solid-state drive to obtain sample features corresponding to the write task; and determine a prediction result of a next write task corresponding to the current write task based on the sample features; wherein the prediction result of the next write task may include a predicted write data type of the next write task;
[0108] Correspondingly, the four-layer storage unit solid-state hard drive can obtain the next write task prediction result corresponding to the current write task sent by the host device; if the current write task and the next write task prediction result are write tasks of the same write data type, then data of the target data type is selected from the cache and moved to the single-layer storage unit block; wherein, the next write task prediction result is the result obtained by the host device based on the sample characteristics of the current write task, and the sample characteristics include at least one of the logical block address, write size, write mode, write start time and write data type of the current write task, and the write data type is any preset data type, and the preset data types include cold data type, warm data type and hot data type; the target data type is two data types other than the write data type in the next write task prediction result.
[0109] Corresponding to the above method embodiment, an embodiment of the present invention further provides a computer program product. The computer program product described below and the data storage method described above can refer to each other.
[0110] A computer program product includes a computer program / instruction, which, when executed by a processor, implements the steps of the data storage method provided in the above method embodiment.
[0111] Corresponding to the above method embodiment, an embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium described below and the data storage method described above can be referred to in correspondence with each other.
[0112] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the data storage method of the above method embodiment.
[0113] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference will be made to the descriptions of the embodiments for similar or identical parts. The device, four-layer storage unit solid-state drive, system, computer program product, and computer-readable storage medium disclosed in the embodiments correspond to the methods disclosed in the embodiments, so their descriptions are relatively simple. For relevant details, refer to the descriptions of the methods.
[0114] The above is a detailed introduction to a data storage method, device, four-layer storage unit solid-state hard disk and system provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. A data storage method, characterized in that: Applicable to four-layer storage unit solid-state drives, including: Determine a data migration judgment result based on the storage data information of the full single-layer storage unit block and the storable data amount information of the free four-layer storage unit block; wherein the full single-layer storage unit block is a full single-layer storage unit block in the four-layer storage unit solid state drive; the storage data information includes a valid data amount and a valid data type, the valid data type includes a first data type and a second data type, the first data type includes a cold data type and a hot data type, and the second data type includes a warm data type; If the data migration determination result is to start data migration, obtaining the layer type of each layer in the target four-layer storage unit block; wherein the target four-layer storage unit block is any of the idle four-layer storage unit blocks, and the layer type includes a short-term storage layer corresponding to the first data type and a long-term storage layer corresponding to the second data type; The data in the full single-layer storage unit block is moved to the target four-layer storage unit block according to the layer type and the valid data type.
2. The data storage method according to claim 1, wherein: The valid data type is the block type of the corresponding full single-layer storage unit block, and the full single-layer storage unit block includes a first single-layer storage unit block storing valid data of the first data type and a second single-layer storage unit block storing valid data of the second data type.
3. The data storage method according to claim 2, wherein: Before determining the data migration result based on the storage data information of the full single-layer storage unit block and the storable data amount information of the free four-layer storage unit block, the method further includes: Performing feature detection on a write task sent by a host device to obtain feature information corresponding to the write task; wherein the feature information includes at least one of a logical block address, a write size, a write mode, and a read count of the write task; Determine, based on the characteristic information, a data type label of the data to be written in the write task; wherein the data type label is any preset data label, and the preset data labels include a cold data label, a warm data label, and a hot data label; According to the data type label, a target single-layer storage unit block corresponding to the write task is allocated from a pool of free single-layer storage unit blocks, and the data to be written is written to the target single-layer storage unit block; wherein, when the data type label is the cold data label or the hot data label, the target single-layer storage unit block is the single-layer storage unit block with the smallest number of erase and write times in the pool of free single-layer storage unit blocks; when the data type label is the warm data label, the number of erase and write times of the target single-layer storage unit block is less than the average number of erase and write times of the pool of free single-layer storage unit blocks.
4. The data storage method according to claim 1, wherein: The step of determining the data migration result based on the storage data information of the full single-layer storage unit block and the storable data amount information of the idle four-layer storage unit block includes: Determine whether the sum of the valid data amounts of all the full single-layer storage unit blocks reaches the overall storable data amount of the four-layer storage unit blocks to be used; wherein the storable data amount information includes the overall storable data amount; If so, the data migration determination result is determined to be the start data migration, and the currently to-be-used four-layer storage unit block is determined as the target four-layer storage unit block.
5. The data storage method according to any one of claim 1, characterized in that: The step of obtaining the layer type of each layer in the target four-layer storage unit block includes: pass , calculate the storage time of each layer in the target four-layer storage unit block; where T wl For the stated retention period, RBER wl is the raw bit error rate of a single word line, PE max is the preset maximum number of erase and write times of the solid-state hard disk, PE is the number of erase and write times of the target four-layer storage unit block, temp is the temperature of the solid-state hard disk of the four-layer storage unit, rd cnt is the number of reads of the target four-layer storage unit block, wl is the number of layers of the target four-layer storage unit block, and wl mean is the number of middle layers of the target four-layer storage unit block, and A, B, C and D are preset coefficients respectively; According to the storage duration, K-means clustering is performed on all layers in the target four-layer storage unit block to obtain a layer type of each layer in the target four-layer storage unit block; wherein K is 2.
6. The data storage method according to claim 1, wherein: The step of moving the data in the full single-layer storage unit block to the target four-layer storage unit block according to the layer type and the valid data type includes: If the number of erase / write times of the target four-layer storage unit block does not reach a first number threshold, then, based on the layer type and the valid data type, fully writing four pages of each layer in the target four-layer storage unit block using data in the full single-layer storage unit block; If the number of erase / write times of the target four-layer storage unit block reaches the first number threshold and does not reach the second number threshold, then, based on the layer type and the valid data type, the four pages of the non-target layer and the first page, the second page, and the third page of the target layer in the target four-layer storage unit block are fully written using the data in the full single-layer storage unit block; wherein the target layer is a preset unstable layer, and the non-target layer is a layer other than the preset unstable layer in the target four-layer storage unit block; If the number of erase / write times of the target four-layer storage unit block reaches the second number threshold and does not reach the third number threshold, then, based on the layer type and the valid data type, fully write the four pages of the non-target layer and the first and second pages of the target layer of the target four-layer storage unit block using the data in the full single-layer storage unit block; If the number of erase and write times of the target four-layer storage unit block reaches the third number threshold, then according to the layer type and the valid data type, the four pages of the non-target layer and the first page of the target layer in the target four-layer storage unit block are filled with data in the full single-layer storage unit block; wherein the third number threshold is greater than the second number threshold and greater than the first number threshold.
7. The data storage method according to any one of claims 1 to 6, characterized in that: Also includes: Obtaining a next write task prediction result corresponding to a current write task sent by a host device; wherein the next write task prediction result is a result predicted by the host device based on sample features of the current write task, the sample features including at least one of a logical block address, a write size, a write mode, a write start time, and a write data type of the current write task, the write data type being any preset data type, including a cold data type, a warm data type, and a hot data type; If the current write task and the predicted result of the next write task are write tasks of the same write data type, data of the target data type is selected from the cache and moved to the single-layer storage unit block; wherein, the target data type is two data types other than the write data type in the predicted result of the next write task.
8. A data storage device, characterized in that: Applicable to four-layer storage unit solid-state drives, including: a determination module, configured to determine a data migration determination result based on storage data information of a full single-layer storage unit block and storable data volume information of an idle four-layer storage unit block; wherein the full single-layer storage unit block is a full single-layer storage unit block in the four-layer storage unit solid-state drive; the storage data information includes a valid data volume and a valid data type, the valid data type includes a first data type and a second data type, the first data type includes a cold data type and a hot data type, and the second data type includes a warm data type; an acquisition module, configured to, if the data migration determination result is to initiate data migration, acquire a layer type of each layer in a target four-layer storage unit block; wherein the target four-layer storage unit block is any of the idle four-layer storage unit blocks, and the layer types include a short-term storage layer corresponding to the first data type and a long-term storage layer corresponding to the second data type; A migration module is used to migrate the data in the full single-layer storage unit block to the target four-layer storage unit block according to the layer type and the valid data type.
9. A four-layer storage unit solid state hard disk, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the data storage method according to any one of claims 1 to 7 when executing the computer program.
10. A data storage system, characterized in that: include: A host device and a four-layer storage unit solid state drive as claimed in claim 9.