Solid state disk bad block processing method and device, equipment, medium and product

By determining the bad block threshold based on wear level and type information in a solid-state hard disk, and making multi-level judgments combined with the growth rate of flip times, the problem of untimely identification of bad blocks in traditional methods is solved, and more efficient bad block replacement is achieved, and the reliability and performance of data storage is improved.

CN120508264AInactive Publication Date: 2025-08-19INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511007974.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-08-19
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the traditional method of handling bad blocks in solid state drives, bad blocks are not recognized in time, resulting in reduced data storage reliability and impact on read and write performance.

Method used

By obtaining the wear level information and type information of the current block, the target bad block threshold is determined, and when the cumulative number of flips in the detection cycle exceeds the threshold, the current block is determined as a bad block for replacement, and a second-level or third-level judgment is performed in combination with the increase rate of the number of flips to improve recognition accuracy and timeliness.

Benefits of technology

It improves the timeliness and accuracy of bad block recognition, avoids data loss, improves the reliability of data storage and the operation stability of solid-state drives.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508264A_ABST
    Figure CN120508264A_ABST
Patent Text Reader

Abstract

The invention discloses a solid state disk bad block processing method and device, equipment, a medium and a product, and relates to the technical field of computer storage, and the method comprises the following steps: determining a target bad block threshold value from a plurality of preset bad block threshold values according to obtained wear level information and type information of a current block; obtaining the accumulated number of overturning times of the current block in the current detection period; and determining the current block as a bad block for carrying out bad block replacement processing when the accumulative overturning times are greater than the target bad block threshold value. The timeliness and accuracy of bad block identification can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer storage technology, and in particular to a method, device, equipment, medium and product for processing bad blocks of a solid-state hard disk. Background Art

[0002] With the advancement of information technology, solid-state drives (SSDs) have gradually become mainstream storage devices due to their advantages such as high read / write speeds, low power consumption, and strong shock resistance. The NAND flash memory (a type of flash memory consisting of semiconductor cells arranged in series) in SSDs can experience performance issues due to wear and tear over time, manufacturing defects, or unexpected power outages. These issues can lead to abnormal performance of storage blocks, making it impossible to read, write, or store data properly. This results in bad blocks. Bad blocks reduce data storage reliability and affect the read / write performance of SSDs, increasing read / write latency and reducing data transfer rates. Therefore, bad block handling is crucial for ensuring the proper operation of SSDs.

[0003] In the traditional bad block processing method, the current block is identified as a bad block only when the storage block cannot perform the erase and write operation normally, which has the problem of untimely bad block identification. Summary of the Invention

[0004] The present application provides a method for processing bad blocks of a solid-state hard disk, so as to at least solve the problem of untimely bad block identification in the related art.

[0005] The present application provides a method for processing bad blocks of a solid-state hard drive, comprising the following steps: determining a target bad block threshold from a plurality of preset bad block thresholds based on acquired wear level information and type information of a current block; obtaining the cumulative number of flips of the current block in a current detection cycle; and when the cumulative number of flips is greater than the target bad block threshold, determining the current block as a bad block for bad block replacement processing.

[0006] Among them, the wear level information is positively correlated with the cumulative number of erases and writes of the current block. The type information includes hot data type information and cold data type information determined by the read and write frequency of the current block. The cumulative number of flips is the total number of error bit flips accumulated in the current detection cycle.

[0007] The present application also provides a bad block processing device, comprising: a threshold determination module, a flip count determination module and a bad block identification module.

[0008] The threshold determination module is used to determine a target bad block threshold from a plurality of preset bad block thresholds according to the acquired wear level information and type information of the current block.

[0009] The flip count determination module is used to obtain the cumulative flip count of the current block in the current detection cycle.

[0010] The bad block identification module is used to determine the current block as a bad block when the cumulative flip times are greater than the target bad block threshold, so as to perform bad block replacement processing.

[0011] Among them, the wear level information is positively correlated with the cumulative number of erases and writes of the current block. The type information includes hot data type information and cold data type information determined by the read and write frequency of the current block. The cumulative number of flips is the total number of error bit flips accumulated in the current detection cycle.

[0012] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned bad block processing methods when executing the computer program.

[0013] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned bad block processing methods are implemented.

[0014] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned bad block processing methods when executed by a processor.

[0015] Through this application, the corresponding target bad block threshold is confirmed based on the wear level information and type information of the current block, and the cumulative number of flips of the current block within the detection period is compared with the target bad block threshold. When the cumulative number of flips is greater than the target bad block threshold, the current block is determined to be a bad block for bad block replacement. In this application, different wear levels and type information correspond to different bad block thresholds. By combining the wear level of the current block and the type information representing the frequency of data reading and writing to comprehensively determine the bad block threshold for bad block judgment, the accuracy of bad block identification and judgment can be improved. At the same time, based on the cumulative number of flips within the detection period as the detection standard for judging bad blocks, potential bad blocks can be identified in advance for bad block replacement, thereby improving the timeliness of bad block identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0017] Figure 1 A diagram illustrating an application environment of a bad block processing method provided in an embodiment of the present application; Figure 2 A flowchart of a bad block processing method provided in an embodiment of the present application; Figure 3A schematic diagram of a process for determining bad blocks in some embodiments; Figure 4 is a flowchart of a bad block processing method in some embodiments; Figure 5 is a schematic diagram of a bad block replacement process in some embodiments; Figure 6 FIG. 4 is a structural block diagram of a bad block processing device in some embodiments. DETAILED DESCRIPTION

[0018] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0019] It should be noted that, in the description of this application, the terms "comprises", "includes" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. The term "plurality" or other variants are used to indicate that the number of objects is two or more.

[0020] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0021] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the solid state drive bad block processing method depends, the specific application environment architecture or specific hardware architecture is described herein.

[0022] The method for processing bad blocks of a solid-state hard disk provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the solid-state drive 100 includes a control unit 110 and a storage unit 120. The control unit 110 is connected to the storage unit 120 for data read and write scheduling and bad block processing. The storage unit 120 is used to store data. In some examples, the storage unit can be a NAND flash memory chip, which can be composed of multiple layers of stacked flash memory cells, such as TLC (Triple-Level Cell, three-level storage cell) and QLC (Quad-Level Cell, four-level storage cell), divided into multiple dies (bare dies) and planes (planes).

[0023] The bad block processing method is applied to Figure 1 The control unit 110 in FIG. 1 is taken as an example to illustrate, in some embodiments, such as Figure 2 As shown, the method for processing a bad block of a solid state drive includes steps S201 to S203 that can be executed by the control unit 110. Each step is described in detail below.

[0024] Step S201: Determine a target bad block threshold from a plurality of preset bad block thresholds according to the acquired wear level information and type information of the current block.

[0025] The wear level information is positively correlated with the cumulative number of erases and writes of the current block, and the type information includes hot data type information and cold data type information determined by the read and write frequency of the current block.

[0026] The current block is the storage block being detected and identified in the current detection cycle. In a storage system, a block is usually the smallest physical or logical access unit with a fixed size (such as 4KB). It is the basic unit for storage devices to perform read and write operations.

[0027] The theoretical service life of a solid-state drive can usually be reflected by the number of erase and write cycles. SSDs with different flash memory types have different theoretical upper erase and write limits. For example, the theoretical erase and write cycles of SLC (Single-Level Cell) flash memory can reach more than 100,000 times, the theoretical erase and write cycles of TLC flash memory are about 1,000-3,000 times, and the theoretical erase and write cycles of QLC flash memory are 500-1,500 times. Regardless of the type of solid-state drive, the more cumulative erase and write cycles it has, the greater the degree of wear, and accordingly, the higher the wear level.

[0028] The type information corresponds to the data type of the data stored in the current block. If the data stored in the current block is read and written frequently and reaches the preset hot data threshold, the corresponding data is hot data, and the type information of the current block is the hot data type information. If it is less than the preset hot data threshold, it is the cold data type information.

[0029] The bad block threshold is used to compare with the number of error bit flips. If the number of error bit flips within the detection period is greater than the corresponding target bad block threshold, the current block is determined to be a bad block.

[0030] Different wear level information and type information correspond to different bad block thresholds. In some specific examples, a correspondence table of wear level information, type information and bad block thresholds can be set in advance. When the wear level information and type information are determined, the target bad block threshold can be determined according to the preset correspondence table.

[0031] In some specific examples, the higher the wear level corresponding to the wear level information, the smaller the corresponding bad block threshold. The higher the wear level means that the cumulative number of erases is closer to the erase upper limit value corresponding to the theoretical service life. The smaller the threshold is set, the potential failure risk can be identified in advance.

[0032] In addition, since the storage blocks of the hot data type are read and written more frequently, high-frequency read and write operations will accelerate their aging speed. Therefore, under the same wear level, the bad block threshold corresponding to the cold data type is greater than the bad block threshold corresponding to the hot data type.

[0033] Step S202: Obtain the cumulative number of flips of the current block in the current detection cycle.

[0034] The cumulative number of flips is the total number of bit erroneous flips accumulated during the current detection cycle. A bit flip in an SSD occurs when the binary data (0 or 1) stored in the NAND flash memory cell unexpectedly changes due to physical or electrical reasons. Error bits can be detected and corrected using a pre-set error correction mechanism.

[0035] The current detection cycle refers to the detection period corresponding to the current bad block detection instruction. The bad block detection instruction is periodically initiated according to the preset detection frequency during the operation of the solid-state drive.

[0036] Step S203: When the cumulative flipping times is greater than the target bad block threshold, the current block is determined as a bad block for bad block replacement processing.

[0037] In some specific examples, during the operation of the solid-state drive, bad block identification is periodically performed at a preset frequency. A corresponding target bad block threshold is determined based on the acquired wear level and type information of the current block. The cumulative number of flips of the current block during the current detection cycle is acquired. When the cumulative number of flips exceeds the target bad block threshold, the current block is determined to be a bad block and replaced.

[0038] In the above-mentioned method for processing bad blocks of a solid-state hard drive, the corresponding target bad block threshold is confirmed based on the wear level information and type information of the current block, and the cumulative number of flips of the current block within the detection period is compared with the target bad block threshold. When the cumulative number of flips is greater than the target bad block threshold, the current block is determined to be a bad block for bad block replacement. In the present application, different wear levels and type information correspond to different bad block thresholds, and the bad block threshold for bad block judgment is comprehensively determined by combining the wear level of the current block and the type information representing the frequency of data reading and writing. This can improve the accuracy of bad block identification and judgment. At the same time, based on the cumulative number of flips within the detection period as the detection standard for judging bad blocks, potential bad blocks can be identified in advance for bad block replacement, thereby improving the timeliness of bad block identification.

[0039] In some embodiments, as Figure 3 As shown, the bad block processing method may further include steps S301 to S303.

[0040] Step S301: when the cumulative number of flipping times is less than or equal to the target bad block threshold, a target weak block threshold is determined from a plurality of preset weak block thresholds according to the wear level information and the type information.

[0041] Different wear level information and type information correspond to different weak block thresholds. In some specific examples, a correspondence table of wear level information, type information and weak block thresholds can be set in advance. When the wear level information and type information are determined, the target weak block threshold can be determined according to the preset correspondence table.

[0042] When the cumulative number of flips is less than or equal to the target bad block threshold, it indicates that the current block is not a bad block, and further determination is made as to whether it is a weak block. The target weak block threshold for weak block identification is determined based on the wear level information and type information.

[0043] Step S302: When the cumulative number of flipping times is greater than the target weak block threshold, the flipping times growth rate of the current block is calculated.

[0044] When the cumulative flip count is greater than the target weak block threshold, that is, when the cumulative flip count is greater than the target weak block threshold and less than or equal to the target bad block threshold, the flip count growth rate of the current block is further calculated.

[0045] The flip count growth rate represents the growth in the number of erroneous bit flips occurring within the most recent detection cycle. In some examples, the flip count growth rate may be the flip count growth rate in the current detection cycle compared to the previous detection cycle, or the average growth rate over the most recent cycles. The growth rate may refer to a month-on-month growth rate or a year-on-year growth rate. The number of cycles and the calculation method for calculating the flip count growth rate are not particularly limited herein and may be configured by those skilled in the art based on actual circumstances.

[0046] Step S303: When the flip count growth rate is within the first interval of the preset value interval, the current block is determined to be a bad block.

[0047] Any value in the first interval is greater than values in other intervals in the numerical interval.

[0048] In some examples, the preset numerical interval may include a first interval and a second interval, and any numerical value in the first interval is greater than the numerical value in the second interval. In some specific examples, 70% can be used as the dividing endpoint of the first interval and the second interval, that is, the range of the first interval is greater than 70%, and the range of the second interval is less than or equal to 70%. Of course, the preset numerical interval may also include a third interval, and the numerical values of the dividing endpoints of the interval may include 70% and 30%. Each interval may be continuous or discontinuous. There is no restriction on the number of intervals and the dividing endpoints of each interval of the preset numerical interval, as well as whether each interval is a continuous interval. Those skilled in the art can set it according to actual needs.

[0049] When the flip count growth rate is in the first interval with the largest interval value, it means that although the flip count of the current block has not reached the target bad block threshold, the flip growth rate is high and the aging speed of the current block is fast. In this case, the current block is determined to be a bad block and replaced in advance.

[0050] By using the flip count growth rate to perform secondary judgment on bad block identification, blocks with a high flip count growth rate and accelerated aging can be identified in advance, and potential bad blocks can be replaced in advance, thereby improving the security and reliability of data storage.

[0051] In some embodiments, the bad block processing method may further include determining a target threshold group from a plurality of preset threshold groups according to the wear level information and the type information, wherein any threshold group includes a bad block threshold and a weak block threshold.

[0052] In some embodiments, the preset numerical interval further includes a second interval and a third interval, and any value within the second interval is greater than a value within the third interval. That is, the preset numerical interval includes the third interval, the second interval, and the first interval, with values increasing in sequence. Taking the interval division endpoints of 30% and 70% as an example, the interval range of the first interval is greater than 70%, the interval range of the second interval is greater than 30% and less than or equal to 70%, and the interval range of the third interval is less than or equal to 30%.

[0053] Correspondingly, the bad block processing method further includes the following steps: When the flip count growth rate is in the second interval or the third interval, the weak block marking times corresponding to the numerical interval are recorded in the preset weak block record table. When the weak block marking times reaches the preset risk value, the current block is determined to be a bad block.

[0054] Among them, the number of weak block markings corresponding to the second interval is greater than the number of weak block markings corresponding to the third interval. The preset risk value can be 3 or other values. When the growth rate of the number of flips is in the second interval, it means that the storage block is a medium-risk weak block and needs to be continuously monitored and paid attention to. When the growth rate of the number of flips of the storage block is in the third interval, it means that the aging speed of the storage block is slow and it is a low-risk weak block. The number of weak block markings is set to be less than the number of weak block markings in the second interval to avoid misjudgment caused by too high a weight.

[0055] In some specific examples, the number of weak block markings corresponding to the second interval may be 1, and the number of weak block markings corresponding to the third interval may be 0.5. In still other specific examples, the number of weak block markings corresponding to the second interval and the third interval may be 2 and 1, respectively. Accordingly, the risk value may be 3 or 6. Regarding the number of weak block markings and the risk value corresponding to different intervals, those skilled in the art may set them as needed and are not limited here.

[0056] The preset weak block record table is used to record the number of weak block markings, which may include information such as weak block identification and weak block marking times. When any storage block in the solid-state hard disk is identified as a weak block for the first time, that is, when the flip count growth rate is in the second interval or the third interval for the first time, the identification information of the block is added to the weak block record table, and the number of weak block markings is increased by a corresponding number. In subsequent periodic detections, the number of weak block markings is updated according to the specific situation of the flip count growth rate, until the number of weak block markings of the storage block accumulates to be greater than or equal to the risk threshold, the storage block is determined to be a bad block, and the bad block replacement process begins.

[0057] By making different judgments on the growth rate of the number of flips in three intervals (the first interval corresponds to bad blocks, the second interval corresponds to medium-risk weak blocks, and the third interval corresponds to low-risk weak blocks), the judgment dimension and precision of bad block identification are increased, and the status of storage blocks can be monitored and recorded according to the aging of storage blocks at different stages, avoiding the misjudgment problem of bad block identification using a single threshold and a single dimension. Moreover, the aging speed of storage blocks can be predicted through the growth rate of the number of flips, and weak blocks and bad blocks can be identified in advance to avoid data loss caused by sudden bad blocks, thereby improving the reliability of data storage.

[0058] In some embodiments, different cyclic detection cycles can be set for weak blocks of different risk levels, namely the medium-risk weak blocks and low-risk weak blocks mentioned above. For example, the detection cycle frequency of medium-risk weak blocks can be higher than the detection cycle frequency of low-risk weak blocks, thereby increasing the monitoring frequency of medium-risk weak blocks, being able to identify bad blocks in time and replace them in advance, and improving the reliability of data storage.

[0059] In some embodiments, step S302 may include the following steps: obtaining multiple cumulative flipping times of the current block within a statistical period, and calculating a flipping times growth rate based on the multiple cumulative flipping times.

[0060] The statistical period is a plurality of consecutive detection periods including the current detection period, and each detection period corresponds to a cumulative number of flips.

[0061] In some specific examples, the statistical period may include two detection periods, namely the current detection period and the previous detection period. Correspondingly, the cumulative number of flips includes the first cumulative number of flips corresponding to the current detection period and the second cumulative number of flips corresponding to the previous detection period. The calculated growth rate of the number of flips may be a month-on-month growth rate calculated based on the first cumulative number of flips and the second cumulative number of flips.

[0062] For example, the flip growth rate = (first cumulative flip number - second cumulative flip number) / second cumulative flip number * 100%.

[0063] In some specific examples, the statistical period may include three detection periods, namely the current detection period, the previous detection period and the previous two detection periods. Correspondingly, the cumulative number of flips includes the first cumulative number of flips, the second cumulative number of flips and the third cumulative number of flips respectively. The calculated growth rate of the number of flips may be the average of the month-on-month growth rates calculated based on the first cumulative number of flips, the second cumulative number of flips and the third cumulative number of flips.

[0064] For example, the flip growth rate = ((first cumulative flip number - second cumulative flip number) / second cumulative flip number * 100% + (second cumulative flip number - third cumulative flip number) / third cumulative flip number * 100%) / 2.

[0065] In yet other specific examples, the flip count growth rate may be a calculated year-on-year growth rate.

[0066] In some embodiments, calculating the flip count growth rate based on multiple cumulative flip counts can include the following steps: calculating the month-on-month growth rate of the two adjacent cycles based on the cumulative flip counts of the current detection cycle and the two most recent historical detection cycles, and obtaining a first growth rate corresponding to the current detection cycle and a second growth rate corresponding to the previous detection cycle; and performing a weighted average calculation on the first growth rate and the second growth rate based on a preset weight value to obtain the flip count growth rate.

[0067] Among the preset weight values, the weight value of the first growth rate is greater than the weight value of the second growth rate, so that the calculation weight of the growth change of the number of flips in the current detection cycle is higher than that in the previous two detection cycles.

[0068] The two most recent historical detection cycles are the previous detection cycle and the two previous detection cycles of the current detection cycle. The month-on-month growth rates of the two adjacent cycles are calculated respectively, and the weighted average calculation is performed according to the preset weight value to obtain the flip count growth rate.

[0069] Specifically, among the preset weight values, the weight value of the first growth rate and the weight value of the second growth rate can be 0.6 and 0.4 respectively, or 0.7 and 0.3 respectively, or other weight distributions, as long as the weight value of the first growth rate is greater than the weight value of the second growth rate.

[0070] In some specific examples, the calculation formula for the growth rate of the number of flips can be expressed as follows: ; Where GR represents the growth rate of the number of flips, E0 is the cumulative number of flips in the current detection cycle, E1 is the cumulative number of flips in the previous detection cycle, and E2 is the cumulative number of flips in the previous two detection cycles. α is the weight value, which can be 0.6. σ is the minimum value, which can be 1, and is used to avoid calculation overflow caused by a denominator of 0.

[0071] It's easy to understand that when the statistical period includes N detection periods, there are N-1 corresponding weight values. N can be 3, 4, or more. For example, when the statistical period includes 4 detection periods, there are 3 weight values, which can be 0.5, 0.3, and 0.2 respectively. Ensure that the weight value corresponding to the current period is higher than the weight value of the historical period.

[0072] In some embodiments, the bad block processing method also includes the following steps: in response to the error bit flip event of the current block, recording the flip number corresponding to the error bit flip event; counting the flip number according to the preset detection cycle period to obtain the cumulative flip number corresponding to the current detection cycle and multiple cumulative flip numbers corresponding to multiple historical detection cycles.

[0073] That is, during the operation of the solid-state drive, the error bit flip event occurring in the storage block is monitored. When an error bit flip event occurs in the storage block, the flip count corresponding to the error bit flip event is recorded, and the flip count is counted according to the preset detection period to obtain the corresponding cumulative flip count.

[0074] In some specific examples, the detection period for bad block identification can be 5 seconds or other time periods. Correspondingly, the number of flips corresponding to the error bit flip event is counted every 5 seconds to obtain the cumulative number of flips corresponding to the current detection period and multiple cumulative number of flips corresponding to multiple historical detection periods.

[0075] In some specific examples, multiple historical detection cycles can save 2, 3 or other numbers. As the solid-state drive runs, the cumulative number of flips corresponding to the previous cycle is continuously overwritten by the cumulative number of flips of the latest current detection cycle. The cumulative number of flips of the current detection cycle is counted at the end of each detection cycle and then cleared to zero, and then re-entered into the statistics of the next round of detection cycle.

[0076] In some embodiments, the bad block processing method further includes the following steps: In response to the erase and write operation of the current block, the erase and write times of the current block are recorded to obtain the cumulative erase and write times. Before determining the target bad block threshold from multiple preset bad block thresholds based on the acquired wear level information and type information of the current block, in response to the bad block detection instruction for the current block, the wear level information of the current block is determined based on the cumulative erase and write times.

[0077] The bad block detection instruction is periodically initiated at a preset detection frequency. In some specific examples, the bad block detection instruction may be periodically initiated at a detection frequency of 5 seconds. The bad block detection instruction may be automatically initiated by a built-in detection program, or in some examples, may be manually initiated by a detection operator.

[0078] In some embodiments, the wear level information includes level one wear information, level two wear information, and level three wear information, which indicate increasing degrees of wear. Determining the wear level information of the current block based on the accumulated number of erases and writes includes: Determine the wear level information based on the ratio of the cumulative number of erase and write times to the erase upper limit of the solid-state drive; Among them, the corresponding proportion values of the first-level wear information, the second-level wear information and the third-level wear information increase in sequence.

[0079] SSDs with different flash memory types have different upper erase and write limits. In some cases, the upper erase and write limit may be clearly marked on the product website or in the product manual, obtained from the manufacturer's specification documents, or read through software tools.

[0080] In some specific examples, determining the wear level information includes the following steps: determining the wear level according to the proportion relationship value and the preset wear value range to obtain the wear level information.

[0081] Specifically, the wear value intervals include an initial interval corresponding to level one wear, a mid-term interval corresponding to level two wear, and a final interval corresponding to level three wear. The initial interval ranges from greater than or equal to 0 to less than or equal to 30%, the mid-term interval ranges from greater than 30% to less than or equal to 70%, and the final interval ranges from greater than 70%.

[0082] According to the ratio of the cumulative number of erase and write times to the erase upper limit value, the corresponding wear level can be determined to obtain wear level information.

[0083] In some embodiments, the bad block processing method further includes the following steps: In response to the read and write operations of the current block, record the number of read and write operations; Count the cumulative number of reads and writes within the preset time window to obtain the read and write frequency; When the read and write frequency is greater than or equal to the preset hot data threshold, the type information of the current block is hot data type information; When the read and write frequency is less than the hot data threshold, the type information of the current block is cold data type information.

[0084] The preset time window can be 24 hours, the preset hot data threshold can be 10, and the cumulative number of reads and writes is counted to obtain the read and write frequency, that is, the total number of reads and writes of the current block in the most recent 24-hour period. The preset time window period and hot data threshold are not specifically limited, and those skilled in the art can set them according to actual needs.

[0085] In some embodiments, the bad block processing method further includes the following steps: when the cumulative number of flips is less than or equal to the target weak block threshold, determining the current block as a good block to continue to maintain the current block usage status.

[0086] Specifically, when the cumulative flip count is less than or equal to the target weak block threshold, it indicates that the number of error bit flips occurring in the current storage block is relatively small and the current storage block can continue to be used.

[0087] In some embodiments, the bad block processing method further includes the following steps: When the current block is determined to be a bad block, a target good block with the smallest logical address is selected from the remaining reserved blocks of the die to which the current block belongs; a replacement relationship is established between the target good block and the bad block, the address mapping table of the solid-state drive is updated, and the data of the bad block is migrated to the target good block to complete the bad block replacement process.

[0088] In some embodiments, the bad block processing method further includes the following steps: in response to a power-on initialization operation of the solid state drive, allocating a plurality of reserved blocks for bad block replacement to each die.

[0089] In some specific examples, the proportion of the reserved blocks may be 7% of the total number of storage blocks of the die, or other proportions.

[0090] By allocating reserved blocks for the die during power-on initialization, bad blocks can be replaced with individual storage blocks, avoiding the fragmentation and waste of storage controls caused by directly skipping the bad blocks and enabling the entire plane in traditional solutions.

[0091] In some embodiments, the bad block processing method also includes the following steps: when the solid-state drive is initially powered on, a factory bad block scan is performed, all storage blocks are traversed to perform an erase operation, and when the current block erase fails, the current block is determined to be a bad block for bad block replacement.

[0092] In some embodiments, the bad block processing method further includes the following steps: initializing a bad block record table, a bad block replacement table, and a weak block record table when the solid state drive is powered on and initialized.

[0093] The bad block record table records information about detected bad blocks, such as the corresponding die ID, plane ID, and block ID. The bad block replacement table records bad block replacement information, and the weak block record table records information about detected weak blocks, including weak block identification information and the number of times the weak block has been marked.

[0094] In some embodiments, as Figure 4 As shown, the bad block processing method may include steps S410 to S453.

[0095] Step S410: When the solid state drive is powered on and initialized, an initial reserved block is allocated to each die, and a bad block record table, a bad block replacement table, and a weak block record table are initialized.

[0096] The proportion of reserved blocks can be 7% of the total number of memory blocks on the die. Power-on initialization of a solid-state drive refers to the complete loading and initialization of the Flash Translation Layer (FTL) at power-on.

[0097] Step S420: perform a factory bad block scan and perform an erase operation on all blocks of the entire disk.

[0098] Step S421: If the erase fails, the block is marked as a bad block, and the identification information of the factory bad block is recorded in the bad block record table.

[0099] Step S422: Is there an available good block in the bare chip space where the current bad block is located? If so, execute step S423; if not, execute step S424.

[0100] Step S423: Perform bad block replacement and write the replacement information into the bad block replacement table.

[0101] Step S424: bad blocks are skipped.

[0102] Step S430: Initialize an independent thread to perform periodic real-time bad block monitoring.

[0103] Specifically, the controller performs an identification test in a detection cycle of 5 seconds.

[0104] Step S431: Obtain the wear level information and type information corresponding to the current block, and determine the target bad block threshold and the target weak block threshold.

[0105] Step S432: Obtain the cumulative number of flips of the current block in the current detection cycle.

[0106] Step S433: Determine whether the cumulative number of flipping times is greater than the target bad block threshold. If so, execute step S434; if not, execute step S435.

[0107] Step S434: Record the identification information of the current block into the bad block record table.

[0108] Step S435: Determine whether the cumulative flipping times is greater than the target weak block threshold, if so, execute step S436.

[0109] Step S436: Calculate the growth rate of the number of flips.

[0110] Step S437: If the growth rate is greater than 70%, execute step S434.

[0111] Step S438: If the growth rate is less than or equal to 70% and greater than 30%, proceed to step S440.

[0112] Step S439: If the growth rate is less than or equal to 30%, execute step S441.

[0113] Step S440: Search the weak block record table for the identification information of the current block. If the search fails, add the identification information of the current block and increase the number of weak block markings by 1.

[0114] Step S441: Search the weak block record table for identification information of the current block. If the search fails, add the identification information of the current block and increase the number of weak block markings by 0.5.

[0115] Step S442: Is the number of weak block markings in the weak block record table greater than or equal to 3? If so, execute step S443: clear the identification information of the current block from the weak block record table and execute step S434; if not, continue to execute step S430.

[0116] Step S450: Determine whether there is an available good block in the same die space.

[0117] Step S451: Replace the bad block and record the replacement information in the bad block replacement table.

[0118] Step S452: Read the valid information of the bad block and migrate the data to the replacement good block.

[0119] Step S453: Execute the garbage collection mechanism.

[0120] Specifically, when the solid-state drive is powered on and initialized, an initial reserved block is allocated to each die in advance, and when the current block is determined to be a bad block, a bad block replacement process is executed. In some specific examples, the bad block replacement process may include steps S501 to S504.

[0121] Step S501: Select an available good block with the smallest logical address from the spare block pool of the local die.

[0122] Step S502: Update the spare block mapping table, replace the selected good block with the current bad block, and write the corresponding replacement information into the pre-initialized bad block replacement table.

[0123] Step S503: In the address mapping table of the solid state drive, the physical address corresponding to the logical address of the original bad block is modified to the physical address of the spare block, and a mapping change log is recorded.

[0124] Step S504: Locate the valid page in the bad block through the address mapping table, read the data from the original bad block address to the controller cache, and then write it to the replacement good block address, migrating the valid information on the bad block to the replaced good block.

[0125] It should be understood that although Figure 2-Figure 5 The steps in the flowchart are displayed in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Figure 2-Figure 5 Unless otherwise specified herein, the steps shown and the steps involved in other embodiments are not strictly limited in order of execution and can be executed in other orders. Moreover, at least a portion of the steps in the aforementioned embodiments may include multiple sub-steps or multiple stages, which are not necessarily executed at the same time but can be executed at different times. The order of execution of these sub-steps or stages is not necessarily sequential but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0126] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0127] The embodiment of the present application also provides a device for processing bad blocks of a solid state drive, such as Figure 6 As shown, the bad block processing device 600 includes a threshold determination module 610 , a flip count acquisition module 620 and a bad block identification module 630 .

[0128] The threshold determination module 610 is configured to determine a target bad block threshold from a plurality of preset bad block thresholds according to the acquired wear level information and type information of the current block.

[0129] The flip count acquisition module 620 is used to acquire the cumulative flip count of the current block in the current detection cycle.

[0130] The bad block identification module 630 is configured to determine the current block as a bad block when the cumulative flip count is greater than a target bad block threshold, so as to perform a bad block replacement process.

[0131] Among them, the wear level information is positively correlated with the cumulative number of erases and writes of the current block. The type information includes hot data type information and cold data type information determined by the read and write frequency of the current block. The cumulative number of flips is the total number of error bit flips accumulated in the current detection cycle.

[0132] In some embodiments, the bad block processing apparatus 600 further includes a weak block threshold determination module and a growth rate calculation module.

[0133] The weak block threshold determination module is used to determine a target weak block threshold from a plurality of preset weak block thresholds according to the wear level information and type information when the cumulative flip times are less than or equal to the target bad block threshold.

[0134] The growth rate calculation module is used to calculate the growth rate of the number of flips of the current block when the cumulative number of flips is greater than the target weak block threshold.

[0135] The bad block identification module 630 is further configured to determine the current block as a bad block when the flip count growth rate is in a first interval of a preset numerical interval, wherein any value in the first interval is greater than values in other intervals of the numerical interval.

[0136] In some embodiments, the preset numerical range further includes a second range and a third range, and any numerical value in the second range is greater than a numerical value in the third range.

[0137] The bad block processing device 600 further includes a weak block recording module. The weak block recording module is configured to record the number of weak block marks corresponding to the numerical interval in a preset weak block recording table when the flip count growth rate is within the second interval or the third interval.

[0138] The bad block identification module 630 is further configured to determine the current block as a bad block when the number of weak block markings reaches a preset risk value.

[0139] The number of weak block markings corresponding to the second interval is greater than the number of weak block markings corresponding to the third interval.

[0140] In some embodiments, the growth rate calculation module is further configured to obtain multiple cumulative flipping times of the current block within a statistical period, and calculate a flipping number growth rate based on the multiple cumulative flipping times.

[0141] The statistical period is a plurality of consecutive detection periods including the current detection period, and each detection period corresponds to a cumulative number of flips.

[0142] In some embodiments, the growth rate calculation module includes a month-on-month growth rate calculation unit and a weighted average calculation unit.

[0143] The month-on-month growth rate calculation unit is used to calculate the month-on-month growth rates of two adjacent cycles based on the cumulative number of flips of the current detection cycle and the two most recent historical detection cycles, and obtain the first growth rate corresponding to the current detection cycle and the second growth rate corresponding to the previous detection cycle.

[0144] The weighted average calculation unit is used to perform weighted average calculation on the first growth rate and the second growth rate according to a preset weight value to obtain the flip count growth rate.

[0145] Among the preset weight values, the weight value of the first growth rate is greater than the weight value of the second growth rate.

[0146] In some embodiments, the bad block processing device 600 further includes a rollover number recording module and a rollover number obtaining module.

[0147] The flip count recording module is configured to respond to an error bit flip event of a current block and record the flip count corresponding to the error bit flip event.

[0148] The flip count acquisition module is used to count the flip counts according to a preset detection cycle period, and obtain the cumulative flip counts corresponding to the current detection cycle and multiple cumulative flip counts corresponding to multiple historical detection cycles.

[0149] In some embodiments, the bad block processing device 600 further includes an erase recording module and a wear level determination module.

[0150] The erase and write recording module is used for recording the erase and write times of the current block in response to the erase and write operation of the current block, and obtaining the cumulative erase and write times.

[0151] The wear level determination module is used to determine the wear level information of the current block according to the accumulated number of erases and writes in response to a bad block detection instruction for the current block before determining the target bad block threshold from multiple preset bad block thresholds based on the acquired wear level information and type information of the current block.

[0152] The bad block detection instruction is initiated periodically according to a preset detection frequency.

[0153] In some embodiments, the wear level information includes level one wear information, level two wear information, and level three wear information, which indicate increasing degrees of wear. The wear level determination module is configured to determine the wear level information based on a ratio of the cumulative number of erase and write times to an upper limit of the erase and write operation of the solid-state drive.

[0154] Among them, the corresponding proportion values of the first-level wear information, the second-level wear information and the third-level wear information increase in sequence.

[0155] In some embodiments, the bad block processing device 600 further includes a read / write recording module, a read / write frequency determination module, and a data type determination module.

[0156] The read and write recording module is used to record the number of read and write operations in response to the read and write operations of the current block.

[0157] The read and write frequency determination module is used to count the cumulative number of read and write times within a preset time window to obtain the read and write frequency.

[0158] The data type determination module is used to determine that the type information of the current block is hot data type information when the read and write frequency is greater than or equal to the preset hot data threshold, and to determine that the type information of the current block is cold data type information when the read and write frequency is less than the hot data threshold.

[0159] In some embodiments, the bad block processing device 600 further includes a good block determination module, which is configured to determine the current block as a good block when the cumulative number of flips is less than or equal to the target weak block threshold, so as to continue to maintain the current block usage status.

[0160] In some embodiments, the bad block processing device 600 also includes a bad block replacement module, which is used to select a target good block with the smallest logical address from the remaining reserved blocks of the bare chip to which the current block belongs when the current block is determined to be a bad block, establish a replacement relationship between the target good block and the bad block, update the address mapping table of the solid-state drive, and migrate the data of the bad block to the target good block to complete the bad block replacement processing.

[0161] In some embodiments, the bad block processing device 600 further includes a good block reservation module for allocating a plurality of reserved blocks for bad block replacement to each die in response to a power-on initialization operation of the solid state drive.

[0162] For the description of the features in the embodiment corresponding to the bad block processing device 600, reference can be made to the relevant description of the embodiment corresponding to the bad block processing method for a solid state drive, which will not be repeated here.

[0163] An embodiment of the present application further provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps of any of the above-mentioned embodiments of the method for processing bad blocks of a solid-state drive.

[0164] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned solid-state hard drive bad block processing method embodiments when running.

[0165] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0166] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned solid-state hard drive bad block processing method embodiments are implemented.

[0167] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of any of the above-mentioned solid-state hard drive bad block processing method embodiments.

[0168] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0169] The above is a detailed introduction to a method for processing bad blocks of a solid-state drive provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core ideas of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.

Claims

1. A method for processing bad blocks of a solid state drive, characterized in that: The method comprises: Determining a target bad block threshold from a plurality of preset bad block thresholds based on the acquired wear level information and type information of the current block, wherein the wear level information is positively correlated with the cumulative number of erases and writes of the current block, and the type information includes hot data type information and cold data type information determined by the read and write frequency of the current block; Obtaining a cumulative flip count of the current block in a current detection cycle, where the cumulative flip count is a total number of erroneous bit flips accumulated in the current detection cycle; When the accumulated flipping times are greater than the target bad block threshold, the current block is determined as a bad block for bad block replacement processing.

2. The method according to claim 1, characterized in that The method further comprises: When the cumulative flip count is less than or equal to the target bad block threshold, a target weak block threshold is determined from a plurality of preset weak block thresholds according to the wear level information and the type information. When the cumulative number of flipping times is greater than the target weak block threshold, calculating a flipping times growth rate of the current block; When the flip count growth rate is in a first interval in a preset numerical interval, the current block is determined to be a bad block, wherein any value in the first interval is greater than values in other intervals in the numerical interval.

3. The method according to claim 2, characterized in that The preset numerical range further includes a second range and a third range, and any value in the second range is greater than a value in the third range; The method further comprises: When the flip count growth rate is within the second interval or the third interval, recording the number of weak block marks corresponding to the numerical interval in a preset weak block record table; When the number of times the weak block is marked reaches a preset risk value, the current block is determined as a bad block; The number of weak block markings corresponding to the second interval is greater than the number of weak block markings corresponding to the third interval.

4. The method according to claim 2, characterized in that The calculating the growth rate of the number of flipping times of the current block includes: Obtain multiple cumulative flip counts of the current block within a statistical period; Calculating the flipping number growth rate according to the multiple accumulated flipping numbers; The statistical period is a plurality of consecutive detection periods including the current detection period, and each detection period corresponds to a cumulative number of flips.

5. The method according to claim 4, characterized in that: Calculating the flip count growth rate according to the plurality of accumulated flip counts includes: Calculate the month-on-month growth rates of the two adjacent cycles based on the cumulative number of flips in the current detection cycle and the two most recent historical detection cycles, to obtain a first growth rate corresponding to the current detection cycle and a second growth rate corresponding to the previous detection cycle; Performing a weighted average calculation on the first growth rate and the second growth rate according to a preset weight value to obtain the flip count growth rate; Among the preset weight values, the weight value of the first growth rate is greater than the weight value of the second growth rate.

6. The method according to claim 2, characterized in that: The method further comprises: In response to an error bit flip event of the current block, recording a flip count corresponding to the error bit flip event; The flipping times are counted according to a preset detection cycle period to obtain a cumulative flipping times corresponding to the current detection cycle and a plurality of cumulative flipping times corresponding to a plurality of historical detection cycles.

7. The method according to claim 1, characterized in that: The method further comprises: In response to the erase / write operation of the current block, recording the number of erase / write operations of the current block to obtain the cumulative number of erase / write operations; Before determining the target bad block threshold from a plurality of preset bad block thresholds based on the acquired wear level information and type information of the current block, in response to a bad block detection instruction for the current block, determining the wear level information of the current block based on the accumulated number of erase and write times; The bad block detection instruction is initiated periodically according to a preset detection frequency.

8. The method according to claim 7, characterized in that: The wear level information includes first-level wear information, second-level wear information, and third-level wear information indicating increasing degrees of wear. Determining the wear level information of the current block based on the accumulated number of erase and write times includes: Determining the wear level information according to a ratio of the cumulative number of erase and write times to an upper limit of the erase and write of the solid-state hard disk; Among them, the corresponding proportion relationship values of the first-level wear information, the second-level wear information and the third-level wear information increase in sequence.

9. The method according to claim 1, characterized in that: The method further comprises: In response to the read and write operations of the current block, recording the number of read and write operations; Counting the cumulative number of reads and writes within a preset time window to obtain the read and write frequency; When the read and write frequency is greater than or equal to a preset hot data threshold, the type information of the current block is the hot data type information; When the read and write frequency is less than the hot data threshold, the type information of the current block is the cold data type information.

10. The method according to claim 2, characterized in that: The method further comprises: When the accumulated flipping times are less than or equal to the target weak block threshold, the current block is determined as a good block, so as to continue to maintain the current block usage status.

11. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When the current block is determined to be a bad block, selecting a target good block with the smallest logical address from the remaining reserved blocks of the die to which the current block belongs; A replacement relationship is established between the target good block and the bad block, the address mapping table of the solid state drive is updated, and the data of the bad block is migrated to the target good block to complete the bad block replacement process.

12. The method according to claim 11, characterized in that: The method further comprises: In response to a power-on initialization operation of the solid state drive, a plurality of the reserved blocks for bad block replacement are allocated to each die.

13. A bad block processing device, characterized in that: include: A threshold determination module, configured to determine a target bad block threshold from a plurality of preset bad block thresholds based on the acquired wear level information and type information of the current block; A flip count determination module, configured to obtain the cumulative flip count of the current block in the current detection cycle; a bad block identification module, configured to determine the current block as a bad block for bad block replacement processing when the cumulative flip count is greater than the target bad block threshold; Among them, the wear level information is positively correlated with the cumulative number of erases and writes of the current block, the type information includes hot data type information and cold data type information determined by the read and write frequency of the current block, and the cumulative number of flips is the total number of erroneous bit flips accumulated in the current detection cycle.

14. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the bad block processing method according to any one of claims 1 to 12 when executing the computer program.

15. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the bad block processing method according to any one of claims 1 to 12.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the bad block processing method according to any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

  • Bad block screening method and device, computer readable storage medium and electronic equipment

    CN113241112A

  • Bad block management method of flash memory, storage medium, electronic device and solid state disk

    CN116467225A

  • Storage block screening method and device of storage equipment, equipment and storage medium

    CN117594104A