Method, device, equipment and medium for extending SSD lifespan by utilizing different data characteristics

By establishing a write boundary block and data write pool in SSD, dynamically adjusting the filling threshold and read times of data blocks, and reasonably allocating data, solving the problem of extended read time and shortening of life caused by read interference, and reducing the number of read rewrites and improving SSD performance.

CN115240743BActive Publication Date: 2025-08-29JINAN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210954690.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-10
Publication Date
2025-08-29
Estimated Expiration
2042-08-10

AI Technical Summary

Technical Problem

In the prior art, the read time and life shortening caused by the read interference of SSDs, and traditional read interference management technology is difficult to effectively reduce the number of read and rewrite times and extend the life of SSDs.

Method used

By establishing the first write boundary block, the second write boundary block and the data write pool in the SSD, the filling threshold and read times of the data block are dynamically adjusted, and the user write data and read and rewrite data are reasonably allocated, reducing read interference accumulation and avoiding additional erasing operations.

Benefits of technology

It effectively reduces the number of read and rewrite times, extends the life of the SSD, and shortens the read delay time, improving the reliability and performance of the SSD.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115240743B_ABST
    Figure CN115240743B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, apparatus, device, and medium for extending the lifespan of solid-state drives (SSDs) by utilizing the diverse characteristics of data. This method addresses the issue of SSD data blocks requiring erase operations due to severe read disturb, which impacts the SSD's lifespan. The method proposes managing data using two write boundary blocks and a data write pool, mixing low-frequency user write data with high-frequency read-rewrite data proportionally into the same block. This reduces data block read disturb and the number of erases, thereby extending the SSD's lifespan. The present invention utilizes the diverse characteristics of data written to the SSD to reduce the number of read-rewrites while shortening the SSD's read latency and alleviating SSD reliability issues caused by read-rewrites.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of SSD data storage technology, and more specifically, relates to a method, apparatus, device and medium for extending the life of an SSD by utilizing different characteristics of data. Background Art

[0002] 3D NAND flash memory is a widely used storage device, and its performance and reliability are currently of great concern. In solid-state drives (SSDs), a circuit-level noise called read disturb exists. The primary cause of read disturb is read accumulation. When a block is read too frequently, this operation severely disrupts the block's voltage distribution. Therefore, when read disturb is present in a block, NAND flash memory can take several times longer to read a single page, or even permanently lose the disturbed page. SSDs employ a read-rewrite operation, similar to garbage collection (GC), which erases a severely disturbed block. If the disturbed block contains valid data, the valid data must be written to a new, free block. These erase operations increase SSD response time, increase write amplification, and shorten service life. Traditional read disturb management technologies primarily involve firmware-level correction and device-level management. Firmware-level correction reduces read disturb by lowering the read voltage of a data block, while device-level management manages data placement to reduce read disturb for each block. Experiments have shown that distributing the write-back data generated by read-rewrite (most of the default write-back data is hot read data) into multiple data blocks and combining it with other user write data can reduce the number of read-rewrite cycles to a certain extent, extend the life of the SSD and shorten the SSD's response time, thereby improving the SSD's performance and ensuring the SSD's reliability. Summary of the Invention

[0003] The purpose of the present invention is to address the above-mentioned defects in the prior art and to provide a method, apparatus, computer equipment and storage medium for extending the life of an SSD by utilizing different characteristics of data.

[0004] The first object of the present invention can be achieved by adopting the following technical solutions:

[0005] A method for extending the life of an SSD by utilizing different data characteristics is applied to a solid-state drive (SSD) that needs to erase and rewrite block data due to block read interference. The method includes the following steps:

[0006] S1. Establishing a first write boundary block, a second write boundary block, and a data write pool in an SSD, wherein the first write boundary block is used to store newly written user write data, the second write boundary block is used to store write-back data caused by read rewrite, and the data write pool is used to store a certain number of first write boundary blocks and second write boundary blocks;

[0007] S2. When the data filled in the first or second write boundary block reaches a preset threshold, the first or second write boundary block is placed in the data write pool. If the data write pool is already full of data blocks, the data blocks in the data write pool are polled to find the data block with the least number of reads. If the number of reads of this data block is greater than the number of reads of the first or second write boundary block that has reached the threshold, the current first or second write boundary block is swapped with the data block in the data write pool. That is, the current first or second write boundary block enters the data write pool, and the replaced data block becomes the current first or second write boundary block.

[0008] S3. Dynamically adjust the data filling threshold of the write boundary block according to the number of blocks in the data write pool. Assuming that there are n data blocks in the data write pool, the threshold of user write data in the first write boundary block is (n–1) / n of the data block capacity, and 1 / n of free space is reserved. When the user write data in the first write boundary block reaches the threshold, step S2 is executed, and the reserved 1 / n of free space is used to store read-rewrite data; similarly, the ratio of read-rewrite data in the second write boundary block is 1 / n of the data block capacity, and (n–1) / n of free space is reserved. That is, the ratio of read-rewrite data to data block space in the first write boundary block and the second write boundary block is always the inverse of the number of data blocks in the data write pool;

[0009] S4. When user write data arrives, if the data write pool is pre-filled with data blocks of user write data, the user write data is written to the current first write boundary block. If the data in the first write boundary block reaches the threshold, step S2 is executed. If the data write pool is pre-filled with data blocks of read-rewrite data, a data block with the least number of reads is polled from the data write pool and the user write data is written to the data block. If a data block in the data write pool is full, the full data block is removed from the data write pool and step S3 is executed.

[0010] S5. When read-rewrite data arrives, if the data write pool is pre-filled with data blocks that are written by the user, a data block with the least number of reads is polled from the data write pool, and the read-rewrite data is written into the data block. If a data block in the data write pool is full, it is driven out of the data write pool and step S3 is executed. If the data write pool is pre-filled with data blocks that are written by the user, determine whether the number of data blocks in the data write pool reaches the maximum capacity of the data write pool. If not, write the read-rewrite data into the second write boundary block. If so, write the data into the data write pool directly.

[0011] Furthermore, the process of step S4 is as follows:

[0012] S41, polling the data blocks in the data write pool, looking for the data block that is pre-filled with read-rewrite data and has the least number of reads. If it can be found, go to step S42; if not, go to step S43;

[0013] S42. Directly write the user write data into the found data block;

[0014] S43: Write the user write data into the first write boundary block. If the number of data blocks in the data write pool reaches the maximum capacity of the data write pool, determine whether the number of data blocks in the data write pool reaches the maximum capacity of the data write pool. If not, proceed to step S44; if so, proceed to step S45.

[0015] S44: put the current first write boundary block into the data write pool, and randomly select a free block from the free block pool to become the new first write boundary block;

[0016] S45. Poll the data write pool for a block with the largest number of reads and compare it with the current first write boundary block. If the current first write boundary block has a smaller number of reads, replace the current first write boundary block with the data block in the data write pool. That is, the current first write boundary block enters the data write pool, and the replaced data block becomes the current first write boundary block.

[0017] Furthermore, the process of step S5 is as follows:

[0018] S51, polling the data blocks in the data write pool, looking for the data block that is pre-filled with user write data and has the least number of reads. If it can be found, go to step S52; if not, go to step S53;

[0019] S52, directly writing the read and rewrite data into the found data block;

[0020] S53, determining whether the number of data blocks in the data write pool has reached the maximum capacity of the data write pool; if not, proceeding to step S54; if so, proceeding to step S55;

[0021] S54: Write the read-rewrite data into the second write boundary block. If the second write boundary block threshold is reached, put the current second write boundary block into the data write pool and randomly select a free block from the free block pool as the new second write boundary block.

[0022] S55. Poll the data write pool to find a data block with the minimum number of reads, and directly write the read-rewrite data into this data block. If this data block is just full, drive it out of the data write pool and execute step S3.

[0023] Furthermore, the user write data filling threshold γ1 in the first write boundary block is set to (n–1) / n, where n is the number of blocks in the data write pool. By pre-filling the first write boundary block with a large amount of user write data, the accuracy of predicting the number of future reads of the data block in step S4 can be improved.

[0024] Furthermore, the fill threshold for read-rewrite data in the second write boundary block is γ2 = 1 / n, where n is the number of blocks in the data write pool. Distributing the read-rewrite data across multiple data blocks can reduce the read disturb of a single data block and evenly distribute the read disturb to data blocks with fewer reads.

[0025] Furthermore, an initial capacity value and a maximum capacity value are set for the data block capacity in the data write pool. When the number of data blocks is less than the initial capacity value, the filling threshold n in the first write boundary block and the second write boundary block is set to the initial capacity value; when the number of data blocks is greater than or equal to the initial value, the filling threshold n in the first write boundary block and the second write boundary block is the number of blocks in the current data write pool.

[0026] Furthermore, in step S4, when polling the data write pool for a data block with the fewest read counts, if multiple data blocks have the same read count, the data block with the most failed pages is selected. The failed pages will not be read again in the future. Assuming that the read frequencies of other pages are similar, the data block with the most failed pages will generate less read interference in the future.

[0027] Furthermore, in step S5, when the data write pool is pre-filled with data blocks of read-rewrite data, since the threshold value of the second write boundary block pre-filled with read-rewrite data is 1 / n, the data blocks in the current data write pool will have a large amount of free space. Therefore, when the number of blocks in the data write pool reaches the initial capacity value, the capacity will not continue to expand to the maximum capacity, but will maintain the current capacity until the data block space in the data write pool is filled with data.

[0028] The second object of the present invention can be achieved by adopting the following technical solutions:

[0029] A device for extending the life of an SSD by utilizing different characteristics of data, the device comprising:

[0030] An initialization module is configured to establish a first write boundary block, a second write boundary block, and a data write pool in the SSD, wherein the first write boundary block is used to store newly written user write data, the second write boundary block is used to store write-back data caused by read rewrite, and the data write pool is used to store a certain number of first write boundary blocks and second write boundary blocks;

[0031] a first data module configured to place the first or second write boundary block into a data write pool when the data filled in the first or second write boundary block reaches a preset threshold; and, if the data write pool is already full of data blocks, to poll the data blocks in the data write pool and find the data block with the least number of reads; and, if the number of reads of this data block is greater than the number of reads of the first or second write boundary block that has reached the threshold, to swap the current first or second write boundary block with the data block in the data write pool, i.e., the current first or second write boundary block enters the data write pool, and the swapped data block becomes the current first or second write boundary block;

[0032] The second data module is used to dynamically adjust the data fill threshold of the write boundary block according to the number of blocks in the data write pool. Assuming that there are n data blocks in the data write pool, the threshold of user write data in the first write boundary block is (n–1) / n of the data block capacity, and 1 / n of the free space is reserved. When the user write data in the first write boundary block reaches the threshold, the first data module is executed, and the reserved 1 / n of the free space is used to store read-rewrite data; similarly, the ratio of read-rewrite data in the second write boundary block is 1 / n of the data block capacity, and (n–1) / n of the free space is reserved. That is, the ratio of read-rewrite data to data block space in the first and second write boundary blocks is always the inverse of the number of data blocks in the data write pool;

[0033] A write data processing module is configured to, when user write data arrives, write the user write data to the current first write boundary block if the data write pool is pre-filled with data blocks that have user write data, and execute the first data module if the data in the first write boundary block reaches a threshold; if the data write pool is pre-filled with data blocks that have read and rewritten data, poll a data block with the least number of reads from the data write pool and write the user write data to the data block; if a data block in the data write pool is full, remove the full data block from the data write pool and execute the second data module;

[0034] The read data processing module is used to, when read and rewrite data arrives, poll a data block with the least number of reads from the data write pool if the data write pool is pre-filled with data blocks written by users, write the read and rewrite data into the data block; if a data block in the data write pool is full, drive it out of the data write pool and execute the second data module; if the data write pool is pre-filled with data blocks written by users, determine whether the number of data blocks in the data write pool reaches the maximum capacity of the data write pool; if not, write the read and rewrite data into the second write boundary block; if so, write the data directly into the data write pool.

[0035] The third object of the present invention can be achieved by adopting the following technical solutions:

[0036] A computer device includes a processor and a memory for storing a program executable by the processor. When the processor executes the program stored in the memory, the method of extending the life of an SSD by utilizing different characteristics of data is implemented.

[0037] The fourth object of the present invention can be achieved by adopting the following technical solutions:

[0038] A storage medium stores a program, which, when executed by a processor, implements the above-mentioned method of extending the life of an SSD by utilizing different characteristics of data.

[0039] The present invention has the following advantages and effects compared to the prior art:

[0040] (1) The method of the present invention uses data with fewer read times extracted from user requests to pre-fill a specific part of each block, and then uses the write-back data caused by read-rewrite to fill the block pre-filled with user data. The ratio of user write data and read-rewrite data in the data block is controlled by the threshold of the first write boundary block and the second write boundary block, so as to avoid certain blocks accumulating too much read interference and requiring an erase operation.

[0041] (2) The method of the present invention extracts data with fewer read times from user write data through multiple blocks in the data write pool, which is conducive to dispersing the write-back data caused by read-rewrite into a large range of blocks and combining it with data with fewer read times, thereby reducing the occurrence of the second read-rewrite and the overall read times of the block. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0043] Figure 1This is a schematic diagram of a method disclosed in the present invention for extending the life of an SSD by utilizing different characteristics of data;

[0044] Figure 2 is a detailed flow chart of step S4 of the present invention;

[0045] Figure 3 is a detailed flow chart of step S5 of the present invention;

[0046] Figure 4 This is a block diagram of the structure of a device for extending the life of an SSD by utilizing different data characteristics in Example 3 of the present invention;

[0047] Figure 5 This is a structural block diagram of the computer device in Example 4 of the present invention. DETAILED DESCRIPTION

[0048] 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.

[0049] Example 1

[0050] like Figure 1 、 Figure 2 and Figure 3 As shown, this embodiment discloses a method for extending the lifespan of an SSD by utilizing different data characteristics. Applied in a solid-state disk storage system, this method pre-populates a specific portion of each block with data extracted from user requests that has a low read count. The pre-populated blocks are then filled with write-back data caused by read-rewrites. The ratio of user-written data to read-rewrite data in a data block is controlled by thresholds for the first and second write boundary blocks, preventing certain blocks from accumulating excessive read disturb and requiring an erase operation. Simultaneously, data with a low read count is extracted from user-written data using multiple blocks in a data write pool. The write-back data caused by read-rewrites is dispersed across a wide range of blocks and combined with the data with a low read count, thereby reducing the occurrence of a second read-rewrite and the overall number of reads per block. Finally, a performance test was conducted on this solid-state disk data management method to evaluate the performance impact of the present invention on the flash memory system from multiple perspectives. The present invention sets a data pre-fill attribute for each logical block in the solid-state disk's onboard cache DRAM to identify the type of data pre-filled in the logical block. The pre-fill threshold and the maximum block capacity of the data write pool are also dynamically set. The method is divided into five main steps:

[0051] S1. Establish a first write boundary block, a second write boundary block and a data write pool in the SSD, wherein the first write boundary block is used to store newly written user write data, the second write boundary block is used to store write-back data caused by read rewrite, and the data write pool is used to store a certain number of first write boundary blocks and second write boundary blocks.

[0052] S2. Dynamically adjust the thresholds for the first and second write boundary blocks and the maximum capacity of the data write pool. The initial value of the data write pool capacity is set to 20, the threshold for user write data in the first write boundary block is set to 19 / 20, and the threshold for read / rewrite data in the second write boundary block is set to 1 / 20.

[0053] S3. When the data write pool is filled with 20 blocks, the thresholds for the first and second write boundary blocks are adjusted for each new data block. For example, when the data write pool has 21 blocks, the threshold for user write data in the first write boundary block is set to 20 / 21, and the threshold for read / rewrite data in the second write boundary block is set to 1 / 21. The maximum capacity of the data write pool is set to 40.

[0054] S4, such as Figure 2 As shown, when user write data arrives, if the data write pool is pre-filled with data blocks of user write data, the user write data is written to the current first write boundary block. If the data in the first write boundary block reaches the threshold, the data block with the most read times in the data write pool is polled and compared with the first write boundary block. If the first write boundary block has a small number of reads, the first write boundary block enters the data write pool, and the data block with the large number of reads becomes the new first write boundary block. If the data write pool is pre-filled with read-rewrite data blocks, a data block with the least number of reads is polled from the data write pool, and the user write data is written to the data block. If a data block in the data write pool is full, it is driven out of the data write pool, and the thresholds of the first write boundary block and the second write boundary block are adjusted.

[0055] S5, such as Figure 3 As shown, when read-rewrite data arrives, the data blocks in the data write pool are polled to find the data block that is pre-filled with user write data and has the least number of reads. If it can be found, the read-rewrite data is directly written to the found data block; if it cannot be found, it is determined whether the number of data blocks in the data write pool has reached the maximum capacity of the data write pool. If not, the read-rewrite data is written to the second write boundary block; if it has reached the maximum capacity, the data write pool is polled for a data block with the least number of reads, and the read-rewrite data is directly written to this data block.

[0056] In summary, the present embodiment proposes a method for extending the life of an SSD by utilizing different data characteristics. This method is to reasonably distribute and combine write data according to their respective data characteristics by setting a first write boundary block, a second write boundary block, and a data write pool, and to set data write thresholds for the first write boundary block and the second write boundary block in advance. As shown in Table 1, adjusting the initial value of the data write pool capacity will change the number of read and rewrite operations of the load, evenly distributing read disturbances to multiple data blocks in the data write pool, thereby avoiding the need for additional read and rewrite operations for certain blocks due to severe read disturbance accumulation. This reduces the number of read and rewrite operations, shortens the read latency of the SSD, and alleviates SSD reliability issues caused by read and rewrite.

[0057] Example 2

[0058] This embodiment further discloses a method for extending the lifespan of an SSD by utilizing different data characteristics. The method mainly includes five steps:

[0059] S1. Establish a first write boundary block, a second write boundary block and a data write pool in the SSD, wherein the first write boundary block is used to store newly written user write data, the second write boundary block is used to store write-back data caused by read rewrite, and the data write pool is used to store a certain number of first write boundary blocks and second write boundary blocks.

[0060] S2. Dynamically adjust the thresholds for the first and second write boundary blocks and the maximum capacity of the data write pool. The initial value of the data write pool capacity is set to 10, the threshold for user write data in the first write boundary block is set to 9 / 10, and the threshold for read / rewrite data in the second write boundary block is set to 1 / 10.

[0061] S3. After the data write pool is filled with 10 blocks, the thresholds for the first and second write boundary blocks are adjusted for each new data block. For example, if the data write pool has 11 blocks, the threshold for user write data in the first write boundary block is set to 10 / 11, and the threshold for read / rewrite data in the second write boundary block is set to 1 / 11. The maximum capacity of the data write pool is set to 20.

[0062] S4, such as Figure 2As shown, when user write data arrives, if the data write pool is pre-filled with data blocks of user write data, the user write data is written to the current first write boundary block. If the data in the first write boundary block reaches the threshold, the data block with the most read times in the data write pool is polled and compared with the first write boundary block. If the first write boundary block has a small number of reads, the first write boundary block enters the data write pool, and the data block with the large number of reads becomes the new first write boundary block. If the data write pool is pre-filled with read-rewrite data blocks, a data block with the least number of reads is polled from the data write pool, and the user write data is written to the data block. If a data block in the data write pool is full, it is driven out of the data write pool, and the thresholds of the first write boundary block and the second write boundary block are adjusted.

[0063] S4, such as Figure 3 As shown, when read-rewrite data arrives, the data blocks in the data write pool are polled to find the data block that is pre-filled with user write data and has the least number of reads. If it can be found, the read-rewrite data is directly written to the found data block; if it cannot be found, it is determined whether the number of data blocks in the data write pool has reached the maximum capacity of the data write pool. If not, the read-rewrite data is written to the second write boundary block; if it has reached the maximum capacity, the data write pool is polled for a data block with the least number of reads, and the read-rewrite data is directly written to this data block.

[0064] To summarize, the present embodiment proposes a method for extending the life of an SSD by utilizing different data characteristics, which is to reasonably distribute and combine the write data according to their respective data characteristics by setting a first write boundary block, a second write boundary block, and a data write pool, and to set the data write thresholds of the first write boundary block and the second write boundary block in advance.

[0065] Table 1. Comparison of read and rewrite times under different loads with different data write pool capacity initial values

[0066]

[0067] As shown in Table 1, adjusting the initial value of the data write pool capacity changes the number of read and rewrite operations during the workload, evenly distributing read disturb across multiple data blocks in the data write pool. This prevents certain blocks from requiring additional read and rewrite operations due to severe read disturb accumulation. This reduces the number of read and rewrite operations and shortens the SSD's read latency, alleviating SSD reliability issues caused by read and rewrite.

[0068] Example 3

[0069] like Figure 4As shown, this embodiment provides a device for extending the life of an SSD by utilizing different data characteristics. The device includes an initialization module 401, a first data module 402, a second data module 403, a write data processing module 404, and a read data processing module 405. The specific functions of each module are as follows:

[0070] Initialization module 401 is configured to establish a first write boundary block, a second write boundary block, and a data write pool in the SSD, wherein the first write boundary block is used to store newly written user write data, the second write boundary block is used to store write-back data caused by read rewrite, and the data write pool is used to store a certain number of first write boundary blocks and second write boundary blocks;

[0071] The first data module 402 is configured to place the first or second write boundary block into the data write pool when the data filled in the first or second write boundary block reaches a preset threshold. If the data write pool is already full of data blocks, the first data module 402 polls the data blocks in the data write pool and finds the data block with the least number of reads. If the number of reads of this data block is greater than the number of reads of the first or second write boundary block that has reached the threshold, the first or second write boundary block is swapped with the data block in the data write pool. That is, the first or second write boundary block is placed into the data write pool, and the replaced data block becomes the current first or second write boundary block.

[0072] The second data module 403 is used to dynamically adjust the data filling threshold of the write boundary block according to the number of blocks in the data write pool. Assuming that there are n data blocks in the data write pool, the threshold of user write data in the first write boundary block is (n-1) / n of the data block capacity, and 1 / n of the free space is reserved. When the user write data in the first write boundary block reaches the threshold, the first data module is executed, and the reserved 1 / n of the free space is used to store read-rewrite data; similarly, the ratio of read-rewrite data in the second write boundary block is 1 / n of the data block capacity, and (n-1) / n of the free space is reserved. That is, the ratio of read-rewrite data to data block space in the first write boundary block and the second write boundary block is always the inverse of the number of data blocks in the data write pool;

[0073] The write data processing module 404 is configured to, when user write data arrives, write the user write data to the current first write boundary block if the data write pool is pre-filled with data blocks of user write data. If the data in the first write boundary block reaches a threshold, execute the first data module. If the data write pool is pre-filled with data blocks of read-rewrite data, poll the data write pool for a data block with the least number of reads and write the user write data to the data block. If a data block in the data write pool is full, remove the full data block from the data write pool and execute the second data module.

[0074] The read data processing module 405 is used to, when read and rewrite data arrives, if the data write pool is pre-filled with data blocks written by users, poll a data block with the least number of reads from the data write pool, write the read and rewrite data into the data block, and if a data block in the data write pool is full, drive it out of the data write pool and execute the second data module; if the data write pool is pre-filled with data blocks written by users, determine whether the number of data blocks in the data write pool reaches the maximum capacity of the data write pool, if not, write the read and rewrite data into the second write boundary block, if so, write it directly into the data write pool.

[0075] The specific implementation of each module in this embodiment can be found in the above-mentioned embodiment 1, and will not be described one by one here; it should be noted that the device provided in this embodiment is only illustrated by the division of the above-mentioned functional modules. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure can be divided into different functional modules to complete all or part of the functions described above.

[0076] Example 4

[0077] This embodiment provides a computer device, which can be a computer, such as Figure 5 As shown, a processor 502, a memory, an input device 503, a display 504, and a network interface 505 are connected via a system bus 501. The processor is used to provide computing and control capabilities. The memory includes a non-volatile storage medium 506 and an internal memory 507. The non-volatile storage medium 506 stores an operating system, a computer program, and a database. The internal memory 507 provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. When the processor 502 executes the computer program stored in the memory, the method for extending the life of an SSD by utilizing different data characteristics proposed in the above-mentioned embodiment 1 is implemented. In the solid-state drive hereinafter referred to as SSD, the method includes the following steps:

[0078] S1. Establishing a first write boundary block, a second write boundary block, and a data write pool in an SSD, wherein the first write boundary block is used to store newly written user write data, the second write boundary block is used to store write-back data caused by read rewrite, and the data write pool is used to store a certain number of first write boundary blocks and second write boundary blocks;

[0079] S2. When the data filled in the first or second write boundary block reaches a preset threshold, the first or second write boundary block is placed in the data write pool. If the data write pool is already full of data blocks, the data blocks in the data write pool are polled to find the data block with the least number of reads. If the number of reads of this data block is greater than the number of reads of the first or second write boundary block that has reached the threshold, the current first or second write boundary block is swapped with the data block in the data write pool. That is, the current first or second write boundary block enters the data write pool, and the replaced data block becomes the current first or second write boundary block.

[0080] S3. Dynamically adjust the data filling threshold of the write boundary block according to the number of blocks in the data write pool. Assuming that there are n data blocks in the data write pool, the threshold of user write data in the first write boundary block is (n–1) / n of the data block capacity, and 1 / n of free space is reserved. When the user write data in the first write boundary block reaches the threshold, step S2 is executed, and the reserved 1 / n of free space is used to store read-rewrite data; similarly, the ratio of read-rewrite data in the second write boundary block is 1 / n of the data block capacity, and (n–1) / n of free space is reserved. That is, the ratio of read-rewrite data to data block space in the first write boundary block and the second write boundary block is always the inverse of the number of data blocks in the data write pool;

[0081] S4. When user write data arrives, if the data write pool is pre-filled with data blocks of user write data, the user write data is written to the current first write boundary block. If the data in the first write boundary block reaches the threshold, step S2 is executed. If the data write pool is pre-filled with data blocks of read-rewrite data, a data block with the least number of reads is polled from the data write pool and the user write data is written to the data block. If a data block in the data write pool is full, the full data block is removed from the data write pool and step S3 is executed.

[0082] S5. When read-rewrite data arrives, if the data write pool is pre-filled with data blocks that are written by the user, a data block with the least number of reads is polled from the data write pool, and the read-rewrite data is written into the data block. If a data block in the data write pool is full, it is driven out of the data write pool and step S3 is executed. If the data write pool is pre-filled with data blocks that are written by the user, determine whether the number of data blocks in the data write pool reaches the maximum capacity of the data write pool. If not, write the read-rewrite data into the second write boundary block. If so, write the data into the data write pool directly.

[0083] Example 5

[0084] This embodiment provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the method of using different data characteristics to extend the life of an SSD in the above-mentioned embodiment 1 is implemented. In the solid-state drive (SSD), the method includes the following steps:

[0085] S1. Establishing a first write boundary block, a second write boundary block, and a data write pool in an SSD, wherein the first write boundary block is used to store newly written user write data, the second write boundary block is used to store write-back data caused by read rewrite, and the data write pool is used to store a certain number of first write boundary blocks and second write boundary blocks;

[0086] S2. When the data filled in the first or second write boundary block reaches a preset threshold, the first or second write boundary block is placed in the data write pool. If the data write pool is already full of data blocks, the data blocks in the data write pool are polled to find the data block with the least number of reads. If the number of reads of this data block is greater than the number of reads of the first or second write boundary block that has reached the threshold, the current first or second write boundary block is swapped with the data block in the data write pool. That is, the current first or second write boundary block enters the data write pool, and the replaced data block becomes the current first or second write boundary block.

[0087] S3. Dynamically adjust the data filling threshold of the write boundary block according to the number of blocks in the data write pool. Assuming that there are n data blocks in the data write pool, the threshold of user write data in the first write boundary block is (n–1) / n of the data block capacity, and 1 / n of free space is reserved. When the user write data in the first write boundary block reaches the threshold, step S2 is executed, and the reserved 1 / n of free space is used to store read-rewrite data; similarly, the ratio of read-rewrite data in the second write boundary block is 1 / n of the data block capacity, and (n–1) / n of free space is reserved. That is, the ratio of read-rewrite data to data block space in the first write boundary block and the second write boundary block is always the inverse of the number of data blocks in the data write pool;

[0088] S4. When user write data arrives, if the data write pool is pre-filled with data blocks of user write data, the user write data is written to the current first write boundary block. If the data in the first write boundary block reaches the threshold, step S2 is executed. If the data write pool is pre-filled with data blocks of read-rewrite data, a data block with the least number of reads is polled from the data write pool and the user write data is written to the data block. If a data block in the data write pool is full, the full data block is removed from the data write pool and step S3 is executed.

[0089] S5. When read-rewrite data arrives, if the data write pool is pre-filled with data blocks that are written by the user, a data block with the least number of reads is polled from the data write pool, and the read-rewrite data is written into the data block. If a data block in the data write pool is full, it is driven out of the data write pool and step S3 is executed. If the data write pool is pre-filled with data blocks that are written by the user, determine whether the number of data blocks in the data write pool reaches the maximum capacity of the data write pool. If not, write the read-rewrite data into the second write boundary block. If so, write the data into the data write pool directly.

[0090] The storage medium described in this embodiment can be a magnetic disk, an optical disk, a computer memory, a random access memory (RAM), a USB flash drive, a mobile hard disk, or other media.

[0091] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.

Claims

1. A method for extending the life of an SSD by utilizing different data characteristics, applied to a solid-state drive (hereinafter referred to as an SSD) that needs to erase and rewrite block data due to block read interference, characterized in that: The method comprises the following steps: S1. Establishing a first write boundary block, a second write boundary block, and a data write pool in an SSD, wherein the first write boundary block is used to store newly written user write data, the second write boundary block is used to store write-back data caused by read rewrite, and the data write pool is used to store a certain number of first write boundary blocks and second write boundary blocks; S2. When the data filled in the first or second write boundary block reaches a preset threshold, the first or second write boundary block is placed in the data write pool. If the data write pool is already full of data blocks, the data blocks in the data write pool are polled to find the data block with the least number of reads. If the number of reads of this data block is greater than the number of reads of the first or second write boundary block that has reached the threshold, the current first or second write boundary block is swapped with the data block in the data write pool. That is, the current first or second write boundary block enters the data write pool, and the replaced data block becomes the current first or second write boundary block. S3. Dynamically adjust the data filling threshold of the write boundary block according to the number of blocks in the data write pool. Assuming that there are n data blocks in the data write pool, the threshold of user write data in the first write boundary block is (n–1) / n of the data block capacity, and 1 / n of free space is reserved. When the user write data in the first write boundary block reaches the threshold, step S2 is executed, and the reserved 1 / n of free space is used to store read-rewrite data; similarly, the ratio of read-rewrite data in the second write boundary block is 1 / n of the data block capacity, and (n–1) / n of free space is reserved. That is, the ratio of read-rewrite data to data block space in the first write boundary block and the second write boundary block is always the inverse of the number of data blocks in the data write pool; S4. When user write data arrives, if the data write pool is pre-filled with data blocks of user write data, the user write data is written to the current first write boundary block. If the data in the first write boundary block reaches the threshold, step S2 is executed. If the data write pool is pre-filled with data blocks of read-rewrite data, a data block with the least number of reads is polled from the data write pool and the user write data is written to the data block. If a data block in the data write pool is full, the full data block is removed from the data write pool and step S3 is executed. S5. When read-rewrite data arrives, if the data write pool is pre-filled with data blocks that are written by the user, a data block with the least number of reads is polled from the data write pool, and the read-rewrite data is written into the data block. If a data block in the data write pool is full, it is driven out of the data write pool and step S3 is executed. If the data write pool is pre-filled with data blocks that are written by the user, determine whether the number of data blocks in the data write pool reaches the maximum capacity of the data write pool. If not, write the read-rewrite data into the second write boundary block. If so, write the data into the data write pool directly.

2. The method for extending the life of an SSD by utilizing different characteristics of data according to claim 1, characterized in that: The process of step S4 is as follows: S41, polling the data blocks in the data write pool, looking for the data block that is pre-filled with read-rewrite data and has the least number of reads. If it can be found, go to step S42; if not, go to step S43; S42. Directly write the user write data into the found data block; S43: Write the user write data into the first write boundary block. If the number of data blocks in the data write pool reaches the maximum capacity of the data write pool, determine whether the number of data blocks in the data write pool reaches the maximum capacity of the data write pool. If not, proceed to step S44; if so, proceed to step S45. S44: put the current first write boundary block into the data write pool, and randomly select a free block from the free block pool to become the new first write boundary block; S45. Poll the data write pool for a block with the largest number of reads and compare it with the current first write boundary block. If the current first write boundary block has a smaller number of reads, replace the current first write boundary block with the data block in the data write pool. That is, the current first write boundary block enters the data write pool, and the replaced data block becomes the current first write boundary block.

3. The method for extending the life of an SSD by utilizing different characteristics of data according to claim 1, characterized in that: The process of step S5 is as follows: S51, polling the data blocks in the data write pool, looking for the data block that is pre-filled with user write data and has the least number of reads. If it can be found, go to step S52; if not, go to step S53; S52, directly writing the read and rewrite data into the found data block; S53, determining whether the number of data blocks in the data write pool has reached the maximum capacity of the data write pool; if not, proceeding to step S54; if so, proceeding to step S55; S54: Write the read-rewrite data into the second write boundary block. If the second write boundary block threshold is reached, put the current second write boundary block into the data write pool and randomly select a free block from the free block pool as the new second write boundary block. S55. Poll the data write pool to find a data block with the minimum number of reads, and directly write the read-rewrite data into this data block. If this data block is just full, drive it out of the data write pool and execute step S3.

4. The method for extending the life of an SSD by utilizing different characteristics of data according to claim 1, characterized in that: The filling threshold γ1 of the user write data in the first write boundary block is (n−1) / n.

5. The method for extending the life of an SSD by utilizing different characteristics of data according to claim 1, characterized in that: The fill threshold γ2 of the read-rewrite data in the second write boundary block is 1 / n, where n is the number of blocks in the data write pool.

6. A device based on the method of using different data characteristics to extend the life of an SSD according to any one of claims 1 to 5, characterized in that: The device comprises: An initialization module is configured to establish a first write boundary block, a second write boundary block, and a data write pool in the SSD, wherein the first write boundary block is used to store newly written user write data, the second write boundary block is used to store write-back data caused by read rewrite, and the data write pool is used to store a certain number of first write boundary blocks and second write boundary blocks; a first data module configured to place the first or second write boundary block into a data write pool when the data filled in the first or second write boundary block reaches a preset threshold; and, if the data write pool is already full of data blocks, to poll the data blocks in the data write pool and find the data block with the least number of reads; and, if the number of reads of this data block is greater than the number of reads of the first or second write boundary block that has reached the threshold, to swap the current first or second write boundary block with the data block in the data write pool, i.e., the current first or second write boundary block enters the data write pool, and the swapped data block becomes the current first or second write boundary block; The second data module is used to dynamically adjust the data fill threshold of the write boundary block according to the number of blocks in the data write pool. Assuming that there are n data blocks in the data write pool, the threshold of user write data in the first write boundary block is (n–1) / n of the data block capacity, and 1 / n of the free space is reserved. When the user write data in the first write boundary block reaches the threshold, the first data module is executed, and the reserved 1 / n of the free space is used to store read-rewrite data; similarly, the ratio of read-rewrite data in the second write boundary block is 1 / n of the data block capacity, and (n–1) / n of the free space is reserved. That is, the ratio of read-rewrite data to data block space in the first and second write boundary blocks is always the inverse of the number of data blocks in the data write pool; A write data processing module is configured to, when user write data arrives, write the user write data to the current first write boundary block if the data write pool is pre-filled with data blocks that have user write data, and execute the first data module if the data in the first write boundary block reaches a threshold; if the data write pool is pre-filled with data blocks that have read and rewritten data, poll a data block with the least number of reads from the data write pool and write the user write data to the data block; if a data block in the data write pool is full, remove the full data block from the data write pool and execute the second data module; The read data processing module is used to, when read and rewrite data arrives, poll a data block with the least number of reads from the data write pool if the data write pool is pre-filled with data blocks written by users, write the read and rewrite data into the data block; if a data block in the data write pool is full, drive it out of the data write pool and execute the second data module; if the data write pool is pre-filled with data blocks written by users, determine whether the number of data blocks in the data write pool reaches the maximum capacity of the data write pool; if not, write the read and rewrite data into the second write boundary block; if so, write the data directly into the data write pool.

7. A computer device comprising a processor and a memory for storing a program executable by the processor, characterized in that: When the processor executes the program stored in the memory, the method for extending the life of an SSD by utilizing different characteristics of data as described in any one of claims 1 to 5 is implemented.

8. A storage medium storing a program, characterized in that: When the program is executed by a processor, the method for extending the life of an SSD by utilizing different characteristics of data as described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Super-Endurance Solid-State Drive with Endurance Translation Layer (ETL) and Diversion of Temp Files for Reduced Flash Wear

    US20120284587A1

  • Data de-duplication

    US20200333970A1