CN110543434A - NAND flash device, memory table management method, device and storage medium - Google Patents

NAND flash device, memory table management method, device and storage medium Download PDF

Info

Publication number
CN110543434A
CN110543434A CN201910837313.5A CN201910837313A CN110543434A CN 110543434 A CN110543434 A CN 110543434A CN 201910837313 A CN201910837313 A CN 201910837313A CN 110543434 A CN110543434 A CN 110543434A
Authority
CN
China
Prior art keywords
storage
level
block
storing
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.)
Granted
Application number
CN201910837313.5A
Other languages
Chinese (zh)
Other versions
CN110543434B (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.)
Shanghai Geyi Electronic Co ltd
Zhaoyi Innovation Technology Group Co ltd
Original Assignee
Shanghai Geyi Electronics Co Ltd
GigaDevice Semiconductor Beijing Inc
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 Shanghai Geyi Electronics Co Ltd, GigaDevice Semiconductor Beijing Inc filed Critical Shanghai Geyi Electronics Co Ltd
Priority to CN201910837313.5A priority Critical patent/CN110543434B/en
Publication of CN110543434A publication Critical patent/CN110543434A/en
Application granted granted Critical
Publication of CN110543434B publication Critical patent/CN110543434B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0646Configuration or reconfiguration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0877Cache access modes
    • G06F12/0882Page mode

Landscapes

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

Abstract

The embodiment of the invention discloses a NAND flash device and a storage table management method, a device, equipment and a storage medium thereof, wherein the NAND flash device comprises: the method comprises the steps that a physical block and a storage table stored in the physical block are included, the storage table comprises a first-level table, a second-level table, a third-level table and a fourth-level table according to the sequence from low update frequency degree to high update frequency degree of an information table, the first-level table is a system table, the second-level table comprises a root table and a metadata table, and the third-level table at least comprises an idle table and a section table; the four-level table comprises a plurality of zone tables, and only the system table is stored in a plurality of physical blocks specified by the guide rule; the system table is used for recording the block address of a physical block for storing the secondary table, the root table is used for recording the block address of the physical block for storing the segment table, the segment table is used for recording the page address of a storage page of the storage region table, and the metadata table is used for recording the block address of the physical block for storing the free table. The invention reduces the updating frequency of the system table and reduces the consumption of the storage block of the system table.

Description

NAND flash device, memory table management method, device and storage medium
Technical Field
The embodiment of the invention relates to the technical field of storage, in particular to a NAND flash device, a storage table management method, storage table management equipment and a storage medium.
Background
the system table is very important system data in NAND Firmware (FW), and records physical addresses of all system data memory blocks and the like. At the beginning of powering on the storage device, the system table needs to be rebuilt into a Random Access Memory (RAM) through the function of the update (Rebuild) module, and subsequent update and normal operation of the firmware must be guided based on the information of the system table. The system table records physical block information of the root table, the firmware code and the metadata table. Besides some important system configuration information, the root table also records the physical block address information of the sector table; recording the physical block address information of the zone table in the zone table; the mapping relation from the logical address to the physical address of the 4K storage unit of the user data is recorded in the area table; the firmware code records the physical address information of the storage block of the firmware code; the metadata table records the physical block address information of the user table, the free table and the bad block table, and shares a storage space with a fixed size. The system table information is shown in fig. 1, and fig. 1 is a schematic diagram of a system table in the prior art.
in the prior art, addresses of a user table, a free table, a bad block table, a section table, a firmware code and the like are uniformly put into a system table for recording. The power-up rule is fixed in the NAND-controlled boot program: the latest system table is scanned from fixed physical memory blocks of the NAND, the RAM is read, the corresponding table is loaded from other physical blocks of the NAND into the RAM according to address information of other tables recorded in the system table, and the subsequent FW operation is continued.
However, the prior art has the following disadvantages: 1. the block addresses of all the tables are uniformly put in the system table for management, the logic is simple and easy to implement, but due to the fact that the updating of the area table, the free table and the like is very frequent, the corresponding table block addresses are frequently changed and written into the system block, the rules of the NAND controller are solidified, the system table is obtained by scanning the physical storage blocks specified by the rules at the beginning of power-on in the whole service life of the NAND memory device, the system table is frequently written into, the consumption of the physical storage blocks specified by the starting rules is extremely large, and the physical storage blocks are easily damaged, so that the service life of the NAND memory device is influenced. 2. When updating, the block address of each table is required to be obtained from the system table, versions of the same table under different time stamps are scanned and compared, and the latest table in the NAND is obtained through repeated comparison, so that the updating time is increased.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a method, an apparatus, a device and a storage medium for managing a storage table of a NAND flash device, so as to optimize the storage table management method in the prior art, reduce the consumption of storage blocks and speed up the update time.
in order to achieve the purpose, the invention adopts the following technical scheme:
in a first aspect, an embodiment of the present invention provides a NAND flash device, including a physical block and a storage table stored in the physical block, where the storage table includes a first-level table, a second-level table, a third-level table, and a fourth-level table in order from low to high in update frequency of an information table, the first-level table is a system table, the second-level table includes a root table and a metadata table, and the third-level table includes at least a free table and a segment table; the four-level table comprises a plurality of zone tables, and only the system table is stored in a plurality of physical blocks specified by a boot rule;
the system table is used for recording the block addresses of physical blocks for storing the secondary table, the root table is used for recording the block addresses of the physical blocks for storing the section table, the section table is used for recording the page addresses of storage pages for storing the section table, the metadata table is used for recording the block addresses of the physical blocks for storing the free table, and the free table is used for recording the number of free blocks, the physical addresses and the erasing times.
further, the section table is further configured to record storage change information of the section table.
Further, the system table is further used for recording a block address of a physical block for storing firmware codes and parameter information of firmware configuration, and the system table includes a reserved storage space;
the third-level table also comprises a user table, a bad block table and a mapping table; the metadata table is further used for recording block addresses of physical blocks storing the user table, the bad block table and the mapping table.
In a second aspect, an embodiment of the present invention provides a memory table management method based on the NAND flash device, including:
Acquiring block addresses of physical blocks for storing a secondary table and a tertiary table;
If the block address of the physical block for storing the secondary table is changed, updating the system table;
And if the block address of the physical block storing the tertiary table is changed, updating the secondary table.
Further, the physical blocks storing the secondary table and the tertiary table each include two basic blocks;
If the block address of any one of the two basic blocks for storing the secondary table changes, judging that the block address of the physical block for storing the secondary table changes;
And if the block address of any one of the two basic blocks storing the three-level table is changed, judging that the block address of the physical block storing the three-level table is changed.
further, the method also comprises the following steps:
when a plurality of area tables in the four-level table are subjected to random storage change, the storage change information of the area tables is recorded in the section table of the three-level table.
Further, the method also comprises the following steps:
Reading the page address of the last zone table from the physical block of the storage zone table;
if the reading is wrong, updating the zone table;
And if the reading is correct and the page address of the last zone table is not recorded in the zone table, updating the zone table.
In a third aspect, an embodiment of the present invention further provides a storage table management apparatus, including:
The block address acquisition module is used for acquiring the block addresses of the physical blocks for storing the secondary table and the tertiary table;
The system table updating module is used for updating the system table when the block address of the physical block for storing the secondary table is changed;
and the second-level table updating module is used for updating the second-level table when the block address of the physical block for storing the third-level table is changed.
Further, the physical blocks storing the secondary table and the tertiary table each include two basic blocks;
The system table updating module is specifically used for judging that the block address of the physical block for storing the secondary table changes if the block address of any one of the two basic blocks for storing the secondary table changes;
And if the block address of any one of the two basic blocks specifically used for storing the tertiary table is changed, the secondary table updating module judges that the block address of the physical block storing the tertiary table is changed.
further, the storage table management apparatus further includes:
and the third-level table updating module is used for recording the storage change information of the area table in the section table of the third-level table when a plurality of area tables in the fourth-level table are subjected to random storage change.
Further, the storage table management apparatus further includes a region table updating module, where the region table updating module is specifically configured to:
reading the page address of the last zone table from the physical block of the storage zone table;
If the reading is wrong, updating the zone table;
And if the reading is correct and the page address of the last zone table is not recorded in the zone table, updating the zone table.
In a fourth aspect, an embodiment of the present invention further provides an apparatus, where the apparatus includes:
one or more processors;
storage means for storing one or more programs;
When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the storage table management method according to the second aspect.
In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the storage table management method according to the second aspect.
the invention has the beneficial effects that: according to the NAND flash device and the storage table management method, device, equipment and storage medium thereof provided by the embodiment of the invention, the storage tables stored in the physical blocks are divided into the first-level table, the second-level table, the third-level table and the fourth-level table according to the sequence from low update frequency of the information tables to high update frequency, and if the block address of the physical block currently storing the lower-level table is different from the block address of the physical block previously storing the lower-level table, the previous-level table is updated. The technical scheme provided by the embodiment of the invention reduces the updating frequency of the system table, reduces the consumption of the storage block of the system table, reduces the updating difficulty of each table under the system table, and reduces the comparison of different timestamp versions of the same table, thereby reducing the reading times and reducing the updating time consumption.
Drawings
The above and other features and advantages of the present invention will become more apparent to those of ordinary skill in the art by describing in detail exemplary embodiments thereof with reference to the attached drawings, in which:
FIG. 1 is a schematic diagram of a prior art system table;
FIG. 2 is a block diagram of a NAND flash device according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a storage table management method according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a system table rebuilding method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a storage table management apparatus according to an embodiment of the present invention;
Fig. 6 is a schematic structural diagram of an apparatus provided in an embodiment of the present invention.
Detailed Description
The technical scheme of the invention is further explained by the specific implementation mode in combination with the attached drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
fig. 2 is a block diagram of a NAND flash device according to an embodiment of the present invention, and as shown in fig. 2, the NAND flash device 1 may include a physical block 10 and a storage table stored in the physical block 10, where the storage table includes a first-level table 101, a second-level table 102, a third-level table 103, and a fourth-level table 104 in order from low update frequency of an information table to high update frequency, the first-level table 101 is a system table, the second-level table 102 includes a root table and a metadata table, and the third-level table 103 includes at least a free table and a segment table; the four-level table 104 includes a plurality of zone tables, and only the system table is stored in a plurality of physical blocks specified by the boot rule;
The system table is used for recording the block address of the physical block storing the secondary table 102, the root table is used for recording the block address of the physical block storing the segment table, the segment table is used for recording the page address of the storage page of the storage area table, the metadata table is used for recording the block address of the physical block storing the free table, and the free table is used for recording the number of free blocks, the physical address and the erasing times.
In the embodiment, various storage tables are designed in a hierarchical manner, the storage table at the highest level (the first-level table 101) is only a system table, the second-level table 102 comprises two types of storage tables, namely a root table and a metadata table, which are not updated frequently, and the frequently-updated region table and the frequently-updated free table are respectively designed as a fourth-level table 104 and a third-level table 103 which are lower than the second-level table 102, the change of the region table only updates the region table in the third-level table 103, the block address of the physical block of the free table only updates the metadata table in the second-level table 102, and the system table only updates the system table when the block address of the root table and/or the physical block of the metadata table in the second-level table 102. Therefore, according to the NAND flash device provided by this embodiment, the storage tables stored in the physical blocks are divided into the first-level table, the second-level table, the third-level table, and the fourth-level table in the order from low to high in the update frequency of the information table, and if the block address of the physical block currently storing the low-level table is different from the block address of the physical block previously storing the low-level table, the previous-level table is updated, so that the update frequency of the system table is reduced, the consumption of the storage blocks of the system table is reduced, and the service life of the NAND storage device is prolonged.
in addition, the system table is also used for recording the block address of the physical block for storing the firmware code and the parameter information of the firmware configuration, and the system table comprises the reserved storage space. The third-level table also comprises a user table, a bad block table and a mapping table; the metadata table is also used to record block addresses of physical blocks storing the user table, bad block table, and mapping table.
further, the segment table is also used for recording storage change information of the zone table. The storage change information includes any information that may change in the area table, such as change information of block addresses of physical blocks in the area table and change information of data in the area table. In the embodiment, the storage change information of the zone table is used and stored in the NAND, and the storage change information of the zone table needs to be recorded in the zone table every time any storage change occurs to the zone table, so that in the process of completing system table reconstruction, scanning of a large number of zone tables (up to thousands) and comparison of different timestamp versions of each zone table are avoided, reading times are greatly reduced, updating difficulty of the storage table under the system table is reduced, and consumption of updating time is reduced.
Further, the physical blocks include basic blocks for storing the secondary table 102 and/or the tertiary table 103, a root table and a metadata table in the secondary table 102, and/or a sector table and a free table in the tertiary table 103, wherein data in each of the two basic blocks is erased and rewritten, and a block address is updated in the primary table only when the block address of the written basic block is replaced, for example, when the block address of the written basic block in the tertiary table 103 is replaced, the block address of the physical block storing the tertiary table 103 recorded in the secondary table 102 is updated; when the block address of the basic block written in the secondary table 102 is replaced, the block address of the physical block storing the secondary table 102 recorded in the system table is updated, so that the updating times of the upper table of each level table are reduced, the storage times are reduced, and the consumption of the physical block is reduced.
Fig. 3 is a flowchart illustrating a storage table management method according to an embodiment of the present invention. The method is suitable for the case of rebuilding the system table in the NAND flash device, and can be executed by a storage table management device. The memory table management means may be implemented by means of software and/or hardware. As shown in fig. 3, the storage table management method includes:
and step 110, acquiring block addresses of physical blocks for storing the secondary table and the tertiary table.
specifically, in this embodiment, at the beginning of powering on the NAND flash device, a system table (primary table) needs to be obtained by scanning in a plurality of physical blocks specified by a boot rule, and the system table is read into the RAM; loading the secondary table from other NAND physical blocks into the RAM according to the block address of the physical block for storing the secondary table recorded in the system table; loading the third-level table from other NAND physical blocks into the RAM according to the block address of the physical block for storing the third-level table recorded in the second-level table; and finally, loading the area table from other physical blocks of the NAND into the RAM according to the block address of the physical block of the storage area table recorded in the area table in the third-level table, and then continuing to execute the subsequent operation of the NAND firmware. In the normal operation of the subsequent NAND firmware, the storage information of each storage table may change, which is to update and store each storage table in real time, so that when the NAND flash device is powered on next time, the latest storage table can be loaded into the RAM, the reconstruction of the NAND firmware is completed, and the normal operation of the NAND firmware is ensured.
in order to avoid damage to a plurality of physical blocks specified by a guide rule due to frequent update of a system table, in the embodiment, various storage tables are designed in a hierarchical manner, the highest-level storage table, namely the first-level table, is only a system table, the block address of each-level table is updated only to the previous-level table after being replaced, and the system table is updated only when the block address of the physical block of a root table and/or a metadata table in the second-level table changes. In order to update the system table and the secondary table, block addresses of physical blocks storing the secondary table and the tertiary table need to be acquired respectively, the block addresses of the physical blocks storing the secondary table and the tertiary table may be changed according to a certain rule, if the storage space of the physical blocks storing the secondary table is small, a new physical block with the minimum erasing times needs to be selected as a storage block of the secondary table, and the obtained block address of the physical block is the block address of the physical block storing the secondary table.
and step 120, if the block address of the physical block for storing the secondary table is changed, updating the system table.
specifically, the physical blocks storing the secondary table each include two basic blocks, and the data of the secondary table is erased and written in the corresponding two basic blocks. And if the block address of any one of the two basic blocks for storing the secondary table is changed, judging that the block address of the physical block for storing the secondary table is changed.
and step 130, if the block address of the physical block for storing the third-level table is changed, updating the second-level table.
specifically, the physical blocks storing the three-level table each include two basic blocks, and data of the three-level table is erased and written back in the corresponding two basic blocks. And if the block address of any one of the two basic blocks storing the three-level table is changed, judging that the block address of the physical block storing the three-level table is changed.
And 140, if the plurality of area tables in the four-level table are randomly changed in storage, updating the three-level table.
Specifically, when a plurality of area tables in the four-level table are subjected to random storage change, the storage change information of the area table is recorded in the section table of the three-level table and is stored in the NAND flash device. The storage change information includes any information that may change in the area table, such as change information of block addresses of physical blocks in the area table and change information of data in the area table. In the embodiment, the storage change information of the zone table is used and stored in the NAND, and the storage change information of the zone table needs to be recorded in the zone table every time any storage change occurs to the zone table, so that in the process of completing system table reconstruction, scanning of a large number of zone tables (up to thousands) and comparison of different timestamp versions of each zone table are avoided, reading times are greatly reduced, updating difficulty of the storage table under the system table is reduced, and consumption of updating time is reduced.
in the hierarchical design of the storage table in this embodiment, the frequently updated region table is a four-level table, and the frequently updated idle table is a three-level table, so that the update of the region table and the idle table does not cause the update of the system table, thereby greatly reducing the update times of the system table, reducing the consumption of a storage block of the system table, and improving the service life of the NAND storage device.
Further, the storage table management method in this embodiment further includes: reading the page address of the last zone table from the physical block of the storage zone table; if the reading is wrong, updating the zone table; and if the reading is correct and the page address of the last zone table is not recorded in the zone table, updating the zone table. If the page address of the last zone table is read incorrectly, it can be said that the NAND flash device is powered off and the zone table is invalid if the storage is not completed. If no error occurs during reading the page address of the last zone table, but the page address of the last zone table is not recorded in the corresponding zone table, it indicates that the storage of the zone table is completed when the NAND flash device is powered off, but the page address of the zone table is not updated yet by the corresponding zone table, and the power off occurs.
In the method for managing a storage table based on a NAND flash device according to this embodiment, the storage table stored in the physical block is divided into a first-level table, a second-level table, a third-level table, and a fourth-level table in order of low update frequency of the information table, and if the block address of the physical block currently storing the lower-level table is different from the block address of the physical block previously storing the lower-level table, the previous-level table is updated. According to the technical scheme, the block address is updated in the upper-level table when the address written in the physical block is replaced in the lower-level table, the updating times and the storage times of the upper-level table of each-level table are reduced, the updating frequency of the system table is reduced, the consumption of the storage blocks of the system table is reduced, the updating difficulty of each table under the system table is reduced, the comparison of different timestamp versions of the same table is reduced, the reading times are reduced, and the updating time consumption is reduced.
In addition, fig. 4 is a schematic flow chart of a system table rebuilding method provided in the embodiment of the present invention, where the method includes:
and 11, powering on the NAND flash device.
And step 12, inquiring the system physical block according to the guiding rule.
and step 13, acquiring the latest system table.
Specifically, after the NAND flash device is powered on, the latest system table may be scanned and obtained from a plurality of physical blocks specified by the boot rule by using the binary method, and the latest system table may be loaded into the RAM.
And step 14, judging whether the system table is loaded into the RAM or not.
if the system table is successfully loaded into the RAM, executing step 15; if the system table is not successfully loaded into RAM, step 24 is performed.
And step 15, acquiring the physical block address of the root table and the metadata table and the firmware configuration parameter information.
Specifically, the physical block address and firmware configuration parameter information of the root table and the meta table are obtained from the latest system table.
and step 16, acquiring the latest root table and metadata table and loading the latest root table and metadata table into the RAM.
Specifically, the latest root table and metadata table are obtained in the corresponding physical block by adopting a binary method and loaded into the RAM.
And step 17, whether the last valid memory page is read correctly.
reading the last valid storage page of the root table and the metadata table, and if the last valid storage page of the root table and the metadata table is successfully read, executing step 18; if the last valid memory page read of the root table and metadata table fails, step 26 is performed.
Specifically, if the last valid storage page of the root table and the metadata table fails to be read, it indicates that the root table and the metadata table may store data once before the NAND flash device is powered off, but the storage is not completed yet, the root table and the metadata table are invalid, the root table and the metadata table are updated, and then the root table and the metadata table are loaded into the RAM. And if the last effective storage page of the root table and the metadata table is successfully read, the data storage of the root table and the metadata table is completed before the NAND flash device is powered off, and the root table and the metadata table are directly loaded into the RAM.
And step 18, judging whether the block address conflicts with the root table and the metadata table.
when the root table and the metadata table are loaded into the RAM, if the block address of the last physical block recording the root table and the metadata table in the system table conflicts with the block address of the last physical block storing the root table and the metadata table, it is indicated that the root table and the metadata table are stored before the NAND flash device is powered off, but the system table is not updated, and step 27 is performed to update the system table. Otherwise, step 19 is executed.
And step 19, acquiring the latest section table and loading the latest section table into the RAM.
And acquiring the physical block address of the section table from the latest root table, acquiring the latest section table from the corresponding physical block by adopting a dichotomy, and loading the latest section table into the RAM.
and step 20, acquiring the latest zone table.
The sector table records the storage variation information of the sector table, and the NAND flash device stores the storage variation information, so that the latest sector table can be obtained.
And step 21, judging whether the area table is loaded into the RAM or not.
if the area table is loaded into the RAM, executing step 22; otherwise, step 28 is performed.
Specifically, the memory page of the last region table may be read first, if the memory page of the last region table is successfully read, the region table may be loaded into the RAM, and it is determined that the region table is loaded into the RAM, and if the memory page of the last region table is unsuccessfully read, the region table may not be loaded into the RAM, and it is determined that the region table is not loaded into the RAM. If the storage page of the last zone table is read wrongly, which can indicate that the NAND flash device is powered off, the zone table stores data once, but the storage is not completed yet, and the zone table is invalid, the zone table is updated and stored, and the updated zone table is read into the RAM. And if no error occurs during reading the page address of the last zone table, further judging whether the page address of the last zone table recorded in the zone table conflicts with the page address of the last zone table stored.
And step 22, judging whether the page address conflicts with the page address of the last zone table.
If the page address of the last zone table recorded in the zone table conflicts with the page address of the last zone table stored, executing step 23; otherwise, step 25 is performed.
Specifically, if no error occurs during reading the page address of the last zone table, but the page address of the last zone table is not recorded in the corresponding zone table, that is, the page address of the last zone table recorded in the zone table conflicts with the page address of the last zone table stored in the zone table, it indicates that the storage of the zone table is completed when the NAND flash device is powered off, but the page address of the zone table is not yet updated and stored in the corresponding zone table, and then the zone table is updated and stored when the NAND flash device is powered off.
And step 23, updating and storing the section table.
And 24, reporting an error.
And step 25, ending.
Step 26, updating and storing the root table and metadata table.
Step 27, update and store the system table.
step 28, the zone table is updated and stored.
Fig. 5 is a schematic structural diagram of a storage table management apparatus according to an embodiment of the present invention. As shown in fig. 5, the memory table management apparatus includes:
A block address obtaining module 310, configured to obtain a block address of a physical block storing the secondary table and the tertiary table;
the system table updating module 320 is used for updating the system table when the block address of the physical block for storing the secondary table is changed;
the second-level table updating module 330 is configured to update the second-level table when the block address of the physical block storing the third-level table changes;
And the third-level table updating module 340 is configured to update the third-level table when any storage change occurs to the plurality of region tables in the fourth-level table.
Further, the physical blocks storing the secondary table and the tertiary table each include two basic blocks;
The system table updating module is specifically used for judging that the block address of the physical block for storing the secondary table changes if the block address of any one of the two basic blocks for storing the secondary table changes;
And if the block address of any one of the two basic blocks specifically used for storing the tertiary table is changed, the secondary table updating module judges that the block address of the physical block storing the tertiary table is changed.
Further, the storage table management apparatus further includes:
And the third-level table updating module is used for recording the storage change information of the area table in the section table of the third-level table and storing the storage change information into the NAND flash device when a plurality of area tables in the fourth-level table are subjected to random storage change.
Further, the storage table management device further includes a region table updating module, and the region table updating module is specifically configured to:
Reading the page address of the last zone table from the physical block of the storage zone table;
if the reading is wrong, updating the zone table;
and if the reading is correct and the page address of the last zone table is not recorded in the zone table, updating the zone table.
according to the storage table management device based on the NAND flash device, the storage tables stored in the physical blocks are divided into the first-level table, the second-level table, the third-level table and the fourth-level table according to the sequence from low update frequency of the information tables to high update frequency of the information tables, and if the block address of the physical block storing the lower-level table at present is different from the block address of the physical block storing the upper-level table at last time, the upper-level table is updated. The technical scheme provided by the embodiment of the invention reduces the updating frequency of the system table, reduces the consumption of the storage block of the system table, reduces the updating difficulty of each table under the system table, and reduces the comparison of different timestamp versions of the same table, thereby reducing the reading times and reducing the updating time consumption.
The storage table management device provided by the embodiment of the invention belongs to the same inventive concept as the storage table management device provided by the embodiment of the invention, can execute the storage table management method provided by the embodiment of the invention, and has corresponding functions and beneficial effects. For details of the technique not described in detail in this embodiment, reference may be made to the storage table management method provided in the embodiment of the present invention.
fig. 6 is a schematic structural diagram of an apparatus provided in an embodiment of the present invention. FIG. 6 illustrates a block diagram of an exemplary device 412 suitable for use in implementing embodiments of the present invention. The device 412 shown in fig. 6 is only an example and should not impose any limitation on the functionality or scope of use of embodiments of the present invention.
As shown in fig. 6, the device 412 is in the form of a general purpose device. The components of device 412 may include, but are not limited to: one or more processors 416, a storage device 428, and a bus 418 that couples the various system components including the storage device 428 and the processors 416.
Bus 418 represents one or more of any of several types of bus structures, including a memory device bus or memory device controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Device 412 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by device 412 and includes both volatile and nonvolatile media, removable and non-removable media.
Storage 428 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 430 and/or cache Memory 432. The device 412 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 434 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk such as a Compact disk Read-Only Memory (CD-ROM), Digital Video disk Read-Only Memory (DVD-ROM) or other optical media may be provided. In these cases, each drive may be connected to bus 418 by one or more data media interfaces. Storage 428 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
a program/utility 440 having a set (at least one) of program modules 442 may be stored, for instance, in storage 428, such program modules 442 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. The program modules 442 generally perform the functions and/or methodologies of the described embodiments of the invention.
The device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing terminal, display 424, etc.), with one or more terminals that enable a user to interact with the device 412, and/or with any terminals (e.g., network card, modem, etc.) that enable the device 412 to communicate with one or more other computing terminals. Such communication may occur via input/output (I/O) interfaces 422. Further, the device 412 may also communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network, such as the internet) via the Network adapter 420. As shown in FIG. 6, network adapter 420 communicates with the other modules of device 412 via bus 418. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the device 412, including but not limited to: microcode, end drives, Redundant processors, external disk drive Arrays, RAID (Redundant Arrays of Independent Disks) systems, tape drives, and data backup storage systems, among others.
The processor 416 executes various functional applications and data processing by running programs stored in the storage device 428, for example, implementing the storage table management method of the NAND flash device according to the above embodiments of the present invention, including:
Acquiring block addresses of physical blocks for storing a secondary table and a tertiary table;
If the block address of the physical block for storing the secondary table is changed, updating the system table;
if the block address of the physical block storing the third-level table is changed, updating the second-level table;
and if the plurality of area tables in the four-level table are randomly changed in storage, updating the three-level table.
The device provided by the embodiment of the invention comprises the storage table management device provided by the embodiment of the invention. The device can update data of the NAND flash device by adopting a corresponding memory table management method through the memory table management device provided by the invention.
The device can be a smart phone, a tablet computer or a personal digital assistant.
an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a storage table management method for a NAND flash device based on the foregoing embodiments, where the method includes:
Acquiring block addresses of physical blocks for storing a secondary table and a tertiary table;
If the block address of the physical block for storing the secondary table is changed, updating the system table;
if the block address of the physical block storing the third-level table is changed, updating the second-level table;
And if the plurality of area tables in the four-level table are randomly changed in storage, updating the three-level table.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or terminal. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
it is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments illustrated herein, but is capable of various obvious modifications, rearrangements, combinations and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A NAND flash device is characterized by comprising a physical block and a storage table stored in the physical block, wherein the storage table comprises a first-level table, a second-level table, a third-level table and a fourth-level table in the sequence from low update frequency degree of an information table to high update frequency degree, the first-level table is a system table, the second-level table comprises a root table and a metadata table, and the third-level table at least comprises an idle table and a section table; the four-level table comprises a plurality of zone tables, and only the system table is stored in a plurality of physical blocks specified by a boot rule;
the system table is used for recording the block addresses of physical blocks for storing the secondary table, the root table is used for recording the block addresses of the physical blocks for storing the section table, the section table is used for recording the page addresses of storage pages for storing the section table, the metadata table is used for recording the block addresses of the physical blocks for storing the free table, and the free table is used for recording the number of free blocks, the physical addresses and the erasing times.
2. the NAND flash device of claim 1 wherein the sector table is further configured to record storage change information of the sector table.
3. the NAND flash device of claim 1 wherein the system table is further configured to record a block address of a physical block storing firmware code and parameter information of firmware configuration, and the system table includes a reserved memory space;
the third-level table also comprises a user table, a bad block table and a mapping table; the metadata table is further used for recording block addresses of physical blocks storing the user table, the bad block table and the mapping table.
4. A memory table management method for a NAND flash device according to any one of claims 1 to 3, comprising:
Acquiring block addresses of physical blocks for storing a secondary table and a tertiary table;
If the block address of the physical block for storing the secondary table is changed, updating the system table;
if the block address of the physical block storing the third-level table is changed, updating the second-level table;
And if the plurality of area tables in the four-level table are randomly changed in storage, updating the three-level table.
5. the storage table management method according to claim 4, wherein the physical blocks storing the secondary table and the tertiary table each include two basic blocks;
If the block address of any one of the two basic blocks for storing the secondary table changes, judging that the block address of the physical block for storing the secondary table changes;
and if the block address of any one of the two basic blocks storing the three-level table is changed, judging that the block address of the physical block storing the three-level table is changed.
6. the storage table management method according to claim 4, wherein if any storage change occurs to the plurality of region tables in the four-level table, updating the three-level table comprises:
And if the plurality of area tables in the four-level table are randomly changed in storage, recording the storage change information of the area tables in the section table of the three-level table and storing the storage change information into the NAND flash device.
7. The storage table management method according to claim 4, further comprising:
Reading the page address of the last zone table from the physical block of the storage zone table;
If the reading is wrong, updating the zone table;
And if the reading is correct and the page address of the last zone table is not recorded in the zone table, updating the zone table.
8. a storage table management apparatus, comprising:
The block address acquisition module is used for acquiring the block addresses of the physical blocks for storing the secondary table and the tertiary table;
The system table updating module is used for updating the system table when the block address of the physical block for storing the secondary table is changed;
the second-level table updating module is used for updating the second-level table when the block address of the physical block for storing the third-level table is changed;
And the third-level table updating module is used for updating the third-level table when a plurality of area tables in the fourth-level table are subjected to random storage change.
9. An apparatus, characterized in that the apparatus comprises:
one or more processors;
Storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the storage table management method of any of claims 4-7.
10. a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a storage table management method according to any one of claims 4 to 7.
CN201910837313.5A 2019-09-05 2019-09-05 NAND flash device, memory table management method, device and storage medium Active CN110543434B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910837313.5A CN110543434B (en) 2019-09-05 2019-09-05 NAND flash device, memory table management method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910837313.5A CN110543434B (en) 2019-09-05 2019-09-05 NAND flash device, memory table management method, device and storage medium

Publications (2)

Publication Number Publication Date
CN110543434A true CN110543434A (en) 2019-12-06
CN110543434B CN110543434B (en) 2022-07-01

Family

ID=68712642

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910837313.5A Active CN110543434B (en) 2019-09-05 2019-09-05 NAND flash device, memory table management method, device and storage medium

Country Status (1)

Country Link
CN (1) CN110543434B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112558878A (en) * 2020-12-16 2021-03-26 北京华弘集成电路设计有限责任公司 Space exchange method based on different types of storage mechanisms

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110307651A1 (en) * 2005-06-08 2011-12-15 Wanmo Wong Robust index storage for non-volatile memory
CN104317731A (en) * 2014-10-17 2015-01-28 杭州华为数字技术有限公司 Hierarchical storage management method, device and storage system
US20150143046A1 (en) * 2013-11-21 2015-05-21 Green Cache AB Systems and methods for reducing first level cache energy by eliminating cache address tags
CN104714894A (en) * 2015-03-18 2015-06-17 清华大学 Layered phase-change memory abrasion equilibrating method and system based on random mapping
CN105224478A (en) * 2015-09-25 2016-01-06 联想(北京)有限公司 A kind of formation of mapping table, renewal and restoration methods and electronic equipment
CN105589767A (en) * 2015-12-21 2016-05-18 北京时代民芯科技有限公司 System power failure protection realizing method for NAND FLASH
CN106502928A (en) * 2016-09-29 2017-03-15 华为技术有限公司 A kind of storage system power-off protection method, storage control and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110307651A1 (en) * 2005-06-08 2011-12-15 Wanmo Wong Robust index storage for non-volatile memory
US20150143046A1 (en) * 2013-11-21 2015-05-21 Green Cache AB Systems and methods for reducing first level cache energy by eliminating cache address tags
CN104317731A (en) * 2014-10-17 2015-01-28 杭州华为数字技术有限公司 Hierarchical storage management method, device and storage system
CN104714894A (en) * 2015-03-18 2015-06-17 清华大学 Layered phase-change memory abrasion equilibrating method and system based on random mapping
CN105224478A (en) * 2015-09-25 2016-01-06 联想(北京)有限公司 A kind of formation of mapping table, renewal and restoration methods and electronic equipment
CN105589767A (en) * 2015-12-21 2016-05-18 北京时代民芯科技有限公司 System power failure protection realizing method for NAND FLASH
CN106502928A (en) * 2016-09-29 2017-03-15 华为技术有限公司 A kind of storage system power-off protection method, storage control and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JUNTAO ZHANG 等: "Research on Reliability Improvement of NAND Flash Memory in FAT File System", 《2010 INTERNATIONAL CONFERENCE ON BIOMEDICAL ENGINEERING AND COMPUTER SCIENCE》 *
张琦 等: "一种优化的闪存地址映射方法", 《软件学报》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112558878A (en) * 2020-12-16 2021-03-26 北京华弘集成电路设计有限责任公司 Space exchange method based on different types of storage mechanisms
CN112558878B (en) * 2020-12-16 2023-07-04 北京华弘集成电路设计有限责任公司 Space exchange method based on different types of storage mechanisms

Also Published As

Publication number Publication date
CN110543434B (en) 2022-07-01

Similar Documents

Publication Publication Date Title
US9164887B2 (en) Power-failure recovery device and method for flash memory
US10901949B2 (en) Method and apparatus for compressing metadata in a file system
KR101288408B1 (en) A method and system for facilitating fast wake-up of a flash memory system
TWI423026B (en) Data writing method, memory controller and memory storage apparatus
US7725646B2 (en) Method of using a flash memory for a circular buffer
CN105808163B (en) Method for accessing shingled magnetic recording SMR hard disk and server
CN109471851B (en) Data processing method, device, server and storage medium
US20150012687A1 (en) Method for managing commands in command queue, memory control circuit unit and memory storage apparatus
US11763899B2 (en) Balanced three-level read disturb management in a memory device
CN102567242A (en) Method and apparatus to perform concurrent read and write memory operations
US8819387B2 (en) Memory storage device, memory controller, and method for identifying valid data
US11354192B2 (en) Data storage devices and methods for firmware failure prevention
US8812772B2 (en) Data merging method for non-volatile memory and controller and storage apparatus using the same
CN102890655B (en) Memory storage device, memory controller and valid data recognition method thereof
US20130054877A1 (en) Data writing method, memory controller and memory storage apparatus
CN110543434B (en) NAND flash device, memory table management method, device and storage medium
US9946644B2 (en) Memory system and operating method thereof
CN111143240B (en) Image storage method, system and terminal equipment
CN110209349B (en) Data processing method and terminal equipment
US11922020B2 (en) Read-disturb-based read temperature information persistence system
CN114020525B (en) Fault isolation method, device, equipment and storage medium
US20230064693A1 (en) Storing data in a log-structured format in a two-tier storage system
TWI436209B (en) Memory management table proceesing method, memory controller and memory storage apparatus
WO2019007315A1 (en) Data writing method in flash memory device, and device
US11436105B2 (en) Data processing method and memory controller utilizing the same

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
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Room 101, Floor 1-5, Building 8, Yard 9, Fenghao East Road, Haidian District, Beijing 100094

Patentee after: Zhaoyi Innovation Technology Group Co.,Ltd.

Patentee after: SHANGHAI GEYI ELECTRONIC Co.,Ltd.

Address before: 100083 12 Floors, Block A, Tiangong Building, Science and Technology University, 30 College Road, Haidian District, Beijing

Patentee before: GIGADEVICE SEMICONDUCTOR(BEIJING) Inc.

Patentee before: SHANGHAI GEYI ELECTRONIC Co.,Ltd.