CN106648463B - Nand Flash block management method and system - Google Patents

Nand Flash block management method and system Download PDF

Info

Publication number
CN106648463B
CN106648463B CN201611191783.1A CN201611191783A CN106648463B CN 106648463 B CN106648463 B CN 106648463B CN 201611191783 A CN201611191783 A CN 201611191783A CN 106648463 B CN106648463 B CN 106648463B
Authority
CN
China
Prior art keywords
block
nand flash
address
storage
physical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611191783.1A
Other languages
Chinese (zh)
Other versions
CN106648463A (en
Inventor
周立功
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Ligong Science And Technology Co Ltd
Original Assignee
Guangzhou Ligong Science And Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Ligong Science And Technology Co Ltd filed Critical Guangzhou Ligong Science And Technology Co Ltd
Priority to CN201611191783.1A priority Critical patent/CN106648463B/en
Publication of CN106648463A publication Critical patent/CN106648463A/en
Application granted granted Critical
Publication of CN106648463B publication Critical patent/CN106648463B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
    • 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/0626Reducing size or complexity 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/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to 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]

Abstract

The invention relates to a Nand Flash block management method and a Nand Flash block management system. The method comprises the following steps: receiving an access instruction of an application layer, wherein the access instruction comprises a logical block address; inquiring a preset address mapping table to obtain a physical block address corresponding to the logical block address; inquiring a preset bad block list, and detecting whether a storage block pointed by the physical block address is available; if the storage block pointed by the physical storage address is unavailable, re-determining the Nand Flash physical block address corresponding to the logical block address according to a preset address mapping algorithm, updating the address mapping table, and operating the storage block pointed by the re-determined physical block address according to the access instruction. The invention can reduce the complexity of the system, does not need to occupy larger memory, and has stronger transportability and universality.

Description

Nand Flash block management method and system
Technical Field
The invention relates to the technical field of memories, in particular to a Nand Flash block management method and system.
Background
However, the NAND Flash has the problem of bad blocks which are inevitable with other high-density storage media. Therefore, when the NAND Flash is applied, the existing bad blocks of the NAND Flash must be avoided and managed.
The bad block problem of NAND Flash is an important problem affecting storage reliability. Currently, NAND bad block management methods can be divided into the following two categories: bad block management based on FTL chip and bad block management based on NAND file system. The bad block management based on the FTL chip is to use an extra FTL (flash Translation layer) chip to manage the NAND, the bad block information is shielded externally, and the management method is used for a U disk, an SD card, an MMC card and a solid state disk; this approach is based on FTL chips and therefore requires additional hardware costs. The bad block management based on the NAND file system is that a file system specially aiming at NAND is directly introduced, and can also realize the management of NAND bad blocks, such as file systems like JFFS2, YAFFS2, FlashFx, UBIFS and the like; the method has the defects of large memory occupation of the system, complex code, low efficiency, low access speed and the like.
It can be seen that the current NAND bad block management method still needs to be improved.
Disclosure of Invention
Based on this, the embodiment of the invention provides a Nand Flash block management method and system, which can reduce the complexity of the system, do not need to occupy larger memory, and have stronger transportability and universality.
On one hand, the invention provides a Nand Flash block management method, which comprises the following steps:
receiving an access instruction of an application layer, wherein the access instruction comprises a logical block address; inquiring a preset address mapping table to obtain physical block addresses corresponding to the logical block addresses, wherein Nand Flash physical block addresses corresponding to the logical block addresses are stored in the address mapping table;
inquiring a preset bad block list, and detecting whether a storage block pointed by the physical block address is available; marking all unavailable storage blocks in the Nand Flash in the bad block list;
if the storage block pointed by the physical storage address is unavailable, re-determining the Nand Flash physical block address corresponding to the logical block address according to a preset address mapping algorithm, updating the address mapping table, and operating the storage block pointed by the re-determined physical block address according to the access instruction.
Another aspect of the present invention provides a Nand Flash block management system, including:
the instruction and address confirmation module is used for receiving an access instruction of an application layer, wherein the access instruction comprises a logical block address; inquiring a preset address mapping table to obtain physical block addresses corresponding to the logical block addresses, wherein Nand Flash physical block addresses corresponding to the logical block addresses are stored in the address mapping table;
the block state detection module is used for inquiring a preset bad block list and detecting whether the storage block pointed by the physical block address is available; marking all unavailable storage blocks in the Nand Flash in the bad block list;
and the mapping management module is used for re-determining the Nand Flash physical block address corresponding to the logical block address according to a preset address mapping algorithm, updating the address mapping table and operating the storage block to which the re-determined physical block address points according to the access instruction if the storage block to which the physical storage address points is unavailable.
Based on the Nand Flash block management method and system provided by the embodiment, when receiving an access instruction of an application layer, the access instruction comprises a logical block address; inquiring a preset address mapping table to obtain a physical block address corresponding to the logical block address; inquiring a preset bad block list, and detecting whether a storage block pointed by the physical block address is available; if the storage block pointed by the physical storage address is unavailable, re-determining the Nand Flash physical block address corresponding to the logical block address according to a preset address mapping algorithm, and operating the storage block pointed by the re-determined physical block address according to the access instruction. Therefore, bad block management is realized by putting a driver layer, the direct connection between the Nand Flash block and the application layer is cut off, and the portability and the universality are stronger; meanwhile, the time for loading a file system or initializing the middleware is saved, and a larger memory is not required to be occupied.
Drawings
FIG. 1 is a schematic illustration of an operating environment in which aspects of the present invention may be practiced, in one embodiment;
FIG. 2 is a schematic flow chart of a Nand Flash block management method according to an embodiment;
FIG. 3 is a schematic structural diagram of a Nand Flash block management system according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
FIG. 1 is a schematic representation of the operating environment of an embodiment of the inventive arrangements. As shown in FIG. 1, in the embodiment of the present invention, a Nand Flash driver layer is further disposed between the application layer of the Nand Flash and the physical layer of the Nand Flash. The Nand Flash physical layer comprises a plurality of physical storage blocks, the physical storage blocks comprise available blocks and unavailable blocks, the unavailable blocks comprise bad blocks and occupied blocks, and the reliability of the Nand Flash storage blocks is difficult to guarantee. The Nand Flash drive layer relates to a virtual reliable logic storage block, a bad block list and an address mapping table; the bad block list records the physical block address of the storage block which is currently in an unavailable state; the address mapping table stores Nand Flash physical block addresses corresponding to the logic block addresses; the application layer is directly faced with reliable logical memory blocks, since there are no bad blocks in the logical memory blocks. The unreliable Nand Flash storage block is virtualized into the reliable logic storage block, the application layer only accesses the virtualized storage block, the direct connection between the application layer and the Nand Flash physical layer is cut off through the Nand Flash drive layer, the portability and the universality are high, and the blocks accessed by the application layer can be guaranteed to be reliable usable blocks. The storage blocks in Nand Flash are divided into non-replacement-class storage blocks and reserved blocks (also called replacement-class storage blocks), and the number of the non-replacement-class storage blocks is equal to the number of the logic blocks of the drive layer.
With reference to fig. 1 and the above description of the operating environment, the following describes an embodiment of the Nand Flash block management method.
FIG. 2 is a schematic flow chart of a Nand Flash block management method according to an embodiment; as shown in fig. 2, the Nand Flash block management method in this embodiment includes the steps of:
s11, receiving an access instruction of an application layer, wherein the access instruction comprises a logical block address; inquiring a preset address mapping table to obtain physical block addresses corresponding to the logical block addresses, wherein Nand Flash physical block addresses corresponding to the logical block addresses are stored in the address mapping table;
in this embodiment, the application layer directly faces the virtual logical block of the time driver layer, and therefore the access instruction includes a logical block address. Each logical block address corresponds to a Nand Flash physical block address.
In a preferred embodiment, the method further includes a step of initializing an address mapping table, which may specifically include: the method comprises the steps of obtaining the physical block address of a non-replaced available storage block in NandFlash, establishing the one-to-one correspondence of each logical block address and the physical block address of the non-replaced available storage block, and constructing an address mapping table according to the correspondence.
S12, inquiring a preset bad block list, and detecting whether the storage block pointed by the physical block address is available; marking all unavailable storage blocks in the Nand Flash in the bad block list;
in a preferred embodiment, the Nand Flash block management method further includes the steps of: scanning all storage blocks in the Nand Flash, recording the state of each storage block in the Nand Flash, and constructing a bad block list corresponding to the Nand Flash. The bad block list can only record the currently unavailable storage block information; or to record both currently unavailable and currently available memory block information. Preferably, after the bad block list is created, periodic scanning can be performed according to a set time so as to update the bad block list.
And S13, if the storage block pointed by the physical storage address is unavailable, re-determining the Nand Flash physical block address corresponding to the logical block address according to a preset address mapping algorithm, updating the address mapping table, and operating the storage block pointed by the re-determined physical block address according to the access instruction.
In a preferred embodiment, if the memory block pointed by the physical memory address is in an available state, the corresponding memory block in the Nand Flash block is operated according to the access instruction.
In a preferred embodiment, the implementation of re-determining the Nand Flash physical block address corresponding to the logical block address according to a preset address mapping algorithm may include: randomly acquiring the physical block address of any reserved block in the Nand Flash, and establishing the corresponding relation between the logical block address and the physical block address of any reserved block; or, obtaining the reserved block with the minimum physical block address, and establishing the corresponding relation between the logical block address and the physical block address of the reserved block; and the reserved block is an available storage block except the non-replaced storage block in the Nand Flash.
It is understood that the execution subjects of the above steps S11-S13 can all be Nand Flash driver layers.
Based on the Nand Flash block management method provided by the embodiment, when an access instruction of an application layer is received, a preset address mapping table is inquired, and a physical block address corresponding to a logical block address is obtained; inquiring a preset bad block list, and detecting whether a storage block pointed by the physical block address is available; if the storage block pointed by the physical storage address is unavailable, re-determining the Nand Flash physical block address corresponding to the logical block address according to a preset address mapping algorithm, updating the address mapping table, and operating the storage block pointed by the re-determined physical block address according to the access instruction. Because the bad block management is realized by putting the drive layer, the direct connection between the Nand Flash block and the application layer is better cut off, and the portability and the universality are stronger; meanwhile, the time for loading a file system or initializing the middleware is saved, and a larger memory is not required to be occupied.
In a preferred embodiment, to save resources, the bad block list is set to bitwise mark unusable blocks, such as: a corresponding bit of 1 indicates that this is an available block, a corresponding bit of 0 indicates that this is a bad block or that this block is already occupied, and such a bad block list is also called a bad block bitmap, so that Flash is not erased frequently when the bad block list is updated. When the Nand Flash block management system is powered on for the first time, the system needs to scan the whole Nand Flash to initialize a bad block bitmap and record the physical storage block condition of the Nand Flash so as to reserve an available reserved block for 'repairing' the existing bad block in the Nand Flash and the bad block dynamically generated in the future operation process.
Preferably, the structure definition and description of the bad block bitmap can refer to table 1:
TABLE 1
Figure BDA0001187325270000061
In a preferred embodiment, taking samsung K9F1G08PCB0 as an example, a Nand Flash chip has 1024 blocks in total, and the block address is 0-0 x3 FF. In order to realize the address mapping from the logical block to the physical block, a block address mapping table needs to be constructed. Preferably, the address mapping table may be defined as a one-dimensional array with an unknown short data type, and the index of the array indicates the logical block address. For example, the structure definition of the address mapping table can refer to table 2:
TABLE 2
Figure BDA0001187325270000071
Based on the definition of the address mapping table, when the value of gusBlockReMap [ usaIndex ] is 0xFFFF, the block with the physical block address of usaIndex is represented as an available storage block, and then the mapping relationship between the logical block address and the physical block address of the available storage block is as follows:
addr logical block, Addr physical block, usIndex
I.e. the logical block address of the available memory block pair is the same as its own physical block address.
When gusBlockReMap [ usaIndex ] is not 0xFFFF, the block with the physical block address of usaIndex is represented as an unavailable storage block, and the corresponding mapping relationship is determined according to the algorithm shown in program list 1:
program list 1 logical address remapping algorithm
Figure BDA0001187325270000072
Figure BDA0001187325270000081
Preferably, in this embodiment, the reserved block is allocated at the end of the entire Nand Flash storage interval, only the driver layer can directly access the reserved block, and the application layer can access the physical block address of which the maximum logical block address should be smaller than that of the reserved block, so that one reserved block can be prevented from corresponding to a plurality of logical blocks. That is, the number of the logical blocks is less than that of the physical blocks in the Nand Flash, so that when a physical block is detected to be a bad block in the using process, other physical blocks can be virtualized to be a logical block for use by a logical block supply layer instead of the bad block, and therefore, the maximum logical block address contained in the address mapping table is less than the physical block address of the reserved block in the Nand Flash.
If the bad block bitmap and the address mapping table are stored in the Nand Flash chip, a certain storage space needs to be occupied, and the method is not beneficial to popularization into a common Nand Flash chip.
In order to further solve the problem, in a preferred embodiment, the Nand Flash block management method further includes a step of pre-establishing a structure constant corresponding to the Nand Flash, where the structure constant includes a start address of a bad block list, a start address of an address mapping table, and attribute information for describing the Nand Flash; and storing the structure constant at a specified position in the Nand Flash, storing the address mapping table and the bad block list in a storage unit outside the Nand Flash, and accessing the address mapping table and the bad block list according to the structure constant.
For example, the structure constant is a data structure field established in advance, and is used for describing the NAND Flash attribute, and the structure definition thereof can refer to the program list 2 as shown in the following:
structure definition of program List 2 Structure constants NANDFLASH
Figure BDA0001187325270000082
Figure BDA0001187325270000091
Since the structure constant NANDFLASH only has 24 bytes, in practical application, the structure constant NANDFLASH can be stored in a fixed position of the 0 th block of Nand Flash, such as a position of 0xE000, and the bad block bitmap and the mapping table can be stored in other positions, so that the Nand Flash of any 128 KB/block or 16 KB/block can share the same bad block management algorithm. Of course, the structure constant may also be stored in other blocks, or the structure constant, the bad block bitmap, and the address mapping table may all be stored in additional storage units.
In the Nand Flash block management method of the embodiment, the bad block bitmap and the address mapping table related to the bad block management mechanism and the NANDFLASH structure constant for describing the property of the Nand Flash are directly stored in the existing storage unit, so that the hardware cost is not required to be additionally increased; the code volume for realizing the block management method is not large, the memory is not occupied much, the access speed is high, the efficiency is high, and the method is also suitable for an embedded single chip microcomputer system with small Flash capacity. In addition, by reserving the mapping mechanism of the block, the support of erasing load averaging is also facilitated to be provided.
It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present invention is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present invention. Further, the above embodiments may be arbitrarily combined to obtain other embodiments.
Based on the same idea as the Nand Flash block management method in the embodiment, the invention also provides a Nand Flash block management system, and the system can be used for executing the Nand Flash block management method. For convenience of explanation, the structural schematic diagram of the NandFlash block management system embodiment only shows a part related to the embodiment of the present invention, and those skilled in the art will understand that the illustrated structure does not constitute a limitation of the system, and may include more or less components than those illustrated, or combine some components, or arrange different components.
FIG. 3 is a schematic structural diagram of a Nand Flash block management system according to an embodiment of the present invention; as shown in fig. 3, the Nand Flash block management system of the present embodiment includes: the command and address validation module 310, the block status detection module 320, and the mapping management module 330 are described in detail as follows:
the command and address confirmation module 310 is configured to receive an access command of an application layer, where the access command includes a logical block address; inquiring a preset address mapping table to obtain physical block addresses corresponding to the logical block addresses, wherein Nand Flash physical block addresses corresponding to the logical block addresses are stored in the address mapping table;
the block state detection module 320 is configured to query a preset bad block list, and detect whether a storage block pointed by the physical block address is available; marking all unavailable storage blocks in the Nand Flash in the bad block list;
the mapping management module 330 is configured to, if the storage block to which the physical storage address points is unavailable, re-determine the Nand Flash physical block address corresponding to the logical block address according to a preset address mapping algorithm, update the address mapping table, and operate the storage block to which the re-determined physical block address points according to the access instruction.
In a preferred embodiment, the Nand Flash block management system further includes: and the bad block list establishing module 340 is used for scanning all storage blocks in the Nand Flash when the Nand Flash block management system is powered on, recording the states of the storage blocks in the Nand Flash, and constructing a bad block list corresponding to the Nand Flash. The Nand Flash block management system can further comprise: an address mapping table establishing module 350, configured to obtain physical block addresses of non-replaced available storage blocks in Nand Flash, establish a one-to-one correspondence between each logical block address and the physical block address of the non-replaced available storage block, and establish an address mapping table according to the correspondence
In a preferred embodiment, the Nand Flash block management system further includes: and the structure constant establishing module 360 is used for establishing a structure constant corresponding to the Nand Flash in advance, wherein the structure constant comprises a starting address of a bad block list, a starting address of an address mapping table and attribute information used for describing the Nand Flash. And a storage management module (not shown in fig. 3) configured to store the structure constant in a specified location in the Nand Flash, and store the address mapping table and the bad block list in a storage unit outside the Nand Flash, so as to access the address mapping table and the bad block list according to the structure constant.
Based on the Nand Flash block management system, bad block management is carried out on a drive layer, so that the connection between a physical layer and an application layer is completely cut off, and the Nand Flash block management system is not only suitable for foreground and background applications, but also suitable for application with an operating system; the method is also not dependent on any third-party library and is also suitable for an embedded system with short resources; in addition, other applications using file systems and non-file systems may be used as well; therefore, the Nand Flash block management system has strong portability and universality.
It should be noted that, in the implementation of the Nand Flash block management system in the foregoing example, because the contents of information interaction, execution process, and the like between the modules are based on the same concept as that of the foregoing method embodiment of the present invention, the technical effect brought by the contents is the same as that of the foregoing method embodiment of the present invention, and specific contents may refer to descriptions in the method embodiment of the present invention, and are not described again here.
In addition, in the embodiment of the Nand Flash block management system of the above example, the logical division of each functional module is only an example, and in practical application, the above function allocation may be completed by different functional modules according to needs, for example, due to the configuration requirements of corresponding hardware or the convenience of implementation of software, that is, the internal structure of the Nand Flash block management system is divided into different functional modules to complete all or part of the above described functions. The functional modules can be realized in a hardware mode or a software functional module mode.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which is stored in a computer readable storage medium and sold or used as a stand-alone product. The program, when executed, may perform all or a portion of the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-only Memory (ROM), a Random Access Memory (RAM), or the like.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The above-described examples merely represent several embodiments of the present invention and should not be construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (11)

1. A Nand Flash block management method is characterized by being applied to a Nand Flash drive layer, wherein the drive layer is positioned between an application layer and a physical layer and is used for cutting off the direct connection between the application layer and the physical layer; the method comprises the following steps:
receiving an access instruction of the application layer, wherein the access instruction comprises a logical block address; the logic block address is an address of a virtual logic block preset in the drive layer;
inquiring an address mapping table preset in the drive layer to obtain physical block addresses corresponding to the logical block addresses, wherein Nand Flash physical block addresses corresponding to the logical block addresses are stored in the address mapping table;
inquiring a bad block list preset in the drive layer, and detecting whether a storage block pointed by the physical block address is available; marking all unavailable storage blocks in the Nand Flash in the bad block list;
if the storage block pointed by the physical block address is unavailable, re-determining the Nand Flash physical block address corresponding to the logical block address according to a preset address mapping algorithm, updating the address mapping table, and operating the storage block pointed by the re-determined physical block address according to the access instruction.
2. The Nand Flash block management method according to claim 1, wherein after detecting whether the storage block corresponding to the physical block address is available, the method further comprises:
and if the storage block pointed by the physical block address is in an available state, operating the storage block according to the access instruction.
3. The Nand Flash block management method of claim 1, wherein before querying the preset bad block list, the method further comprises:
scanning all storage blocks in the Nand Flash, recording the state of each storage block in the Nand Flash, and constructing a bad block list corresponding to the Nand Flash.
4. The Nand Flash block management method according to claim 3, wherein recording the state of each storage block in the Nand Flash, and constructing the bad block list corresponding to the Nand Flash comprises:
and marking the state of each storage block in the Nand Flash according to bits, representing the value of the corresponding bit of the available storage block by 1, and representing the value of the corresponding bit of the unavailable storage block by 0, and constructing a bad block bitmap corresponding to the Nand Flash.
5. The Nand Flash block management method of claim 1, further comprising the step of initializing an address mapping table, comprising: acquiring physical block addresses of non-replaced available storage blocks in Nand Flash, establishing a one-to-one correspondence relationship between the logical block addresses and the physical block addresses of the non-replaced available storage blocks, and constructing an address mapping table according to the correspondence relationship;
re-determining the Nand Flash physical block address corresponding to the logical block address according to a preset address mapping algorithm, wherein the method comprises the following steps:
randomly acquiring the physical block address of any reserved block in the Nand Flash, and establishing the corresponding relation between the logical block address and the physical block address of any reserved block;
or, obtaining the reserved block with the minimum physical block address, and establishing the corresponding relation between the logical block address and the physical block address of the reserved block;
and the reserved block is an available storage block except the non-replaced storage block in the Nand Flash.
6. The Nand Flash block management method of claim 5, wherein the maximum logical block address contained in the address mapping table is smaller than the physical block address of the reserved block.
7. The Nand Flash block management method of claim 1, further comprising:
pre-establishing a structure constant corresponding to the Nand Flash, wherein the structure constant comprises a starting address of the bad block list, a starting address of the address mapping table and attribute information for describing the Nand Flash;
and storing the structure constant in a specified position in the Nand Flash, and storing the address mapping table and the bad block list in a storage unit outside the Nand Flash.
8. A Nand Flash block management system is characterized in that the Nand Flash block management system is applied to a Nand Flash drive layer, and the drive layer is positioned between an application layer and a physical layer and is used for cutting off the direct connection between the application layer and the physical layer; the method comprises the following steps:
the instruction and address confirmation module is used for receiving an access instruction of the application layer, wherein the access instruction comprises a logical block address; the logic block address is an address of a virtual logic block preset in the drive layer; inquiring an address mapping table preset in the drive layer to obtain physical block addresses corresponding to the logical block addresses, wherein Nand Flash physical block addresses corresponding to the logical block addresses are stored in the address mapping table;
the block state detection module is used for inquiring a bad block list preset in the drive layer and detecting whether the storage block pointed by the physical block address is available or not; marking all unavailable storage blocks in the Nand Flash in the bad block list;
and the mapping management module is used for re-determining the Nand Flash physical block address corresponding to the logical block address according to a preset address mapping algorithm, updating the address mapping table and operating the storage block pointed by the re-determined physical block address according to the access instruction if the storage block pointed by the physical block address is unavailable.
9. The Nand Flash block management system of claim 8, further comprising: the bad block list establishing module is used for scanning all storage blocks in the Nand Flash when the Nand Flash block management system is electrified, recording the state of each storage block in the Nand Flash and establishing a bad block list corresponding to the Nand Flash;
and/or the address mapping table establishing module is used for acquiring the physical block address of the non-replaced available storage block in the Nand Flash, establishing the one-to-one correspondence of each logical block address and the physical block address of the non-replaced available storage block, and establishing the address mapping table according to the correspondence.
10. The Nand Flash block management system of claim 8, further comprising:
the structure constant establishing module is used for establishing a structure constant corresponding to the Nand Flash in advance, wherein the structure constant comprises a starting address of the bad block list, a starting address of the address mapping table and attribute information used for describing the Nand Flash;
and the storage management module is used for storing the structure constant in a specified position in the Nand Flash and storing the address mapping table and the bad block list in a storage unit outside the Nand Flash.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN201611191783.1A 2016-12-21 2016-12-21 Nand Flash block management method and system Active CN106648463B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611191783.1A CN106648463B (en) 2016-12-21 2016-12-21 Nand Flash block management method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611191783.1A CN106648463B (en) 2016-12-21 2016-12-21 Nand Flash block management method and system

Publications (2)

Publication Number Publication Date
CN106648463A CN106648463A (en) 2017-05-10
CN106648463B true CN106648463B (en) 2020-06-16

Family

ID=58834492

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611191783.1A Active CN106648463B (en) 2016-12-21 2016-12-21 Nand Flash block management method and system

Country Status (1)

Country Link
CN (1) CN106648463B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107894872A (en) * 2017-09-30 2018-04-10 南京扬贺扬微电子科技有限公司 Spi nand flash bad block management mode
CN108172249B (en) * 2017-12-22 2021-09-17 湖南国科微电子股份有限公司 NAND Flash access operation method, device and system
CN108054114A (en) * 2018-01-12 2018-05-18 江苏华存电子科技有限公司 A kind of method for improving flash memory availability
CN109144423B (en) * 2018-08-31 2022-03-18 湖南率为控制科技有限公司 Memory bad block management method and device and flash memory
CN109491930B (en) * 2018-11-16 2023-04-11 杭州阿姆科技有限公司 Method for optimizing write address allocation in SSD
CN109656480A (en) * 2018-12-12 2019-04-19 广东浪潮大数据研究有限公司 A kind of management method, system and the device of SSD cache pool
CN112612418B (en) * 2020-12-25 2024-03-08 航天信息股份有限公司 Method and system for managing large-capacity NandFlash bad blocks
CN112885402B (en) * 2020-12-29 2023-12-22 北京浪潮数据技术有限公司 Method and device for querying bad blocks of solid state disk and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317733A (en) * 2014-10-28 2015-01-28 陕西千山航空电子有限责任公司 NAND FLASH bad block management method
CN105225695A (en) * 2014-05-28 2016-01-06 上海复旦微电子集团股份有限公司 The method for deleting of flash memory and flash memory
CN105843749A (en) * 2016-03-24 2016-08-10 浙江大学 NAND Flash fault-tolerance method based on FPGA (Field Programmable Gate Array)

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105225695A (en) * 2014-05-28 2016-01-06 上海复旦微电子集团股份有限公司 The method for deleting of flash memory and flash memory
CN104317733A (en) * 2014-10-28 2015-01-28 陕西千山航空电子有限责任公司 NAND FLASH bad block management method
CN105843749A (en) * 2016-03-24 2016-08-10 浙江大学 NAND Flash fault-tolerance method based on FPGA (Field Programmable Gate Array)

Also Published As

Publication number Publication date
CN106648463A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
CN106648463B (en) Nand Flash block management method and system
US7191306B2 (en) Flash memory, and flash memory access method and apparatus
KR101263307B1 (en) Method and device to improve USB flash write performance
CN108874298B (en) Data storage method and device
US7284085B2 (en) Managing configuration data in a flash configuration space in flash memory within a host interface port
JP2013137771A (en) Mount-time reconciliation of data availability
JPH08328762A (en) Semiconductor disk device and memory management method therefor
US11614885B2 (en) Data processing method for improving access performance of memory device and data storage device utilizing the same
CN116431530B (en) CXL memory module, memory processing method and computer system
CN116466879A (en) CXL memory module, memory data replacement method and computer system
US8068363B2 (en) Flash memory apparatus and read operation control method therefor
KR101826778B1 (en) EEPROM Emulation Method Considering implementation of Flash Life Cycle and Performance Improvement
KR20190091035A (en) Memory system and operating method thereof
US10990323B2 (en) Flash memory controller, memory device and method for accessing flash memory module
CN117075801A (en) Data storage management method, device and equipment
US8370599B2 (en) Storage system and controlling system and method thereof
US7773433B2 (en) Method for managing a non-volatile memory in a smart card
CN112015672A (en) Data processing method, device, equipment and storage medium in storage system
CN115687173B (en) Data address query method and device, electronic equipment and readable storage medium
US20230146696A1 (en) Storage device and method for restoring meta data thereof
US11663065B2 (en) SCSI command set for error history logging in a memory system and operating method thereof
US20230393974A1 (en) Memory system and address verification method
US20220171706A1 (en) Memory system and operating method thereof
CN114647367A (en) Data reading and writing method, device, equipment and storage medium
CN114691620A (en) File management system, method, storage medium, and vehicle

Legal Events

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

Address after: 510660 Guangdong city of Guangzhou province Tianhe District Long Yi Road No. 117 room 1603-1607

Applicant after: Guangzhou Ligong Science and Technology Co., Ltd.

Address before: 510660 Guangdong city of Guangzhou province Tianhe District No. 1039 Room 303 third Pu Lu

Applicant before: GUANGZHOU ZLG SINGLECHIP TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant