NAND bad block management method and device with low memory consumption, equipment and storage medium

By introducing a low-memory consumption management method of bad block table and mapping block table in NAND flash memory devices, the problem of excessive memory consumption in traditional methods is solved, a balance between data reliability and operation speed is achieved, and the stability and efficiency of storage devices are ensured.

CN120848795APending Publication Date: 2025-10-28WUHAN YUXIN SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510959189.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

On embedded storage devices, traditional NAND bad block management methods consume too much memory and cannot effectively manage bad blocks, affecting data reliability and operating speed.

Method used

A low-memory-consumption NAND bad block management method is adopted. By introducing a bad block table and a mapping block table, the memory usage of the recording unit is smaller than that of the mapping block table. The status of the target data storage block is determined based on the status mapping identifier of the bad block table, and the mapping block table is queried to determine the logical address of the spare storage block for replacement when necessary.

Benefits of technology

It achieves the goal of significantly reducing memory consumption and the impact of running speed while ensuring data reliability, saving runtime memory space for bad block management, and ensuring the stability and speed of storage devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120848795A_ABST
    Figure CN120848795A_ABST
Patent Text Reader

Abstract

The invention provides an NAND bad block management method and device with low memory consumption, equipment and a storage medium, and relates to the technical field of solid storage. The NAND bad block management method comprises the steps that when a target data storage block in a data area is operated, a state mapping identifier corresponding to the target data storage block in a bad block table is obtained, and the memory occupation amount of a recording unit in the bad block table is smaller than the memory occupation amount of a recording unit in a mapping block table; under the condition that the state mapping identification of the target data storage block is a bad block identification, logic addresses corresponding to all standby storage blocks in a mapping block table are inquired based on the physical address of the target data storage block to determine a target replacement block, and the mapping block table does not record the logic addresses corresponding to all the data storage blocks; and transferring the operation on the target data storage block to the target replacement block. Through the NAND bad block management method, the reliability of the data on the NAND can be ensured, and the memory space during bad block management operation can be saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of solid-state storage technology, and in particular to a method, apparatus, device and storage medium for managing NAND bad blocks with low memory consumption. Background Technology

[0002] NAND flash memory devices consist of multiple storage planes, each containing multiple blocks, each block containing multiple pages, and each page consisting of multiple storage cells. Each storage cell can store one bit of data. NAND is written to on a page-by-page basis and erased on a block-by-block basis.

[0003] Due to manufacturing limitations, NAND flash memory cannot guarantee that all blocks are good when it leaves the factory. Furthermore, because the number of write cycles is limited, new bad blocks will be generated during use. Therefore, additional bad block management methods are needed to ensure the reliability of data on NAND flash memory. However, in embedded storage devices, free memory is extremely scarce, and traditional methods of directly replacing bad blocks consume excessive memory. Summary of the Invention

[0004] In view of this, this application proposes a method, apparatus, device and storage medium for low memory consumption NAND bad block management.

[0005] Firstly, this application provides a low-memory-consumption NAND bad block management method. The NAND bad block management method is used for bad block management of a storage plane in a NAND flash memory device. The storage plane includes a data area and a spare area. Each storage plane corresponds to a bad block table and a mapped block table. The memory usage of a record unit in the bad block table is less than the memory usage of a record unit in the mapped block table. The NAND bad block management method includes: When operating on the target data storage block of the data region, obtain the status mapping identifier of the target data storage block in the bad block table; When the status mapping identifier of the target data storage block is a bad block identifier, the target replacement block is determined by querying the logical address corresponding to each spare storage block in the mapping block table based on the physical address of the target data storage block. The mapping block table does not record the logical address corresponding to each data storage block. Operations performed on the target data storage block are transferred to the target replacement block.

[0006] In one embodiment, the method further includes: When the status mapping identifier of the target data storage block is a bad block identifier, and the logical addresses corresponding to each spare storage block in the mapping block table are different from the physical addresses of the target data storage block, the status of each spare storage block in the spare area is queried in a preset order, and when the status of the currently queried spare storage block is normal, the occupancy status of the currently queried spare storage block is determined according to the mapping block table. The first sequential spare storage block that is in a normal state and is not occupied is identified as the target replacement block, and the logical address of the target replacement block in the mapping block table is replaced with the physical address of the target data storage block.

[0007] In one embodiment, the memory usage of a record unit in the bad block table is 1 bit, and the state mapping identifier recorded by the record unit is a binary number.

[0008] In one embodiment, querying the status of each backup storage block in the backup area in a preset order includes: Obtain the arrangement order of each spare storage block in the spare area; The status mapping identifiers recorded in the bad block table are queried sequentially according to the arrangement order of each spare storage block; The status of the currently queried standby storage block is determined based on the status mapping identifier corresponding to the currently queried standby storage block.

[0009] In one embodiment, determining the occupancy status of the currently queried standby storage block based on the mapping block table when the current status of the standby storage block is normal includes: Obtain the logical address of the currently queried standby storage block corresponding to the mapping block table; If the logical address corresponding to the currently queried standby storage block is the default identifier, it is determined that the currently queried standby storage block is not occupied; If the logical address of the corresponding currently queried standby storage block is not the default identifier, it is determined that the currently queried standby storage block is occupied.

[0010] In one embodiment, the NAND bad block management method further includes: When a new bad block is detected in the data area, the original state mapping identifier of the corresponding good block in the target recording unit is modified to the new state mapping identifier of the corresponding bad block, wherein the target recording unit is the recording unit in the bad block table corresponding to the new bad block.

[0011] In one embodiment, the NAND bad block management method further includes: If the target data storage block is identified as a bad block in the status mapping, and no spare storage block that is in normal condition and not occupied is found, the NAND flash memory device will be marked as a damaged device.

[0012] Secondly, this application provides a low-memory-consumption NAND bad block management device. The NAND bad block management device is used for bad block management of a storage plane in a NAND flash memory device. The storage plane includes a data area and a spare area. Each storage plane corresponds to a bad block table and a mapped block table. The memory usage of a record unit in the bad block table is less than the memory usage of a record unit in the mapped block table. The NAND bad block management device includes: The acquisition module is used to acquire the status mapping identifier of the target data storage block in the bad block table when operating on the target data storage block of the data area; The query module is used to determine the target replacement block by querying the logical addresses corresponding to each spare storage block in the mapping block table based on the physical address of the target data storage block when the status mapping identifier of the target data storage block is a bad block identifier. The mapping block table does not record the logical addresses corresponding to each of the data storage blocks. A processing module is used to transfer operations performed on the target data storage block to the target replacement block.

[0013] Thirdly, this application also provides an electronic device, including a processor and a memory; the memory has a computer program stored thereon, wherein the computer program, when executed by the processor, implements the low memory consumption NAND bad block management method as described in the first aspect.

[0014] Fourthly, this application also provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the low-memory-consumption NAND bad block management method as described in the first aspect.

[0015] The low-memory-consumption NAND bad block management method of this application has the following advantages over related technologies: 1. In this application, due to the introduction of a bad block table, the memory usage of each record unit in the bad block table is less than that of each record unit in the mapping block table. The mapping block table does not record the logical addresses corresponding to each data storage block, while the number of data storage blocks is far greater than the number of spare storage blocks. Related technologies require the mapping block table to record the logical addresses of all storage blocks. Therefore, the sum of the memory usage of the bad block table and the mapping block table in this application is far less than the memory usage of the mapping block table in related technologies. Based on this, the NAND bad block management method of this application can determine the status of the target data storage block based on the status mapping identifier in the bad block table. When the status mapping identifier of the target data storage block is a bad block identifier, it queries the logical addresses corresponding to each spare storage block in the mapping block table based on the physical address of the target data storage block to determine the target replacement block. Operations performed on the target data storage block are then transferred to the target replacement block, thereby realizing the replacement management of bad blocks in the data area, ensuring the reliability of data on the NAND, and saving runtime memory space for bad block management.

[0016] 2. In this application, when operating on the target data storage block of the data area, the bad block table is first queried. If it is a good block, the operation is performed directly on that block; if it is a bad block, the blocks in the spare area are traversed, and after finding the corresponding replacement block, the operation is performed on the replacement block. Therefore, the existence of the bad block table can avoid the problem of traversing the spare storage blocks in the spare area every time a data storage block is operated on, which can significantly reduce the traversal operation of the spare area, thus minimizing the impact on the running speed and ensuring a balance between running speed and memory consumption. Attached Figure Description

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 This is a schematic diagram of a mapping block table in related technologies; Figure 2 This is a flowchart illustrating a low-memory-consumption NAND bad block management method in one embodiment of this application. Figure 3 This is a schematic diagram illustrating the division of the data area and the spare area in one embodiment of this application; Figure 4 This is a schematic diagram of a bad block table and a mapped block table in one embodiment of this application; Figure 5 This is a schematic diagram of a bad block table and a mapped block table in another embodiment of this application; Figure 6 This is a schematic diagram of the bad block table and the mapped block table in another embodiment of this application; Figure 7 This is a schematic diagram of a low-memory-consumption NAND bad block management device in one embodiment of this application. Detailed Implementation

[0019] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0020] As described in the background section, the storage space of a NAND flash memory device comprises multiple storage planes, each storage plane comprises multiple blocks, each block comprises multiple pages, and each page consists of multiple storage cells, with each storage cell capable of storing 1 bit of data. NAND is written to on a page-by-page basis and erased on a block-by-block basis.

[0021] Due to manufacturing limitations, NAND flash memory cannot guarantee that all blocks are good when it leaves the factory. Furthermore, because the number of write cycles is limited, new bad blocks will be generated during use. Therefore, additional bad block management methods are needed to ensure the reliability of data on NAND flash memory. However, in embedded storage devices, free memory is extremely scarce, and traditional methods of directly replacing bad blocks consume excessive memory.

[0022] For example, such as Figure 1 As shown, Figure 1 This algorithm corresponds to a direct algorithm for replacing bad blocks on a single plane. It allocates 2 bytes of runtime memory space for each block. At the beginning of storage device production, blocks n+2 and m are in their original bad block state. During subsequent production processes, the state of all blocks is transformed... Figure 1 A mapping block table is used for the normal operation of the storage device after it leaves the factory. During normal use of the storage device, if block 2 becomes a new bad block, it is necessary to traverse all blocks in the spare area (from block n+1 to block m). If block n+1 is found to be a good block that has not been replaced, then block 2 is replaced with block n+1. In the mapping block table, the memory location of block 2 is recorded as the replaced block n+1, and the memory location of block n+1 is also recorded as the replaced bad block 2. Figure 1 In the corresponding direct algorithm for replacing bad blocks in a single plane, the runtime memory consumption is ( ) bytes, where m is the total number of blocks in the storage device. It can be seen that the direct replacement method for bad blocks consumes a lot of memory.

[0023] Based on this, in some embodiments, such as Figure 2 As shown, this application provides a low-memory-consumption NAND bad block management method. This method is used for bad block management in the storage plane of a NAND flash memory device, where the storage plane includes a data area and a spare area, for example... Figure 3 As shown, the data area has multiple data storage blocks, and the spare area has multiple spare storage blocks. Each storage plane corresponds to a bad block table and a mapped block table, and the memory usage of a record unit in the bad block table is less than the memory usage of a record unit in the mapped block table. The NAND bad block management method includes the following steps S201 to S203.

[0024] S201: When operating on the target data storage block of the data area, obtain the status mapping identifier of the corresponding target data storage block in the bad block table.

[0025] The bad block table's recording units can record either the status mapping identifier of a bad block or the status mapping identifier of a good block. Therefore, after obtaining the status mapping identifier of the target data storage block in the bad block table, it's possible to determine whether the target data storage block is good or bad based on that identifier. For example, the memory usage of each recording unit in the bad block table is 1 bit, and the status mapping identifier recorded by the recording unit is a binary number, using 1 and 0 as the status mapping identifier. One of 1 and 0 represents the status mapping identifier of the corresponding bad block, and the other represents the status mapping identifier of the corresponding good block.

[0026] S202: If the target data storage block's status mapping identifier is a bad block identifier, the target replacement block is determined by querying the logical addresses corresponding to each spare storage block in the mapping block table based on the physical address of the target data storage block. Note that the mapping block table does not record the logical addresses corresponding to each data storage block.

[0027] It is understandable that if the target data storage block is identified as a bad block when its status mapping is marked as such, then the target data storage block is considered bad. In this case, a good block from the spare area needs to be used to replace the target data storage block. The replacement of the target data storage block with a good block from the spare area is done by mapping logical addresses in the mapping block table. Therefore, the logical addresses corresponding to each spare storage block in the mapping block table can be queried, and the spare storage block whose logical address is the same as the physical address of the target data storage block is identified as the target replacement block.

[0028] It should also be noted that, because the memory usage of a record unit in the bad block table is less than that of a record unit in the mapped block table, the mapped block table does not record the logical address corresponding to each data storage block. However, the number of data storage blocks is far greater than the number of spare storage blocks. Therefore, the mapped block table in related technologies needs to record the logical address of all storage blocks (e.g., ...). Figure 1 (as shown in the mapping block table), therefore, the sum of the memory usage of the bad block table and the mapping block table in this application is much smaller than the memory usage of the mapping block table in related technologies.

[0029] For example, such as Figure 4 As shown, Figure 4 In the memory, the data area has no bad blocks, while the spare area has two bad blocks, block n+2 and block m. The bad block table in memory represents the good / bad status of all blocks in both the data and spare areas, with each block represented by 1 bit (0 for good, 1 for bad). The mapped block table in memory represents the bad blocks in the data area that are replaced by good blocks in the spare area. This table only records blocks in the spare area, with each block being 2 bytes. In the spare area, 1 bit in the bad block table indicates whether the block is good or bad. If a block is good, and the mapped block table shows that the logical address of the spare storage block matches the physical address of the target data storage block, then that spare storage block is the target replacement block.

[0030] With a memory footprint of 1 bit for a record unit in the bad block table and 2 bytes (16 bits) for a record unit in the mapped block table, the following is the percentage memory consumption gain of the new bad block management algorithm compared to the direct bad block replacement algorithm:

[0031] Where m is the total number of blocks in the storage device, and n is the total number of blocks in the data region. The closer n is to m, the closer the return is to... .

[0032] Taking a storage device with 7% internal over-provision (OP) space and a user capacity of 515GB as an example, there are 24 planes, each plane has 363 blocks, and the total physical capacity is [number of blocks]. The physical capacity of the data area is The number of blocks n = 8064.

[0033] Table 1 shows the bad block management method of this application and Figure 1 The ratio of memory consumed by the corresponding methods

[0034] As shown in Table 1, on this specific device, runtime memory consumption was reduced by 17424-2385=15039 bytes, approximately 86.3%.

[0035] S203: Transfer the operation performed on the target data storage block to the target replacement block.

[0036] It can be understood that by transferring the operations performed on the target data storage block to the target replacement block, the target replacement block replaces the target data storage block, thereby realizing the replacement management of bad blocks in the data area.

[0037] The aforementioned low-memory-consumption NAND bad block management method determines the status of the target data storage block based on the status mapping identifier in the bad block table. When the target data storage block's status mapping identifier indicates a bad block, it queries the logical addresses of the corresponding spare storage blocks in the mapping block table based on the physical address of the target data storage block to determine the target replacement block. Operations on the target data storage block are then transferred to the target replacement block, thereby achieving bad block replacement management in the data area, ensuring the reliability of data on the NAND, and saving runtime memory space for bad block management. Furthermore, when operating on the target data storage block in the data area, the bad block table is first queried. If it is a good block, the operation is performed directly on that block; if it is a bad block, the blocks in the spare area are traversed to find the corresponding replacement block, and then the operation is performed on the replacement block. Therefore, the existence of the bad block table avoids the problem of traversing the spare storage blocks in the spare area for every operation on the data storage block, significantly reducing traversal operations in the spare area, thus minimizing the impact on running speed and ensuring a balance between running speed and memory consumption.

[0038] In some embodiments, the NAND bad block management method further includes the following steps: when the status mapping identifier of the target data storage block is a bad block identifier, and the logical addresses corresponding to each spare storage block in the mapping block table are different from the physical addresses of the target data storage block, querying the status of each spare storage block in the spare area in a preset order, and determining the occupancy status of the currently queried spare storage block according to the mapping block table when the status of the currently queried spare storage block is normal; determining the first-order spare storage block with a normal status and not occupied as the target replacement block, and replacing the logical address of the corresponding target replacement block in the mapping block table with the physical address of the target data storage block.

[0039] It is understandable that when the status mapping identifier of the target data storage block is detected as a bad block identifier, it means that the target data storage block is a bad block. At the same time, if the logical addresses corresponding to each spare storage block in the mapping block table are different from the physical addresses of the target data storage block, it means that the target data storage block has not been replaced by a spare storage block. Then, the status of each spare storage block in the spare area can be queried one by one according to a pre-set specific order. Here, the status of each spare storage block can be determined by querying the bad block table.

[0040] When a standby storage block with a normal status is found, it is used as the current standby storage block. The system then uses the mapping block table to determine the occupancy status of this standby storage block and check if it is already occupied by other data storage blocks. Once a first-order standby storage block with a normal status and not occupied is found, it is designated as the target replacement block. This target replacement block will take over the data storage task from the failed target data storage block. Finally, to ensure the accuracy and continuity of data read and write operations, the system replaces the logical address of the corresponding target replacement block in the mapping block table with the physical address of the target data storage block. This ensures that subsequent data read and write commands correctly point to the new target replacement block, achieving seamless switching of data storage locations and guaranteeing the stable operation of the data storage system and the reliability of the data.

[0041] In some embodiments, querying the status of each backup storage block in the backup area in a preset order includes: obtaining the arrangement order of each backup storage block in the backup area; sequentially querying the status mapping identifier recorded in the bad block table according to the arrangement order of each backup storage block; and determining the status of the currently queried backup storage block according to the status mapping identifier corresponding to the currently queried backup storage block.

[0042] The order of the spare storage blocks can be based on ascending physical address logic, storage location priority, or a pre-defined logical order, thus providing an ordered retrieval path for the query operation. When it is necessary to determine the status of each spare storage block, the status mapping identifier recorded in the bad block table is queried one by one according to the order of arrangement. The bad block table, as an index database of storage block status, stores the status mapping information corresponding to each spare storage block. These identifiers usually represent the status of the storage block using specific encodings (such as binary values, character tags, etc.). Finally, the actual status of the currently queried spare storage block is determined according to the status mapping identifier corresponding to it. Thus, when a spare storage block with a normal status is found, it is used as the currently queried spare storage block, and the occupancy status of the currently queried spare storage block is further determined according to the mapping block table. Once a first-order spare storage block with a normal status and not occupied is found, it is determined as the target replacement block, and the target data storage block is replaced by the target replacement block.

[0043] In some embodiments, when the status of the currently queried standby storage block is normal, the determination of the occupancy status of the currently queried standby storage block based on the mapping block table includes: obtaining the logical address corresponding to the currently queried standby storage block in the mapping block table; determining that the currently queried standby storage block is not occupied if the logical address corresponding to the currently queried standby storage block is a default identifier; and determining that the currently queried standby storage block is occupied if the logical address corresponding to the currently queried standby storage block is not a default identifier.

[0044] Understandably, when determining the occupancy status of a spare storage block, the system first extracts the logical address corresponding to the currently queried spare storage block from the mapping block table. The mapping block table, as the core data structure for storage address mapping, records the correspondence between the logical address of each spare storage block and its physical storage location. The default identifier here is usually a specific value pre-set by the system (such as "0xFFFF"), used to indicate that the logical address has not yet been allocated to any valid data storage task. When the extracted logical address has the default identifier, the system determines that the currently queried spare storage block is in an unoccupied state, meaning its physical storage space has not been allocated for storing actual data and can be scheduled and used by the system at any time. Conversely, if the extracted logical address does not have the default identifier, it indicates that the logical address has been mapped to a specific data storage task, and the system determines that the currently queried spare storage block is occupied, thus determining its occupancy status.

[0045] For example, such as Figure 5 As shown, the target data storage block is data storage block 2. A sequential query of the spare storage blocks in the spare area (from block n+1 to block m) reveals that the identifier for spare storage block n+1 in the bad block table is 0, indicating that spare storage block n+1 is a good block. Then, the value in the mapping block table is queried. Since the value in the mapping block table is 0xFFFF, and 0xFFFF indicates that block n+1 is unoccupied, spare storage block n+1 is therefore an unoccupied good block. Following the sequential priority matching principle, block 2 is replaced with block n+1, and the logical address corresponding to block n+1 in the mapping block table is replaced with the physical address of bad block 2.

[0046] In some embodiments, the NAND bad block management method further includes the step of modifying the original state mapping identifier of the corresponding good block in the target recording unit to the new state mapping identifier of the corresponding bad block when a new bad block is detected in the data area. The target recording unit is the recording unit in the bad block table corresponding to the new bad block.

[0047] It is understandable that during the operation of a NAND flash memory device, new bad blocks may be generated. When a storage block that meets the bad block determination criteria (such as reaching a preset threshold of erase counts) is identified by the built-in error detection mechanism, it will be identified as a new bad block. At this time, in order to accurately record the change in the state of the storage block, the processing device will access the target recording unit, which originally stores the state mapping identifier of the corresponding storage block when it was a good block (such as "0" indicating normal). The processing device will modify this original state mapping identifier to the new state mapping identifier of the corresponding bad block (such as "1" indicating a bad block). This updates the record of the health status of the storage block and provides a trigger condition for the subsequent bad block handling process, ensuring that the system can respond to storage media failures in a timely manner and maintain the reliability and availability of data storage. Moreover, through this dynamic update mechanism of state mapping identifiers, the system can effectively manage storage resources and ensure data integrity and the stability of read and write operations.

[0048] For example, such as Figure 6 As shown, as the storage device continues to be used, block 3 also becomes a new bad block. First, the bit corresponding to block 3 in the bad block table is set to 1. Then, all blocks in the spare area (from block n+1 to block m) are traversed again. It is found that block n+1 is a good block, but the value of the mapping block table is not 0xFFFF, indicating that block n+1 has been used, so block n+1 is skipped. Block n+2 is an existing bad block, so it is also skipped. Block n+3 is a good block and the value of the mapping block table is 0xFFFF, indicating that block n+3 is a good block that has not been replaced. According to the first-match principle, block 3 is replaced with block n+3, and the replaced bad block 3 is recorded in the memory location corresponding to block n+3 in the mapping block table.

[0049] In one example, if a new bad block is detected in the spare area, the original state mapping identifier of the record unit in the bad block table is modified to the new state mapping identifier of the corresponding bad block. For example, if a spare block used as a replacement block becomes a new bad block, the original state mapping identifier of the record unit in the bad block table is modified to the new state mapping identifier of the corresponding bad block, and the corresponding logical address in the mapping block table is updated to the default identifier (0xFFFF). For example, if the previously replaced block n+1 becomes a new bad block, the bad block table of block n+1 becomes 1 and the mapping table is updated to 0xFFFF; if block n+4 meets the replacement condition (i.e., a first-order spare storage block that is in a normal state and not occupied), the logical address of block n+4 in the mapping block table is updated to the target data storage block (e.g., 2) that was previously replaced by block n+1.

[0050] In some embodiments, the NAND bad block management method further includes the step of marking the NAND flash memory device as a damaged device if no spare storage block in a normal state and not occupied is found when the status mapping identifier of the target data storage block is a bad block identifier.

[0051] In the management system of NAND flash memory devices, when the status mapping identifier of a target data storage block is clearly marked as a bad block, it indicates that the storage block can no longer perform data read and write functions normally. At this time, the system will query the status and occupancy of the spare storage blocks in the spare area according to a preset procedure. If no usable blocks with normal status and no occupancy are found after completely traversing all spare storage blocks, it means that the device lacks sufficient healthy spare resources to replace the faulty block. In this case, the system will mark the NAND flash memory device as a damaged device. In applications, this marking operation will trigger the fault response mechanism of the upper-layer application or storage controller, such as terminating read and write requests to the device, isolating it from the storage array, or issuing a device fault alarm to the user, to avoid data loss or system anomalies due to continued use of the damaged device. This fault marking mechanism is an important part of the reliability management of NAND flash memory devices. By timely identifying and isolating failed devices, the overall stability and data security of the storage system can be effectively guaranteed.

[0052] In some embodiments, please refer to Figure 7 This application provides a low-memory-consumption NAND bad block management device 70, including: an acquisition module 71, a query module 72, and a processing module 73. Among them, The acquisition module 71 is used to acquire the status mapping identifier of the target data storage block in the bad block table when operating on the target data storage block of the data area. The query module 72 is used to determine the target replacement block by querying the logical address corresponding to each spare storage block in the mapping block table based on the physical address of the target data storage block when the status mapping identifier of the target data storage block is a bad block identifier. The mapping block table does not record the logical address corresponding to each data storage block. Processing module 73 is used to transfer operations performed on the target data storage block to the target replacement block.

[0053] In some embodiments, the query module 72 is further configured to: query the status of each spare storage block in the spare area in a preset order when the status mapping identifier of the target data storage block is a bad block identifier and the logical addresses corresponding to each spare storage block in the mapping block table are different from the physical addresses of the target data storage block; and determine the occupancy status of the currently queried spare storage block according to the mapping block table when the status of the currently queried spare storage block is normal; determine the first-order spare storage block that is in normal status and not occupied as the target replacement block, and replace the logical address of the corresponding target replacement block in the mapping block table with the physical address of the target data storage block.

[0054] In some embodiments, the query module 72 is further configured to: obtain the arrangement order of each spare storage block in the spare area; query the status mapping identifier recorded in the bad block table according to the arrangement order of each spare storage block; and determine the status of the currently queried spare storage block according to the status mapping identifier corresponding to the currently queried spare storage block.

[0055] In some embodiments, the query module 72 is further configured to: obtain the logical address of the currently queried standby storage block in the mapping block table; determine that the currently queried standby storage block is not occupied if the logical address of the currently queried standby storage block is a default identifier; and determine that the currently queried standby storage block is occupied if the logical address of the currently queried standby storage block is not a default identifier.

[0056] In some embodiments, the NAND bad block management device 70 further includes an update module. The update module is used to modify the original state mapping identifier of the corresponding good block in the target record unit to the new state mapping identifier of the corresponding bad block when a new bad block is detected in the data area, wherein the target record unit is the record unit in the bad block table corresponding to the new bad block.

[0057] In some embodiments, the NAND bad block management device 70 further includes a marking module. The marking module is also configured to mark the NAND flash memory device as a damaged device if no spare storage block in a normal state and not occupied is found when the status mapping identifier of the target data storage block is a bad block identifier.

[0058] It should be noted that the low memory consumption NAND bad block management device 70 provided in this application embodiment and the low memory consumption NAND bad block management method provided in this application embodiment are based on the same application concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned low memory consumption NAND bad block management method, and the repeated parts will not be described again.

[0059] In some embodiments, an electronic device provided in this application includes a processor and a memory; the memory stores a computer program, wherein the computer program, when executed by the processor, implements the aforementioned low-memory-consumption NAND bad block management method.

[0060] Specifically, the processor may include, for example, a general-purpose microprocessor, an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor may also include onboard memory for caching purposes. The processor may be a single processing unit or multiple processing units for performing different actions of the method flow according to embodiments of this application.

[0061] Memory can be any medium capable of containing, storing, transmitting, propagating, or transmitting instructions. For example, memory can include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, instruments, or propagation media. Specific examples of memory include: magnetic storage devices such as magnetic tape or hard disk drives (HDDs); optical storage devices such as optical discs (CD-ROMs); and also random access memory (RAM) or flash memory; and / or wired / wireless communication links.

[0062] This application also provides a computer-readable medium storing a computer program thereon, which, when executed by a processor, implements the aforementioned low-memory-consumption NAND bad block management method. This computer-readable medium may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into that device / apparatus / system. The aforementioned computer-readable medium carries one or more programs, which, when executed, implement the method as described in the embodiments of this application.

[0063] According to embodiments of this application, a computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wired, optical fiber, radio frequency signals, etc., or any suitable combination thereof.

[0064] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments and / or claims of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application. Therefore, the scope of this application should not be limited to the above embodiments, but should be defined not only by the appended claims, but also by their equivalents. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A low-memory-consumption NAND bad block management method, characterized in that, The NAND bad block management method is used for bad block management of the storage plane in a NAND flash memory device. The storage plane includes a data area and a spare area. Each storage plane corresponds to a bad block table and a mapping block table. The memory usage of the record unit in the bad block table is less than the memory usage of the record unit in the mapping block table. The NAND bad block management method includes: When operating on the target data storage block of the data region, obtain the status mapping identifier of the target data storage block in the bad block table; When the status mapping identifier of the target data storage block is a bad block identifier, the target replacement block is determined by querying the logical address corresponding to each spare storage block in the mapping block table based on the physical address of the target data storage block. The mapping block table does not record the logical address corresponding to each data storage block. Operations performed on the target data storage block are transferred to the target replacement block.

2. The low-memory-consumption NAND bad block management method as described in claim 1, characterized in that, The method further includes: When the status mapping identifier of the target data storage block is a bad block identifier, and the logical addresses corresponding to each spare storage block in the mapping block table are different from the physical addresses of the target data storage block, the status of each spare storage block in the spare area is queried in a preset order, and when the status of the currently queried spare storage block is normal, the occupancy status of the currently queried spare storage block is determined according to the mapping block table. The first sequential spare storage block that is in a normal state and is not occupied is identified as the target replacement block, and the logical address of the target replacement block in the mapping block table is replaced with the physical address of the target data storage block.

3. The low-memory-consumption NAND bad block management method as described in claim 1, characterized in that, The memory usage of each record unit in the bad block table is 1 bit, and the state mapping identifier recorded by each record unit is a binary number.

4. The low-memory-consumption NAND bad block management method as described in claim 2, characterized in that, The step of querying the status of each backup storage block in the backup area in a preset order includes: Obtain the arrangement order of each spare storage block in the spare area; The status mapping identifiers recorded in the bad block table are queried sequentially according to the arrangement order of each spare storage block; The status of the currently queried standby storage block is determined based on the status mapping identifier corresponding to the currently queried standby storage block.

5. The low-memory-consumption NAND bad block management method as described in claim 2, characterized in that, The step of determining the occupancy status of the currently queried standby storage block according to the mapping block table when the current status of the standby storage block is normal includes: Obtain the logical address of the currently queried standby storage block corresponding to the mapping block table; If the logical address corresponding to the currently queried standby storage block is the default identifier, it is determined that the currently queried standby storage block is not occupied; If the logical address of the corresponding currently queried standby storage block is not the default identifier, it is determined that the currently queried standby storage block is occupied.

6. The low-memory-consumption NAND bad block management method as described in claim 1, characterized in that, The NAND bad block management method also includes: When a new bad block is detected in the data area, the original state mapping identifier of the corresponding good block in the target recording unit is modified to the new state mapping identifier of the corresponding bad block, wherein the target recording unit is the recording unit in the bad block table corresponding to the new bad block.

7. The low-memory-consumption NAND bad block management method as described in claim 6, characterized in that, The NAND bad block management method also includes: If the target data storage block is identified as a bad block in the status mapping, and no spare storage block that is in normal condition and not occupied is found, the NAND flash memory device will be marked as a damaged device.

8. A low-memory-consumption NAND bad block management device, characterized in that, The NAND bad block management device is used for bad block management of the storage plane in the NAND flash memory device. The storage plane includes a data area and a spare area. Each storage plane corresponds to a bad block table and a mapping block table. The memory usage of the record unit in the bad block table is less than the memory usage of the record unit in the mapping block table. The NAND bad block management device includes: The acquisition module is used to acquire the status mapping identifier of the target data storage block in the bad block table when operating on the target data storage block of the data area; The query module is used to determine the target replacement block by querying the logical addresses corresponding to each spare storage block in the mapping block table based on the physical address of the target data storage block when the status mapping identifier of the target data storage block is a bad block identifier. The mapping block table does not record the logical addresses corresponding to each of the data storage blocks. A processing module is used to transfer operations performed on the target data storage block to the target replacement block.

9. An electronic device, characterized in that, It includes a processor and a memory; the memory has a computer program stored thereon, wherein the computer program, when executed by the processor, implements the low memory consumption NAND bad block management method as described in any one of claims 1 to 7.

10. A computer storage medium, characterized in that, It stores a computer program, wherein the computer program, when executed by a processor, implements the low memory consumption NAND bad block management method as described in any one of claims 1 to 7.