CN111459708B - Bad block processing method and device - Google Patents

Bad block processing method and device Download PDF

Info

Publication number
CN111459708B
CN111459708B CN202010167035.XA CN202010167035A CN111459708B CN 111459708 B CN111459708 B CN 111459708B CN 202010167035 A CN202010167035 A CN 202010167035A CN 111459708 B CN111459708 B CN 111459708B
Authority
CN
China
Prior art keywords
block
target block
error type
target
read
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010167035.XA
Other languages
Chinese (zh)
Other versions
CN111459708A (en
Inventor
赖文辉
叶欣
张翔
李振华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Biwin Storage Technology Co Ltd
Original Assignee
Biwin Storage Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Biwin Storage Technology Co Ltd filed Critical Biwin Storage Technology Co Ltd
Priority to CN202010167035.XA priority Critical patent/CN111459708B/en
Publication of CN111459708A publication Critical patent/CN111459708A/en
Application granted granted Critical
Publication of CN111459708B publication Critical patent/CN111459708B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1044Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices with specific ECC/EDC distribution
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Read Only Memory (AREA)

Abstract

The invention discloses a bad block processing method, which comprises the following steps: reading the stored data in the target block; when the ECC failure occurs in the read storage data, acquiring an error code of a target block; according to the data recorded by the error codes, carrying out reading error type analysis on the target block, and determining the reading error type of the target block; and carrying out state identification on the target block according to the read error type of the target block. The bad block processing method provided by the invention can determine the read error type of the target block when ECC failure occurs, so as to identify the target block with the read error caused by software reasons as a block to be determined instead of directly identifying the target block as a bad block. Therefore, if the block to be determined is actually read error due to software, the block to be determined can be used normally through software optimization, so that the number of bad blocks is reduced, the erasing times of the available blocks are reduced, and the service cycle of the product is prolonged. In addition, the invention also discloses a bad block processing device.

Description

Bad block processing method and device
Technical Field
The present invention relates to the field of memories, and in particular, to a bad block processing method and apparatus.
Background
Flash Memory (Flash Memory), also known as Flash Memory, is an electronically erasable programmable read only Memory that allows it to be erased multiple times during operation. Common Flash media are both NandFlash and norflash, which divide storage space into erase blocks of a particular size, such as 16KB and 64 KB. When the erasing operation is executed, the positions of one erasing block are all set to be 1 at one time, when the writing operation is executed, the 1 of a single bit can be written to be 0, but the 0 cannot be written to be 1, so that the original content of the whole erasing block is firstly erased in the normal writing operation, and then new data is written.
ECC (Error Correcting Code, error checking and correction) is a technique that enables error checking and correction, and in memory, ECC can tolerate errors and correct errors, so that the system can continue to operate normally without interruption due to errors.
The occurrence of ECC Fail (ECC failure) in the current data read command is that the data cannot be restored under the existing LDPC (Low-Density Parity-check) error correction capability, at which point this block is marked as bad and removed from the operation chain. The above operations may cause the total number of operable blocks to decrease, and increase the number of operations of the remaining normal blocks, thereby causing the number of Program/Erase operations of the normal blocks to increase, and shortening the service cycle of the flash memory product.
Disclosure of Invention
The invention mainly aims to provide a bad block processing method to solve the technical problem that the service cycle of the existing flash memory product is shortened due to the continuous increase of bad blocks.
In order to achieve the above object, the present invention provides a bad block processing method, which includes:
reading the stored data in the target block; when the ECC failure occurs in the reading of the storage data, acquiring an error code of the target block; according to the data recorded by the error codes, carrying out reading error type analysis on the target block, and determining the reading error type of the target block; and carrying out state identification on the target block according to the read error type of the target block.
Preferably, the analyzing the read error type of the target block according to the data recorded by the error code, and determining the read error type of the target block includes: if all the data recorded by the error code are the first numerical value, acquiring the write command parameters of the target block; judging whether a target writing block in the writing command parameters is consistent with the target block or not; if the read error types of the target blocks are inconsistent, determining that the read error types of the target blocks are first error types, wherein the first error types indicate that the stored data of the target blocks are incorrect; if the data is consistent, a target writing page in the target block is acquired, and whether the target writing page finishes data writing or not is judged; if not, determining that the read error type of the target block is a second error type, wherein the second error type represents that the target write page of the target block does not complete data writing; if so, determining that the read error type of the target block is a bad block error type, wherein the bad block error type indicates that the target block is a bad block.
Preferably, the performing state identification on the target block according to the read error type of the target block includes: if the read error type is a first error type or a second error type, marking the target block as a block to be determined; and if the read error type is a bad block error type, marking the target block as a bad block.
Preferably, the analyzing the read error type of the target block according to the data recorded by the error code, and determining the read error type of the target block includes: if all the data recorded by the error code are the second numerical value, judging whether all the stored data of the target block are the second numerical value; if yes, determining that the read error type of the target block is a third error type, wherein the third error type indicates that the target block is free of abnormality; if not, acquiring a write operation mode and a read operation mode of the target block, and judging that the write operation mode is inconsistent with the read operation mode; if the read error types of the target blocks are consistent, determining that the read error types of the target blocks are bad block error types, wherein the bad block error types indicate that the target blocks are bad blocks; if the read operation mode and the write operation mode of the target block are inconsistent, determining that the read error type of the target block is a fourth error type, wherein the fourth error type indicates that the current read operation mode and the write operation mode of the target block are inconsistent.
Preferably, the bad block processing method further comprises: if the stored data of the target block are not all the second values, acquiring scrambling parameters of the stored data of the target block in a writing operation and a reading operation, and judging whether the scrambling parameters of the target block in the writing operation and the reading operation are consistent; if the read error types of the target blocks are consistent, determining that the read error types of the target blocks are bad block error types, wherein the bad block error types indicate that the target blocks are bad blocks; if the read error type of the target block is inconsistent, determining that the read error type of the target block is a fifth error type, wherein the fifth error type indicates that the current read operation of the target block is inconsistent with the scrambling code parameters of the write operation.
Preferably, the performing state identification on the target block according to the read error type of the target block includes: if the read error type is a third error type, a fourth error type or a fifth error type, marking the target block as a block to be determined; and if the read error type is a bad block error type, marking the target block as a bad block.
Preferably, the analyzing the read error type of the target block according to the data recorded by the error code, and determining the read error type of the target block includes: if the data recorded by the error code comprises a first value and a second value, determining an operation page of the target block for reading operation currently; reading adjacent pages within a preset range of the operation page according to a reading strategy; acquiring the ECC failure number of the adjacent pages, and judging whether the ECC failure number of all the adjacent pages is larger than a preset value of the low-density parity check error correction capability; if the ECC failure number of all the adjacent pages is smaller than the preset value of the low-density parity check error correction capability, determining that the read error type of the target block is a bad block error type, wherein the bad block error type indicates that the target block is a bad block; if the ECC failure number of all the adjacent pages is greater than or equal to the preset value of the low-density parity check error correction capability, determining that the read error type of the target block is a sixth error type, wherein the sixth error type indicates that the read algorithm of the target block is to be optimized.
Preferably, the analyzing the read error type of the target block according to the data recorded by the error code, and determining the read error type of the target block includes: if the data recorded by the error code comprises a first value and a second value, acquiring maintenance parameters of the target block, and determining the erasing times of the target block; judging whether the erasing times of the target block are larger than or equal to preset erasing times; if the erasing times of the target block is smaller than the preset erasing times, determining that the read error type of the target block is a bad block error type, wherein the bad block error type indicates that the target block is a bad block; if the erasing times of the target block are greater than or equal to the preset erasing times, determining that the read error type of the target block is a seventh error type, wherein the seventh error type indicates that wear leveling is required for the target block.
Preferably, the performing state identification on the target block according to the read error type of the target block includes: if the read error type is a sixth error type or a seventh error type, marking the target block as a block to be determined; and if the read error type is a bad block error type, marking the target block as a bad block.
The invention also provides a bad block processing device, which comprises: the data reading module is used for reading the stored data in the target block; the data acquisition module is used for acquiring error codes of the target blocks when the ECC failure occurs in the reading of the storage data; the error analysis module is used for analyzing the read error type of the target block according to the data recorded by the error code and determining the read error type of the target block; and the error identification module is used for carrying out state identification on the target block according to the read error type of the target block.
Compared with the prior art, the embodiment of the invention has the beneficial effects that: the bad block processing method provided by the invention can determine the read error type of the target block when the ECC failure occurs in the read storage data, so as to identify the target block with the read error caused by the software reason as the block to be determined, instead of directly identifying the target block as the bad block. Therefore, if the block to be determined is the read error caused by the software, the block to be determined can be normally used by software optimization, so that the number of bad blocks is reduced, the erasing times of the available blocks are reduced, and the service cycle of the product is prolonged.
Drawings
FIG. 1 is a flowchart of a bad block processing method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a bad block processing method according to a second embodiment of the present invention;
FIG. 3 is a flowchart of a bad block processing method according to a third embodiment of the present invention;
FIG. 4 is a flowchart of a bad block processing method according to a fourth embodiment of the present invention;
FIG. 5 is a flowchart of a bad block processing method according to a fifth embodiment of the present invention;
FIG. 6 is a flowchart of a bad block processing method according to a sixth embodiment of the present invention;
FIG. 7 is a flowchart of a seventh embodiment of a bad block processing method according to the present invention;
fig. 8 is a schematic structural diagram of an embodiment of a bad block processing device according to the present invention.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below are exemplary and intended to illustrate the present invention and should not be construed as limiting the invention, and all other embodiments, based on the embodiments of the present invention, which may be obtained by persons of ordinary skill in the art without inventive effort, are within the scope of the present invention.
The present invention proposes a bad block processing method, in an embodiment, referring to fig. 1, the bad block processing method includes:
step S10, reading storage data in a target block; the flash memory includes blocks (blocks) for storing data, the data to be stored are written in the blocks, and when the data in the flash memory needs to be called, the data are read from the corresponding blocks. It should be noted that the target block mentioned in this embodiment refers to a block in which data reading is currently being performed.
Step S20, when ECC failure occurs in the read storage data, obtaining an error code of a target block; after the command of reading the storage data is completed, corresponding data feedback exists, if ECC information exists in the data, the condition that ECC failure occurs when the storage data is read is indicated, and then the error code of the target block can be acquired.
Step S30, according to the data recorded by the error codes, analyzing the read error type of the target block, and determining the read error type of the target block; it should be noted that the error code of the target block is recorded with the type of data read, from which the cause of the read error of the target block can be analyzed to determine the type of read error of the target block.
Step S40, according to the read error type of the target block, the state identification is carried out on the target block. In this embodiment, after confirming the read error type of the target block, the target block of the read error type caused by the software cause may be identified as the block to be determined, and the target block of the read error type caused by the non-software cause may be identified as the bad block, so that the system may remove the bad block from the operation chain. For the block to be determined caused by the software cause, it may be verified thereafter to perform targeted optimization on the software, such as resetting write command parameters, or changing read-write operation modes, etc., including but not limited to. If the ECC failure condition does not occur any more after the software is optimized, the block to be determined is a usable block, which is a read error caused by the software reason, and is not a bad block which is not operable.
In an embodiment, referring to fig. 2, according to the data recorded by the error code, performing read error type analysis on the target block, and determining the read error type of the target block includes:
step S31, if all the data recorded by the error code are the first numerical value, the write command parameter of the target block is obtained; in this embodiment, the first value is 1, that is, if all the data recorded by the error code is 1, it indicates that an error has occurred in the process of writing the data, so that the data is not written into the target block, and the read data is all 1 after the erasure. It should be noted that 1 here represents a stored form of data, which is represented in binary. The available blocks can set all the bits of one erasure block to 1 at a time when the erasure operation is performed, and can write 1 of a single bit to 0 when the write operation is performed, but can not write 0 to 1, so that the original content of the whole erasure block is erased and new data is written in the normal write operation.
Step S32, judging whether the target writing block in the writing command parameter is consistent with the target block;
step S33, if the read error types of the target blocks are inconsistent, determining that the read error types of the target blocks are first error types, wherein the first error types indicate that the storage data of the target blocks are incorrect;
in this embodiment, it is first confirmed whether the addresses of the target write block and the target block are identical. If the storage data read from the target block is inconsistent, the storage error indicates that the storage position of the storage data read from the target block is wrong, the correct storage position of the storage data is the target writing block and is not the target block, and in practical application, the data stored in two different blocks are different. Therefore, in the present embodiment, if all of the storage data BBB read from the target block a has the first value of 1, the write command parameter of the target block is acquired, the target write block a 'of the read storage data BBB is acquired from the write command parameter, and if the address of the target block a matches the address of the target write block a', this indicates that the storage position of the storage data read from the target block a is correct, and if the address of the target block a does not match the address of the target write block a ', this indicates that the storage position of the storage data read from the target block a is incorrect, that is, the storage position of the storage data BBB should be the target write block a', but this is stored in the target block a. Since the storage data BBB is stored in a wrong position, all the read-out storage data BBBs are 1 in the present read operation. In this step, if the target block a is inconsistent with the target write block a', it is determined that the first error type occurs in the read operation from the target block a.
Step S34, if the data are consistent, a target writing page in the target block is obtained, and whether the target writing page finishes data writing or not is judged;
and if the address of the target writing block is consistent with that of the target block, acquiring a target writing page in the target block, and judging whether the target writing page finishes data writing. Note that a Block (Block) includes several pages (pages), and in different Flash protocols, a plurality of pages form one Word Line (WL). When judging whether the target writing page finishes data writing, namely judging whether a plurality of pages of the same word line write data according to the specificity of Flash, if not writing data according to the specificity of Flash, the data is not written into the target block, so that a reading command is failed, and the read data is all 1. For example, assuming that three pages form one WL, in general, if three pages of the same WL do not write data together, a read command fails, so that all data read from the target block is 1. However, in some Flash specifics, some Flash's Low Page (lower Page) may be written separately and allow read operations, upper Page (Upper Page) and Extra Page (Extra Page) to operate together.
Step S35, if not, determining that the read error type of the target block is a second error type, wherein the second error type represents that the target write page of the target block does not complete data writing;
step S36, if the read error type of the target block is determined to be a bad block error type, wherein the bad block error type indicates that the target block is a bad block.
In this embodiment, after determining that the target write page does not complete the data writing, that is, the target write page indicating that the data is not written in the target block, the target block is determined as the second error type. After determining that the target write page completes writing data, that is, indicating that data has been written in this target block, since the data read out from the target block is all 1's, it can be determined that the target block is a bad block.
In the above embodiment, referring to fig. 3, according to the read error type of the target block, performing the status identification on the target block includes:
step S41, if the read error type is the first error type or the second error type, marking the target block as a block to be determined;
in step S42, if the read error type is a bad block error type, the target block is marked as a bad block.
In this embodiment, if the read error type is the first error type or the second error type, the target block is marked as the block to be determined. After the status identification is completed, a determination operation may be performed on the block to be determined of the first error type and the second error type to verify whether the block to be determined is a read data error caused by a software cause, thereby determining whether the block to be determined can be used continuously. Specifically, for the first error type, correct storage data can be stored in the target block and the reading operation of the storage data is repeated, if the read data is correct, the ECC failure cannot occur, and the block to be determined is an available block, which is the last reading error caused by software reasons. Otherwise, if ECC failure still occurs when reading data, the block to be determined is a bad block. And for the second error type, the block to be determined can be read and written again according to the Specific of Flash, and if the read data is correct, the ECC failure cannot occur, the block to be determined is an available block, and the last read error is caused by software reasons. If ECC failure still occurs when data is read, the block to be determined is a bad block.
In another embodiment, referring to fig. 4, according to the data recorded by the error code, performing read error type analysis on the target block, and determining the read error type of the target block includes:
step S37, if all the data recorded by the error code are the second numerical value, judging whether all the stored data of the target block are the second numerical value; in this embodiment, the second value is 0, that is, if all the data recorded by the error code is 0, the data that may be written is all 0, which results in all 0 after erasing the data that is read. It should be noted that 0 here represents a stored form of data, which is represented in binary.
Step S38, if yes, determining that the read error type of the target block is a third error type, wherein the third error type indicates that the target block is abnormal;
step S39, if not, the write operation mode and the read operation mode of the target block are obtained, and the write operation mode and the read operation mode are judged to be inconsistent;
in this embodiment, if the data written in the target block is all 0, it indicates that the target block is an available block without any exception, and the error type of the target block is determined to be the third error type. If the data written in the target block is not all 0, the write operation mode and the read operation mode of the target block are acquired, so as to judge whether the operation modes of the target block during writing and reading are consistent or not respectively. Data writing and data reading generally include the following four modes: a Slc (Single level cell, single-tier storage) mode, a Tlc (Trinary level cell, three-tier storage) mode, a Mlc (Multi-tier storage) mode, and a Qlc (Quad-tier storage) mode. If the data write mode is different from the data read mode, it means that the write mode and the read mode of the target block do not match. For example, data is written in the Slc mode and read out in the Tlc mode; alternatively, data is written in Tlc mode and read out in Slc mode.
Step S310, if the read error types of the target blocks are consistent, determining that the read error types of the target blocks are bad block error types, wherein the bad block error types indicate that the target blocks are bad blocks;
in step S311, if the read error type of the target block is inconsistent, it is determined that the read error type of the target block is a fourth error type, and the fourth error type indicates that the current read operation mode and the write operation mode of the target block are inconsistent.
In this embodiment, if the write operation mode of the target block is consistent with the read operation mode, it may be determined that the read error type of the target block is a bad block error type. If the write operation mode and the read operation mode of the target block are inconsistent, the current read operation mode and the write operation mode of the target block are inconsistent, and the error type of the target block is determined to be a fourth error type.
In the above-mentioned another embodiment, referring to fig. 5, the bad block processing method according to the present invention further includes:
step S312, if the stored data of the target block is not all the second value, the scrambling parameters of the stored data of the target block in the writing operation and the reading operation are obtained, and whether the scrambling parameters of the target block in the writing operation and the reading operation are consistent is judged; in this embodiment, if the scrambling parameters set by the target block in the data writing operation and the data reading operation are inconsistent, the read data is all 0. For example, data is written with the scrambling parameters open and read with the scrambling parameters closed; alternatively, the data is written with the ram closed and read with the ram open.
Step S313, if the read error types of the target blocks are consistent, determining that the read error types of the target blocks are bad block error types, wherein the bad block error types indicate that the target blocks are bad blocks;
in step S314, if the read error type of the target block is inconsistent, it is determined that the read error type of the target block is a fifth error type, and the fifth error type indicates that the scrambling parameters of the current read operation and the write operation of the target block are inconsistent.
In this embodiment, if the scrambling parameters set by the target block during the data writing operation are consistent with those set during the data reading operation, the data reading error caused by inconsistent scrambling parameters can be eliminated, so that the reading error type of the target block is determined as a bad block error type. If the scrambling parameters set by the target block in the data writing operation and the data reading operation are inconsistent, the reading error type of the target block is determined to be a fifth error type.
In another embodiment, referring to fig. 3, the identifying the status of the target block according to the read error type of the target block includes:
step S43, if the read error type is the third error type, the fourth error type or the fifth error type, marking the target block as the block to be determined;
in step S44, if the read error type is a bad block error type, the target block is marked as a bad block.
In this embodiment, if the read error type is the third error type, the fourth error type, or the fifth error type, the target block is marked as the block to be determined. After the status identification is completed, a determination operation may be performed on the block to be determined of the third error type, the fourth error type, and the fifth error type to verify whether the block to be determined is a read data error caused by a software cause, thereby determining whether the block to be determined can be used continuously. Specifically, for the third error type, the target block may be re-read and written, before that, all the data stored in the target block needs to be erased, the erased data type is all 1, and then the data is written, that is, the 1 is rewritten to 0 correspondingly. After the data is rewritten, the data in the target block is read again, if the read data is correct, and ECC failure does not occur, the block to be determined is an available block, and the last reading error is caused by software reasons. Otherwise, if ECC failure still occurs when reading data, the block to be determined is a bad block. Likewise, for the fourth error type and the fifth error type, the data stored in the target block can be read again by changing the operation mode and the scrambling code parameter of the target block to be opposite to the current read command, if the read data is correct, the ECC failure will not occur, and the block to be determined is an available block, which is the last read error caused by the software reason. Otherwise, if ECC failure still occurs when reading data, the block to be determined is a bad block.
In yet another embodiment, referring to fig. 6, performing read error type parsing on the target block according to the error code data, determining the read error type of the target block includes:
step S315, if the data recorded by the error code comprises a first value and a second value, determining an operation page of the target block for reading operation currently; in this embodiment, when there are both 1 and 0 in the data recorded by the error code, three cases are mainly considered, the first: confirming whether the current Block is an Open Block; second,: confirming whether the number of ECC failures in adjacent pages or adjacent word lines exceeds a preset value of low density parity check error correction capability (LDPC); third,: and confirming whether the Program/Erase times of the currently operated Block exceeds the preset erasing times. That is, if there are both 1 and 0 in the data read out from the target block, the cause of the ECC failure in this case is mainly the three cases.
Step S316, reading the adjacent pages within the preset range of the operation page according to the reading strategy;
step S317, the ECC failure number of the adjacent pages is obtained, and whether the ECC failure number of all the adjacent pages is larger than a preset value of the low density parity check error correction capability is judged;
In this embodiment, the above second case is first identified, and the reading policy includes reading a preset number of pages from the Page number currently operated, typically 12 pages, and it should be understood that this number of pages is only exemplary and not limiting. After the reading is finished, checking whether the ECC failure number in all 12 pages is larger than a preset value of the low-density parity check error correction capability, and analyzing the reading error type of the target block according to the ECC failure number.
Step S318, if the ECC failure number of all the adjacent pages is smaller than the preset value of the low density parity check error correction capability, determining that the read error type of the target block is a bad block error type, wherein the bad block error type indicates that the target block is a bad block;
in step S319, if the number of ECC failures of all the adjacent pages is greater than or equal to the preset value of the low-density parity check error correction capability, the read error type of the target block is determined to be a sixth error type, where the sixth error type indicates that the read algorithm of the target block is to be optimized.
When the number of ECC failures in the 12 pages read before is greater than or equal to the preset value of the error correction capability of the low-density parity check, the ECC failure condition occurring when the stored data of the target block is read is indicated, and the relationship between the ECC failure condition and the higher number of ECC failures in the adjacent pages exists. That is, the number of ECC failures in adjacent pages will affect the data reading of the current Page, resulting in ECC failure of the Page of the current read data. Further, the read error type of the target block may be determined as a sixth error type, the sixth error type indicating that the read algorithm of the target block is to be optimized. Otherwise, when the number of ECC failures in the 12 pages read forward is smaller than the preset value of the error correction capability of the low-density parity check, the ECC failure condition occurring when the data stored in the target block is read due to the fact that the number of ECC failures in the adjacent pages is high can be eliminated, namely the target block is an inoperable bad block. Preferably, the preset value of the low density parity check error correction capability according to the present embodiment uses half of the low density parity check error correction capability as a reference threshold, and it should be understood that this value is only exemplary and not limiting.
In yet another embodiment, referring to fig. 7, according to the data recorded by the error code, performing read error type analysis on the target block, and determining the read error type of the target block includes:
step S320, if the data recorded by the error code comprises a first value and a second value, the maintenance parameters of the target block are obtained, and the erasing times of the target block are determined;
step S321, judging whether the erasing times of the target block is larger than or equal to the preset erasing times;
in this embodiment, for the third case, whether the erasing frequency of the target block is higher is checked by checking the software maintenance parameter. It will be appreciated that if the number of erasures of the target block is high, there is a possibility that the data read error may be caused by the reason that if the number of erasures of the target block exceeds the preset number of erasures, the data stored in the target block may have an error itself, rather than the data read error caused by the bad block.
Step S322, if the erasing times of the target block is smaller than the preset erasing times, determining that the read error type of the target block is a bad block error type, wherein the bad block error type indicates that the target block is a bad block;
In step S323, if the number of times of erasing the target block is greater than or equal to the preset number of times of erasing, the read error type of the target block is determined to be a seventh error type, and the seventh error type indicates that the target block needs wear leveling.
In this embodiment, if it is determined that the number of times of erasing the target block is smaller than the preset number of times of erasing, the error of the stored data in the target block caused by the number of times of erasing the target block exceeding the preset number of times of erasing can be eliminated, so that the read error type of the target block is determined as a bad block error type. Otherwise, if the number of times of erasing the target block is determined to be greater than or equal to the preset number of times of erasing, the reason for indicating that the data reading error occurs in the target block may be caused by a software wear-leveling algorithm error, so that the target block is identified as a seventh error type instead of being directly identified as a bad block error type.
As for the first case mentioned above, it should be noted that Open Block refers to a Block that does not write a full Page, for example, 1 Block has 200 pages, and only 100 or 199 blocks are written during data writing, and all blocks belong to the category of Open Block. In the case of Open Block, this also results in both 1 and 0 data being read from the target Block. For this reason, if the data read from the target Block has both 1 and 0, it is necessary to confirm whether all the pages in the target Block are completely written, or send a read command to read the last page of the target Block to determine whether the target Block is an Open Block. Whether the target Block is an Open Block can be determined based on the last page of the read target Block because data is written one by one in page order during the writing process. For this case, the data stored in the target Block may be erased completely, the data in the erased target Block is all 1, and then the data is read again from the target Block, if the read data is all 1 or the data of the last page of the target Block is all 1, it means that the target Block is an Open Block, which is an available Block capable of continuing operation, but not a bad Block.
In still another embodiment or another embodiment of the foregoing, referring to fig. 3, the identifying the status of the target block according to the read error type of the target block includes:
step S45, if the read error type is a sixth error type or a seventh error type, marking the target block as a block to be determined;
in step S46, if the read error type is a bad block error type, the target block is marked as a bad block.
In this embodiment, if the read error type is the sixth error type or the seventh error type, the target block is marked as the block to be determined. After the status identification is completed, a determination operation may be performed on the block to be determined of the sixth error type or the seventh error type to verify whether the block to be determined is a read data error caused by a software cause, thereby determining whether the block to be determined can be used continuously. Specifically, for the sixth error type, the data stored in the target block may be re-read after optimizing the re-reading algorithm of the software, that is, under the condition of not being affected by the number of ECC failures of adjacent pages, the stored data in the target block may be re-read, and if the read data is correct, the ECC failure will not occur, which indicates that the block to be determined is an available block, which is the last reading error caused by the software cause. Otherwise, if ECC failure still occurs when reading data, the block to be determined is a bad block. Similarly, for the seventh error type, after wear-leveling is performed on the target block, the stored data in the target block is read again, and if the read data is correct, no ECC failure occurs, the block to be determined is an available block, which is the last read error caused by software reasons. If ECC failure still occurs when data is read, the block to be determined is a bad block.
Based on the foregoing proposed bad block processing method, the present invention further proposes a bad block processing device, referring to fig. 8, the bad block processing device includes:
a data reading module 1 for reading the stored data in the target block;
the data acquisition module 2 is used for acquiring error codes of the target blocks when ECC failure occurs in the read storage data;
the error analysis module 3 is used for analyzing the read error type of the target block according to the data recorded by the error code and determining the read error type of the target block;
and the error identification module 4 is used for carrying out state identification on the target block according to the read error type of the target block.
In one embodiment, the error resolution module 3 according to the present invention includes:
the first acquisition unit is used for acquiring write command parameters of the target block if all the data recorded by the error code are the first numerical value;
a first judging unit for judging whether the target writing block in the writing command parameter is consistent with the target block;
the first determining unit is used for determining that the read error type of the target block is a first error type if the read error type is inconsistent, and the first error type indicates that the storage data of the target block is incorrect;
the second judging unit is used for acquiring a target writing page in the target block if the target writing page is consistent with the target writing page, and judging whether the target writing page finishes data writing;
A second determining unit configured to determine that a read error type of the target block is a second error type, the second error type indicating that the target write page of the target block does not complete data writing;
and the third determining unit is used for determining that the read error type of the target block is a bad block error type if the read error type of the target block is finished, wherein the bad block error type indicates that the target block is a bad block.
In the above-described embodiment, the error identification module 4 according to the present invention includes:
a first marking unit, configured to mark the target block as a block to be determined if the read error type is the first error type or the second error type;
and the second marking unit is used for marking the target block as a bad block if the read error type is a bad block error type.
In another embodiment, the error resolution module 3 according to the present invention further includes:
the third judging unit is used for judging whether the stored data of the target block are all the second numerical values if the data recorded by the error codes are all the second numerical values;
a fourth determining unit, configured to determine, if yes, that the read error type of the target block is a third error type, where the third error type indicates that the target block is not abnormal;
a fourth judging unit, configured to obtain a write operation mode and a read operation mode of the target block if not, and judge that the write operation mode is inconsistent with the read operation mode;
A fifth determining unit, configured to determine that the read error type of the target block is a bad block error type if the read error type is consistent, where the bad block error type indicates that the target block is a bad block;
and the sixth determining unit is used for determining that the read error type of the target block is a fourth error type if the read error type is inconsistent, wherein the fourth error type indicates that the current read operation mode and the write operation mode of the target block are inconsistent.
In the above-described another embodiment, the error resolution module 3 according to the present invention further includes:
a fifth judging unit, configured to obtain scrambling parameters of the stored data of the target block during the write operation and the read operation if it is judged that the stored data of the target block is not all the second values, and judge whether the scrambling parameters of the target block during the write operation and the read operation are consistent;
a seventh determining unit, configured to determine that the read error type of the target block is a bad block error type if the read error type is consistent, where the bad block error type indicates that the target block is a bad block;
and an eighth determining unit, configured to determine that the read error type of the target block is a fifth error type if the read error type is inconsistent, where the fifth error type indicates that the current scrambling parameters of the read operation and the write operation of the target block are inconsistent.
In the above-described other embodiment, the error identification module 4 according to the present invention further includes:
a third marking unit, configured to mark the target block as a block to be determined if the read error type is a third error type, a fourth error type, or a fifth error type;
and the fourth marking unit is used for marking the target block as a bad block if the read error type is a bad block error type.
In yet another embodiment, the error resolution module 3 according to the present invention further includes:
a ninth determining unit, configured to determine an operation page of the target block that is currently performing the read operation if the data recorded by the error code includes the first value and the second value;
the reading unit is used for reading the adjacent pages within the preset range of the operation page according to the reading strategy;
a sixth judging unit, configured to obtain the number of ECC failures of adjacent pages, and judge whether the number of ECC failures of all adjacent pages is greater than a preset value of low-density parity check error correction capability;
a tenth determining unit, configured to determine that the read error type of the target block is a bad block error type if the number of ECC failures of all adjacent pages is smaller than a preset value of the low density parity check error correction capability, where the bad block error type indicates that the target block is a bad block;
And the eleventh determining unit is configured to determine that the read error type of the target block is a sixth error type if the number of ECC failures of all adjacent pages is greater than or equal to a preset value of the low-density parity check error correction capability, where the sixth error type indicates that the read algorithm of the target block is to be optimized.
In still another embodiment, the error resolution module 3 according to the present invention further includes:
a twelfth determining unit, configured to obtain a maintenance parameter of the target block if the data recorded by the error code includes the first value and the second value, and determine the erasing times of the target block;
a seventh judging unit, configured to judge whether the number of erasing times of the target block is greater than or equal to a preset number of erasing times;
a thirteenth determining unit, configured to determine that the read error type of the target block is a bad block error type if the number of times of erasing the target block is less than the preset number of times of erasing, where the bad block error type indicates that the target block is a bad block;
and a fourteenth determining unit, configured to determine that the read error type of the target block is a seventh error type if the number of times of erasing the target block is greater than or equal to the preset number of times of erasing, where the seventh error type indicates that wear leveling is required for the target block.
In the above-described further embodiment or another embodiment, the error identification module 4 according to the present invention further includes:
A fifth marking module, configured to mark the target block as a block to be determined if the read error type is the sixth error type or the seventh error type;
and the sixth marking module is used for marking the target block as a bad block if the read error type is a bad block error type.
Based on the bad block processing method, the invention also provides bad block processing equipment, which comprises:
a memory for storing a computer program;
and a processor, configured to implement the steps of the bad block processing method in the foregoing embodiment when executing the computer program, where the steps of the bad block processing method at least include:
step S10, reading storage data in a target block;
step S20, when ECC failure occurs in the read storage data, obtaining an error code of a target block;
step S30, according to the data recorded by the error codes, analyzing the read error type of the target block, and determining the read error type of the target block;
step S40, according to the read error type of the target block, the state identification is carried out on the target block.
Based on the bad block processing method proposed by the foregoing, the present invention further proposes a computer readable storage medium, where a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the bad block processing method in the foregoing embodiment are implemented, and the steps of the bad block processing method at least include:
Step S10, reading storage data in a target block;
step S20, when ECC failure occurs in the read storage data, obtaining an error code of a target block;
step S30, according to the data recorded by the error codes, analyzing the read error type of the target block, and determining the read error type of the target block;
step S40, according to the read error type of the target block, the state identification is carried out on the target block.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple modules or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or modules, which may be in electrical, mechanical, or other forms.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
The integrated modules, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above description of the preferred embodiments of the present invention should not be taken as limiting the scope of the invention, but rather should be understood to cover all modifications, variations and adaptations of the present invention using its general principles and the following detailed description and the accompanying drawings, or the direct/indirect application of the present invention to other relevant arts and technologies.

Claims (10)

1. A bad block processing method, characterized in that the bad block processing method comprises:
reading the stored data in the target block;
when the ECC failure occurs in the reading of the storage data, acquiring an error code of the target block;
according to the data recorded by the error codes, carrying out reading error type analysis on the target block, and determining the reading error type of the target block;
performing state identification on the target block according to the read error type of the target block;
the performing state identification on the target block includes:
marking a target block of a read error type caused by a software reason as a block to be determined, and marking a target block of a read error type caused by a non-software reason as a bad block;
verifying the block to be determined to optimize software;
If the ECC failure does not occur any more after the software is optimized, the block to be determined is an available block.
2. The bad block processing method of claim 1, wherein the performing read error type parsing on the target block according to the data recorded by the error code, and determining the read error type of the target block comprises:
if all the data recorded by the error code are the first numerical value, acquiring the write command parameters of the target block;
judging whether a target writing block in the writing command parameters is consistent with the target block or not;
if the read error types of the target blocks are inconsistent, determining that the read error types of the target blocks are first error types, wherein the first error types indicate that the stored data of the target blocks are incorrect;
if the data is consistent, a target writing page in the target block is acquired, and whether the target writing page finishes data writing or not is judged;
if not, determining that the read error type of the target block is a second error type, wherein the second error type represents that the target write page of the target block does not complete data writing;
if so, determining that the read error type of the target block is a bad block error type, wherein the bad block error type indicates that the target block is a bad block.
3. The bad block processing method of claim 2, wherein the status identifying the target block according to the read error type of the target block comprises:
if the read error type is a first error type or a second error type, marking the target block as a block to be determined;
and if the read error type is a bad block error type, marking the target block as a bad block.
4. The bad block processing method of claim 1, wherein the performing read error type parsing on the target block according to the data recorded by the error code, and determining the read error type of the target block comprises:
if all the data recorded by the error code are the second numerical value, judging whether all the stored data of the target block are the second numerical value;
if yes, determining that the read error type of the target block is a third error type, wherein the third error type indicates that the target block is free of abnormality;
if not, acquiring a write operation mode and a read operation mode of the target block, and judging whether the write operation mode and the read operation mode are inconsistent;
if the read error types of the target blocks are consistent, determining that the read error types of the target blocks are bad block error types, wherein the bad block error types indicate that the target blocks are bad blocks;
If the read operation mode and the write operation mode of the target block are inconsistent, determining that the read error type of the target block is a fourth error type, wherein the fourth error type indicates that the current read operation mode and the write operation mode of the target block are inconsistent.
5. The bad block processing method of claim 4, wherein the bad block processing method further comprises:
if the stored data of the target block are not all the second values, acquiring scrambling parameters of the stored data of the target block in a writing operation and a reading operation, and judging whether the scrambling parameters of the target block in the writing operation and the reading operation are consistent;
if the read error types of the target blocks are consistent, determining that the read error types of the target blocks are bad block error types, wherein the bad block error types indicate that the target blocks are bad blocks;
if the read error type of the target block is inconsistent, determining that the read error type of the target block is a fifth error type, wherein the fifth error type indicates that the current read operation of the target block is inconsistent with the scrambling code parameters of the write operation.
6. The bad block processing method of claim 5, wherein the status identifying the target block based on the read error type of the target block comprises:
If the read error type is a third error type, a fourth error type or a fifth error type, marking the target block as a block to be determined;
and if the read error type is a bad block error type, marking the target block as a bad block.
7. The bad block processing method of claim 1, wherein the performing read error type parsing on the target block according to the data recorded by the error code, and determining the read error type of the target block comprises:
if the data recorded by the error code comprises a first value and a second value, determining an operation page of the target block for reading operation currently;
reading adjacent pages of the operation page within a preset range according to a reading strategy;
acquiring the ECC failure number of the adjacent pages, and judging whether the ECC failure number of all the adjacent pages is larger than a preset value of the error correction capability of the low-density parity check code;
if the ECC failure number of all the adjacent pages is smaller than the preset value of the error correction capability of the low-density parity check code, determining that the read error type of the target block is a bad block error type, wherein the bad block error type indicates that the target block is a bad block;
If the number of ECC failures of all the adjacent pages is greater than or equal to the preset value of the error correction capability of the low-density parity check code, determining that the read error type of the target block is a sixth error type, wherein the sixth error type indicates that the read algorithm of the target block is to be optimized.
8. The bad block processing method of claim 1, wherein the performing read error type parsing on the target block according to the data recorded by the error code, and determining the read error type of the target block comprises:
if the data recorded by the error code comprises a first value and a second value, acquiring maintenance parameters of the target block, and determining the erasing times of the target block;
judging whether the erasing times of the target block are larger than or equal to preset erasing times;
if the erasing times of the target block is smaller than the preset erasing times, determining that the read error type of the target block is a bad block error type, wherein the bad block error type indicates that the target block is a bad block;
if the erasing times of the target block are greater than or equal to the preset erasing times, determining that the read error type of the target block is a seventh error type, wherein the seventh error type indicates that wear leveling is required for the target block.
9. The bad block processing method according to claim 7 or 8, wherein the performing status identification on the target block according to the read error type of the target block comprises:
if the read error type is a sixth error type or a seventh error type, marking the target block as a block to be determined;
and if the read error type is a bad block error type, marking the target block as a bad block.
10. A bad block processing apparatus, comprising:
the data reading module is used for reading the stored data in the target block;
the data acquisition module is used for acquiring error codes of the target blocks when the ECC failure occurs in the reading of the storage data;
the error analysis module is used for analyzing the read error type of the target block according to the data recorded by the error code and determining the read error type of the target block;
the error identification module is used for carrying out state identification on the target block according to the read error type of the target block;
the performing state identification on the target block includes:
marking a target block of a read error type caused by a software reason as a block to be determined, and marking a target block of a read error type caused by a non-software reason as a bad block;
Verifying the block to be determined to optimize software;
if the ECC failure does not occur any more after the software is optimized, the block to be determined is an available block.
CN202010167035.XA 2020-03-11 2020-03-11 Bad block processing method and device Active CN111459708B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010167035.XA CN111459708B (en) 2020-03-11 2020-03-11 Bad block processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010167035.XA CN111459708B (en) 2020-03-11 2020-03-11 Bad block processing method and device

Publications (2)

Publication Number Publication Date
CN111459708A CN111459708A (en) 2020-07-28
CN111459708B true CN111459708B (en) 2023-08-29

Family

ID=71685756

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010167035.XA Active CN111459708B (en) 2020-03-11 2020-03-11 Bad block processing method and device

Country Status (1)

Country Link
CN (1) CN111459708B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035417A (en) * 2020-09-07 2020-12-04 浙江大华技术股份有限公司 Method and device for managing storage block, storage medium and electronic device
CN113885416A (en) * 2021-10-20 2022-01-04 上海新纪元机器人有限公司 Method and system for automatically detecting servo motor parameters
CN114879916B (en) * 2022-07-12 2022-09-30 合肥康芯威存储技术有限公司 Method and device for managing storage unit

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455386A (en) * 2013-08-28 2013-12-18 华为技术有限公司 Method and equipment for restoring error data
CN103514104A (en) * 2012-06-27 2014-01-15 安凯(广州)微电子技术有限公司 Method for reading data and method for writing data
CN103645965A (en) * 2013-11-28 2014-03-19 陕西千山航空电子有限责任公司 NAND-FLASH bad block recovery method based on ECCs

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103514104A (en) * 2012-06-27 2014-01-15 安凯(广州)微电子技术有限公司 Method for reading data and method for writing data
CN103455386A (en) * 2013-08-28 2013-12-18 华为技术有限公司 Method and equipment for restoring error data
CN103645965A (en) * 2013-11-28 2014-03-19 陕西千山航空电子有限责任公司 NAND-FLASH bad block recovery method based on ECCs

Also Published As

Publication number Publication date
CN111459708A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
EP2530595B1 (en) System and method of tracking error data within a storage device
CN111459708B (en) Bad block processing method and device
KR100321302B1 (en) A method of controlling flash memory and a flash memory chip
KR101696389B1 (en) System and method to correct data errors using a stored count of bit values
US7240178B2 (en) Non-volatile memory and non-volatile memory data rewriting method
KR100850515B1 (en) Memory system having multl level cell flash memory and programming method thereof
CN101529526B (en) Method for estimating and reporting the life expectancy of flash-disk memory
CN103995784B (en) Flash memory controller, storage device and flash memory control method
US6851015B2 (en) Method of overwriting data in nonvolatile memory and a control apparatus used for the method
CN109582216B (en) Data storage device and data processing method of memory device
KR20020032340A (en) Method of managing a defect in a flash memory
US20140115422A1 (en) Non-volatile memory error correction
CN116880782B (en) Embedded memory and testing method thereof
TWI744049B (en) Data processing method and memory controller utilizing the same
JP3675375B2 (en) Nonvolatile memory and data rewriting method of nonvolatile memory
CN111273857A (en) Selective relocation of data of subgroups of data blocks based on statistical distribution of reliability
CN113470723B (en) Method and device for testing read retry, readable storage medium and electronic equipment
KR20050064887A (en) Flash memory having enhanced error detection capability and method for detecting multi-bit errors
CN114627959A (en) Flash memory detection method, flash memory detection device, equipment and medium
US10019186B2 (en) Data maintenance method for error control and data storage device using the same
US11550710B2 (en) Data processing method and memory controller utilizing the same
JP3314719B2 (en) Flash EEPROM and its test method
CN117519574A (en) Memory management method, memory controller and memory storage device
CN116339628A (en) Method for determining storage partition of storage unit, storage medium and electronic device
CN115421964A (en) Non-aligned data error processing method, control component and storage device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 518000 floors 1-3 and 4 of buildings 4 and 8, zone 2, Zhongguan honghualing Industrial South Zone, No. 1213 Liuxian Avenue, Pingshan community, Taoyuan Street, Nanshan District, Shenzhen, Guangdong

Applicant after: BIWIN STORAGE TECHNOLOGY Co.,Ltd.

Address before: 518000 1st, 2nd, 4th and 5th floors of No.4 factory building, tongfuyu industrial town, Taoyuan Street, Nanshan District, Shenzhen City, Guangdong Province

Applicant before: BIWIN STORAGE TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant