Block management method of memory, operation method, and storage controller

By configuring different identifier data for blocks within a memory logic block and determining the state of the logic block based on the sum of the identifier data, the inefficiency caused by frequent queries in the prior art is solved, achieving more efficient memory operation and space utilization.

CN115963978BActive Publication Date: 2026-04-14MAXIO TECHNOLOGY (HANGZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MAXIO TECHNOLOGY (HANGZHOU) CO LTD
Filing Date
2021-10-11
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In existing technologies, memory needs to query the bad block table and replacement table multiple times when processing bad blocks, resulting in low operational efficiency.

Method used

By configuring different identifier data for blocks within a logical block, the status information of the logical block is determined based on the sum of the identifier data, directly determining whether the logical block is usable and reducing the number of queries.

Benefits of technology

It significantly reduces query time, improves memory operation efficiency, makes full use of storage space, and enhances product yield and power consumption efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115963978B_ABST
    Figure CN115963978B_ABST
Patent Text Reader

Abstract

The present disclosure provides a block management method, an operating method and a storage controller. The block management method comprises: configuring different identification data for a first block and a second block, the first block comprising un-replaced bad blocks and replaced good blocks, and the second block comprising un-replaced good blocks and replaced bad blocks; determining state information indicating whether a logical block is usable according to a sum of all identification data in the logical block, and the second block being a usable logical block if the proportion of the second block is less than a preset proportion; and storing the state information so as to determine whether a corresponding logical block is usable based on the state information in the operation of the storage. The present disclosure can effectively improve the operation efficiency of the storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of memory, and more specifically to a block management method, operation method, and memory controller for memory. Background Technology

[0002] Figure 1 The diagram shows the structure of a solid-state drive (SSD). (Refer to...) Figure 1 The solid-state drive 100 includes a storage controller 110 and a storage module 120. The storage module 120 contains several storage chips (such as common flash memory chips). These storage chips are used to store data and perform data read, write, and erase operations under the control of the storage controller 110.

[0003] Figure 2 The diagram shown illustrates the fabrication process of a memory chip. (Refer to...) Figure 2 A memory chip may contain several dies, which are small pieces cut from silicon wafers using lasers. Each die is an independent functional chip, and they are ultimately packaged as a unit within a flash memory chip. Dies are not directly usable; they have no pins and no heat sinks.

[0004] Figure 3 The diagram shown is an exemplary capacity structure of a memory chip. (Refer to...) Figure 3 The capacity structure of a memory chip, from largest to smallest, can be divided into dies (as described above), planes (comprising dies), and blocks (comprising planes) (in the diagram, planes are marked with the letter "P"). Since multiple dies often operate in parallel, blocks located at the same position in the top-to-bottom sequence form a "logical block" (e.g., ...). Figure 3 The capacity structure (within the dashed box) allows multiple blocks within the same logical block to be operated on simultaneously.

[0005] A block contains several pages, and a page contains several cells. A cell is the smallest unit for reading, writing, and erasing within a page, corresponding to a floating-gate transistor, and can store one or more bits of data. Therefore, if one floating-gate transistor in a block is damaged, it is a bad block, and a block without any damaged floating-gate transistors is a good block.

[0006] In existing technologies, bad blocks are replaced by good blocks to ensure correct data reading and writing. The storage space within the memory chip is pre-divided into a storage area and a spare area. If bad blocks exist in the storage area, good blocks from the spare area are used to replace them. After replacement, if a logical block in the storage area still contains unusable bad blocks, that logical block is skipped and the next logical block is operated on; otherwise, all blocks within that logical block are operated on. Specifically, refer to... Figure 1 The storage controller 110 includes a control unit 111 and a storage unit 112. The storage unit 112 stores a replacement table and a bad block table. The replacement table records replacement information for replaced bad blocks within the storage area, and the bad block table records the location information of unreplaced bad blocks within the storage area. During the operation of the storage chip, when the control unit 111 operates on a logic block, it first queries the bad block table for each block within that logic block to determine if the logic block still contains unusable bad blocks. If not, when operating on any block within that logic block, it first queries the replacement table to determine whether to operate on that block or operate on a good block to replace it. This process requires the control unit 111 to query the bad block table and the replacement table multiple times per block, which is time-consuming and results in low operational efficiency. Summary of the Invention

[0007] To address the aforementioned technical problems, this disclosure provides a block management method, operation method, and memory controller for a memory, which can effectively improve the operating efficiency of the memory.

[0008] The first aspect of this disclosure provides a block management method for a memory, comprising:

[0009] Different identification data are configured for the first block and the second block. The first block includes good blocks that have not been replaced and bad blocks that have been replaced, and the second block includes bad blocks that have not been replaced and good blocks that have been replaced.

[0010] Based on the sum of all the identifier data within a logic block, determine the status information indicating whether the logic block is usable. Logic blocks whose proportion of the second block is less than a preset proportion are usable logic blocks.

[0011] The status information is stored so that, during the operation of the memory, it can be used to determine whether the corresponding logic block is available.

[0012] Optionally, the status information includes:

[0013] The first state corresponds to a logic block that does not include the second block;

[0014] The second state corresponds to a logic block that includes the second block but whose proportion is less than the preset proportion;

[0015] The third state corresponds to a logic block that includes the second block and whose proportion is not less than the preset proportion.

[0016] Optionally, the block management method further includes: for a logical block whose state information is determined to be in the second state, storing the identification data of each block within it, so as to determine whether the corresponding block is operable based on the stored identification data during the operation of the memory.

[0017] Optionally, after storing the status information, if a new bad block is added during the memory operation, the block management method further includes:

[0018] Update the identification data of the newly added bad blocks;

[0019] Based on the updated identification data, update the status information of the logical block including the newly added bad block, and store the updated status information;

[0020] In addition, the stored identifier data is updated based on the updated status information.

[0021] Optionally, the identifier data of the first block is "0", and the identifier data of the second block is "1". Based on the sum of all identifier data within a logical block, status information indicating whether the logical block is usable is determined, including:

[0022] If the sum of all identifier data within a logical block is 0, the state information is determined to be the first state.

[0023] If the sum of all identifier data within a logical block is greater than 0 and less than the value of the preset ratio, the state information is determined to be the second state;

[0024] If the sum of all identifier data within a logic block is not less than the value of the preset ratio, the state information is determined to be the third state.

[0025] Optionally, before configuring different identifier data for the first and second blocks within a logical block, the block management method further includes:

[0026] The logic block whose total number of bad blocks is not greater than the first preset value is determined as the first logic block;

[0027] For a bad block within a first logic block, replace it with an unreplaced good block that is not located in any of the first logic blocks on the same face, so that the first logic block does not include unreplaced bad blocks.

[0028] Optionally, replacing with an unreplaced good block that is not located within any of the first logic blocks on the same face includes:

[0029] Obtain a set of logic blocks, which consists of multiple candidate logic blocks, wherein the candidate logic blocks have unreplaced good blocks on the face where the bad block is located within the first logic block;

[0030] A target logic block is determined in the set of logic blocks, and the target logic block is the logic block in the set of logic blocks where the second block is most frequent.

[0031] For a bad block within the first logic block, replace it with an unreplaced good block located within the target logic block on the same plane.

[0032] Optionally, after replacing the unreplaced good block within the same face that is not located in either of the first logical blocks, and before configuring different identification data for the first and second blocks within the logical block, the block management method further includes:

[0033] The logic block whose total number is greater than the second preset value is determined as the second logic block, and the second preset value is greater than the first preset value;

[0034] For any unreplaced good block within the second logic block, replace any unreplaced bad block within the same face that is not located in any of the second logic blocks.

[0035] The second aspect of this disclosure provides a method for operating a memory, wherein the blocks within the memory are managed by any of the block management methods described in the first aspect, the method comprising: when operating on a logical block, acquiring stored state information and determining whether the logical block can be used based on the acquired state information.

[0036] A third aspect of this disclosure provides a storage controller including a coupled control unit and a storage unit, the control unit being configured to execute any of the block management methods described in the first aspect, and the storage unit being configured to store information required to be stored during the execution of the block management method.

[0037] A fourth aspect of this disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed, implements any of the block management methods described in the first aspect.

[0038] The beneficial effects of this disclosure are:

[0039] The block management method provided in this disclosure first configures different identification data for the first and second blocks within a logical block. Then, it determines the status information indicating whether the logical block is usable based on the sum of all identification data within a logical block. This status information is then stored so that the usability of the corresponding logical block can be determined directly based on the status information during memory operation. Therefore, it is not necessary to query the bad block table multiple times on a block-by-block basis to determine whether a logical block is usable, which greatly saves query time and effectively improves the operating efficiency of the memory. Attached Figure Description

[0040] The above and other objects, features and advantages of this disclosure will become clearer from the following description of embodiments of this disclosure with reference to the accompanying drawings.

[0041] Figure 1 This diagram illustrates the structure of a solid-state drive (SSD).

[0042] Figure 2 A schematic diagram of the fabrication process for a memory chip is shown.

[0043] Figure 3 A schematic diagram of the capacity structure of an exemplary memory chip is shown;

[0044] Figure 4 A flowchart of the block management method provided in this disclosure is shown;

[0045] Figure 5 An exemplary memory chip that has completed block compaction is shown;

[0046] Figure 6 Show Figure 5 The diagram shows the state of the memory chip before block compaction.

[0047] Figure 7 Show Figure 6 The diagram shows the state of the memory chip during the block reorganization process. Detailed Implementation

[0048] To facilitate understanding of this disclosure, a more complete description will now be given with reference to the accompanying drawings, in which preferred embodiments of the present disclosure are shown. However, this disclosure may be implemented in various forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the contents of this disclosure.

[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of this disclosure.

[0050] This disclosure provides a method for managing memory blocks. Memory Reference Figure 1 As shown, although not shown, the control unit 111 also includes a conversion layer. This conversion layer, as a software layer, is used to access the memory chip and supports technologies such as bad block management, wear leveling, and power-off recovery. Therefore, the block management method provided in this embodiment can constitute an application layer above the conversion layer or a functional module included in the conversion layer. Figure 1 The control unit 111 performs the operation.

[0051] Figure 4 The diagram shows a flowchart of the memory block management method provided in this disclosure. (Refer to...) Figure 4 Memory block management methods include:

[0052] Step S110: Configure different identification data for the first block and the second block. The first block includes good blocks that have not been replaced and bad blocks that have been replaced, and the second block includes bad blocks that have not been replaced and good blocks that have been replaced.

[0053] Specifically, the aforementioned "unreplaced good block" refers to a good block that has not replaced a bad block, "replaced good block" refers to a good block that has replaced a bad block, "unreplaced bad block" refers to a bad block that has not been matched with a good block for replacement, and "replaced bad block" refers to a bad block that has been matched with a good block for replacement. Since bad blocks can only be replaced by good blocks within the same face, the aforementioned "replaced bad blocks" are replaced by good blocks within the same face.

[0054] Here, the first block is a block that allows data to be written, either by writing data on itself (corresponding to a good block that has not been replaced) or by writing data on a good block that has replaced it (corresponding to a bad block that has been replaced); the second block is a block that does not allow data to be written, either because it is a bad block and has not been replaced (corresponding to a bad block that has not been replaced), or because it is a good block but has been used by other logical blocks because it replaced a bad block of another logical block (corresponding to a good block that has been replaced).

[0055] It should be noted that in this embodiment, the storage space of the memory chip is not divided into a spare area, and the replaced blocks are located within the storage area. Based on this, any second block within a logic block can be used as long as its proportion is less than a preset proportion, thus fully utilizing the usable blocks of the memory chip. During use, if individual bad blocks appear due to wear and tear, in many cases it is not necessary to discard the entire logic block containing the bad block. Therefore, not only does a newly manufactured memory have a large usable space, but memory in use can also have its usable space expanded.

[0056] Figure 5 The image shows a memory chip that has completed the process of replacing bad blocks with good blocks. Good blocks are divided into replaced good blocks and unreplaced good blocks, and bad blocks are divided into replaced bad blocks and unreplaced bad blocks. The logical block number is the sequence number of the logical block in the row on the memory chip. Figure 5 The logical blocks in the memory are not ordered according to their row positions on the memory chip. See also Figure 5 The preset ratio is 1 / 2, so not only can the logic block within the dashed box that does not include the second block be used to store data, but also the logic block within the dotted box whose second block ratio is smaller than the preset ratio can be used to store data.

[0057] It should be understood that this step involves configuring block identification data for all logical blocks on the memory chip used to store external data. Within some memory chips, several logical blocks (such as...) Figure 5 The logic block (Block Unit) shown is preset to store data related to the operation of the driver chip, and therefore does not need to be configured with identification data, i.e., it is not within the management scope of the block management method provided in this disclosure.

[0058] Step S120: Determine the status information indicating whether a logical block is usable based on the sum of all identifier data within the logical block.

[0059] It should be noted that since the first block and the second block are configured with different identification data, and different logical blocks include an equal number of blocks, the sum of all identification data in a logical block represents the proportion of the second block in that logical block. The proportion of the second block determines whether the logical block can be used. Therefore, the status information of a logical block can be determined based on the sum of all identification data in a logical block.

[0060] Step S130: Store the status information so that the corresponding logic block can be used based on the status information during memory operation.

[0061] Specifically, memory operations include three operations: reading, writing, and erasing of the memory chip. In this embodiment of the present disclosure, no data is written to unusable logic blocks, so data cannot be read and there is no need to erase data. Therefore, unusable logic blocks are not operated during memory operations.

[0062] In this embodiment, the status information indicating whether a logical block is usable is determined based on the sum of all identifier data within that logical block. This status information is then stored, allowing the memory to directly determine whether a corresponding logical block is usable based on the status information during memory operations. This eliminates the need for multiple lookups of the bad block table on a block-by-block basis to determine a logical block's usability. Since the number of blocks is much smaller than the number of logical blocks, the number of lookups is significantly reduced, greatly saving lookup time and effectively improving memory operating efficiency.

[0063] In one optional embodiment, the status information described above has three states: a first state, corresponding to a logic block that does not include the second block; a second state, corresponding to a logic block that includes the second block but the proportion of the second block is less than a preset proportion; and a third state, corresponding to a logic block that includes the second block and the proportion of the second block is not less than the preset proportion.

[0064] Specifically, the aforementioned preset ratio depends on the characteristics of the memory requirements. If the memory needs a high product yield, the preset ratio is set to a larger value, such as 3 / 4; if the memory needs a high power efficiency, the preset ratio is set to a smaller value, such as 1 / 2. Here, power efficiency refers to the power efficiency during parallel memory operations. Since multiple dies involve parallel operations across all planes, the presence of a second block of the same logic block results in invalid operations (commonly known as "idling"), causing power waste. The higher the proportion of the second block, the more severe the power waste. Therefore, improving power efficiency requires reducing the proportion of the second block.

[0065] The markers for the aforementioned status information are not limited in this disclosure. For example, numbers can be used as markers for status information. The first status uses the number "0", the second status uses the number "1", and the third status uses the number "2". In memory operation, the availability of the corresponding logic block and whether the available logic block is all or part of the internal blocks can be identified based on the numbers.

[0066] In this embodiment of the disclosure, two of the three states of the status information (the first state and the second state) are set to be available logic blocks. The logic blocks in the second state are available, thereby making full use of the effective blocks in the storage chip 120 (such as flash memory), increasing the usable space of the product, improving the product yield, and distinguishing between logic blocks that are available to all blocks and logic blocks that are available to some blocks. If some users are very concerned about power consumption and need only logic blocks that are available to all blocks, they can adjust the status information, which is very flexible.

[0067] In another optional embodiment, for a logical block whose status information is determined to be in the second state, the block management method further includes: storing identification data for each block within it, so as to determine whether the block corresponding to the identification data is operable based on the stored identification data during the specific operation of a logical block. Specifically, if the block corresponding to the identification data is determined to be the second block (i.e., an inoperable block) based on the stored identification data, there is no need to query the replacement table to determine whether there is a replacement block and the location information of the replacement block. This saves the time of querying the replacement table for the second block and significantly improves the operating efficiency of the memory.

[0068] Furthermore, after step S130, if a new bad block is added during memory operation, the block management method further includes: updating the identification data of the new bad block, that is, updating the identification data of the block from the identification data of the first block to the identification data of the second block; updating the status information of the logical block including the new bad block according to the updated identification data in the manner described in step S120, and storing the updated status information; and updating the stored identification data according to the updated status information, that is, if the status information of a logical block is updated from the first state to the second state or the third state, the stored identification data is updated with the identification data of each block within that logical block. In the case of a new bad block, the status information of the logical block will generally be updated from the first state to the second state first, at which point the logical block is still usable. As more bad blocks are added, the status information of the logical block may be updated from the second state to the third state first, at which point the logical block becomes unusable, thereby slowing down the rate at which the usable space in the memory 120 decreases. Here, the identification data and status information of the new bad block are updated to ensure that the memory correctly operates the usable blocks based on the status information and identification data.

[0069] In another optional embodiment, based on distinguishing between the first block and the second block of identification data, to facilitate recording the identification data, the first block of identification data uses binary data "0", and the second block of identification data uses binary data "1". Based on this, Figure 5 The blocks included in the logic blocks Block Unit 236, Block Unit T, Block Unit Q, and Block Unit G are labeled with the identification data shown in Table 1 in order from left to right.

[0070] Table 1

[0071] Block Unit 236 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Block Unit T 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Block Unit Q 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 Block Unit G 0 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1

[0072] Combination Figure 5 The bolded identifiers in Table 1 indicate the identifiers for good blocks that have not been replaced, good blocks that have been replaced, bad blocks that have not been replaced, and bad blocks that have been replaced. All blocks configured with "0" (i.e., the first block) are blocks that are allowed to be written to; all blocks configured with "1" (i.e., the second block) are blocks that are not allowed to be written to.

[0073] It should be understood that Table 1 only provides an example of the identification data of each block within an individual logic block. In the embodiments of this disclosure, each logic block on a memory chip used for storing external data is configured with identification data of all internal blocks.

[0074] In this embodiment, step S120, determining the status information indicating whether a logic block is usable based on the sum of all identifier data within a logic block, includes: if the sum of all identifier data within a logic block is 0, determining the status information as a first state; if the sum of all identifier data within a logic block is greater than 0 and less than a preset proportion, determining the status information as a second state; if the sum of all identifier data within a logic block is not less than a preset proportion, determining the status information as a third state. Since the identifier data of the first block uses binary data "0" and the identifier data of the second block uses binary data "1", the sum of all identifier data within a logic block directly represents the number of second blocks within that logic block. Thus, the condition that the proportion of the second block needs to satisfy is converted into the condition that the sum of all identifier data within the logic block needs to satisfy, thus conveniently limiting the condition that the proportion of the second block needs to satisfy through the sum of all identifier data within the logic block.

[0075] In another optional embodiment, prior to step S110, the block management method further includes sorting out good blocks and bad blocks on the memory chip, that is, optimizing the storage space of the memory chip by replacing bad blocks with good blocks. After sorting, the good blocks on the memory chip are divided into the aforementioned replaced good blocks and unreplaced good blocks, and the bad blocks on the memory chip are divided into the aforementioned replaced bad blocks and unreplaced bad blocks.

[0076] Specifically, sorting out good and bad blocks on the memory chip includes: determining a first logical block as a logical block whose total number of bad blocks is not greater than a first preset value (e.g., 1 / 8 or 1 / 16 of the total number of blocks in a logical block); for a bad block in a first logical block, replacing it with an unreplaced good block that is not located in any first logical block on the same face, so that the first logical block does not include unreplaced bad blocks.

[0077] Figure 6 The diagram shown illustrates all the logic blocks on an unorganized memory chip, where good and bad blocks are not yet further distinguished. See also... Figure 6 The number of a logic block indicates its position in the row of the memory chip. Figure 6 The logical blocks in the diagram are sorted by the total number of bad blocks. Logic blocks with a total of zero bad blocks are arranged sequentially, while logic blocks with a non-zero number of bad blocks are placed after those with a zero number of bad blocks. The diagram uses letters to indicate some logic blocks with a non-zero number of bad blocks, and the order of the letters does not relate to the row order of the corresponding logic blocks on the memory chip. Figure 6 Taking the memory chip shown as an example, if the first preset value is set to 1 / 8, then the first logic block is a logic block with a total number of bad blocks not exceeding 2, that is... Figure 6 The logic block within the dashed box.

[0078] It should be noted that for a bad block within a first logical block, it is replaced by an unreplaced good block that is not located in any first logical block on the same face. This ensures that the first logical block does not include unreplaced bad blocks, but also does not include replaced good blocks.

[0079] Since a logical block contains unreplaced bad blocks, the bad block table needs to allocate space for that logical block to record the unreplaced bad blocks. Therefore, the above method of organizing memory chips reduces the management data structure of the logical block while ensuring that the first logical block does not contain unreplaced bad blocks, which is beneficial to the management of the logical block.

[0080] Furthermore, the above-mentioned replacement with unreplaced good blocks not located within any first logic block on the same face includes: obtaining a set of logic blocks, the set of logic blocks consisting of multiple candidate logic blocks, wherein unreplaced good blocks exist on the face where the bad blocks of the first logic blocks are located; determining a target logic block in the set of logic blocks, and for a bad block within a first logic block, replacing it with an unreplaced good block located within the target logic block on the same face. The target logic block is the logic block with the most second-most blocks in the set of logic blocks. Since logic blocks with a second-most block ratio greater than a preset ratio are unusable, this facilitates full utilization of blocks within some unusable logic blocks, thereby increasing the storage space of the memory chip.

[0081] by Figure 6 Taking the memory chip shown as an example, in Figure 6 In the sequence of logic blocks shown, it is easy to identify Block Unit T, Block Unit S, and Block Unit R as the first logic blocks that contain bad blocks and need to be replaced. For the bad blocks within Block Unit T, a set of logic blocks consisting of Block Unit Q, Block Unit H, Block Unit G, and Block Unit E is determined. Then, based on the determined set of logic blocks... Figure 6 The sequence of logic blocks shown identifies Block Unit E as the target logic block. Then, the bad block located on Plane 2 within Die 0 of Block Unit E is replaced with the unreplaced good block in Plane 2 of Block Unit T. Block Unit S and Block Unit R undergo similar processing, with the results shown below. Figure 7 As shown.

[0082] In another optional embodiment, before step S110, the block management method includes sorting out good blocks and bad blocks on the memory chip, and further includes: after replacing the unreplaced good blocks that are not located in any first logic block in the same face, determining the logic blocks whose total number of second blocks is greater than a second preset value as second logic blocks; and replacing the unreplaced good blocks in the second logic blocks with the unreplaced bad blocks that are not located in any second logic block in the same face.

[0083] Specifically, the second preset value is greater than the first preset value, and the second preset value is, for example, set to 1 / 2 of the total number of blocks within the logical block. Figure 7 Taking the memory chip shown as an example after replacing bad blocks in the first logic block, if the second preset value is set to 8, then the second logic block is a logic block with a total number greater than 8. Figure 7 The logic blocks within the dotted frame. Within this second logic block, only Block Units G, F, E, and D contain unreplaced good blocks. Of these unreplaced good blocks, only a portion contain unreplaced bad blocks not located in any of the second logic blocks on the same face. Therefore, the final result is... Figure 5 The replacement result shown is based on step S110. Figure 5 The replacement result shown will execute the corresponding steps of the block management.

[0084] In this embodiment of the disclosure, the power consumption utilization of the second block is not high. By using the above method, the unreplaced good blocks in the second logic block are utilized as much as possible. After the unreplaced good blocks are used, the second logic block is very likely to become an unusable logic block. This achieves the dual improvement of power consumption utilization and product space utilization.

[0085] Corresponding to the block management method of the memory described above, this disclosure also provides a memory operation method, wherein each block in the memory is managed by any of the block management methods described above. The operation method includes: when operating on a logical block, obtaining stored state information and determining whether the logical block can be used based on the obtained state information. For specific details, please refer to the corresponding steps of the block management method described above, which will not be repeated here.

[0086] Corresponding to the block management method of the memory described above, this disclosure also provides a memory controller, which is as follows: Figure 1The diagram shows a coupled control unit 111 and a storage unit 112. The control unit 111 executes any of the block management methods described above, and the storage unit 112 stores information required during the execution of the block management method, such as status information and identification data. Specifically, the storage unit 112 stores a file (hereinafter referred to as a status information table) containing status information, with one file per storage chip. The number of status information entries in the status information table is equal to the number of logical blocks within the corresponding storage chip used to store external data. Similarly, the storage unit 112 stores a file (hereinafter referred to as an identification data table) containing identification data, with one file per storage chip, and the identification data in the identification data table is divided into logical blocks.

[0087] Corresponding to the block management method of the memory described above, this disclosure also provides a computer-readable storage medium storing a computer program (or computer-executable instructions) thereon, which, when executed, is used to perform any of the block management methods of the memory described above.

[0088] The computer-readable storage medium of this disclosure can be any combination of one or more computer-readable media. The computer-readable storage medium can 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 (a non-exhaustive list) of computer-readable storage media include: 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 disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0089] Program code contained on a computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0090] Computer program code for performing the operations of embodiments of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​(such as Java, Smalltalk, C++) and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0091] Furthermore, throughout this document, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0092] Finally, it should be noted that the above embodiments are merely examples for clearly illustrating this disclosure and are not intended to limit the implementation. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of this disclosure.

Claims

1. A block management method for a memory, characterized in that, include: Different identification data are configured for the first block and the second block. The first block includes good blocks that have not been replaced and bad blocks that have been replaced, and the second block includes bad blocks that have not been replaced and good blocks that have been replaced. Based on the sum of all the identifier data within a logic block, determine the status information indicating whether the logic block is usable. Logic blocks whose proportion of the second block is less than a preset proportion are usable logic blocks. The status information is stored so that, during the operation of the memory, it can be used to determine whether the corresponding logic block is available. The status information includes: The first state corresponds to a logic block that does not include the second block; The second state corresponds to a logic block that includes the second block but whose proportion is less than the preset proportion; The third state corresponds to a logic block that includes the second block and whose proportion is not less than the preset proportion.

2. The block management method according to claim 1, characterized in that, Also includes: For a logic block whose state information is determined to be in the second state, the identification data of each block within it is stored so that, during the operation of the memory, it can be determined whether the corresponding block is operable based on the stored identification data.

3. The block management method according to claim 2, characterized in that, After storing the status information, if a new bad block is added during the memory operation, the method further includes: Update the identification data of the newly added bad blocks; Based on the updated identification data, update the status information of the logical block including the newly added bad block, and store the updated status information; In addition, the stored identifier data is updated based on the updated status information.

4. The block management method according to claim 1, characterized in that, The first block's identifier data is "0", and the second block's identifier data is "1". Based on the sum of all identifier data within a logical block, the status information indicating whether the logical block is usable is determined, including: If the sum of all identifier data within a logical block is 0, the state information is determined to be the first state. If the sum of all identifier data within a logical block is greater than 0 and less than the value of the preset ratio, the state information is determined to be the second state; If the sum of all identifier data within a logic block is not less than the value of the preset ratio, the state information is determined to be the third state.

5. The block management method according to claim 1, characterized in that, Before configuring different identifier data for the first block and the second block, the following is also included: The logic block whose total number of bad blocks is not greater than the first preset value is determined as the first logic block; For a bad block within a first logic block, replace it with an unreplaced good block that is not located in any of the first logic blocks on the same face, so that the first logic block does not include unreplaced bad blocks.

6. The block management method according to claim 5, characterized in that, Replacement with unreplaced good blocks that are not located within any of the first logic blocks on the same face, including: Obtain a set of logic blocks, which consists of multiple candidate logic blocks, wherein the candidate logic blocks have unreplaced good blocks on the face where the bad block is located within the first logic block; A target logic block is determined in the set of logic blocks, and the target logic block is the logic block in the set of logic blocks where the second block is most frequent. For a bad block within the first logic block, replace it with an unreplaced good block located within the target logic block on the same plane.

7. The block management method according to claim 5, characterized in that, After replacing with an unreplaced good block that is not located within either of the first logical blocks on the same face, and before configuring different identifier data for the first and second blocks within the logical block, the method further includes: The logic block whose total number is greater than the second preset value is determined as the second logic block, and the second preset value is greater than the first preset value; For any unreplaced good block within the second logic block, replace any unreplaced bad block within the same face that is not located in any of the second logic blocks.

8. A method for operating a memory, characterized in that, Each block in the memory is managed by the block management method according to any one of claims 1-7, wherein the operation method includes: when operating on a logical block, obtaining stored state information and determining whether the logical block can be used based on the obtained state information.

9. A storage controller comprising a coupled control unit and a storage unit, the control unit being configured to execute the block management method according to any one of claims 1-7, and the storage unit being configured to store information required to be stored during the execution of the block management method.

10. A computer-readable storage medium having a computer program stored thereon, which, when executed, implements the block management method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • NAND Flash bad block management method and system

    CN106776359A

  • Memory system and method for bad block management

    CN110347528A