Method, device and storage medium for reliable data storage in NAND flash memory

By comparing and writing the data to be processed in the NAND flash memory, it is determined that the storage unit is damaged and the address table is recorded, which solves the problem of unreliable data after the storage unit is worn out, realizes the correct and reliable storage of data in the NAND flash memory, and improves Improves the reliability and security of the memory.

CN117008833BActive Publication Date: 2024-09-17HUIJU ELECTRONICS (DONGGUAN) IND CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202310898535.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-21
Publication Date
2024-09-17
Estimated Expiration
2043-07-21

AI Technical Summary

Technical Problem

After the storage cells in NAND flash memory are worn out, data information is difficult to recover. Existing error correction and verification solutions fail under a large number of errors, resulting in unreliable data storage.

Method used

By receiving the data to be processed, comparison and writing operations are performed to determine whether the storage unit is damaged. If it is damaged, it is rewritten to other storage areas, and the damaged block address table is recorded to ensure that the data is written to the intact unit.

Benefits of technology

Ensure that data information is stored correctly and reliably in NAND flash memory, avoid writing damaged cells, and improve the reliability and safety of the memory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117008833B
    Figure CN117008833B
Patent Text Reader

Abstract

The present invention relates to the field of NAND flash memory technology, and more particularly to methods, devices and storage media for reliable data storage in NAND flash memory. In some embodiments, it includes: a write module for receiving data to be processed and writing it into a first storage area of ​​a storage unit to form stored data; a read module for reading the stored data in the first storage area and forming data to be verified; a comparison module for comparing the data to be verified with the data to be processed. If the comparison result is inconsistent, the comparison module re-sends the data to be processed to the write module, and the write module re-writes the data to be processed into a second storage area in the storage unit. In summary, it can be ensured that the data information stored in the NAND flash memory is correct and reliable, and the data information will not be stored in a damaged storage unit, thereby improving the reliability and security of the user's use of the NAND flash memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of NAND flash memory, and in particular to a method, device and storage medium for reliable data storage in a NAND flash memory. Background Art

[0002] NAND Flash memory is a type of Flash memory that uses a nonlinear macrocell mode internally, providing a cheap and effective solution for the implementation of solid-state large-capacity storage. NAND Flash memory has the advantages of large capacity and fast rewrite speed, and is suitable for storing large amounts of data, so it has been increasingly widely used in the market.

[0003] NAND Flash is a non-volatile storage device based on a floating gate transistor design. It latches charges through a floating gate. Since the floating gate is electrically isolated, electrons reaching the gate will be captured even after the voltage is removed. This is the principle of the non-volatility of flash memory. Data stored in this type of device will not be lost even if the power is off. For ease of use, NAND Flash is usually also equipped with a NAND FTL, also known as a flash translation layer. The flash translation layer of a general memory needs to include the following functions: logical-physical address mapping table, damaged block address table, power-off recovery, wear-leveling, etc.

[0004] There are five NAND flash types on the market today, differentiated by the number of bits that can be stored per cell. SLC, MLC, TLC, QLC, and PLC can store one, two, three, four, and five bits of data per cell, respectively. So, each cell of SLC can store a "0" or a "1," each cell of MLC can store "00," "01," "10," or "11," and so on. The key differences between the various NAND flash types are cost, capacity, and endurance. Endurance is determined by the number of program-erase (P / E) cycles a flash cell can complete before it starts to wear out.

[0005] Because people need to store more and more data, TLC, QLC and PLC flash memory types with more advantageous capacity have been vigorously developed. However, their durability has also attracted people's attention. In particular, due to the electronic storage method of flash memory, once its storage unit is damaged, the recorded data information is difficult to recover.

[0006] Therefore, people have also designed some corresponding remedial measures, such as adding error correction or verification information when writing data, such as using ECC verification scheme for verification and error correction. However, the storage bit number of error correction and verification information is usually limited, and it can only correct a small number of erroneous data bits. When the storage unit is worn, a large amount of erroneous data will usually appear, causing the error correction and verification scheme to become ineffective.

[0007] In addition, when using solid-state memory, people cannot pay attention to whether specific storage units are worn out in real time. Only when an error occurs when reading data can they know that the storage unit where the current data is located is damaged. However, at this time, the stored data cannot be recovered, which can easily cause immeasurable losses to users.

[0008] Therefore, in daily use, how to ensure that the data information stored in the NAND flash memory is correct and reliable, and that the data information is not stored in a damaged storage unit, is a technical problem that needs to be solved. Summary of the invention

[0009] In order to overcome the above-mentioned shortcomings, the present invention aims to provide a technical solution that can solve the above-mentioned problems.

[0010] The present invention provides a method for reliably storing data in a NAND flash memory, the method comprising the following steps: receiving data to be processed sent by a host, writing the data to be processed into a first storage area of ​​a storage unit, and forming stored data; reading the stored data in the first storage area, and forming data to be verified; comparing the data to be verified with the data to be processed, and operating the data to be processed according to the comparison result.

[0011] As a further solution of the present invention: in the comparison step, if the comparison results of the data information of the data to be verified and the data to be processed are consistent, the operation on the data to be processed is abandoned; if the comparison results of the data information of the data to be verified and the data to be processed are inconsistent, the data to be processed is re-written into the second storage area in the storage unit.

[0012] As a further solution of the present invention: when the comparison result is inconsistent, the first storage area is repeatedly written, read and compared for a certain number of times to determine whether the first storage area is damaged.

[0013] As a further solution of the present invention: in the determination step, the first storage area is first erased, and then random data information is generated and written into the first storage area; after writing is completed, the first storage area is re-read to form data to be verified; the data to be verified is compared with the generated random data information, and according to the comparison result, the physical address information of the first storage area is operated.

[0014] As a further solution of the present invention: in the determination step, after a certain number of multiple comparisons, when the number of inconsistencies between the comparison results of the data to be verified and the generated random data information reaches a certain threshold, it is determined that the first storage area is damaged, and then the physical address information of the first storage area is added to the damaged block address table.

[0015] As a further solution of the present invention: in the determination step, after a certain number of multiple comparisons, when the ratio between the number of inconsistencies between the comparison results of the data to be verified and the generated random data information and the certain number of times reaches a certain threshold, it is determined that the first storage area is damaged, and then the physical address information of the first storage area is added to the damaged block address table.

[0016] The present invention also provides a device for reliably storing data, comprising: a write module, used for receiving data to be processed sent by a host, writing the data to be processed into a first storage area of ​​a storage unit, and forming stored data; a read module, used for reading the stored data in the first storage area, and forming data to be verified; a comparison module, used for comparing the data to be verified with the data to be processed, and operating the data to be processed according to the comparison result; wherein, if the comparison result of the data information of the data to be verified is consistent with that of the data to be processed, the comparison module discards the data to be processed; if the comparison result of the data information of the data to be verified is inconsistent with that of the data to be processed, the comparison module sends the data to be processed to the write module, and the write module re-writes the data to be processed into the second storage area in the storage unit.

[0017] As a further solution of the present invention: it also includes: a determination module, which is used to perform repeated writing, reading and comparison operations on the first storage area for a certain number of times, so as to determine whether the first storage area is damaged; wherein, the first storage area is first erased, and then random data information is generated and written into the first storage area. After the writing is completed, the first storage area is re-read to form the data to be verified, and the data to be verified is compared with the generated random data information; if after multiple comparisons, the number of inconsistencies between the comparison results of the data to be verified and the generated random data information reaches a certain threshold, or the ratio between the number of inconsistencies between the comparison results of the data to be verified and the generated random data information reaches a certain threshold, then it is determined that the first storage area is damaged, and then the physical address information of the first storage area is added to the damaged block address table.

[0018] The present invention also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for reliably storing data in a NAND flash memory described in any one of the above items is implemented.

[0019] The present invention also provides a NAND flash memory, comprising: a flash memory chip, the flash memory chip using one or more storage units of SLC, MLC, TLC, QLC or PLC type for data storage; a transmission interface, used to connect the memory to an external host system and transmit data; a controller, electrically connected to the flash memory chip and the transmission interface, respectively, and executing any of the above-mentioned methods for reliable data storage in NAND flash memory on the flash memory chip.

[0020] Compared with the prior art, the present invention has the following beneficial effects:

[0021] 1. By comparing the stored data to make it consistent with the received data to be processed, it can be ensured that the data information written in the storage unit is correct and reliable, and the situation where data information is written into a damaged storage unit, resulting in the recorded data being unable to be read or recovered, is eliminated.

[0022] 2. When the comparison results are found to be inconsistent in the comparison step, the data to be processed is rewritten into another second storage area, thereby ensuring that the data information can be rewritten into the intact storage area to prevent the data information from being written into a damaged storage unit.

[0023] 3. A determination step is also provided, in which multiple write and read operations are performed on the storage unit suspected of being damaged, and the written data information is compared with the read data information to determine whether they are consistent. If the number or ratio of inconsistencies reaches a certain threshold, it can be determined that the storage unit has been damaged, and its specific physical address information is stored in the damaged block address table, so that the memory can avoid the damaged storage unit in subsequent use.

[0024] Therefore, through the above-mentioned improvements, it can be ensured that in daily use, the data information stored in the NAND flash memory is correct and reliable, and the data information will not be stored in a damaged storage unit, thereby improving the reliability and security of users' use of the NAND flash memory.

[0025] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0027] Figure 1 is a block diagram of a memory of the present invention;

[0028] Figure 2 It is a schematic flow diagram of the comparison step of the present invention;

[0029] Figure 3 It is a flow chart of the determination step of the present invention.

[0030] The reference numerals and names in the figures are as follows:

[0031] 10 memory; 11 transmission interface; 20 flash memory chip; 21 storage unit; 22 first storage area; 23 second storage area; 24 blank area; 30 controller; 31 write module; 32 read module; 33 comparison module; 34 determination module; 35 erase module; 40 flash memory conversion layer; 41 address mapping table; 42 damaged block address table; 43 temporary block address table; 51 data to be processed; 52 stored data; 53 data to be verified; 54 data to be used. DETAILED DESCRIPTION

[0032] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0033] In order to facilitate the understanding of the technical solution of the present invention, a general introduction to the relevant technical field is first given. Solid State Disk (SSD), also known as solid state drive, is a hard disk made of a solid-state electronic storage chip array, which is increasingly being used for large-capacity storage. SSD is usually composed of a control unit and a storage unit (FLASH chip, DRAM chip), among which the development of NAND Flash memory is also very rapid. In order to increase the storage capacity, NAND flash memory is usually manufactured using TLC, QLC or PLC flash memory units with more advantageous capacity, thereby obtaining a large-capacity memory. However, it is precisely because each unit in the multi-layer storage unit can store multiple bits of data that the access to the storage unit becomes more frequent, reducing the durability of the storage unit.

[0034] Therefore, the storage cells in the memory using multi-layer storage cells have a limited number of program erase (P / E) cycles. When the number of program erase cycles of some storage cells reaches or approaches a critical value, the storage cells will be degraded or damaged, resulting in that the data stored in the storage cells cannot be correctly read out. This degradation or damage will significantly reduce the reliability of such a memory using multi-layer storage cells. In order to increase the reliability of the memory using NAND flash memory and increase the service life of the memory, the present invention proposes a method for reliable data storage in NAND flash memory.

[0035] See also Figures 1 to 3 In an embodiment of the present invention, a method for reliably storing data in a NAND flash memory includes the following steps: receiving data 51 to be processed sent by an external host, writing the data 51 to be processed into a first storage area 22 of a storage unit 21, and forming stored data 52; reading the stored data 52 in the first storage area 22, and forming data 53 to be verified; comparing the data 53 to be verified with the data 51 to be processed, and operating the data 51 to be processed according to the comparison result.

[0036] A NAND flash memory 10 includes: a flash memory chip 20, wherein the flash memory chip 20 uses one or more storage units 21 of SLC, MLC, TLC, QLC or PLC type for data storage; a transmission interface 11, used to connect the memory 10 to an external host system and transmit data; a controller 30, which is electrically connected to the flash memory chip 20 and the transmission interface 11 respectively, and executes the above-mentioned method for reliable data storage in NAND flash memory on the flash memory chip 20.

[0037] Specifically, the most commonly used solid-state hard disk is a memory 10 made of NAND flash memory, which generally includes a transmission interface 11, a flash memory chip 20 and a controller 30 electrically connected to each other. The controller 30 receives the to-be-processed data 51 to be stored in the flash memory chip 20 from the external host system through the transmission interface 11, and then writes the to-be-processed data 51 into the flash memory chip 20 to form the stored data 52, thereby completing the data storage operation; similarly, the controller 30 can also read the stored data 52 in the flash memory chip 20 to form the to-be-used data 54 required by the external host system, and then the controller 30 also sends the to-be-used data 54 to the external host system through the transmission interface 11 for its use. In addition, the memory 10 can also be provided with other components or operating modules in the prior art, such as a control chip component, a circuit board component, a cache component, an ECC check module, an erase module 35 or a recovery module, etc. Since the use of other components or operating modules in the memory 10 does not conflict with the technical solution of the present invention, and can even be used in conjunction with each other, other known technical details about the memory 10 are not repeated.

[0038] Secondly, unlike the traditional ECC verification scheme, the present invention re-reads the data information after it is written into the storage unit 21, and then compares it to ensure that the written data information is consistent with the read data information, thereby improving the reliability of data storage in the NAND flash memory. The traditional ECC verification scheme is mainly aimed at correcting the read errors that may occur when reading data, which can ensure the fault tolerance of the read data to a certain extent. However, when the storage unit 21 itself is degraded or damaged, the data information written at the beginning is wrong, so even if the corresponding error correction can be performed during the later reading, the original correct data information cannot be obtained. It can be understood that the data information mentioned in the present invention can also be data information with check bits added by the ECC verification scheme. The technical solution in the present invention is to ensure that all data information that needs to be written into the storage unit 21 can be correctly and reliably written into the storage unit 21.

[0039] Thirdly, especially now that more and more large-capacity solid-state memories 10 are used, they usually use multi-layer storage units 21 for encoding and storage, which results in extremely limited erasure life. It is necessary to consider whether the data stored by the user is reliable and can be read correctly when some storage units 21 are degraded or damaged. Therefore, it is best to ensure that the user's data is correctly and reliably stored in the memory 10 at the beginning, so as to facilitate subsequent reading and use.

[0040] In another embodiment, in the comparison step, if the comparison result of the data information of the data to be checked 53 and the data to be processed 51 is consistent, the operation of the data to be processed 51 is abandoned; if the comparison result of the data information of the data to be checked 53 and the data to be processed 51 is inconsistent, the data to be processed 51 is rewritten into the second storage area 23 in the storage unit 21. When the comparison result is inconsistent, the physical address information of the first storage area 22 is also stored in the temporary block address table 43, and the storage area in the temporary block address table 43 is repeatedly written, read and compared for a certain number of times, so as to determine whether the first storage area 22 is damaged.

[0041] Specifically, the data to be verified 53 read from the storage unit 21 is compared with the data to be processed 51 sent by the external host system through the corresponding comparison module 33, and the data to be processed 51 is processed accordingly according to the specific comparison result. If the comparison result shows that the data information is consistent, it means that the data information stored in the storage unit 21 is correct and reliable, so the data to be processed 51 can be discarded, and no other operations are performed, waiting for the next comparison operation. If the comparison result shows that the data information is inconsistent, it means that the data information stored in the storage unit 21 is incorrect, that is, the storage unit 21 of the first storage area 22 may be degraded or damaged, and further processing is required. At this time, it is preferred to rewrite the data to be processed 51 and write it into another second storage area 23. It can be understood that the second storage area 23 is a blank area 24 in which data information can be written. In addition, after writing is completed, it is also necessary to re-read and re-compare the data information in the second storage area 23 according to the above-mentioned comparison steps to ensure that the data information in the second storage area 23 is consistent with the data to be processed 51, and is correct and reliable.

[0042] It is understandable that when a new memory 10 is used, its storage unit 21 is basically intact, so when the comparison module 33 performs the comparison operation, the comparison results are basically consistent, so the comparison module 33 only needs to discard the received data to be processed 51 and the re-read data to be verified 53, and no additional operation time is required, so it will not affect the normal use of the memory 10. When a memory 10 has been used for a long time, and some of its internal storage units 21 have degraded or damaged, when the comparison module 33 performs the comparison operation, there will be inconsistent comparison results, and the comparison module 33 needs to re-send the data to be processed 51 to the write module 31 for re-writing. This operation will definitely consume the writing time of the memory 10, so there will be a proper reduction in the writing speed. However, for a memory 10 that has been used for a long time, the appropriate reduction in the writing speed is also understandable, and the most important thing is to correctly write and correctly save the data, so the user can also accept the appropriate reduction in the writing speed.

[0043] In addition, when the comparison result is found to be inconsistent during the comparison operation of the first storage area 22, preferably, a corresponding determination module 34 can also be set to determine the health status of the first storage area 22, so as to ensure whether the storage unit 21 of the first storage area 22 is an accidental and unexpected error that causes incorrect data writing, or because the corresponding storage unit 21 has been degraded or damaged and can no longer store data correctly, so the error occurs. If it is an accidental and unexpected error, after confirmation by the determination module 34, the controller 30 can continue to use the first storage area 22 in subsequent operations. If the error is caused by degradation or damage, the physical address information of the first storage area 22 should be stored in the corresponding damaged block address table 42 to prevent the controller 30 from using this part of the degraded or damaged storage unit 21 again. The damaged block address table 42 is preferably one of the tables in the original flash conversion layer 40 in the memory 10, and is specifically used to record the physical address information of all degraded or damaged storage units 21 in the memory 10, so that the controller 30 can avoid using these degraded or damaged storage units 21.

[0044] In another embodiment, in the determination step, the storage area in the temporary block address table 43 is erased, and then random data information is generated and written into the storage area; after writing is completed, the storage area is re-read to form the data to be verified 53; the data to be verified 53 is compared with the generated random data information, and according to the comparison result, the physical address information of the storage area is operated.

[0045] Specifically, the temporary block address table 43 is preferably one of the tables in the original flash conversion layer 40 in the memory 10, and is specifically used to temporarily record the physical address information of the storage unit 21. When the controller 30 is idle, the storage unit 21 recorded in the temporary block address table 43 is subjected to the corresponding determination operation. The operation step of erasing the storage area is preferably processed by the controller 30 calling the corresponding erasing module 35, and the erasing module 35 can operate on the block in the storage unit 21, or it can operate on the page in the storage unit 21. In addition, it can also be an existing solution in the prior art, such as the controller 30 reads and writes the storage unit 21 The operation object is page, usually 512 bytes or 2KB; the object of erasure is block, usually containing 32 or 64 pages (16KB or 64KB); each block needs to be erased before writing; before erasing a block, it is necessary to ensure that all pages on the block do not contain valid data (if some pages contain valid data, they need to be moved to other places first).

[0046] It can be seen that if the minimum unit of the degraded or damaged storage unit 21 is set to block, the capacity that needs to be stopped from use is relatively large, and a large part of the pages in the entire block may not be damaged. Therefore, it is preferred to set the minimum unit of the degraded or damaged storage unit 21 to page, so as to maximize the use of the undamaged page part for storage.

[0047] In another embodiment, in order to prevent some errors that may occur when performing read and write operations on pages near the degraded or damaged page, it is preferred to also record one or more adjacent pages near the degraded or damaged page into the damaged block address table 42, so that read and write operations are no longer performed on the one or more adjacent pages.

[0048] In addition, the random data information may be generated by the controller 30 according to an existing solution in the prior art, and stored in a corresponding page, and then the data in the corresponding page is read out again to form the data to be verified 53. By comparing the data to be verified 53 with the generated random number, it can be known whether the data stored in the corresponding page unit is correct and reliable.

[0049] In another embodiment, in the determination step, after a certain number of multiple comparisons, when the number of inconsistencies in the comparison results between the verification data 53 and the generated random data information reaches a certain threshold, it is determined that the storage area is damaged, and then the physical address information of the storage area is removed from the temporary block address table 43 and added to the damaged block address table 42.

[0050] Specifically, in order to improve the accuracy of determining the storage unit 21 that may be degraded or damaged, it is preferred to perform multiple comparisons, and set that if a specific number of comparisons are inconsistent, the corresponding storage unit 21 is considered to be degraded or damaged. For example, it can be set to perform 5 comparisons, and when 3 comparisons are inconsistent, the storage unit 21 is considered to be damaged.

[0051] In another embodiment, in the determination step, after a certain number of multiple comparisons, when the ratio between the number of inconsistencies in the comparison results between the verified data 53 and the generated random data information and the certain number of times reaches a certain threshold, it is determined that the storage area is damaged, and then the physical address information of the storage area is removed from the temporary block address table 43 and added to the damaged block address table 42.

[0052] Specifically, in order to improve the accuracy of determining the storage unit 21 that may be degraded or damaged, it is preferred to perform multiple comparisons, and set a certain value when the ratio of the number of comparison inconsistencies to the total number of comparisons reaches a certain value, then the corresponding storage unit 21 is considered to be degraded or damaged. For example, if the ratio is set to 50%, when there are 4 comparison inconsistencies after 6 comparisons, the ratio is higher than 50%, and the storage unit 21 is considered to be damaged.

[0053] In another embodiment, a device for reliably storing data includes: a write module 31, which is used to receive unprocessed data 51 sent by a host, write the unprocessed data 51 into the first storage area 22 of the storage unit 21, and form stored data 52; a read module 32, which is used to read the stored data 52 in the first storage area 22, and form data to be verified 53; a comparison module 33, which is used to compare the data to be verified 53 with the data to be processed 51, and operate the data to be processed 51 according to the comparison result; wherein, if the data information comparison result of the data to be verified 53 is consistent with that of the data to be processed 51, the comparison module 33 discards the data to be processed 51; if the data information comparison result of the data to be verified 53 is inconsistent with that of the data to be processed 51, the comparison module 33 re-sends the data to be processed 51 to the write module 31, and the write module 31 re-writes the data to be processed 51 into the second storage area 23 in the storage unit 21.

[0054] Specifically, the writing module 31 also updates the physical address of the rewritten second storage area 23 into the mapping table of the FTL, so that the access operation of the external host system to the data to be processed 51 can be directly directed to the second storage area 23. Of course, the updating operation of the mapping table can also be processed by an update module in the prior art that is separately provided in the controller 30. After the writing module 31 writes the data to be processed 51 into the second storage area 23, it only needs to correspond the physical access address of the second storage area 23 and the logical access address of the data to be processed 51 to each other, and send the corresponding relationship and the two addresses to the update module. After receiving the information, the update module updates the FTL.

[0055] In another embodiment, preferably, it also includes a determination module 34, which is used to perform repeated writing, reading and comparison operations on the first storage area 22 for a certain number of times, so as to determine whether the first storage area 22 is damaged; wherein, random data information is generated and written into the first storage area 22, and after writing is completed, the storage area is re-read to form the data to be verified 53, and the data to be verified 53 is compared with the generated random data information; if after multiple comparisons, the number of inconsistencies between the comparison results of the data to be verified 53 and the generated random data information reaches a certain threshold, or the ratio between the number of inconsistencies between the comparison results of the data to be verified 53 and the generated random data information reaches a certain threshold, then it is determined that the first storage area 22 is damaged, and then the physical address information of the first storage area 22 is added to the damaged block address table 42.

[0056] Specifically, the determination module 34 may be a separate processing chip or a functional module in the controller 30. Since the determination operation of the determination module 34 is not an emergency task, the controller 30 may perform the operation when it is idle. For example, when the memory 10 does not perform any read or write operations within a certain period of time, the controller 30 may drive the determination module 34 to perform the above-mentioned processing operation on the storage unit 21 suspected of being damaged recorded in the temporary block address table 43.

[0057] In yet another embodiment, preferably, a storage medium for reliable data storage includes: a computer program is stored thereon, and when the program is executed by a processor, the method for reliable data storage in a NAND flash memory as described above is implemented.

[0058] Specifically, the storage medium can be a storage unit 21 in the memory 10, or a storage unit 21 in the controller 30. The processor is preferably a microcontroller unit (MCU) where the controller 30 is located. The microcontroller unit is used to execute the above-mentioned method of reliable data storage, so that the data information required to be stored by the external host system is correctly and reliably stored in the corresponding storage unit 21.

[0059] When in use, the memory 10 is connected to the external host system through the transmission interface 11 of the memory 10, so that it can be called by the external host system. When the external host system needs to access the data information in the memory 10, like the solid-state memory 10 in the prior art, the controller 30 queries the access address of the physical storage unit 21 where the data information is actually stored through the flash conversion layer 40 according to the logical access address of the data information transmitted by the host system. Then, the corresponding storage unit 21 is read through the reading module 32, and the read data information is returned to the external host system through the transmission interface 11, thereby completing this data reading operation.

[0060] When the external host system needs to store data information, it sends the corresponding data to be processed 51 information to the controller 30 through the transmission interface 11. After receiving the data to be processed 51, the controller 30 sends the data to be processed 51 to the writing module 31 and the comparison module 33 at the same time. After receiving the data to be processed 51, the writing module 31 immediately finds the first storage area 22 that can store data information according to the address mapping table 41 recorded in the current flash translation layer 40 of the memory 10, and writes the data to be processed 51 into the first storage area 22 to form the stored data 52 in the storage unit 21. After writing is completed, the writing module 31 sends a signal of writing completion to the controller 30, and then continues to perform the above-mentioned writing operation on the next data to be processed 51 information received.

[0061] After the controller 30 receives the write completion signal, it controls the comparison module 33 to start the comparison operation. Then, it controls the reading module 32 to read the first storage area 22 and form the data to be verified 53, and then sends the data to be verified 53 to the comparison module 33. After receiving the data to be verified 53, the comparison module 33 compares the data to be verified 53 with the previously received data to be processed 51.

[0062] If the comparison result is consistent, it means that the data information stored in the first storage area 22 is correct and reliable. At this time, the comparison module 33 discards the compared data to be processed 51 and the data to be verified 53, and continues to wait for the next comparison operation step.

[0063] If the comparison result is inconsistent, it means that the data information stored in the first storage area 22 is incorrect, and the first storage area 22 may have been damaged. Therefore, the comparison module 33 sends a comparison inconsistency signal to the controller 30, and resends the data to be processed 51 to the write module 31, and also sends the physical address of the first storage area 22 to the controller 30 so that it is recorded in the temporary block address table 43.

[0064] Then the controller 30 drives the writing module 31 to rewrite the re-received data to be processed 51, and writes it into the second storage area 23 where data can be stored, and at the same time updates the physical access address of the data to be processed 51 in the address mapping table 41, so that its logical access address corresponds to the physical access address of the second storage area 23, so that the subsequent access of the external host system to the data to be processed 51 can be directed to the second storage area 23. It can be understood that the writing operation of the writing module 31 to the second storage area 23 also needs to perform the above-mentioned comparison operation process, so as to ensure that the data information stored in the second storage area 23 is correct and reliable.

[0065] When the controller 30 has processed all pending data 51 sent by the external host system and there are no other read and write tasks to be performed within a certain period of time, the controller 30 can perform a determination operation on the first storage area 22 in the temporary block address table 43 that is suspected to be damaged.

[0066] That is, by repeatedly erasing, writing, reading and comparing the first storage area 22, it is confirmed whether the first storage area 22 is physically damaged. If it is confirmed that the first storage area 22 is not degraded or damaged, the physical address of the first storage area 22 is deleted from the temporary block address table 43 and re-entered into the flash translation layer 40, so that the controller 30 can use the first storage area 22 again. If it is confirmed that the first storage area 22 has been degraded or damaged, the physical address of the first storage area 22 is deleted from the temporary block address table 43 and added to the damaged block address table 42, so that the controller 30 no longer uses the first storage area 22.

[0067] After the above storage processing operation, it can be ensured that the data information written in the storage unit 21 is correct and reliable, and the data information stored in the NAND flash memory is also correct and reliable, avoiding the situation where data information is stored in a damaged storage unit 21, thereby improving the user's reliability and safety in using the NAND flash memory 10.

[0068] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be considered exemplary and non-restrictive in all respects, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present invention.

Claims

1. A method for reliable data storage in NAND flash memory, characterized in that: The method comprises the following steps: Receiving data to be processed (51) sent by the host, writing the data to be processed (51) into a first storage area (22) of a storage unit (21), and forming stored data (52); Reading the stored data (52) in the first storage area (22) and forming data to be verified (53); Compare the data to be verified (53) with the data to be processed (51), and operate the data to be processed (51) according to the comparison result; In the comparison step, if the comparison result of the data information of the data to be verified (53) and the data to be processed (51) is consistent, the operation of the data to be processed (51) is abandoned; If the comparison result of the data information of the data to be verified (53) and the data to be processed (51) is inconsistent, the data to be processed (51) is rewritten into the second storage area (23) in the storage unit (21); When the comparison result is inconsistent, the physical address information of the first storage area (22) is also stored in the temporary block address table (43). When the controller (30) does not perform any read or write operations within a certain period of time, the storage unit (21) recorded in the temporary block address table (43) is judged.

2. The method for reliable data storage in NAND flash memory according to claim 1, characterized in that: In the determination step, the first storage area (22) is first erased, and then random data information is generated and written into the first storage area (22); After writing is completed, the first storage area (22) is re-read to form data to be verified (53); The data to be verified (53) is compared with the generated random data information, and the physical address information of the first storage area (22) is operated according to the comparison result.

3. The method for reliable data storage in NAND flash memory according to claim 2, characterized in that: In the determination step, after a certain number of comparisons, when the number of inconsistencies between the comparison results of the to-be-checked data (53) and the generated random data information reaches a certain threshold, it is determined that the first storage area (22) is damaged, and then the physical address information of the first storage area (22) is added to the damaged block address table (42).

4. The method for reliable data storage in NAND flash memory according to claim 2, characterized in that: In the determination step, after a certain number of comparisons, when the ratio between the number of inconsistencies between the comparison results of the to-be-checked data (53) and the generated random data information and the certain number of inconsistencies reaches a certain threshold, it is determined that the first storage area (22) is damaged, and then the physical address information of the first storage area (22) is added to the damaged block address table (42).

5. A device for reliable data storage, characterized in that: include: A writing module (31) is used to receive the data to be processed (51) sent by the host, write the data to be processed (51) into the first storage area (22) of the storage unit (21), and form stored data (52); A reading module (32) for reading the stored data (52) in the first storage area (22) and forming data to be verified (53); A comparison module (33) is used to compare the data to be verified (53) with the data to be processed (51), and operate the data to be processed (51) according to the comparison result; If the data information comparison result of the data to be verified (53) is consistent with that of the data to be processed (51), the comparison module (33) discards the data to be processed (51); If the data information comparison result of the data to be verified (53) and the data to be processed (51) is inconsistent, the comparison module (33) sends the data to be processed (51) to the writing module (31), and the writing module (31) rewrites the data to be processed (51) into the second storage area (23) in the storage unit (21); The physical address information of the first storage area (22) is also stored in the temporary block address table (43), and when the controller (30) does not perform any read or write operations within a certain period of time, the storage unit (21) recorded in the temporary block address table (43) is judged.

6. The device for reliable data storage according to claim 5, characterized in that: Also includes: A determination module (34) is used to perform a certain number of repeated writing, reading and comparison operations on the first storage area (22), thereby determining whether the first storage area (22) is damaged; wherein the first storage area (22) is first erased, random data information is generated and written into the first storage area (22), and after writing is completed, the first storage area (22) is re-read to form data to be verified (53), and the data to be verified (53) is compared with the generated random data information; If after multiple comparisons, the number of times the comparison results between the data to be verified (53) and the generated random data information are inconsistent reaches a certain threshold, or the ratio between the number of times the comparison results between the data to be verified (53) and the generated random data information are inconsistent and the certain number reaches a certain threshold, it is determined that the first storage area (22) is damaged, and then the physical address information of the first storage area (22) is added to the damaged block address table (42).

7. A storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the method for reliably storing data in a NAND flash memory according to any one of claims 1 to 4 is implemented.

8. A NAND flash memory, characterized in that: include: A flash memory chip (20), wherein the flash memory chip (20) uses one or more storage units (21) of SLC, MLC, TLC, QLC or PLC type for data storage; A transmission interface (11), used to connect the memory (10) to an external host system and transmit data; A controller (30) is electrically connected to the flash memory chip (20) and the transmission interface (11), respectively, and executes the method for reliable data storage in a NAND flash memory according to any one of claims 1 to 4 on the flash memory chip (20).

Citation Information

Patent Citations

  • Data writing method and system and solid state disk

    CN111580757A

  • Data reading and writing method and device, storage equipment and readable storage medium

    CN115904250A

  • Memory control circuit, nonvolatile storage apparatus, and memory control method

    CN1957337A

  • Solid-state memory for verifying write-in state

    CN218631411U

  • Semiconductor memory device

    JP2017142875A