Bad block detection method and device for solid state disk, equipment and storage medium

By analyzing the bad block table and preset comparison table of the solid state drive, accurately locate the location of the bad block flash memory particles in the solid state drive, solving the problem of bad block positioning, reducing the maintenance time and cost, and improving the quality of the hard disk.

CN118918938APending Publication Date: 2024-11-08INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310504622.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-06
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The location of the flash memory particles with bad blocks in the solid state drive is difficult to accurately locate, resulting in long repair time for a failed hard disk and high testing costs.

Method used

By obtaining the bad block table of the solid state hard disk, analyzing the number of bad blocks in the bad block group, determining whether it exceeds the preset threshold, obtaining the channel and chip selection signal combination of each bad block, and determining the location of the flash memory particles based on the preset comparison table. , achieve accurate positioning.

Benefits of technology

It improves the positioning efficiency of abnormal flash memory particles, reduces the repair time and testing costs of faulty hard disks, and improves the quality of solid-state hard disks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118918938A_ABST
    Figure CN118918938A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a bad block detection method, device and equipment for a solid state disk and a storage medium, and the method comprises the steps that a bad block table of the solid state disk is acquired, and the bad block table comprises all bad block groups in the solid state disk; analyzing the bad block table, determining the number of bad blocks in each bad block group, and judging whether the number of bad blocks in each bad block group exceeds a preset threshold value or not; when the number of the bad blocks in the bad block group exceeds a preset threshold value, obtaining a combination of a channel of each bad block in the bad block group and a chip selection signal; and determining the position of the flash memory particle corresponding to the combination of the channel and the chip selection signal from a preset comparison table based on the combination of the channel and the chip selection signal, wherein the mapping relation between the combination of the channel and the chip selection signal and the position of the flash memory particle is stored in the preset comparison table. The positioning efficiency of the flash memory particles can be improved, the maintenance time and the test cost of the fault hard disk are reduced, and the quality of the solid state disk is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] A solid-state drive (SSD) is a hard drive made of an array of solid-state electronic memory chips. Its primary storage unit is NAND flash memory. A NAND flash memory chip consists of multiple blocks, and a block consists of multiple pages. Because NAND flash manufacturing processes cannot guarantee the performance reliability of the memory array throughout its lifecycle, bad blocks (also known as areas in the flash memory that cannot be erased or written) may occur during production and use. Bad blocks, known as inherent bad blocks, are likely to occur during the factory phase. If a program error or other issues occur during use, this block will be marked as bad.

[0003] Bad blocks can prevent electrons from charging into the floating gate, cause electrons to escape from the floating gate, or prevent electrons from escaping. Hard drives typically store a bad block table, which includes both factory-issued bad blocks and newly added bad blocks. With increasing demands for SSD performance, it's necessary to identify the locations of flash memory cells with bad blocks in an SSD so they can be promptly intercepted and replaced. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a method, apparatus, device, and storage medium for detecting bad blocks in a solid-state drive to solve the problem of accurately locating flash memory particles with bad blocks in a solid-state drive.

[0005] In a first aspect, an embodiment of the present invention provides a method for detecting bad blocks of a solid-state drive, the method comprising:

[0006] Obtaining a bad block table of the solid state drive, wherein the bad block table includes all bad block groups in the solid state drive;

[0007] parsing the bad block table to determine the number of bad blocks in each bad block group, and determining whether the number of bad blocks in the bad block group exceeds a preset threshold;

[0008] When the number of bad blocks in the bad block group exceeds a preset threshold, obtaining a combination of a channel and a chip select signal of each bad block in the bad block group;

[0009] Based on the combination of the channel and the chip select signal, the position of the flash memory particle corresponding to the combination of the channel and the chip select signal is determined from a preset comparison table, and the preset comparison table stores a mapping relationship between the combination of the channel and the chip select signal and the position of the flash memory particle.

[0010] The bad block detection method for a solid-state drive provided by an embodiment of the present invention screens bad block groups by parsing a bad block table. When the number of bad blocks in a bad block group exceeds a preset threshold, the combination of channels and chip select signals corresponding to each bad block is obtained based on the analysis of the bad blocks in the bad block group. The location of the flash memory particles corresponding to each channel and chip select signal combination is then determined based on a preset comparison table. This accurately locates the flash memory particles with bad blocks in the solid-state drive, improving the efficiency of locating abnormal flash memory particles. After determining the location of the flash memory particles, the flash memory particles can be replaced, avoiding the time-consuming manual detection. This method can reduce the repair time and testing costs of faulty hard drives and improve the quality of solid-state drives.

[0011] In some optional implementations, parsing the bad block table to determine the number of bad blocks in each bad block group includes:

[0012] Reading the bad block table, and determining all bad block groups from the bad block table;

[0013] The number of bad blocks in each bad block group is determined based on the data of each block in the bad block group.

[0014] In some optional implementations, determining the number of bad blocks in each bad block group based on data of each block in the bad block group includes:

[0015] Read the data of each block in the bad block group in the same row;

[0016] The data of each block in the same row are converted and summed to determine the number of bad blocks in each bad block group.

[0017] In some optional implementations, converting and summing the data of each block in the same row to determine the number of bad blocks in each bad block group includes:

[0018] Convert the data of each block in the same row into binary to obtain binary data;

[0019] Taking the OR operation on the binary data, obtaining the number of bits corresponding to the data in the same row of each block;

[0020] Calculate the sum of all bits in the bad block group to determine the number of bad blocks in each bad block group.

[0021] The method provided by the embodiment of the present invention reads the number of each block in each bad block group, and obtains the number of 1s in the same row of data in each block by reading, converting and performing OR operations. The digits of each bit are added together to obtain the number of bad blocks in the bad block group.

[0022] In some optional implementations, determining whether the number of bad blocks in the bad block group exceeds a preset threshold includes:

[0023] Determining a corresponding preset threshold based on the memory size of the solid state drive;

[0024] It is determined whether the number of bad blocks in the bad block group exceeds a preset threshold corresponding to the solid state drive.

[0025] The method provided in an embodiment of the present invention sets different preset thresholds for SSDs with different memory sizes, determines the corresponding preset threshold based on the SSD's memory size, and then determines whether the number of bad blocks in a bad block group exceeds the corresponding preset threshold. This method considers SSDs with different memory sizes and performs the determination process in a targeted manner, resulting in more accurate determination results.

[0026] In some optional implementations, obtaining a combination of a channel and a chip select signal of each bad block in the bad block group includes:

[0027] Reading a preset description table corresponding to each bad block in the bad block group, wherein the preset description table includes bits corresponding to the channel and chip select signal of each bad block;

[0028] The bits corresponding to the channel and chip select signal of each bad block are determined from the preset description table, and data corresponding to the bits are read to determine the combination of the channel and chip select signal of each bad block in the bad block group.

[0029] The method provided by the embodiment of the present invention reads data of different bits according to a preset description table in the bad block, and then determines the bad block parameters corresponding to the different bits.

[0030] In some optional implementations, obtaining the bad block table of the solid state drive includes:

[0031] Querying the aging status and aging progress of the solid state drive;

[0032] When the aging state and the aging progress meet preset conditions, a bad block table of the solid state drive is obtained.

[0033] The method provided by the embodiment of the present invention first needs to query the aging status and aging progress of the solid-state hard drive. When the aging status and aging progress meet the preset conditions, the bad block table of the solid-state hard drive is obtained to avoid other causes caused by abnormal aging of the solid-state hard drive and improve the accuracy of detection.

[0034] In a second aspect, an embodiment of the present invention provides a bad block detection device for a solid-state drive, the device comprising:

[0035] A bad block table acquisition module, configured to acquire a bad block table of the solid state drive, wherein the bad block table includes all bad block groups in the solid state drive;

[0036] a bad block analysis module, configured to analyze the bad block table, determine the number of bad blocks in each bad block group, and determine whether the number of bad blocks in the bad block group exceeds a preset threshold;

[0037] a data acquisition module, configured to acquire a combination of a channel and a chip select signal of each bad block in the bad block group when the number of bad blocks in the bad block group exceeds a preset threshold;

[0038] A position determination module is used to determine the position of the flash memory particle corresponding to the combination of the channel and the chip select signal from a preset comparison table based on the combination of the channel and the chip select signal, and the preset comparison table stores the mapping relationship between the combination of the channel and the chip select signal and the position of the flash memory particle.

[0039] In some optional implementations, the bad block analysis module includes:

[0040] a bad block table reading unit, configured to read the bad block table and determine all bad block groups from the bad block table;

[0041] The bad block number determining unit is configured to determine the number of bad blocks in each bad block group based on the data of each block in the bad block group.

[0042] In some optional implementations, the bad block number determining unit includes:

[0043] A data reading subunit is used to read the data of each block in the bad block group in the same row;

[0044] The quantity determination subunit is used to convert and sum the data of each block in the same row to determine the number of bad blocks in each bad block group.

[0045] In some optional embodiments, the quantity determination subunit includes:

[0046] A data conversion subunit, configured to convert the data of each block in the same row into binary data to obtain binary data;

[0047] A data OR subunit, configured to perform an OR operation on the binary data to obtain the number of bits corresponding to the data in the same row of each block;

[0048] The bit summing subunit is used to calculate the sum of all bits in the bad block group to determine the number of bad blocks in each bad block group.

[0049] In some optional implementations, the bad block analysis module includes:

[0050] a preset determination unit, configured to determine a corresponding preset threshold based on the memory size of the solid state drive;

[0051] The data judgment unit is used to judge whether the number of bad blocks in the bad block group exceeds a preset threshold corresponding to the solid state drive.

[0052] In some optional implementations, the data acquisition module includes:

[0053] A description table reading unit, configured to read a preset description table corresponding to each bad block in the bad block group, wherein the preset description table includes bits corresponding to the channel and chip select signal of each bad block;

[0054] The parameter reading unit is used to determine the bits corresponding to the channel and chip select signal of each bad block from the preset description table, and read the data corresponding to the bits to determine the combination of the channel and chip select signal of each bad block in the bad block group.

[0055] In some optional implementations, the bad block table acquisition module includes:

[0056] An aging query unit, configured to query the aging status and aging progress of the solid state drive;

[0057] The bad block table acquiring unit is configured to acquire the bad block table of the solid state drive when the aging state and the aging progress meet preset conditions.

[0058] In a third aspect, an embodiment of the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions stored in the memory, and the processor executing the computer instructions to execute the bad block detection method for a solid-state hard disk according to the first aspect or any corresponding embodiment thereof.

[0059] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the bad block detection method for a solid-state hard disk according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0061] Figure 1 is a flowchart of a bad block detection method for a solid state drive according to some embodiments of the present invention;

[0062] Figure 2is a schematic diagram of a bad block statistics interface according to some embodiments of the present invention;

[0063] Figure 3 is a structural block diagram of a bad block detection device for a solid state drive according to an embodiment of the present invention;

[0064] Figure 4 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0065] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.

[0066] The blocks in the flash memory granules, the primary storage unit of solid-state drives, have a limited number of erase and write cycles. Exceeding this limit renders the flash memory granules unusable. Flash memory granules are erased in blocks. If an unrecoverable bit error occurs within an entire block, it is considered a bad block, and the bad block information is stored in a bad block table. When flash memory granules age or a certain number of bad blocks are present, they need to be replaced. To address this issue, embodiments of the present invention provide a bad block detection method for solid-state drives.

[0067] According to an embodiment of the present invention, an embodiment of a bad block detection method for a solid-state drive is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0068] In this embodiment, a method for detecting bad blocks of a solid state drive is provided. Figure 1 FIG. 1 is a flow chart of a bad block detection method for a solid state drive according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0069] Step S11: Obtain a bad block table of the solid state drive, where the bad block table includes all bad block groups in the solid state drive.

[0070] A solid-state drive (SSD) consists of a main control chip and flash memory particles. The main control chip is responsible for transmission, while the flash memory particles are responsible for storage. The flash memory particles contain countless storage units. Since the process of flash memory particles makes it difficult to ensure that the storage units in the flash memory maintain performance reliability within their declaration cycle, bad blocks will be generated during the production and use of the flash memory particles. Bad blocks include factory bad blocks and use bad blocks. During the manufacturing process, a certain number of bad blocks will exist due to defects in the manufacturing process. The factory will mark the bad blocks before the SSD leaves the factory. For the flash memory particles in the SSD, the bad block mark is generally located in the first byte of the spare area of ​​the first page of each block. This is called a factory bad block. All bad blocks detected at the factory are stored in the factory bad block table. During use, since the erase and write life of the flash memory particles is limited, bad blocks will also be generated after a certain period of use. The bad blocks that appear during use are recorded and stored in the newly added bad block table. All bad blocks in the original bad block table and the newly added bad block table constitute the full bad block table. Since the purpose of the embodiment of the present invention is to replace the flash memory particles, the bad block table here refers to the full bad block table. It should be noted that, according to actual business needs, the bad block table can also be set to the original bad block table or a newly added bad block table.

[0071] In this embodiment, based on the design characteristics of the solid-state drive, a block group (mblock) is defined as n consecutive blocks on the same lun (logical unit). In this embodiment, a block group consisting of four blocks is used as an example. If one or more blocks in a block group are bad blocks, the block group is considered a bad block group, and all bad block groups in the solid-state drive are stored in the bad block table.

[0072] When bad blocks need to be parsed, the bad block table stored in the solid state drive is exported to obtain the bad block table of the solid state drive.

[0073] Step S12: parsing the bad block table to determine the number of bad blocks in each bad block group, and determining whether the number of bad blocks in the bad block group exceeds a preset threshold.

[0074] The preset threshold represents the upper limit for the number of bad blocks in a bad block group on an SSD. When the number of bad blocks exceeds this threshold, some of the SSD's flash memory chips must be replaced. This threshold is determined through testing based on various SSD attributes, such as memory capacity and model number.

[0075] The blocks in all bad block groups in the bad block table are parsed to calculate the number of bad blocks in each bad block group. Since the memory and model of solid-state drives are different, the preset threshold needs to be determined based on the memory and model of the solid-state drive to determine whether the number of all bad blocks in the solid-state drive exceeds the preset threshold.

[0076] Step S13: When the number of bad blocks in the bad block group exceeds a preset threshold, a combination of a channel and a chip select signal of each bad block in the bad block group is obtained.

[0077] Since the preset threshold refers to the upper limit of the number of bad blocks, if the number of bad blocks in a bad block group exceeds the preset threshold, it indicates that a flash memory chip needs to be replaced. There are multiple block groups in a flash memory chip, and there are bad block groups in the block groups, and there are bad blocks in the bad block groups. The rows of data stored in the bad blocks in the bad block groups are read and parsed. According to the settings of each block, the data in different rows in the block can represent various parameter information of the block, such as capacity, channel, chip enable signal (abbreviated as: CE), etc. By reading the data in the corresponding rows of the bad blocks, the channel and chip select signal corresponding to each bad block can be obtained. The channel and chip select signal of each bad block are combined to obtain the combination of the channel and chip select signal corresponding to each bad block.

[0078] Step S14, based on the combination of the channel and the chip select signal, determine the position of the flash memory particle corresponding to the combination of the channel and the chip select signal from a preset comparison table, wherein the preset comparison table stores the mapping relationship between the combination of the channel and the chip select signal and the position of the flash memory particle.

[0079] Flash memory operations use flash pages as read and write units and flash blocks as erase units. Internal media access within the device provides parallelism at multiple levels, including channels, particle packaging, and flash chips. The number of channels in a flash particle directly reflects the concurrent read and write capabilities of the SSD. Flash particles may support multiple channels, with each channel supporting multiple CEs. The number of channels and CEs supported per channel affects the capacity of the SSD. Flash particles at different locations in the SSD may correspond to different channels and chip select signals. Because a flash particle may have multiple bad blocks, and the combinations of channels and chip select signals corresponding to different bad blocks may be different, a single flash particle may correspond to one or more combinations of channels and chip select signals.

[0080] Each flash memory chip in an SSD has a fixed code that corresponds one-to-one with the flash memory chip. This code can be used to determine the location of the flash memory chip. During the SSD production process, the mapping between the location of each flash memory chip, the channel, and the chip select signal combination is determined and stored in a preset table. The location of the flash memory chip in the preset table can be stored in the form of a code. The preset table is stored in the SSD.

[0081] After obtaining the channel and chip select signal combination for each bad block, the mapping relationship between the channel and chip select signal combination and the location of the flash memory chip is searched from a preset comparison table stored in the solid-state drive to determine the location of the flash memory chip to which each bad block belongs. After the location of the flash memory chip is determined, the physical location of the flash memory chip is printed in a log, and relevant maintenance personnel can replace the flash memory chip based on the information recorded in the log.

[0082] The bad block detection method for a solid-state drive provided by an embodiment of the present invention screens bad block groups by parsing a bad block table. When the number of bad blocks in a bad block group exceeds a preset threshold, the combination of channels and chip select signals corresponding to each bad block is obtained based on the analysis of the bad blocks in the bad block group. The location of the flash memory particles corresponding to each channel and chip select signal combination is then determined based on a preset comparison table. This accurately locates the flash memory particles with bad blocks in the solid-state drive, improving the efficiency of locating abnormal flash memory particles. After the location of the flash memory particles is determined, the flash memory particles can be replaced, avoiding the time-consuming manual detection. This method can reduce the repair time and testing costs of faulty hard drives and improve the quality of solid-state drives.

[0083] In some optional embodiments, the above Figure 1 The step S12 of parsing the bad block table to determine the number of bad blocks in each bad block group includes the following steps:

[0084] Step S121, read the bad block table, and determine all bad block groups from the bad block table;

[0085] The bad block table includes the original bad blocks and newly added bad blocks of the solid-state drive. The bad block group is a unit, and every n blocks (blocks) constitute a block group (mblock). A block group with one or more bad blocks is considered a bad block group.

[0086] Read the bad block table and extract all the bad block groups in the bad block table. Each bad block group has its corresponding label.

[0087] Step S122: determining the number of bad blocks in each bad block group based on the data of each block in the bad block group.

[0088] A bad block group contains multiple blocks, and there may be one or more bad blocks in the multiple blocks. Each block has multiple rows of data. By reading and analyzing each row of data in each block, the number of bad blocks in each bad block group can be obtained through calculation.

[0089] Specifically, step S122 includes the following steps:

[0090] Step S1221, reading the data of each block in the bad block group in the same row.

[0091] A bad block group contains multiple blocks, each containing multiple rows of data. For example, if a block group contains four blocks, each containing four rows of data, then the data in rows 0, 4, 8, and 12 of the bad block group is read simultaneously. Rows 0, 4, 8, and 12 correspond to the first row of each block, respectively. In addition, rows 1, 5, 9, and 13 are read; rows 2, 6, 10, and 14; and rows 3, 7, 11, and 15 are read as well.

[0092] Step S1222: convert and sum the data of each block in the same row to determine the number of bad blocks in each bad block group.

[0093] Furthermore, step S1222 includes the following steps:

[0094] Step a1: convert the data of each block in the same row into binary to obtain binary data.

[0095] Convert the same row of data in each block read into binary.

[0096] Step a2, performing OR operation on the binary data to obtain the number of bits corresponding to the data in the same row of each block.

[0097] And take the OR of the binary data in the same row of each block, and calculate the number of bits that are set to 1 after taking the OR, that is, the number of bits corresponding to the data in the same row of each block.

[0098] Step a3: Calculate the sum of all bits in the bad block group to determine the number of bad blocks in each bad block group.

[0099] The sum of the calculated digits is used to obtain the number of bad blocks in a bad block group. The number of bad blocks in each bad block group is calculated in the same way. The number of bad blocks in each bad block group is calculated.

[0100] For example, if a bad block group (mblock) consists of four consecutive blocks (blocks) on the same logical unit, calculate the number of bad blocks in each bad block group in the bad block table and record them. Specifically, readline reads the record line number line(0base), converts the read string to hexadecimal, and counts the number of 1s.

[0101] The specific process is as follows:

[0102] L0: line 0, bit_num: the number of bits set to 1 in binary, mblock_bit_num_X: the number of bad blocks in mblock X.

[0103] The number of bad blocks in mblock0 is calculated as follows:

[0104] mblock_bit_num_0=bit_num(L0|L4|L8|L12)+bit_num(L1|L5|L9|L13)+

[0105] bit_num(L2|L6|L10|L14)+bit_num(L3|L7|L11|L15)

[0106] mblock0 represents the first bad block group in a flash memory chip. Convert the data in rows 0, 4, 8, and 12 of mblock0 to binary and take the OR operation to calculate the number of bits set to 1 (A). Convert the data in rows 1, 5, 9, and 13 to binary and take the OR operation to calculate the number of bits set to 1 (B). Convert the data in rows 2, 6, 10, and 14 to binary and take the OR operation to calculate the number of bits set to 1 (C). Convert the data in rows 3, 7, 11, and 15 to binary and take the OR operation to calculate the number of bits set to 1 (D). Finally, calculate the sum of A, B, C, and D, which is the number of bad blocks in mblock0.

[0107] By analogy, the number of bad blocks in mblockX is calculated as follows:

[0108] mblock_bit_num_x=bitnum(L(16X)|L(16X+4)|L(16X+8)|(16X+12))+bit_num(L(16X+1)|L(16X+4 +1)|L(16X+8+1)|L(16X+12+1))+...+bit_num(L(16X+3)|L(16X+4+3)|L(16X+8+3)|L(16X+12+3))

[0109] The method provided by the embodiment of the present invention reads the number of each block in each bad block group, and obtains the number of 1s in the same row of data in each block by reading, converting and performing OR operations. The digits of each bit are added together to obtain the number of bad blocks in the bad block group.

[0110] In some optional embodiments, the above Figure 1 Step S12 of determining whether the number of bad blocks in the bad block group exceeds a preset threshold comprises the following steps:

[0111] Step S21: determining a corresponding preset threshold based on the memory size of the solid state drive.

[0112] The preset threshold represents the upper limit for the number of bad blocks in a bad block group on an SSD. When the number of bad blocks exceeds this threshold, some of the SSD's flash memory chips must be replaced. This threshold is determined through testing based on various SSD attributes, such as memory capacity and model number.

[0113] In this embodiment, a preset threshold is set based on the memory size of the solid-state drive. The preset threshold can be the number of bad blocks in a bad block group or the sum of the number of bad blocks in multiple bad block groups. Depending on the memory size of the solid-state drive, the upper limit of the number of bad blocks corresponding to the preset threshold may vary.

[0114] Step S22: determining whether the number of bad blocks in the bad block group exceeds a preset threshold corresponding to the solid state drive.

[0115] Before making a judgment, you first need to obtain the memory size of the solid-state drive, determine the corresponding preset threshold and judgment rules based on its memory size, calculate the sum of the number of bad blocks in each bad block group, and judge whether the number of bad blocks in the bad block group exceeds the preset threshold corresponding to the solid-state drive.

[0116] If the number of bad blocks in the bad block group does not exceed the preset threshold corresponding to the solid-state drive, it means that the flash memory particles in the solid-state drive have not yet reached the level that requires replacement, and there is no need to perform subsequent steps.

[0117] The preset thresholds and judgment methods for different memory types provided in this embodiment are as follows:

[0118] 1T disk:

[0119] mblock_bit_num_0+mblock_bit_num_1+mblock_bit_num_2+mblock_bit_num_3<12

[0120] mblock_bit_num_4+mblock_bit_num_5+…+mblock_bit_num_12<21

[0121] mblock_bit_num_13+…<90

[0122] 2T disk:

[0123] mblock_bit_num_0+mblock_bit_num_1<12

[0124] mblock_bit_num_2+mblock_bit_num_3+…+mblock_bit_num_10<43

[0125] mblock_bit_num_11+…<90

[0126] 4T disk:

[0127] mblock_bit_num_0<12

[0128] mblock_bit_num_1+mblock_bit_num_2+…+mblock_bit_num_9<86

[0129] mblock_bit_num_10+…<90

[0130] 8T disk:

[0131] mblock_bit_num_0<25

[0132] mblock_bit_num_1+mblock_bit_num_2+…+mblock_bit_num_9<172

[0133] mblock_bit_num_10+…<90

[0134] It should be noted that the preset threshold value in the judgment method provided in the embodiment of the present invention is only an example and can be set according to actual conditions during actual operation.

[0135] The method provided in an embodiment of the present invention sets different preset thresholds for SSDs with different memory sizes, determines the corresponding preset threshold based on the SSD's memory size, and then determines whether the number of bad blocks in a bad block group exceeds the corresponding preset threshold. This method considers SSDs with different memory sizes and performs the determination process in a targeted manner, resulting in more accurate determination results.

[0136] In some optional embodiments, the above Figure 1 Step S13 in the embodiment includes the following steps:

[0137] Step S31 : reading a preset description table corresponding to each bad block in the bad block group, wherein the preset description table includes bits corresponding to the channel and chip select signal of each bad block.

[0138] The preset description table is stored in the first storage unit of each block. Each block has its own corresponding preset description table. When the bad block table is exported, the preset description table for each bad block in each bad block table is automatically exported. The preset description table stores various parameter information corresponding to the bad block, including parameter information corresponding to different bits of data. The corresponding parameter information can be determined by reading the data of different bits in the preset description table. Specific parameter information may include channel, chip select signal, etc.

[0139] Step S32: determining the bits corresponding to the channel and chip select signal of each bad block from the preset description table, and reading the data corresponding to the bits to determine the combination of the channel and chip select signal of each bad block in the bad block group.

[0140] In this embodiment, it is necessary to determine the channel and chip select signal of each bad block, so the data of the bits corresponding to the channel and chip select signal are read from the preset description table to obtain the channel and chip select signal, and then the channel and chip select signal are combined to obtain a combination of the channel and chip select signal.

[0141] In this embodiment, a preset description table of a block is provided, as shown in the following table.

[0142]

[0143] Taking the above preset description table as an example, reading the data of bit13 to bit15 can determine the chip select signal corresponding to the bad block, and reading the data of bit16 to bit20 can determine the channel corresponding to the bad block.

[0144] The method provided by the embodiment of the present invention reads data of different bits according to a preset description table in the bad block, and then determines the bad block parameters corresponding to the different bits.

[0145] In some optional embodiments, the above Figure 1 Step S11 in the embodiment further includes the following steps:

[0146] Step S41 , querying the aging status and aging progress of the solid state drive.

[0147] When it is necessary to obtain the bad block table of the solid state drive, the method of steps S11 to S14 of the embodiment of the present invention is started, the purpose of which is to detect the flash memory particles in the solid state drive and then replace them when the solid state drive encounters reading or operation problems.

[0148] Before obtaining the bad block table of the SSD, in the FT1 test tool of the SSD, after the aging test starts, the aging progress and aging status of the SSD are periodically queried.

[0149] Specifically, the bist_read_env tool can be used to query the aging progress (percentage) and aging status (bist state) of a bus (such as 3d corresponding to a disk).

[0150] Step S42: When the aging state and the aging progress meet the preset conditions, a bad block table of the solid state drive is obtained.

[0151] When the aging status value is between 0 and 5, it indicates that the aging status of the solid-state drive is normal; when the aging status value is greater than 5, it indicates that the aging status is abnormal. In this embodiment, the preset condition is set as: aging progress percentage = 100, and when the aging status is normal, the bad block table of the solid-state drive is obtained.

[0152] If the aging status and aging progress do not meet the preset conditions after testing, no further action is required. For example, if the aging status is abnormal, it may be caused by the aging of the solid-state drive itself, and replacing the flash memory chips will not improve the situation.

[0153] It should be noted that the preset conditions in this embodiment are only an example and can be set according to actual conditions during specific operations.

[0154] The method provided by the embodiment of the present invention first needs to query the aging status and aging progress of the solid-state hard drive. When the aging status and aging progress meet the preset conditions, the bad block table of the solid-state hard drive is obtained to avoid other causes caused by abnormal aging of the solid-state hard drive and improve the accuracy of detection.

[0155] This embodiment provides a specific method for detecting bad blocks in a solid-state drive (SSD). Taking a PCIe Gen4 NVMe SSD as an example, a detection-while-counting method is employed. This method is applied to the FT1 workstation stage of the SSD production phase to perform bad block detection, thereby quickly locating the location of faulty flash memory chips and reducing repair time and testing costs. The specific scheme is as follows: During the FT1 testing process, after the BIST burn-in test begins, the SSD's aging progress and aging status are periodically queried. When the aging progress and aging status meet preset conditions, a bad block table is derived for bad block detection. The derived bad block table includes an original bad block table and a full bad block table. Depending on actual needs, the full bad block table is selected, or new bad blocks are derived based on the full bad block table and the original bad block table. After parsing the full bad block table, the number of bad blocks in each bad block group in the bad block table is calculated based on the design characteristics of the PCIe Gen4 NVMe SSD. If the number of bad blocks exceeds a preset threshold for the SSD, it indicates that the flash memory chips in the SSD need to be replaced. When exporting the bad block table, the preset description table of each block will be automatically exported, the channel and chip select signal of each bad block in the bad block group will be read, and then the corresponding flash memory particles will be read from the preset comparison table according to the combination of channel and chip select signal, so as to locate the flash memory particles.

[0156] If it is necessary to locate a newly added bad block, after obtaining the number of bad blocks in the full bad block table and the number of bad blocks in the original bad block table, the two numbers are compared. A newly added bit set to 1 in the full bad block table indicates a newly added bad block.

[0157] The method provided in the embodiment of the present invention can be used for a bad block detection platform of a solid state drive. The platform is provided with a front-end display interface, which can write the various parameter information of the read bad blocks into the database of the server, so as to facilitate the statistics of the number of bad blocks of each storage unit in the solid state drive. Figure 2 The bad block statistics interface is shown.

[0158] The method provided by the embodiment of the present invention is integrated into a factory test system, and statistics are collected while analyzing, which can reduce manpower consumption, improve test efficiency, and save repair time and test costs of faulty solid-state hard drives.

[0159] This embodiment also provides a bad block detection device for a solid-state drive. The device is used to implement the above-mentioned embodiments and implementation methods. Details that have already been described will not be repeated. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.

[0160] This embodiment provides a bad block detection device for a solid state hard disk. Figure 3 Shown, including:

[0161] A bad block table acquisition module 51 is configured to acquire a bad block table of the solid state drive, wherein the bad block table includes all bad block groups in the solid state drive;

[0162] a bad block analysis module 52 for analyzing the bad block table, determining the number of bad blocks in each bad block group, and determining whether the number of bad blocks in the bad block group exceeds a preset threshold;

[0163] A data acquisition module 53 is configured to acquire a combination of a channel and a chip select signal of each bad block in the bad block group when the number of bad blocks in the bad block group exceeds a preset threshold;

[0164] The position determination module 54 is used to determine the position of the flash memory particle corresponding to the combination of the channel and the chip select signal from a preset comparison table based on the combination of the channel and the chip select signal, and the preset comparison table stores the mapping relationship between the combination of the channel and the chip select signal and the position of the flash memory particle.

[0165] In some optional implementations, the bad block analysis module 52 includes:

[0166] a bad block table reading unit, configured to read the bad block table and determine all bad block groups from the bad block table;

[0167] The bad block number determining unit is configured to determine the number of bad blocks in each bad block group based on the data of each block in the bad block group.

[0168] In some optional implementations, the bad block number determining unit includes:

[0169] A data reading subunit is used to read the data of each block in the bad block group in the same row;

[0170] The quantity determination subunit is used to convert and sum the data of each block in the same row to determine the number of bad blocks in each bad block group.

[0171] In some optional embodiments, the quantity determination subunit includes:

[0172] A data conversion subunit, configured to convert the data of each block in the same row into binary data to obtain binary data;

[0173] A data OR subunit, configured to perform an OR operation on the binary data to obtain the number of bits corresponding to the data in the same row of each block;

[0174] The bit summing subunit is used to calculate the sum of all bits in the bad block group to determine the number of bad blocks in each bad block group.

[0175] In some optional implementations, the bad block analysis module 52 includes:

[0176] a preset determination unit, configured to determine a corresponding preset threshold based on the memory size of the solid state drive;

[0177] The data judgment unit is used to judge whether the number of bad blocks in the bad block group exceeds a preset threshold corresponding to the solid state drive.

[0178] In some optional implementations, the data acquisition module 53 includes:

[0179] A description table reading unit, configured to read a preset description table corresponding to each bad block in the bad block group, wherein the preset description table includes bits corresponding to the channel and chip select signal of each bad block;

[0180] The parameter reading unit is used to determine the bits corresponding to the channel and chip select signal of each bad block from the preset description table, and read the data corresponding to the bits to determine the combination of the channel and chip select signal of each bad block in the bad block group.

[0181] In some optional implementations, the bad block table acquisition module 51 includes:

[0182] An aging query unit, configured to query the aging status and aging progress of the solid state drive;

[0183] The bad block table acquiring unit is configured to acquire the bad block table of the solid state drive when the aging state and the aging progress meet preset conditions.

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

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

[0186] The embodiment of the present invention also provides a computer device having the above Figure 3 A bad block detection device for a solid state drive is shown.

[0187] See also Figure 4 , Figure 4 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 4 As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.

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

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

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

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

[0192] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.

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

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

Claims

1. A method for detecting bad blocks of a solid state drive, characterized in that: The method comprises: Obtaining a bad block table of a solid state drive, wherein the bad block table includes all bad block groups in the solid state drive; Parsing the bad block table to determine the number of bad blocks in each bad block group, and judging whether the number of bad blocks in the bad block group exceeds a preset threshold; When the number of bad blocks in the bad block group exceeds a preset threshold, obtaining a combination of a channel and a chip select signal of each bad block in the bad block group; Based on the combination of the channel and the chip select signal, the position of the flash memory particle corresponding to the combination of the channel and the chip select signal is determined from a preset comparison table, and the preset comparison table stores the mapping relationship between the combination of the channel and the chip select signal and the position of the flash memory particle.

2. The method according to claim 1, characterized in that The parsing of the bad block table to determine the number of bad blocks in each bad block group includes: Reading the bad block table, and determining all bad block groups from the bad block table; Based on the data of each block in the bad block group, the number of bad blocks in each bad block group is determined.

3. The method according to claim 2, characterized in that The determining the number of bad blocks in each bad block group based on the data of each block in the bad block group includes: Read the data of each block in the bad block group in the same row; The data of each block in the same row are converted and summed to determine the number of bad blocks in each bad block group.

4. The method according to claim 3, characterized in that The converting and summing the data of each block in the same row to determine the number of bad blocks in each bad block group includes: Convert the data of each block in the same row into binary to obtain binary data; Taking the OR of the binary data, obtaining the number of bits corresponding to the data in the same row of each block; Calculate the sum of all the bits in the bad block group to determine the number of bad blocks in each bad block group.

5. The method according to claim 1, characterized in that The determining whether the number of bad blocks in the bad block group exceeds a preset threshold comprises: Determining a corresponding preset threshold based on the memory size of the solid state drive; It is determined whether the number of bad blocks in the bad block group exceeds a preset threshold corresponding to the solid state drive.

6. The method according to claim 1, characterized in that The obtaining of a combination of a channel and a chip select signal of each bad block in the bad block group includes: Reading a preset description table corresponding to each bad block in the bad block group, wherein the preset description table includes bits corresponding to a channel and a chip select signal of each bad block; The bits corresponding to the channel and the chip select signal of each bad block are determined from the preset description table, and the data corresponding to the bits are read to determine the combination of the channel and the chip select signal of each bad block in the bad block group.

7. The method according to claim 1, characterized in that The obtaining of the bad block table of the solid state drive includes: Querying the aging status and aging progress of the solid state drive; When the aging state and the aging progress meet preset conditions, a bad block table of the solid state drive is obtained.

8. A bad block detection device for a solid state hard disk, characterized in that: The device comprises: A bad block table acquisition module, used to acquire a bad block table of the solid state drive, wherein the bad block table includes all bad block groups in the solid state drive; A bad block analysis module, used to analyze the bad block table, determine the number of bad blocks in each bad block group, and determine whether the number of bad blocks in the bad block group exceeds a preset threshold; A data acquisition module, used for acquiring a combination of a channel and a chip selection signal of each bad block in the bad block group when the number of bad blocks in the bad block group exceeds a preset threshold; A position determination module is used to determine the position of the flash memory particle corresponding to the combination of the channel and the chip select signal from a preset comparison table based on the combination of the channel and the chip select signal, and the preset comparison table stores the mapping relationship between the combination of the channel and the chip select signal and the position of the flash memory particle.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the bad block detection method for a solid state drive according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the bad block detection method for a solid state drive according to any one of claims 1 to 7.