SSD data scanning method and device, computer device, and storage medium

By calibrating the longest data retention timetable for each erase/write cycle, scanning is only performed on physical blocks that exceed the time threshold, thus solving the power consumption and performance issues caused by full SSD scanning and achieving low-power, high-efficiency data scanning.

CN115543184BActive Publication Date: 2026-04-21SUZHOU UNIONMEMORY INFORMATION SYST LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU UNIONMEMORY INFORMATION SYST LTD
Filing Date
2022-03-11
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing SSDs suffer from increased power consumption and decreased host performance during periodic full disk data scans.

Method used

By defining the longest data retention timetable for different erase/write cycles, the system periodically checks for background data scan triggers and only scans physical blocks that have exceeded the longest data retention time, thus avoiding full disk access.

Benefits of technology

This effectively reduces NAND access volume, lowers power consumption, improves host command response performance, and ensures data reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115543184B_ABST
    Figure CN115543184B_ABST
Patent Text Reader

Abstract

This invention relates to an SSD data scanning method, apparatus, computer device, and storage medium. The method includes: calibrating the longest data retention time schedule for different erase / write cycles and loading it into memory; checking for background data scanning triggers; determining if the SSD has triggered; if triggered, traversing all physical blocks carrying data and selecting any one of them; obtaining the erase / write cycles and data retention time of the physical block and searching for the corresponding erase / write cycle entry; comparing the physical block's data retention time with the longest data retention time in the erase / write cycle entry; determining if it exceeds the longest data retention time; if it does, scanning all physical page data of the physical block; determining if weak data exists in the physical page data; if so, moving the valid data to a new physical block. This invention can effectively reduce full disk access to NAND, reduce power consumption, improve host command response latency, and ensure data reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of SSD data scanning technology, and in particular to SSD data scanning methods, apparatus, computer equipment, and storage media. Background Technology

[0002] Solid-state drives (SSDs) are widely used in various applications and are gradually replacing traditional HDDs in the PC market, providing users with a better experience in terms of reliability and performance. SSDs use NAND flash memory as the storage medium, where different voltage states of cells represent specific values ​​(0 / 1). Due to the characteristics of NAND, electrons can leak from the cells after programming and prolonged storage, leading to data errors. To combat this error, SSDs typically periodically scan the entire disk during operation to check for data nearing corruption; if any is found, the data is refreshed and written to new physical pages. However, frequent background data scanning increases SSD power consumption and also affects the SSD's responsiveness to the host. Summary of the Invention

[0003] The purpose of this invention is to overcome the shortcomings of the prior art and provide an SSD data scanning method, apparatus, computer equipment, and storage medium.

[0004] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:

[0005] Firstly, this embodiment provides an SSD data scanning method, including the following steps:

[0006] Define the longest data retention timetable for different erase / write cycles;

[0007] Load the longest data retention time schedule for the different erase / write cycles into memory;

[0008] Periodic checks trigger background data scans;

[0009] Determine if the SSD has triggered a background data scan;

[0010] If a background data scan is triggered, all physical blocks carrying data are traversed, and any one of the physical blocks carrying data is selected.

[0011] Obtain the number of erase / write cycles and the data retention time of the physical block, and find the corresponding erase / write cycle entry in the longest data retention time table for different erase / write cycle levels;

[0012] Compare the data retention time of the physical block with the longest data retention time of the erase / write count entry;

[0013] Determine whether the data retention time of the physical block is greater than the longest data retention time of the erase / write count entry;

[0014] If the data retention time exceeds the longest data retention time specified in the erase / write count table, then all physical page data of the physical block are scanned.

[0015] Determine whether the physical page data contains weak data;

[0016] If weak data exists, the valid data within the physical block will be moved to a new physical block.

[0017] The further technical solution is as follows: In the step of calibrating the longest data retention time schedule for different erase / write cycles, the calibration of the longest data retention time schedule for different erase / write cycles includes the following steps:

[0018] Select several physical blocks;

[0019] The maximum number of erase / write cycles specified by the physical blocks is N times;

[0020] Set time for holding the circuit in place while energized;

[0021] Scan the physical page data in the aforementioned physical blocks;

[0022] Determine whether the physical page data is uncorrectable;

[0023] If the error cannot be corrected, the cumulative data retention time under the current erase / write count is marked as the longest data retention time under that erase / write count, and recorded in the longest data retention time table for different erase / write count levels;

[0024] Determine whether the aforementioned physical blocks have reached the maximum number of erase / write cycles;

[0025] If the maximum number of erase / write cycles is reached, the longest data retention timetable calibration for different erase / write cycle levels is completed.

[0026] The further technical solution is as follows: after the step of determining whether there is weak data in the physical page data, it further includes: if there is no weak data, then process the next physical block carrying data, and return to the step of obtaining the number of erase / write operations and data retention time of the physical block, and find the corresponding erase / write operation entry in the longest data retention time table of different erase / write operation levels.

[0027] The further technical solution is as follows: after determining whether the data retention time of the physical block is greater than the longest data retention time of the erase / write count table entry, it further includes: if it is not greater than the longest data retention time of the erase / write count table entry, then jump to execute "process the next physical block carrying data, and return to execute the step of obtaining the erase / write count and data retention time of the physical block, and searching for the corresponding erase / write count table entry in the longest data retention time table of different erase / write count levels".

[0028] Secondly, this embodiment provides an SSD data scanning device, including: a calibration unit, a loading unit, a checking unit, a first judgment unit, a traversal selection unit, an acquisition and search unit, a comparison unit, a second judgment unit, a scanning unit, a third judgment unit, and a transfer unit.

[0029] The calibration unit is used to calibrate the longest data retention time schedule for different erase / write cycles.

[0030] The loading unit is used to load the longest data retention time schedule for different erase / write cycles into the memory.

[0031] The inspection unit is used to periodically check the background data scan trigger;

[0032] The first judgment unit is used to determine whether the SSD has triggered a background data scan;

[0033] The traversal selection unit is used to traverse all physical blocks carrying data and select any one of them if a background data scan is triggered.

[0034] The acquisition and search unit is used to acquire the number of erase / write operations and the data retention time of the physical block, and to search for the corresponding erase / write operation entry in the longest data retention time table for different erase / write operation levels.

[0035] The comparison unit is used to compare the data retention time of the physical block with the longest data retention time of the erase / write count entry;

[0036] The second determination unit is used to determine whether the data retention time of the physical block is greater than the longest data retention time of the erase / write count entry;

[0037] The scanning unit is used to scan all physical page data of the physical block if the data retention time is greater than the longest data retention time of the erase / write count entry.

[0038] The third judgment unit is used to determine whether there is weak data in the physical page data;

[0039] The transfer unit is used to transfer valid data from the physical block to a new physical block if weak data exists.

[0040] The further technical solution is as follows: the calibration unit includes: a selection module, an erasing module, a holding module, a scanning module, a first judgment module, a marking and recording module, a second judgment module, and a completion module;

[0041] The selection module is used to select several physical blocks;

[0042] The erase / write module is used to erase / write the plurality of physical blocks a maximum number of times specification / N times;

[0043] The holding module is used to maintain a energized static position for a set time;

[0044] The scanning module is used to scan the physical page data in the plurality of physical blocks;

[0045] The first judgment module is used to determine whether the physical page data is uncorrectable;

[0046] The marking and recording module is used to mark the cumulative data retention time under the current number of erase / write cycles as the longest data retention time under that number of erase / write cycles if the error cannot be corrected, and record it in the longest data retention time table for different erase / write cycle levels;

[0047] The second judgment module is used to determine whether the plurality of physical blocks have reached the maximum number of erase / write cycles;

[0048] The completion module is used to complete the calibration of the longest data retention time schedule for different erase / write count levels if the maximum number of erase / write counts is reached.

[0049] The further technical solution includes: a processing return unit, used to process the next physical block carrying data if no weak data exists, and return the execution of obtaining the number of erase / write operations and data retention time of the physical block, and find the corresponding erase / write operation entry in the longest data retention time table of different erase / write operation levels.

[0050] The further technical solution includes: a jump unit, used to jump to execute "process the next physical block carrying data, and return to execute the process of obtaining the number of erases and writes and the data retention time of the physical block, and finding the corresponding erase and write count entry in the longest data retention time table for different erase and write count levels" if the data retention time is not greater than the longest data retention time of the erase and write count entry.

[0051] Thirdly, this embodiment provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the SSD data scanning method described above.

[0052] Fourthly, this embodiment provides a storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, can implement the SSD data scanning method described above.

[0053] The beneficial effects of this invention compared to existing technologies are as follows: By establishing the longest data retention timetable for different erase / write count levels, and then reading the erase / write count and data write timestamp information of each physical block at runtime, the longest timetable item for the erase / write count in the longest data retention timetable for the corresponding different erase / write count levels is searched. If the data retention time of the current physical block is greater than the maximum time, the physical block is scanned; otherwise, the physical block is skipped. Based on this scanning rule, full disk access to NAND can be effectively reduced, power consumption can be reduced, host command response latency can be improved, and data reliability can also be guaranteed.

[0054] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. Attached Figure Description

[0055] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0056] Figure 1 This is a schematic diagram of a typical existing SSD configuration;

[0057] Figure 2 This is a schematic diagram of the cell voltage distribution in SSD multi-bit storage mode;

[0058] Figure 3 A schematic diagram showing the distribution of cell voltage offset after NAND data has been written and stored for a long time.

[0059] Figure 4 A flowchart illustrating the SSD data scanning method provided in this embodiment of the invention. Figure 1 ;

[0060] Figure 5 A flowchart illustrating the SSD data scanning method provided in this embodiment of the invention. Figure 2 ;

[0061] Figure 6 A schematic diagram of the SSD data scanning device provided in the embodiments of the present invention. Figure 1 ;

[0062] Figure 7A schematic diagram of the SSD data scanning device provided in the embodiments of the present invention. Figure 2 ;

[0063] Figure 8 A schematic block diagram of a computer device provided for an embodiment of the present invention. Detailed Implementation

[0064] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0065] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0066] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0067] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0068] Please see Figure 1 As shown, a typical SSD consists of:

[0069] DIE, a cell that can independently and concurrently perform internal NAND operations;

[0070] A block, or physical block, is an independently erasable cell within a NAND array. Once data is written to each physical location within a block, the entire block must be erased before the next write operation.

[0071] Page, physical page, programming unit.

[0072] Please see Figure 2 As shown, the cell voltage distribution of the SSD in multi-bit storage mode;

[0073] NAND data storage relies on different cell states: In multi-bit storage mode, each cell corresponds to 4 bits, which can be programmed as 0 / 1 respectively. These bits can be combined to represent 16 values, such as 1111, 1110, 1100…0000, and these 16 values ​​can be associated with different voltage distributions. In this case, fifteen preset reference voltages (Vref_1,…Vref_15) are needed to determine 0 / 1. Due to the smaller intervals between voltage distributions, this mode is more prone to errors compared to single-bit storage mode.

[0074] Please see Figure 3 As shown, when NAND is stored for a long time: after long-term storage, due to electron leakage, the voltage on the right side will shift to the left; in the multi-bit storage mode (QLC), since there are sixteen voltage intervals and the window of each interval is very narrow, the left shift will cause some voltages to cross the reference voltage / overlap with the adjacent voltage distribution. Once this scenario occurs, the reference voltage will make an incorrect judgment when making voltage comparison, and thus return incorrect data.

[0075] To combat this scenario, SSDs typically perform periodic full disk scans to check if the number of erroneous bits exceeds a threshold (e.g., 100 bits / 1KB). If so, the corresponding data is considered weak and is in a state of impending failure. In this case, the valid data in such physical blocks is rewritten to new physical blocks. Because the data is rewritten, the voltage offset effect caused by the previously accumulated data retention is eliminated.

[0076] The existing implementation process requires periodic full disk scanning, which necessitates a large number of NAND reads. This consumes NAND bandwidth, resulting in low host command response performance and high power consumption.

[0077] Please see Figure 4 The specific embodiment shown in this invention discloses an SSD data scanning method, including the following steps:

[0078] S1, which specifies the longest data retention time for different erase / write cycles;

[0079] Please see Figure 5 In the specific embodiment shown, step S1, the calibration of the longest data retention timetable for different erase / write cycles includes the following steps:

[0080] S1a, select several physical blocks;

[0081] Among them, 128 physical blocks can be selected from different positions of NAND (such as start / middle / end). S1b, the maximum number of erase / write cycles of the selected physical blocks is specified as N times;

[0082] N can be customized according to actual needs or experience, such as 100, 128 or 150.

[0083] S1c, set time for holding the battery statically;

[0084] The step involves setting a time limit for leaving the SSD powered on and idle. In this embodiment, the set time is 1 hour or 2 hours, etc.

[0085] S1d, scan the physical page data in the plurality of physical blocks;

[0086] S1e: Determine if the physical page data is uncorrectable; if it is correctable, return to step S1c.

[0087] S1f, if error correction is not possible, mark the cumulative data retention time under the current erase / write count as the longest data retention time under that erase / write count, and record it in the longest data retention time table for different erase / write count levels;

[0088] S1g: Determine whether the physical blocks have reached the maximum number of erase / write cycles; if the maximum number of erase / write cycles has not been reached, return to step S1b.

[0089] S1h, if the maximum number of erase / write cycles is reached, the longest data retention timetable calibration for different erase / write cycle levels is completed.

[0090] Among them, at the factory, for the corresponding SSD, the longest data retention time under different PE (erasure and write cycles) of the physical blocks is scanned / created (in terms of specific implementation, considering that the data retention time is related to temperature, it can be calibrated by temperature conversion or by the worst operating temperature, but no limit is made here).

[0091] Please refer to Table 1 for the longest data retention time table (PE_Retention_TH_Table) for different erase / write cycles created at the time of manufacture;

[0092] PE (Physical Erasure Count) represents the number of times a physical block has been erased or written. When looking up a table, based on the current PE of the physical block, the nearest entry with a PE greater than or equal to the current PE is returned. For example, if MAX_PE = 3000, N = 100, and the actual PE of the physical block is 62, which falls between entries with PE = 60 and 90, then the longest data retention time in the PE_Retention_TH_Table entry with PE = 90 is returned. The longest data retention time (in hours) corresponds to the longest data retention time under the given PE; exceeding this time may result in data errors.

[0093]

[0094] Table 1

[0095] S2, Load the longest data retention schedule for the different erase / write cycles into the memory;

[0096] S3, periodically checks background data scans;

[0097] Here, periodicity refers to an empirical value or a manufacturer-defined value (such as 1 hour).

[0098] S4: Determine if the SSD has triggered a background data scan; if not, return to step S3.

[0099] In step S4, the condition for triggering a background data scan is that the time interval between the last background data scan and the trigger time exceeds a specific threshold.

[0100] Furthermore, in this embodiment, the specific threshold is 120H or 240H, etc.

[0101] S5, if a background data scan is triggered, then traverse all physical blocks carrying data and select any one of them.

[0102] Among them, carrying data refers to carrying valid data, which refers to the last data written by the host for a specific address (such as LBA0).

[0103] S6, obtain the number of erase / write operations and data retention time of the physical block, and find the corresponding erase / write operation entry in the longest data retention time table for different erase / write operation levels;

[0104] S7, compare the data retention time of the physical block with the longest data retention time of the erase / write count entry;

[0105] S8, determine whether the data retention time of the physical block is greater than the longest data retention time of the erase / write count entry; if it is not greater than the longest data retention time of the erase / write count entry, then proceed to step S11.

[0106] S9, if the data retention time is greater than the longest data retention time of the erase / write count entry, then scan all physical page data of the physical block;

[0107] S10, determine whether there is weak data in the physical page data;

[0108] S11, if no weak data exists, process the next physical block carrying data and return to execute step S6;

[0109] S12, if weak data exists, the valid data in the physical block is moved to a new physical block.

[0110] In this embodiment, valid data refers to the data last written by the host for a specific address (such as LBA 0). A new physical block refers to a blank physical block that does not contain any data.

[0111] The term "weak data" refers to data within a physical block that is considered weak when the number of erroneous bits exceeds a threshold. Specifically, the threshold is 100 bits per 1KB.

[0112] In this invention, by filtering based on the PE of the corresponding physical block and the actual data retention time each time a data scan check is triggered, only physical blocks that exceed the maximum data retention time are scanned, thereby effectively reducing NAND access volume, thereby reducing power consumption and improving host command response performance.

[0113] This invention establishes a maximum data retention timetable for different erase / write count levels by calibration. Then, at runtime, it reads the erase / write count and data write timestamp information of each physical block, searches for the longest timetable item for the erase / write count in the maximum data retention timetable for different erase / write count levels, and scans the physical block if the data retention time of the current physical block is greater than the maximum time; otherwise, it skips the physical block. Based on this scanning rule, it can effectively reduce full disk access to NAND, reduce power consumption, improve host command response latency, and also ensure data reliability.

[0114] Please see Figure 6 As shown, the present invention also discloses an SSD data scanning device, including: a calibration unit 10, a loading unit 20, a checking unit 30, a first judgment unit 40, a traversal selection unit 50, an acquisition search unit 60, a comparison unit 70, a second judgment unit 80, a scanning unit 90, a third judgment unit 100, and a transfer unit 120.

[0115] The calibration unit 10 is used to calibrate the longest data retention time schedule for different erase / write cycles.

[0116] The loading unit 20 is used to load the longest data retention time schedule of different erase / write cycles into the memory;

[0117] The inspection unit 30 is used to periodically check the background data scan trigger;

[0118] The first judgment unit 40 is used to determine whether the SSD has triggered a background data scan;

[0119] The traversal selection unit 50 is used to traverse all physical blocks carrying data and select any one of them if a background data scan is triggered.

[0120] The acquisition and search unit 60 is used to acquire the number of erase / write operations and the data retention time of the physical block, and to search for the corresponding erase / write operation entry in the longest data retention time table for different erase / write operation levels.

[0121] The comparison unit 70 is used to compare the data retention time of the physical block with the longest data retention time of the erase / write count entry;

[0122] The second judgment unit 80 is used to determine whether the data retention time of the physical block is greater than the longest data retention time of the erase / write count entry;

[0123] The scanning unit 90 is used to scan all physical page data of the physical block if the data retention time is greater than the longest data retention time of the erase / write count entry.

[0124] The third judgment unit 100 is used to determine whether there is weak data in the physical page data;

[0125] The transfer unit 120 is used to transfer the valid data in the physical block to a new physical block if weak data exists.

[0126] Please see Figure 7 As shown, the calibration unit 10 includes: a selection module 11, an erasing module 12, a holding module 13, a scanning module 14, a first judgment module 15, a marking and recording module 16, a second judgment module 17, and a completion module 18.

[0127] The selection module 11 is used to select several physical blocks;

[0128] The erase / write module 12 is used to erase / write the plurality of physical blocks a maximum number of erase / write times specification / N times;

[0129] The holding module 13 is used to hold the device in a static position for a set time while it is energized;

[0130] The scanning module 14 is used to scan the physical page data in the plurality of physical blocks;

[0131] The first judgment module 15 is used to determine whether the physical page data is uncorrectable;

[0132] The marking and recording module 16 is used to mark the cumulative data retention time under the current number of erase / write cycles as the longest data retention time under that number of erase / write cycles if the error cannot be corrected, and record it in the longest data retention time table for different erase / write cycle levels;

[0133] The second judgment module 17 is used to determine whether the plurality of physical blocks have reached the maximum number of erase / write cycles;

[0134] The completion module 18 is used to complete the calibration of the longest data retention time schedule for different erase / write count levels if the maximum number of erase / write counts is reached.

[0135] The device further includes a processing return unit 110, which is used to process the next physical block carrying data if no weak data exists, and return the execution of obtaining the number of erase / write operations and data retention time of the physical block, and find the corresponding erase / write operation entry in the longest data retention time table for different erase / write operation levels.

[0136] The device further includes a jump unit, which, if the data retention time is not greater than the longest data retention time of the erase / write count entry, jumps to execute "processing the next physical block carrying data, and returning to execute the process of obtaining the erase / write count and data retention time of the physical block, and searching for the corresponding erase / write count entry in the longest data retention time table for different erase / write count levels".

[0137] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned SSD data scanning device and each unit can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.

[0138] The aforementioned SSD data scanning device can be implemented as a computer program, which can perform tasks such as... Figure 8 It runs on the computer device shown.

[0139] Please see Figure 8 , Figure 8 This is a schematic block diagram of a computer device 500 provided in an embodiment of this application; the computer device 500 can be a terminal or a server, wherein the terminal can be an electronic device with communication functions such as a smartphone, tablet computer, laptop computer, desktop computer, personal digital assistant, and wearable device. The server can be a standalone server or a server cluster composed of multiple servers.

[0140] See Figure 8 The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.

[0141] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform an SSD data scanning method.

[0142] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.

[0143] The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute an SSD data scanning method.

[0144] This network interface 505 is used for network communication with other devices. Those skilled in the art will understand that... Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0145] The processor 502 is used to run a computer program 5032 stored in the memory to perform the following steps:

[0146] Step S1: Define the longest data retention time for different erase / write cycles.

[0147] Step S2: Load the longest data retention time schedule for different erase / write cycles into the memory;

[0148] Step S3: Periodically check for background data scan triggers;

[0149] Step S4: Determine whether the SSD has triggered a background data scan; if no background data scan has been triggered, return to step S3.

[0150] Step S5: If background data scanning is triggered, traverse all physical blocks carrying data and select any one of them.

[0151] Step S6: Obtain the number of erase / write cycles and the data retention time of the physical block, and find the corresponding erase / write cycle entry in the longest data retention time table for different erase / write cycle levels;

[0152] Step S7: Compare the data retention time of the physical block with the longest data retention time of the erase / write count entry;

[0153] Step S8: Determine whether the data retention time of the physical block is greater than the longest data retention time of the erase / write count entry; if it is not greater than the longest data retention time of the erase / write count entry, proceed to step S11.

[0154] Step S9: If the data retention time is greater than the longest data retention time of the erase / write count entry, then scan all physical page data of the physical block;

[0155] Step S10: Determine whether there is weak data in the physical page data;

[0156] Step S11: If no weak data exists, process the next physical block carrying data and return to execute step S6.

[0157] Step S12: If weak data exists, the valid data in the physical block is moved to a new physical block.

[0158] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0159] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0160] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions that, when executed by a processor, can implement the above-described SSD data scanning method. The storage medium stores a computer program, which includes program instructions that, when executed by a processor, can implement the above-described method. The program instructions include the following steps:

[0161] Step S1: Define the longest data retention time for different erase / write cycles.

[0162] Step S2: Load the longest data retention time schedule for different erase / write cycles into the memory;

[0163] Step S3: Periodically check for background data scan triggers;

[0164] Step S4: Determine whether the SSD has triggered a background data scan; if no background data scan has been triggered, return to step S3.

[0165] Step S5: If background data scanning is triggered, traverse all physical blocks carrying data and select any one of them.

[0166] Step S6: Obtain the number of erase / write cycles and the data retention time of the physical block, and find the corresponding erase / write cycle entry in the longest data retention time table for different erase / write cycle levels;

[0167] Step S7: Compare the data retention time of the physical block with the longest data retention time of the erase / write count entry;

[0168] Step S8: Determine whether the data retention time of the physical block is greater than the longest data retention time of the erase / write count entry; if it is not greater than the longest data retention time of the erase / write count entry, proceed to step S11.

[0169] Step S9: If the data retention time is greater than the longest data retention time of the erase / write count entry, then scan all physical page data of the physical block;

[0170] Step S10: Determine whether there is weak data in the physical page data;

[0171] Step S11: If no weak data exists, process the next physical block carrying data and return to execute step S6.

[0172] Step S12: If weak data exists, the valid data in the physical block is moved to a new physical block.

[0173] In one embodiment, the calibration of the longest data retention time schedule for different erase / write cycles includes the following steps:

[0174] Step S1a: Select several physical blocks;

[0175] Step S1b: Erase the plurality of physical blocks to the maximum number of erase / write cycles specified by N times;

[0176] Step S1c: Hold the energized object at rest for a set time;

[0177] Step S1d: Scan the physical page data in the plurality of physical blocks;

[0178] Step S1e: Determine whether the physical page data is uncorrectable; if it is correctable, return to step S1c.

[0179] In step S1f, if the error cannot be corrected, the cumulative data retention time under the current erase / write count is marked as the longest data retention time under that erase / write count, and recorded in the longest data retention time table for different erase / write count levels;

[0180] Step S1g: Determine whether the number of physical blocks has reached the maximum number of erase / write cycles; if the maximum number of erase / write cycles has not been reached, return to step S1b.

[0181] In step S1h, if the maximum number of erase / write cycles is reached, the longest data retention timetable calibration for different erase / write cycle levels is completed.

[0182] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0183] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0184] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0185] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0186] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0187] The above embodiments are preferred implementations of the present invention. In addition, the present invention can be implemented in other ways. Any obvious substitutions without departing from the concept of the present technical solution are within the protection scope of the present invention.

Claims

1. An SSD data scanning method, characterized in that, Includes the following steps: Define the longest data retention timetable for different erase / write cycles; Load the longest data retention time schedule for the different erase / write cycles into memory; Periodic checks trigger background data scans; Determine if the SSD has triggered a background data scan; If a background data scan is triggered, all physical blocks carrying data are traversed, and any one of the physical blocks carrying data is selected. Obtain the number of erase / write cycles and the data retention time of the physical block, and find the corresponding erase / write cycle entry in the longest data retention time table for different erase / write cycle levels; Compare the data retention time of the physical block with the longest data retention time of the erase / write count entry; Determine whether the data retention time of the physical block is greater than the longest data retention time of the erase / write count entry; If the data retention time exceeds the longest data retention time specified in the erase / write count table, then all physical page data of the physical block are scanned. Determine whether the physical page data contains weak data; If weak data exists, the valid data in the physical block will be moved to a new physical block; The step of calibrating the longest data retention timetable for different erase / write cycles includes the following steps: Select several physical blocks; The maximum number of erase / write cycles specified by the physical blocks is N times; Set time for holding the circuit in place while energized; Scan the physical page data in the aforementioned physical blocks; Determine whether the physical page data is uncorrectable; If the error cannot be corrected, the cumulative data retention time under the current erase / write count is marked as the longest data retention time under that erase / write count, and recorded in the longest data retention time table for different erase / write count levels; Determine whether the aforementioned physical blocks have reached the maximum number of erase / write cycles; If the maximum number of erase / write cycles is reached, the longest data retention timetable calibration for different erase / write cycle levels is completed.

2. The SSD data scanning method according to claim 1, characterized in that, After determining whether the physical page data contains weak data, the method further includes: if no weak data is found, processing the next physical block carrying data, and returning to the step of obtaining the number of erase / write operations and data retention time of the physical block, and searching for the corresponding erase / write operation entry in the longest data retention time table for different erase / write operation levels.

3. The SSD data scanning method according to claim 2, characterized in that, After determining whether the data retention time of the physical block is greater than the longest data retention time of the erase / write count table entry, the method further includes: if it is not greater than the longest data retention time of the erase / write count table entry, then jump to execute "process the next physical block carrying data, and return to execute the step of obtaining the erase / write count and data retention time of the physical block, and finding the corresponding erase / write count table entry in the longest data retention time table of different erase / write count levels".

4. An SSD data scanning device, characterized in that, include: The system includes a calibration unit, a loading unit, a checking unit, a first judgment unit, a traversal selection unit, an acquisition and search unit, a comparison unit, a second judgment unit, a scanning unit, a third judgment unit, and a transfer unit. The calibration unit is used to calibrate the longest data retention time schedule for different erase / write cycles. The loading unit is used to load the longest data retention time schedule for different erase / write cycles into the memory. The inspection unit is used to periodically check the background data scan trigger; The first judgment unit is used to determine whether the SSD has triggered a background data scan; The traversal selection unit is used to traverse all physical blocks carrying data and select any one of them if a background data scan is triggered. The acquisition and search unit is used to acquire the number of erase / write operations and the data retention time of the physical block, and to search for the corresponding erase / write operation entry in the longest data retention time table for different erase / write operation levels. The comparison unit is used to compare the data retention time of the physical block with the longest data retention time of the erase / write count entry; The second determination unit is used to determine whether the data retention time of the physical block is greater than the longest data retention time of the erase / write count entry; The scanning unit is used to scan all physical page data of the physical block if the data retention time is greater than the longest data retention time of the erase / write count entry. The third judgment unit is used to determine whether there is weak data in the physical page data; The transfer unit is used to transfer the valid data in the physical block to a new physical block if weak data exists. The calibration unit includes: a selection module, an erasing module, a holding module, a scanning module, a first judgment module, a marking and recording module, a second judgment module, and a completion module; The selection module is used to select several physical blocks; The erase / write module is used to erase / write the plurality of physical blocks a maximum number of times specification / N times; The holding module is used to maintain a energized static position for a set time; The scanning module is used to scan the physical page data in the plurality of physical blocks; The first judgment module is used to determine whether the physical page data is uncorrectable; The marking and recording module is used to mark the cumulative data retention time under the current number of erase / write cycles as the longest data retention time under that number of erase / write cycles if the error cannot be corrected, and record it in the longest data retention time table for different erase / write cycle levels; The second judgment module is used to determine whether the plurality of physical blocks have reached the maximum number of erase / write cycles; The completion module is used to complete the calibration of the longest data retention time schedule for different erase / write count levels if the maximum number of erase / write counts is reached.

5. The SSD data scanning device according to claim 4, characterized in that, Also includes: The processing return unit is used to process the next physical block carrying data if no weak data exists, and return the execution of obtaining the erase / write count and data retention time of the physical block, and find the corresponding erase / write count entry in the longest data retention time table for different erase / write count levels.

6. The SSD data scanning device according to claim 5, characterized in that, Also includes: The jump unit is used to jump to execute "process the next physical block carrying data and return to execute the process of obtaining the number of erases and writes and the data retention time of the physical block, and finding the corresponding erase and write count entry in the longest data retention time table for different erase and write count levels" if the data retention time is not greater than the longest data retention time of the erase and write count entry.

7. A computer device, characterized in that, The computer device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the SSD data scanning method as described in any one of claims 1-3.

8. A storage medium, characterized in that, The storage medium stores a computer program, which includes program instructions that, when executed by a processor, can implement the SSD data scanning method as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Method for reducing response delay of solid state hard disk

    CN106502583A