IP Library Granted Patent US 10,120,795
Granted Patent B2
US 10,120,795 · App. 15/699,763 · Granted Nov 6, 2018

Wear-leveling nandflash memory reading/writing method

Inventors: Yongyou Yang (Beijing, CN); Wenxuan Chen (Beijing, CN); Qingyun Di (Beijing, CN); Wenxiu Zhang (Beijing, CN); Yuntao Sun (Beijing, CN); Jian Zheng (Beijing, CN)
Assignee: INSTITUTE OF GEOLOGY AND GEOPHYSICS, CHINESE ACADEMY OF SCIENCES
G06F12/0246G06F12/0292G06F12/126G06F2212/7211
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,120,795
App. No.
15/699,763
Granted
Nov 6, 2018
Kind
B2
Abstract

A wear-leveling NandFlash memory reading/writing method can identify a bad block, avoid the bad block, and equalize writing operations to ensure that all the blocks are identical in number of the writing operations so as to guarantee wear-leveling NandFlash memory reading and writing of the entire memory. This method has characteristics of low computational and small RAM cost, is suitable for the application scenario like operating a single file for a long time with an imbedded system with low cost and poor hardware resource, and can provide a complete file system solution.

Claims (35)

1. A method of writing data in a wear-leveling NandFlash memory, a storage space of the NandFlash memory including a storage information area, a file information area, a data area and a swap area, the method comprising:

creating a new file information table in the file information area, and reading all other file information tables to determine a writing starting address of a new file;

determining whether the writing starting address of the new file is in a starting address of a block;

in response to the writing starting address of the new file being in the starting address of the block, erasing the block, and determining a return status of an erasure operation;

in response to an error being returned, indicating that the block is a bad block, finding a replacement block in the swap area to replace the bad block, and updating a bad block registration table in the storage information area;

storing to-be-written data into a data buffer of a memory;

in response to data of one page having been stored sufficiently in the data buffer, writing the data into a block in the data area, and determining a return status of the writing;

in response to an error being returned, indicating that the block where this page is located is a bad block, finding a replacement block in the swap area to replace the bad block, updating the bad block registration table in the storage information area, and copying contents of a current page and its previous page of the bad block into the replacement block;

in response to the pages being successfully written, updating the file information table, which comprises file storage starting and ending addresses, file sizes and file updating time;

repeating steps including the storing to-be-written data through the updating the file information table, until a user ends a writing operation;

determining whether any remaining data exists in the data buffer, in response to any remaining data existing in the data buffer, writing all the data remaining in the buffer into a block in the data area; and

updating the file information table.

2. The method according to claim 1 , further comprising:

deleting information on a to-be-deleted file in the file information table to perform a file deletion operation; and

if there are files stored at a location with a higher logical address than the end address of a deleted file, sequentially copying those files at a location with a lower logical address than the starting address of the last file.

3. The method according to claim 1 , further comprising:

continuing writing at a tail of the file to perform a file addition writing operation;

if there are no other files at a location with a higher logical address than the end address of an additionally written file, directly continuing the writing, and; and

if there are other files at a location with a higher logical address than the end address of the additionally written file, firstly executing a file movement process to move the additionally written file to the tail-most end of a used storage space, and then continuing the writing at the tail of the file.

4. The method according to claim 1 ,

wherein the storage information area is configured to store a bad block registration swap table and is-divided into a plurality of blocks, each of which is used in turn;

wherein the file information area is configured to store information on bad blocks in the file information table and is located in the first several blocks of a physical address of the memory, the file information area being internally divided into a plurality of blocks, each of which is used in turn;

wherein the data area is configured to store data and is located in the middle of the physical address of the memory; and

wherein the swap area is configured to swap a bad block in the data area with a replacement block in the swap area and is located in the last several blocks of the physical address of the memory, the bad block being a block in the data area to which data cannot be written.

5. The method according to claim 4 , wherein information on the bad block is stored in the plurality of blocks in the storage information area, which is used in turn.

6. The method according to claim 1 , further comprising:

reading a file information table in the file information area;

determining a starting address and an ending address of a file storage according to the file information table;

in response to the starting address being an address of a block that has not been previously written to, determining whether a to-be-read block is a bad block;

finding an address of a replacement block of the bad block in response to the to-be-read block being the bad block;

in response to the starting address not being an address of a block that has not been previously written to, reading a page of data once;

determining whether all the files are read according to the file information table;

in response to all the files not being read, determining whether contents of blocks of all the pages are read;

in response to the contents of blocks of all the pages not being read, continuing to perform reading a page of data once with an increased page address by 1; and

in response to the contents of blocks of all the pages being read, continuing to perform determining whether a to-be-read block is a bad block with an increased block address by 1.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 11, 2017
From: YANG, YONGYOU; CHEN, WENXUAN; DI, QINGYUN; ZHANG, WENXIU; SUN, YUNTAO; ZHENG, JIAN
To: INSTITUTE OF GEOLOGY AND GEOPHYSICS, CHINESE ACADEMY OF SCIENCES
Reel/Frame 043547/0221 →
Priority Claims (1)
CN 2016 1 0838881 · Sep 21, 2016 · national
Continuity (1)
Related Publication 20180081797A1 · Mar 22, 2018