# US 9,355,028 B2 · Data-storage device and flash memory control method

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 9,355,028 B2
- Document ID: US9355028B2
- Status: Granted
- Kind: B2
- Application number: 14/851,186
- Filed: 2015-09-11
- Published: 2016-01-07
- Granted: 2016-05-31
- Earliest claimed: 2012-05-30
- Assignees: Silicon Motion, Inc.
- Applicants: Silicon Motion, Inc.
- Inventors: Chang-Kai Cheng
- Web page: https://patentgrep.com/patent/US9355028B2

## CPC

- G06F 12/0246: {in block erasable memory, e.g. flash memory}
- G06F 3/0619: {in relation to data integrity, e.g. data losses, bit errors}
- G06F 3/064: {Management of blocks}
- G06F 3/0679: {Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]}
- G06F 12/1009: using page tables, e.g. page table structures
- G06F 2212/1008: Correctness of operation, e.g. memory ordering
- G06F 2212/152: Virtualized environment, e.g. logically partitioned system
- G06F 2212/2022: Flash memory
- G06F 2212/7201: Logical to physical mapping or translation of blocks or pages
- G06F 2212/7202: Allocation control and policies
- G06F 2212/7207: management of metadata or control data
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A data-storage device having a flash memory allocated to provide data-storage space, a valid page count table, logical-to-physical address mapping information, and an invalid block record. The data-storage device further having a controller, allocating the data-storage space to store data issued from a host, and establishing and maintaining the valid page count table, the logical-to-physical address mapping information, and the invalid block record in the FLASH memory to manage the data-storage space. A FLASH memory control method is also provided.

## Claims

### Claim 1

A data-storage device, comprising:
a FLASH memory, allocated to provide data-storage space, a valid page count table, logical-to-physical address mapping information, and an invalid block record; and
a controller, allocating the data-storage space to store data issued from a host, and establishing and maintaining the valid page count table, the logical-to-physical address mapping information, and the invalid block record in the FLASH memory to manage the data-storage space,
wherein:
the controller updates the logical-to-physical address mapping information after an update of the valid page count table is completed;
the controller maintains the invalid block record based on the valid page count table;
wherein:
every round of updating the valid page count table, the logical-to-physical address mapping information, and the invalid block record is followed by backing up the valid page count table, the logical-to-physical address mapping information, and the invalid block record to the FLASH memory as power-restoration information; and
in power restoration, the controller uses the power-restoration information to update the valid page count table, the logical-to-physical address mapping information, and the invalid block record first and then compares an event record with the logical-to-physical address mapping information to further update the valid page count table and then continuously maintains the valid page count table, the logical-to-physical address mapping information, and the invalid block record.

### Claim 2 (depends on 1)

The data-storage device as claimed in claim 1, wherein the controller further records the event record into the FLASH memory to record memory allocations occurring after a latest complete round of updates of the valid page count table, the logical-to-physical address mapping information, and the invalid block record.

### Claim 3 (depends on 2)

The data-storage device as claimed in claim 2, wherein the controller updates the valid page count table based on a comparison between the event record and the logical-to-physical address mapping information.

### Claim 4 (depends on 3)

The data-storage device as claimed in claim 3, wherein the controller updates the invalid block record after an update of the logical-to-physical address mapping information is completed.

### Claim 5 (depends on 4)

The data-storage device as claimed in claim 4, wherein:
the controller updates a first serial number after each update of the valid page count table to count the updates of the valid page count table and updates a second serial number after each update of the invalid block record to count the updates of the invalid block record; and
the controller detects unexpected interruptions according to a comparison between the first and second serial numbers.

### Claim 6 (depends on 5)

The data-storage device as claimed in claim 5, wherein:
when it is determined that during a power-restoration process the first serial number leads the second serial number, the controller determines that the valid page count table has been ready and then updates the logical-to-physical address mapping information based on the event record and then continuously maintains the valid page count table, the logical-to-physical address mapping information, and the invalid block record.

### Claim 7

A FLASH memory control method, comprising:
allocating data-storage space of FLASH memory to store data issued by a host;
establishing and maintaining a valid page count table, logical-to-physical address mapping information, and a invalid block record in the FLASH memory, wherein the logical-to-physical address mapping information is updated after an update of the valid page count table is completed, and the invalid block record is maintained based on the valid page count table; and
managing the data-storage space by the valid page count table, the logical-to-physical address mapping information, and the invalid block record;
after every round of updating the valid page count table, the logical-to-physical address mapping information, and the invalid block record, backing up the valid page count table, the logical-to-physical address mapping information, and the invalid block record into the FLASH memory as power-restoration information; and
in power restoration, using the power-restoration information to update the valid page count table, the logical-to-physical address mapping information, and the invalid block record first and then comparing an event record with the logical-to-physical address mapping information to further update the valid page count table and then continuously maintaining the valid page count table, the logical-to-physical address mapping information, and the invalid block record.

### Claim 8 (depends on 7)

The FLASH memory control method as claimed in claim 7, further recording the event record into the FLASH memory to record memory allocations occurring after a latest complete round of updates of the valid page count table, the logical-to-physical address mapping information, and the invalid block record.

### Claim 9 (depends on 8)

The FLASH memory control method as claimed in claim 8, further comparing the event record with the logical-to-physical address mapping information to update the valid page count table accordingly.

### Claim 10 (depends on 9)

The FLASH memory control method as claimed in claim 9, wherein the invalid block record is updated after an update of the logical-to-physical address mapping information is completed.

### Claim 11 (depends on 10)

The FLASH memory control method as claimed in claim 10, further comprising:
updating a first serial number after each update of the valid page count table to count the updates of the valid page count table, and updating a second serial number after each update of the invalid block record to count the updates of the invalid block record; and
detecting unexpected interruptions according to a comparison between the first and second serial numbers.

### Claim 12 (depends on 11)

The FLASH memory control method as claimed in claim 11, further comprising:
when it is determined that during a power-restoration process the first serial number leads the second serial number, determining that the valid page count table has been ready and then updating the logical-to-physical address mapping information based on the event record and then continuously maintaining the valid page count table, the logical-to-physical address mapping information, and the invalid block record.
