[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN110837345A - Bad block table storage method and device - Google Patents

Bad block table storage method and device Download PDF

Info

Publication number
CN110837345A
CN110837345A CN201911085843.5A CN201911085843A CN110837345A CN 110837345 A CN110837345 A CN 110837345A CN 201911085843 A CN201911085843 A CN 201911085843A CN 110837345 A CN110837345 A CN 110837345A
Authority
CN
China
Prior art keywords
block
flash memory
bad block
bad
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911085843.5A
Other languages
Chinese (zh)
Inventor
吕立强
梅岳辉
徐晓玉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sage Microelectronics Corp
Original Assignee
Sage Microelectronics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sage Microelectronics Corp filed Critical Sage Microelectronics Corp
Priority to CN201911085843.5A priority Critical patent/CN110837345A/en
Publication of CN110837345A publication Critical patent/CN110837345A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

本发明公开了一种坏块表的存放方法及存放装置,属于涉及数据存储技术领域。本发明提供的坏块表的存放方法中,针对同组闪存,具有存储组内所有闪存信息的全局坏块表,针对每一闪存,具有存储所述闪存内各个块信息的块管理表。针对同一SSD盘内,由同一SSD控制器控制的同组闪存,处理具有全局坏块表外,针对每一闪存,还具有存储闪存内各个块信息的块管理表,从而使得每一闪存内均具有至少一个好块用于存储自身闪存内的各个块信息,以此提高对闪存存储器的可靠管理。

Figure 201911085843

The invention discloses a storage method and a storage device for a bad block table, and belongs to the technical field of data storage. In the storage method of the bad block table provided by the present invention, for the same group of flash memory, there is a global bad block table for storing all flash memory information in the group, and for each flash memory, there is a block management table for storing each block information in the flash memory. For the same group of flash memory controlled by the same SSD controller in the same SSD disk, in addition to having a global bad block table, for each flash memory, there is also a block management table that stores the information of each block in the flash memory, so that each flash memory has a block management table. There is at least one good block for storing each block information in its own flash memory, so as to improve the reliable management of the flash memory.

Figure 201911085843

Description

一种坏块表的存放方法及装置Method and device for storing bad block table

技术领域technical field

本发明涉及数据存储技术领域,尤其涉及一种坏块表的管理方法及装置。The present invention relates to the technical field of data storage, and in particular, to a method and device for managing a bad block table.

背景技术Background technique

存储器在电子产品被广泛应用,因此存储器的坏块管理非常重要。以NAND Flash(闪存)为例,用户在使用闪存的时候,首先应该按照闪存文档,扫描所有的闪存卡,把坏块剔除出来,建立一张BBT(Bad Block Table,坏块表)。Memory is widely used in electronic products, so bad block management of memory is very important. Taking NAND Flash (flash memory) as an example, when users use flash memory, they should first scan all flash memory cards according to the flash memory documentation, remove bad blocks, and create a BBT (Bad Block Table).

BBT的建立和保存极其重要,如果没有建立和保存BBT,就无法将坏块剔除出来,这会使得部分需要存储的数据写在坏块上,导致SSD(Solid State Disk,固态硬盘)中使用的数据异常丢失,使得SSD的可靠性变低。在SSD盘中,SSD控制器控制N个不同的NAND Flash。在这种情况下,传统的NAND Flash BBT的存放方法,如图1所示,是将记录所有的NANDFlash坏块信息的BBT,统一存放在某个NAND Flash的某个存储块中。The establishment and preservation of BBT is extremely important. If the BBT is not established and preserved, the bad blocks cannot be removed, which will cause some data to be stored on the bad blocks, resulting in the use of SSD (Solid State Disk, solid-state drive). Abnormal data loss reduces the reliability of the SSD. In an SSD disk, the SSD controller controls N different NAND Flashes. In this case, the traditional storage method of NAND Flash BBT, as shown in Figure 1, is to store the BBT that records all NAND Flash bad block information uniformly in a certain storage block of a certain NAND Flash.

一旦这个记录所有坏块信息的唯一的NAND Flash,遭到损坏或者被物理破坏,那么其它可用的NAND Flash的坏块信息都会丢失,会导致整个SSD无法使用并且所有NANDFlash都将报废。Once the only NAND Flash that records all bad block information is damaged or physically destroyed, the bad block information of other available NAND Flash will be lost, which will make the entire SSD unusable and all NAND Flash will be scrapped.

发明内容SUMMARY OF THE INVENTION

为了解决上述问题,本发明提供一种坏块表的存放方法及装置。In order to solve the above problems, the present invention provides a method and device for storing a bad block table.

第一方面,本发明提供一种坏块表的存放方法,针对同组闪存,具有存储组内所有闪存信息的全局坏块表,针对每一闪存,具有存储所述闪存内各个块信息的块管理表,所述存放方法包括:In a first aspect, the present invention provides a method for storing a bad block table. For the same group of flash memory, there is a global bad block table for storing all flash memory information in the group, and for each flash memory, there is a block for storing the information of each block in the flash memory. Management table, the storage method includes:

在产生坏块或擦除操作时,更新所述全局坏块表,以及更新坏块或擦除操作所对应闪存的块管理表。When a bad block or an erase operation is generated, the global bad block table is updated, and the block management table of the flash memory corresponding to the bad block or the erase operation is updated.

上述的存放方法,所述在产生坏块或擦除操作时,更新所述全局坏块表,以及更新坏块或擦除操作所对应闪存的块管理表,包括:The above-mentioned storage method, when generating a bad block or erasing operation, update the global bad block table, and update the block management table of the flash memory corresponding to the bad block or the erasing operation, including:

在产生坏块时,更新全局坏块表,根据所述坏块归属的闪存位置,更新所述坏块归属的闪存的块管理表内的坏块信息表;When a bad block is generated, the global bad block table is updated, and the bad block information table in the block management table of the flash memory to which the bad block belongs is updated according to the flash memory location to which the bad block belongs;

在产生擦除操作时,根据被擦除块归属的闪存位置,更新所述擦除块归属的闪存的块管理表内的可使用块信息表。When an erase operation is generated, the usable block information table in the block management table of the flash memory to which the erased block belongs is updated according to the location of the flash memory to which the erased block belongs.

上述的存放方法,包括:在所述在产生坏块或擦除操作之前,还包括初始化所述闪存;The above storage method, comprising: before generating a bad block or erasing operation, further comprising initializing the flash memory;

所述初始化同组闪存,包括:The initializing the same group of flash memory includes:

在同组闪存中,判断的每一闪存中所有块中的好块和/或坏块,生成局部好块信息和/或局部坏块信息;In the same group of flash memory, determine the good blocks and/or bad blocks in all blocks in each flash memory, and generate local good block information and/or local bad block information;

将所述局部好块信息和/或局部坏块信息存入各自闪存的块管理表;storing the local good block information and/or the local bad block information into the block management table of the respective flash memory;

基于所述同一组内闪存内所有的局部坏块信息,得到全局坏块表。Based on all the local bad block information in the flash memory in the same group, a global bad block table is obtained.

上述的存放方法,所述在同组闪存中,判断的每一闪存中所有块中的好块和/或坏块,生成局部好块信息和/或局部坏块信息,包括:The above-mentioned storage method, described in the same group of flash memory, determines the good blocks and/or bad blocks in all blocks in each flash memory, and generates local good block information and/or local bad block information, including:

在同组闪存中,依照位置顺序依次判断闪存中每个块为可使用块或坏块;In the same group of flash memory, each block in the flash memory is judged as a usable block or a bad block according to the position sequence;

根据所述可使用块和/或坏块的位置生成局部好块信息和/或局部坏块信息。Local good block information and/or local bad block information are generated according to the positions of the usable blocks and/or bad blocks.

上述的存放方法,所述块管理表中包括可使用块信息表和坏块信息表,所述可使用块信息表用于存储局部好块信息,所述坏块信息表用于存储局部坏块信息。In the above storage method, the block management table includes a usable block information table and a bad block information table, the usable block information table is used to store local good block information, and the bad block information table is used to store local bad blocks information.

上述的存放方法,所述全局坏块表存储于所述同组闪存中的任意至少一个闪存。In the above storage method, the global bad block table is stored in any at least one flash memory in the same group of flash memory.

上述的存放方法,所述存放方法还包括:Above-mentioned storage method, described storage method also comprises:

在更换或新增闪存时,检测所述更换或新增的闪存是否具有块管理表,若不存在,构建块管理表,并初始化所述更换的闪存卡的块管理表。When replacing or adding a flash memory, it is detected whether the replaced or newly added flash memory has a block management table, if not, a block management table is constructed, and the block management table of the replaced flash memory card is initialized.

上述的存放方法,所述在更换或新增闪存后,还包括:The above storage method, after replacing or adding a flash memory, further includes:

依据所述更换或新增的闪存卡的所述块管理表,更新全局坏块表。The global bad block table is updated according to the block management table of the replaced or newly added flash memory card.

上述的存放方法,所述全局坏块表和所述块管理表均存储于好块上。In the above storage method, both the global bad block table and the block management table are stored on good blocks.

第二方面,本发明提供一种坏块表的存放装置,针对同组闪存中,具有存储组内所有闪存信息的全局坏块表,针对每一闪存,具有存储所述闪存内各个块信息的块管理表,所述存放装置包括:In a second aspect, the present invention provides a storage device for a bad block table. For a flash memory in the same group, there is a global bad block table for storing all flash memory information in the group, and for each flash memory, there is a storage device for storing information about each block in the flash memory. A block management table, the storage device includes:

更新模块,用于在产生坏块或擦除操作时,更新所述全局坏块表,以及更新坏块或擦除操作所对应闪存的块管理表。The updating module is used for updating the global bad block table when a bad block or erasing operation is generated, and updating the block management table of the flash memory corresponding to the bad block or the erasing operation.

本发明提供的坏块表的存放方法中,针对同组闪存,具有存储组内所有闪存信息的全局坏块表,针对每一闪存,具有存储所述闪存内各个块信息的块管理表。针对同一SSD盘内,由同一SSD控制器控制的同组闪存,处理具有全局坏块表外,针对每一闪存,还具有存储闪存内各个块信息的块管理表,从而使得每一闪存内均具有至少一个好块用于存储自身闪存内的各个块信息,以此提高对闪存存储器的可靠管理。In the storage method of the bad block table provided by the present invention, for the same group of flash memory, there is a global bad block table for storing all flash memory information in the group, and for each flash memory, there is a block management table for storing each block information in the flash memory. For the same group of flash memory controlled by the same SSD controller in the same SSD disk, in addition to having a global bad block table, for each flash memory, there is also a block management table that stores the information of each block in the flash memory, so that each flash memory has a block management table. There is at least one good block for storing each block information in its own flash memory, so as to improve the reliable management of the flash memory.

附图说明Description of drawings

此处所说明的附图用来提供对本发明的进一步理解,构成本发明的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings described herein are used to provide further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the attached image:

图1为现有技术中将记录的所有闪存坏块信息存放在在闪存的存储块中;1 shows that all the flash memory bad block information recorded in the prior art is stored in the memory block of the flash memory;

图2为某闪存芯片的结构示意图;FIG. 2 is a schematic structural diagram of a flash memory chip;

图3为本发明一示范性实施例中的坏块表在SSD盘中的存放示意图;FIG. 3 is a schematic diagram of storing a bad block table in an SSD disk according to an exemplary embodiment of the present invention;

图4为本发明一示范性实施例中的块管理表的更新流程图;4 is a flow chart of updating a block management table in an exemplary embodiment of the present invention;

图5为本发明一示范性实施例中的闪存初始化的流程图;FIG. 5 is a flowchart of flash memory initialization in an exemplary embodiment of the present invention;

图6为本发明一示范性实施例中的更换或新增闪存后更新全局坏块表的流程图。FIG. 6 is a flowchart of updating the global bad block table after replacing or adding a flash memory in an exemplary embodiment of the present invention.

具体实施方式Detailed ways

本文中NAND Flash皆指物理上的NAND Flash,是一颗NAND Flash芯片。NANDFlash结构分为五个层次:芯片(chip)、晶圆(die)、分组(plane)、块(block)、页(page)。例如图2即为美光某块闪存芯片的结构。因此,每个NAND Flash具有多个存储块(本文中的块皆指存储块)组成,每一个存储块分成很多个存储页,页是读写操作的基本单位。其中,块是NAND Flash的擦除操作的基本/最小单位。In this article, NAND Flash refers to physical NAND Flash, which is a NAND Flash chip. NANDFlash structure is divided into five levels: chip (chip), wafer (die), grouping (plane), block (block), page (page). For example, Figure 2 shows the structure of a flash memory chip of Micron. Therefore, each NAND Flash is composed of multiple storage blocks (blocks in this text refer to storage blocks), and each storage block is divided into many storage pages, and a page is the basic unit of read and write operations. Among them, the block is the basic/minimum unit of the erase operation of NAND Flash.

通常,用户在使用闪存的时候,首先应该按照闪存文档,扫描所有的闪存卡,把坏块剔除出来,建立一张坏块表,即BBT(Bad Block Table)。Usually, when users use flash memory, they should first scan all flash memory cards according to the flash memory document, remove bad blocks, and establish a bad block table, namely BBT (Bad Block Table).

如图2所示,是将记录所有的NAND Flash坏块信息的BBT,统一存放在某个NANDFlash的某个存储块中。一旦这个记录所有坏块信息的唯一的NAND Flash,遭到损坏或者被物理破坏,那么其它可用的NAND Flash的坏块信息都会丢失,会导致整个SSD无法使用并且所有NAND Flash都将报废。As shown in Figure 2, the BBT that records all NAND Flash bad block information is uniformly stored in a certain storage block of a certain NAND Flash. Once the only NAND Flash that records all bad block information is damaged or physically destroyed, the bad block information of other available NAND Flash will be lost, which will make the entire SSD unusable and all NAND Flash will be scrapped.

为解决上述问题,本发明实施例提供一种坏块表的存放方法及存放装置。To solve the above problem, embodiments of the present invention provide a storage method and storage device for a bad block table.

为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明具体实施例及相应的附图对本发明技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the specific embodiments of the present invention and the corresponding drawings. Obviously, the described embodiments are only some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

本发明实施例提供的坏块表的存放方法中,针对同组闪存,具有存储组内所有闪存信息的全局坏块表,针对每一闪存,具有存储所述闪存内各个块信息的块管理表。针对同一SSD盘内,由同一SSD控制器控制的同组闪存,处理具有全局坏块表外,针对每一闪存,还具有存储闪存内各个块信息的块管理表,从而使得每一闪存内均具有至少一个好块用于存储自身闪存内的各个块信息,以此提高对闪存存储器的可靠管理。In the storage method of the bad block table provided by the embodiment of the present invention, for the same group of flash memory, there is a global bad block table for storing all flash memory information in the group, and for each flash memory, there is a block management table for storing the information of each block in the flash memory. . For the same group of flash memory controlled by the same SSD controller in the same SSD disk, in addition to having a global bad block table, for each flash memory, there is also a block management table that stores the information of each block in the flash memory, so that each flash memory has a block management table. There is at least one good block for storing each block information in its own flash memory, so as to improve the reliable management of the flash memory.

具体的,参图3,SSD盘内具有全局BBT,存放于闪存0中,闪存0上还具有块用于存储闪存0的块管理表,闪存1上具有块用于存储闪存1的块管理表,闪存2上具有块用于存储闪存2的块管理表。实际应用中,SSD盘内的闪存的数量不限于图3的四个,可以是一个、两个、三个、五个等等,本发明实施例不做具体限定。Specifically, referring to FIG. 3 , the SSD disk has a global BBT, which is stored in flash memory 0, flash memory 0 also has a block management table for storing flash memory 0, and flash memory 1 has a block for storing flash memory 1. The block management table , the flash memory 2 has a block management table for storing the blocks of the flash memory 2 . In practical applications, the number of flash memory in the SSD is not limited to four in FIG. 3 , and may be one, two, three, five, etc., which is not specifically limited in the embodiment of the present invention.

本发明实施例的坏块表的存放方法,包括S04:在产生坏块或擦除操作时,更新所述全局坏块表,以及更新坏块或擦除操作所对应闪存的块管理表。The storage method of the bad block table according to the embodiment of the present invention includes S04: when a bad block or an erase operation is generated, the global bad block table is updated, and the block management table of the flash memory corresponding to the bad block or the erase operation is updated.

将全局坏块表和各闪存的块管理表关联,以在产生坏块或擦除操作时,不仅更新所述全局坏块表,还更新坏块或擦除操作所对应闪存的块管理表,进而提高闪存的使用可靠性,而且在需要读取坏块表信息时,仍可以从全局坏块表中得到同组闪存内的坏块表信息。Associate the global bad block table with the block management table of each flash memory, so that when a bad block or erase operation is generated, not only the global bad block table is updated, but also the block management table of the flash memory corresponding to the bad block or the erase operation is updated, Further, the reliability of the use of the flash memory is improved, and when the bad block table information needs to be read, the bad block table information in the same group of flash memory can still be obtained from the global bad block table.

在S04中包括S041和S042。(参图4)S041 and S042 are included in S04. (See Figure 4)

S042:在产生坏块时,更新全局坏块表,根据所述坏块归属的闪存位置,更新所述坏块归属的闪存的块管理表内的坏块信息表。具体的,产生坏块时,更新全局坏块表,查询当前坏块存在于哪一个闪存中,进而更新该闪存的块管理表内的坏块信息表。坏块信息表为用于存储闪存内的局部坏块信息。更新坏块信息表后,更新该闪存块管理表内的数据,包括该闪存中坏块的总数、位置等等。S042: When a bad block is generated, update the global bad block table, and update the bad block information table in the block management table of the flash memory to which the bad block belongs according to the flash memory location to which the bad block belongs. Specifically, when a bad block is generated, the global bad block table is updated to query which flash memory the current bad block exists in, and then the bad block information table in the block management table of the flash memory is updated. The bad block information table is used to store local bad block information in the flash memory. After the bad block information table is updated, the data in the flash memory block management table is updated, including the total number and location of bad blocks in the flash memory.

S044:在产生擦除操作时,根据被擦除块归属的闪存位置,更新所述擦除块归属的闪存的块管理表内的可使用块信息表。具体的,在出现擦除操作时,查询当前擦除块存在于哪一个闪存中,进而更新该闪存的块管理表内的好块信息表。好块信息表为用于存储闪存内的局部好块信息。更新好块信息表后,更新该闪存块管理表内的数据,包括该闪存中好块的总数、位置等等。S044: When the erase operation is generated, update the available block information table in the block management table of the flash memory to which the erased block belongs according to the location of the flash memory to which the erased block belongs. Specifically, when an erase operation occurs, in which flash memory the current erase block exists is inquired, and then the good block information table in the block management table of the flash memory is updated. The good block information table is used to store local good block information in the flash memory. After the block information table is updated, the data in the flash memory block management table is updated, including the total number and location of good blocks in the flash memory.

本发明实施例的坏块表的存放方法,在S04之前包括S02:初始化闪存。The storage method of the bad block table according to the embodiment of the present invention includes S02 before S04: initialize the flash memory.

具体的,S02包括:S022、S024和S026。Specifically, S02 includes: S022, S024 and S026.

S022:在同组闪存中,判断的每一闪存中所有块中的好块和/或坏块,生成局部好块信息和/或局部坏块信息。具体的,同组闪存指位于同一SSD盘中的由同一SSD控制器控制的闪存。在同组闪存中,可以依照位置顺序依次判断闪存中每个块为可使用块或坏块,根据可使用块和/或坏块的位置生成局部好块信息和/或局部坏块信息。当然,作为变形,在同组闪存中,可以不依照位置顺序依次判断闪存中每个块为可使用块或坏块,而是依照闪存的使用寿命、使用时长、或存储内容、或预设优先级等等依次判断闪存中每个块为可使用块或坏块。除了根据可使用块和/或坏块的位置生成局部好块信息和/或局部坏块信息,还可以根据可使用块和/或坏块的数量、各自占比等等生成局部好块信息和/或局部坏块信息。S022: In the same group of flash memory, determine the good blocks and/or bad blocks in all the blocks in each flash memory, and generate local good block information and/or local bad block information. Specifically, the same group of flash memory refers to the flash memory located in the same SSD disk and controlled by the same SSD controller. In the same group of flash memory, each block in the flash memory can be judged as a usable block or a bad block in sequence according to its position, and local good block information and/or local bad block information can be generated according to the position of the usable block and/or bad block. Of course, as a variant, in the same group of flash memory, each block in the flash memory can be judged as a usable block or a bad block, not according to the position sequence, but according to the service life of the flash memory, the use time, or the storage content, or the preset priority. The level and so on in turn determine each block in the flash memory as a usable block or a bad block. In addition to generating local good block information and/or local bad block information according to the positions of usable blocks and/or bad blocks, local good block information and/or local bad block information can also be generated according to the number of usable blocks and/or bad blocks, their respective proportions, etc. / or local bad block information.

S024:将所述局部好块信息和/或局部坏块信息存入各自闪存的块管理表。每个闪存均具有各自对应的块管理表,且块管理表内存储各闪存内块的信息。需要说明的是,本申请中局部好块信息、局部坏块信息的局部是与全局相对的,局部是对应于每一闪存的,而全局是对应一组SSD盘即同组的所有闪存的。S024: Store the local good block information and/or the local bad block information into the block management table of the respective flash memory. Each flash memory has its own corresponding block management table, and the block management table stores the information of the blocks in each flash memory. It should be noted that the local good block information and local bad block information in this application are local relative to the global, the local corresponds to each flash memory, and the global corresponds to a group of SSD disks, that is, all flash memories in the same group.

S026:基于所述同一组内闪存内所有的所述局部坏块信息,得到全局坏块表。具体而言,是基于组内闪存所有的局部坏块信息,得到全局坏块表。S026: Obtain a global bad block table based on all the local bad block information in the flash memory in the same group. Specifically, the global bad block table is obtained based on all the local bad block information of the flash memory in the group.

其中,全局坏块表可以存储于同组闪存上的任意一个闪存、或任意两个不同的闪存、或任意三个不同的闪存等等,以避免某一个闪存损坏后,需要重新构建全局坏块表,提高全局坏块表的可靠性。Among them, the global bad block table can be stored in any flash memory on the same group of flash memory, or any two different flash memory, or any three different flash memory, etc., so as to avoid the need to rebuild the global bad block after a certain flash memory is damaged table to improve the reliability of the global bad block table.

当然,本发明实施例中,全局坏块表和块管理表均应存储于好块上。Of course, in this embodiment of the present invention, both the global bad block table and the block management table should be stored on good blocks.

实际应用中,某一闪存可能遭到损坏或使用寿命到期需要更换,因此,本申请的坏块表的存放方法还包括S06:在更换或新增闪存时,检测所述更换或新增的闪存是否具有块管理表,若不存在,构建块管理表,并初始化所述更换的闪存卡的块管理表。具体的,初始化更换或新增的闪存卡的块管理表可以参照S02中对闪存的初始化。In practical applications, a certain flash memory may be damaged or its service life expires and needs to be replaced. Therefore, the storage method of the bad block table of the present application also includes S06: when replacing or adding a flash memory, detect the replaced or newly added flash memory. Whether the flash memory has a block management table, if not, construct the block management table, and initialize the block management table of the replaced flash memory card. Specifically, to initialize the block management table of the replaced or newly added flash memory card, refer to the initialization of the flash memory in S02.

在S06之后还包括:依据所述更换或新增的闪存卡的所述块管理表,更新全局坏块表。即将更换的闪存的块管理表与全局坏块表关联,便于后续对组内闪存(同一SSD盘内的闪存)进行读取或管理等等。After S06, the method further includes: updating the global bad block table according to the block management table of the replaced or newly added flash memory card. The block management table of the flash memory to be replaced is associated with the global bad block table, which facilitates subsequent reading or management of the flash memory in the group (flash memory in the same SSD disk).

图5示出了一种闪存初始化的流程。具体包括:判断当前闪存中每个块信息是否为坏块;如果是坏块,生成坏块信息,并存入块管理表的坏块信息表中,如果是好块,生成好块初始化信息,存储可使用块信息表;将生成的块管理表,存入当前闪存的一个或几个可使用块内;判断当前SSD盘的闪存是否全部搜索完成;若未完成,选择未搜索的闪存继续搜索;在所述完成后,整理得到完整的BBT(全局坏块表),存入任意一个闪存中。Figure 5 shows a flow of flash memory initialization. Specifically, it includes: judging whether each block information in the current flash memory is a bad block; if it is a bad block, generate the bad block information, and store it in the bad block information table of the block management table; if it is a good block, generate the good block initialization information, Store the available block information table; store the generated block management table in one or several available blocks of the current flash memory; determine whether all the flash memory of the current SSD disk has been searched; if not, select the unsearched flash memory to continue searching ; After the above is completed, a complete BBT (global bad block table) is obtained and stored in any flash memory.

图6示出了一种更换或新增闪存后更新全局坏块表的流程。具体包括:更换或新增闪存;检测更新或新增的闪存是否存在块管理表,若存在则更新全局坏块表,若不存在,则初始化更新或新增的闪存得到块管理表后再更新全局坏块表。就此完成了闪存更换后的全局坏块表的更新,此后,可以对SSD进行全盘擦除以备正常使用。FIG. 6 shows a flow of updating the global bad block table after replacing or adding a flash memory. Specifically, it includes: replacing or adding flash memory; detecting whether the updated or newly added flash memory has a block management table, if so, update the global bad block table, if not, initialize the updated or newly added flash memory to obtain the block management table and then update it Global bad block table. In this way, the update of the global bad block table after the flash memory is replaced is completed. After that, the SSD can be completely erased for normal use.

本发明另一个示范性实施例提供一种坏块表的存放装置,针对同组闪存中,具有存储组内所有闪存信息的全局坏块表,针对每一闪存,具有存储所述闪存内各个块信息的块管理表,所述装置包括:Another exemplary embodiment of the present invention provides a storage device for a bad block table. For a flash memory in the same group, there is a global bad block table for storing all flash memory information in the group, and for each flash memory, there is a storage device for storing each block in the flash memory. A block management table of information, the apparatus includes:

更新模块,用于在产生坏块或擦除操作时,更新所述全局坏块表,以及更新坏块或擦除操作所对应闪存的块管理表。The updating module is used for updating the global bad block table when a bad block or erasing operation is generated, and updating the block management table of the flash memory corresponding to the bad block or the erasing operation.

所述的存放装置中,所述更新模块包括:In the described storage device, the update module includes:

坏块更新子模块,用于在产生坏块时,更新全局坏块表,根据所述坏块归属的闪存位置,更新所述坏块归属的闪存的块管理表内的坏块信息表;A bad block update submodule is used to update the global bad block table when a bad block is generated, and update the bad block information table in the block management table of the flash memory to which the bad block belongs according to the flash memory location to which the bad block belongs;

擦除操作更新子模块,用于在产生擦除操作时,根据被擦除块归属的闪存位置,更新所述擦除块归属的闪存的块管理表内的可使用块信息表。The erasing operation updating sub-module is configured to update the usable block information table in the block management table of the flashing memory to which the erased block belongs according to the location of the flash memory to which the erased block belongs when the erasing operation is generated.

所述的存放装置中,还包括初始化模块,用于所述初始化所述闪存。The storage device further includes an initialization module for initializing the flash memory.

初始化模块,包括:Initialize modules, including:

局部信息生成子模块,用于在同组闪存中,判断的每一闪存中所有块中的好块和/或坏块,生成局部好块信息和/或局部坏块信息;The local information generation sub-module is used to determine the good blocks and/or bad blocks in all the blocks in each flash memory in the same group of flash memory, and generate local good block information and/or local bad block information;

局部信息存入子模块,用于将所述局部好块信息和/或局部坏块信息存入各自闪存的块管理表;The local information is stored in the submodule, for storing the local good block information and/or the local bad block information in the block management table of the respective flash memory;

全局信息子模块,用于基于所述同一组内闪存内所有的局部坏块信息,得到全局坏块表。The global information submodule is configured to obtain a global bad block table based on all local bad block information in the flash memory in the same group.

局部信息生成子模块包括:The local information generation submodule includes:

判断分模块,用于在同组闪存中,依照位置顺序依次判断闪存中每个块为可使用块或坏块;The judgment sub-module is used to judge each block in the flash memory as a usable block or a bad block according to the position sequence in the same group of flash memory;

生成分模块,用于根据所述可使用块和/或坏块的位置生成局部好块信息和/或局部坏块信息。A generating sub-module is configured to generate local good block information and/or local bad block information according to the positions of the usable blocks and/or bad blocks.

所述存放装置中,所述块管理表中包括可使用块信息表和坏块信息表,所述可使用块信息表用于存储局部好块信息,所述坏块信息表用于存储局部坏块信息。In the storage device, the block management table includes a usable block information table and a bad block information table, the usable block information table is used to store local good block information, and the bad block information table is used to store local bad block information. block information.

所述存放装置中,所述全局坏块表存储于所述同组闪存中的任意至少一个闪存。In the storage device, the global bad block table is stored in any at least one flash memory in the same group of flash memory.

所述存放装置中,还包括:In the storage device, it also includes:

闪存更换或新增模块,用于在更换或新增闪存时,检测所述更换或新增的闪存是否具有块管理表,若不存在,构建块管理表,并初始化所述更换的闪存卡的块管理表。A flash memory replacement or addition module is used to detect whether the replaced or newly added flash memory has a block management table when replacing or adding a flash memory, and if not, constructing a block management table and initializing the replaced flash memory card. Block management table.

所述存放装置中,还包括:In the storage device, it also includes:

全局更换或新增模块,用于依据所述更换或新增的闪存卡的所述块管理表,更新全局坏块表。A global replacement or addition module, configured to update the global bad block table according to the block management table of the replaced or newly added flash memory card.

所述存放装置中,所述全局坏块表和所述块管理表均存储于好块上。In the storage device, both the global bad block table and the block management table are stored on good blocks.

本发明实施例的坏块表的存放装置还可执行图4、图5和图6中坏块表的存放装置执行的方法,并实现坏块表的存放装置图4、图5和图6中所示实施例的功能,在此不再赘述。The storage device for the bad block table according to the embodiment of the present invention can also perform the method performed by the storage device for the bad block table in FIG. 4 , FIG. 5 and FIG. The functions of the illustrated embodiment are not repeated here.

优选的,本发明实施例还提供一种数据管理设备,包括处理器,存储器,存储在存储器上并可在所述处理器上运行的计算机程序,该计算机程序被处理器执行时实现上述坏块表的存放方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Preferably, an embodiment of the present invention further provides a data management device, including a processor, a memory, a computer program stored in the memory and running on the processor, and the computer program implements the above-mentioned bad blocks when executed by the processor Each process of the embodiment of the method for storing the table can achieve the same technical effect, and to avoid repetition, it will not be repeated here.

本发明实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述坏块表的存放方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,所述的计算机可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等。Embodiments of the present invention further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, each process of the above embodiment of the method for storing the bad block table is implemented, and can achieve The same technical effect, in order to avoid repetition, will not be repeated here. The computer-readable storage medium is, for example, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk, or an optical disk.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products are stored in a storage medium (such as ROM/RAM, magnetic disk, CD), including several instructions to make a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of the present invention.

以上的具体实例,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施例而已,并不用于限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above specific examples further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific embodiments of the present invention, and are not intended to limit the present invention. Within the spirit and principle of the invention, any modifications, equivalent replacements, improvements, etc. made should be included within the protection scope of the present invention.

Claims (10)

1. A storage method of a bad block table is characterized in that a global bad block table for storing all flash memory information in a group is provided for flash memories in the same group, and a block management table for storing each block information in the flash memories is provided for each flash memory, and the storage method comprises the following steps:
and when a bad block or an erasing operation is generated, updating the global bad block table and updating a block management table of the flash memory corresponding to the bad block or the erasing operation.
2. The storage method according to claim 1, wherein the updating the global bad block table and the updating the block management table of the flash memory corresponding to the bad block or the erase operation when the bad block or the erase operation occurs comprise:
when a bad block is generated, updating a global bad block table, and updating a bad block information table in a block management table of a flash memory to which the bad block belongs according to the flash memory position to which the bad block belongs;
when an erasing operation is generated, according to the position of the flash memory to which the erased block belongs, the usable block information table in the block management table of the flash memory to which the erased block belongs is updated.
3. The method of claim 1, comprising: before the generating of the bad block or the erasing operation, initializing the flash memory;
the initializing the same group of flash memories includes:
in the same group of flash memories, judging good blocks and/or bad blocks in all blocks in each flash memory to generate local good block information and/or local bad block information;
storing the local good block information and/or the local bad block information into a block management table of each flash memory;
and obtaining a global bad block table based on all the local bad block information in the flash memories in the same group.
4. The storage method according to claim 3, wherein the generating local good block information and/or local bad block information of the judged good blocks and/or bad blocks in all blocks in each flash memory in the same group of flash memories comprises:
in the same group of flash memories, sequentially judging each block in the flash memories as a usable block or a bad block according to the position sequence;
and generating local good block information and/or local bad block information according to the positions of the usable blocks and/or the bad blocks.
5. The deposit method according to claim 1, wherein a usable block information table for storing local good block information and a bad block information table for storing local bad block information are included in the block management table.
6. The method of claim 1, wherein the global bad block table is stored in any at least one of the flash memories in the same set of flash memories.
7. The method of storing according to claim 1, further comprising:
when the flash memory is replaced or newly added, whether the replaced or newly added flash memory has a block management table is detected, if not, the block management table is constructed, and the block management table of the replaced flash memory card is initialized.
8. The storage method according to claim 7, further comprising, after replacing or adding the flash memory:
and updating the global bad block table according to the block management table of the replaced or newly added flash memory card.
9. A deposit method according to claim 1, wherein said global bad block table and said block management table are both stored on a good block.
10. A storage device of a bad block table, which is characterized in that, for the same group of flash memories, a global bad block table for storing all flash memory information in the group is provided, and for each flash memory, a block management table for storing each block information in the flash memory is provided, the storage device comprises:
and the updating module is used for updating the global bad block table and updating the block management table of the flash memory corresponding to the bad block or the erasing operation when the bad block or the erasing operation is generated.
CN201911085843.5A 2019-11-08 2019-11-08 Bad block table storage method and device Pending CN110837345A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911085843.5A CN110837345A (en) 2019-11-08 2019-11-08 Bad block table storage method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911085843.5A CN110837345A (en) 2019-11-08 2019-11-08 Bad block table storage method and device

Publications (1)

Publication Number Publication Date
CN110837345A true CN110837345A (en) 2020-02-25

Family

ID=69574670

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911085843.5A Pending CN110837345A (en) 2019-11-08 2019-11-08 Bad block table storage method and device

Country Status (1)

Country Link
CN (1) CN110837345A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI788252B (en) * 2022-01-13 2022-12-21 大陸商合肥沛睿微電子股份有限公司 Bad block table inheritance method and storage device thereof

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101587744A (en) * 2009-06-19 2009-11-25 上海微小卫星工程中心 Multi-level data redundancy method of large scale FLASH memory array
CN102622306A (en) * 2012-02-21 2012-08-01 中颖电子股份有限公司 Bad block management method for storage device
CN104360958A (en) * 2014-12-09 2015-02-18 哈尔滨工业大学 Bad block management system and bad block management method based on block reservation area replacement
CN104750565A (en) * 2013-12-31 2015-07-01 重庆重邮信科通信技术有限公司 NAND bad block processing method and NAND flash memory device
CN104765695A (en) * 2015-04-03 2015-07-08 上海交通大学 NAND FLASH bad block management system and method
CN108804045A (en) * 2018-06-28 2018-11-13 郑州云海信息技术有限公司 A kind of bad block table method for building up and relevant apparatus
CN109582239A (en) * 2018-12-03 2019-04-05 郑州云海信息技术有限公司 A kind of store method, device, equipment and the storage medium of SSD bad block table
CN110333971A (en) * 2019-07-10 2019-10-15 深圳忆联信息系统有限公司 SSD bad block table backup method, device, computer equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101587744A (en) * 2009-06-19 2009-11-25 上海微小卫星工程中心 Multi-level data redundancy method of large scale FLASH memory array
CN102622306A (en) * 2012-02-21 2012-08-01 中颖电子股份有限公司 Bad block management method for storage device
CN104750565A (en) * 2013-12-31 2015-07-01 重庆重邮信科通信技术有限公司 NAND bad block processing method and NAND flash memory device
CN104360958A (en) * 2014-12-09 2015-02-18 哈尔滨工业大学 Bad block management system and bad block management method based on block reservation area replacement
CN104765695A (en) * 2015-04-03 2015-07-08 上海交通大学 NAND FLASH bad block management system and method
CN108804045A (en) * 2018-06-28 2018-11-13 郑州云海信息技术有限公司 A kind of bad block table method for building up and relevant apparatus
CN109582239A (en) * 2018-12-03 2019-04-05 郑州云海信息技术有限公司 A kind of store method, device, equipment and the storage medium of SSD bad block table
CN110333971A (en) * 2019-07-10 2019-10-15 深圳忆联信息系统有限公司 SSD bad block table backup method, device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
于振南: "嵌入式FAT32文件系统设计与实现 基于振南znFAT(下)", 30 April 2014, 北京航空航天大学出版社, pages: 180 - 182 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI788252B (en) * 2022-01-13 2022-12-21 大陸商合肥沛睿微電子股份有限公司 Bad block table inheritance method and storage device thereof

Similar Documents

Publication Publication Date Title
CN108647151B (en) A method, device, device and storage medium for placing metadata in an all-flash system
CN103136243B (en) File system duplicate removal method based on cloud storage and device
CN109634932B (en) Intelligent contract storage method and storage system
TWI645404B (en) Data storage device and control method for non-volatile memory
US20100312749A1 (en) Scalable lookup service for distributed database
CN113127378B (en) Data reading method and device and data storage device
CN112596667A (en) High throughput method and system for organizing NAND blocks and placing data for random writing in a solid state drive
US8347052B2 (en) Initializing of a memory area
CN105446664B (en) A kind of pair of memory carries out file memory method and storage device
CN105808378B (en) Metadata restorative procedure and device
CN109407985B (en) Data management method and related device
CN106815232A (en) Catalog management method, apparatus and system
CN104598161A (en) Data reading and writing method and device and data storage structure
CN108427584A (en) The configuration method of the chip and the chip with parallel computation core quickly started
CN111444114B (en) Method, device and system for processing data in nonvolatile memory
CN109542860B (en) Service data management method based on HDFS and terminal equipment
CN110837345A (en) Bad block table storage method and device
US20170235781A1 (en) Method, server and computer program stored in computer readable medium for managing log data in database
CN100367181C (en) Hard disk re-identification system in redundant array of inexpensive disks and method thereof
WO2025138618A1 (en) Stored data recovery method, apparatus and system, electronic device, and storage medium
CN112083883A (en) Storage system and method for use in storage system
CN109960474A (en) Data update method, device, device and medium based on thin provisioning
US10613973B1 (en) Garbage collection in solid state drives
CN110019086A (en) More copy read methods, equipment and storage medium based on distributed file system
WO2022166265A1 (en) Data recovery method and apparatus, device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200225

RJ01 Rejection of invention patent application after publication