# US 2013/0254514 A1 · Wear-leveling method, storage device, and information system

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

- Number: US 2013/0254514 A1
- Document ID: US20130254514A1
- Status: Published application
- Kind: A1
- Application number: 13/903,774
- Filed: 2013-05-28
- Published: 2013-09-26
- Earliest claimed: 2011-06-24
- Assignees: Tsinghua University; Huawei Technologies Co., Ltd.
- Applicants: Tsinghua University; Huawei Technologies Co., Ltd.
- Inventors: Hongliang Yu; Yuyang Du; Hao Gong
- Web page: https://patentgrep.com/patent/US20130254514A1

## CPC

- G06F 12/0246: {in block erasable memory, e.g. flash memory}
- G06F 2212/7211: Wear leveling
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments of the present invention provide a wear-leveling method, a storage device, and an information system, where a storage region is divided into a plurality of storage sub-regions of the same size. The method includes: recording the accumulated number of write operations of each storage sub-region; and when the accumulated number of write operations of any one storage sub-region of the plurality of storage sub-regions reaches a predetermined remapping rate, mapping a logical address of the storage sub-region to a remapping physical address. With the wear-leveling method, the storage device, and the information system in the embodiments of the present invention, a logical address of a local data block on which too many write operations are performed may be evenly mapped to an overall physical storage region, thereby avoiding that local data is too hot and prolonging a service life of a storage medium.

## Claims

### Claim 1

A wear-leveling method, wherein a storage region is divided into a plurality of storage sub-regions of same size, each storage sub-region is divided into a plurality of storage blocks of same size, each storage block corresponds to one logical address and one physical address, and there is a unique mapping between the logical address and the physical address; and
the method comprises:
recording the accumulated number of write operations of each storage sub-region; and
when the accumulated number of write operations of anyone storage sub-region of the plurality of storage sub-regions reaches a predetermined remapping rate, mapping a logical address of the storage sub-region to a remapping physical address.

### Claim 2 (depends on 1)

The method according to claim 1, wherein mapping the logical address of the storage sub-region to the remapping physical address comprises:
generating a remapping key for the storage sub-region; and
performing an XOR operation on the logical address of the storage sub-region and the remapping key to obtain a remapping physical address of the storage sub-region, thereby implementing mapping of the logical address of the storage sub-region to the remapping physical address.

### Claim 3 (depends on 2)

The method according to claim 2, wherein a logical address of a storage block in the storage sub-region comprises a storage sub-region key and a storage block key, the storage sub-region key is used to identify the storage sub-region, and the storage block key is used to identify the storage block in the storage sub-region;
generating a remapping key for the storage sub-region comprises:
generating a remapping key for the storage sub-region, wherein the number of bits of the remapping key is the same as the number of bits of the logical address of the storage block in the storage sub-region; and
performing an XOR operation on the logical address of the storage sub-region and the remapping key to obtain a remapping physical address of the storage sub-region comprises:
performing an XOR operation on a logical address of each storage block in the storage sub-region and the remapping key to obtain a remapping physical address of each storage block, thereby implementing mapping of the logical address of the storage sub-region to the remapping physical address.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the logical address of the storage block in the storage sub-region is represented by a binary number string MA whose length is Log2N, consecutive Log2(N/n) bits in the binary number string MA are a storage sub-region key, and consecutive Log2n bits in the binary number string MA are a storage block key, wherein N is the total number of storage blocks in the storage region, and n is the number of storage blocks in each storage sub-region;
the generating a remapping key for the storage sub-region comprises:
generating a remapping key for the storage sub-region, wherein the length of the remapping key is Log2N; and
the performing an XOR operation on a logical address of each storage block in the storage sub-region and the remapping key to obtain a remapping physical address of each storage block comprises:
performing an XOR operation on a logical address MA of each storage block in the storage sub-region and the remapping key (Key) to obtain a remapping physical address RMA of each storage block, that is, RMA=MA XOR Key, wherein XOR represents the XOR operation.

### Claim 5 (depends on 1)

The method according to claim 1, wherein recording the accumulated number of write operations of each storage sub-region comprises:
determining, according to an address of a storage block that corresponds to each write operation, a storage sub-region to which the storage block belongs, and recording the accumulated number of write operations of the storage sub-region.

### Claim 6 (depends on 1)

The method according to claim 1, wherein after mapping the logical address of the storage sub-region to the remapping physical address, the method further comprises:
returning the accumulated number of write operations of the storage sub-region to zero, wherein the storage sub-region enters a next remapping round.

### Claim 7 (depends on 6)

The method according to claim 6, further comprising:
after the storage sub-region enters the next remapping round, generating a new remapping key of the current remapping round for the storage sub-region, and when the new remapping key is the same as a remapping key of a previous remapping round, performing an XOR operation on the logical address of the storage sub-region and the remapping key to obtain a remapping physical address of the storage sub-region in the current remapping round.

### Claim 8 (depends on 6)

The method according to claim 6, further comprising:
after the storage sub-region enters the next remapping round, generating a new remapping key for the storage sub-region;
when the new remapping key is different from a remapping key of a previous remapping round, determining whether a remapping physical address of the storage sub-region in the current remapping round is the same as a remapping physical address of a partner storage sub-region of the storage sub-region;
if the two are the same, updating a remapping key of the partner storage sub-region according to the remapping key of the storage sub-region to obtain an updated remapping key of the partner storage sub-region; and
determining the remapping physical address of the partner storage sub-region according to the updated remapping key of the partner storage sub-region.

### Claim 9 (depends on 1)

The method according to claim 1, wherein after performing address remapping on the storage sub-region, the method further comprises:
determining a logical address of a storage sub-region to which an access operation address belongs; and
translating the logical address of the storage sub-region into a physical block address.

### Claim 10 (depends on 9)

The method according to claim 9, wherein translating the logical address of the storage sub-region into the physical block address comprises:
determining a physical address to which the logical address of the storage sub-region is mapped in a previous mapping round;
determining a physical address to which the logical address of the storage sub-region is mapped in a current remapping round; and
when address remapping of the storage sub-region or a partner storage sub-region of the storage sub-region is completed in the current remapping round, determining that the physical block address that is obtained after the translation is the physical address to which the logical address of the storage sub-region is mapped in the current remapping round; otherwise, determining that the physical block address that is obtained after the translation is the physical address to which the logical address of the storage sub-region is mapped in the previous remapping round.

### Claim 11

A storage device, comprising:
a storage region, wherein the storage region comprises a plurality of storage sub-regions of the same size, each storage sub-region comprises a plurality of storage blocks of the same size, each storage block corresponds to one logical address and one physical address, and there is a unique mapping between the logical address and the physical address;
a recording unit, configured to record the accumulated number of write operations of each storage sub-region; and
a remapping unit, configured to, when the accumulated number of write operations of any one storage sub-region of the plurality of storage sub-regions reaches a predetermined remapping rate, map a logical address of the storage sub-region to a remapping physical address.

### Claim 12 (depends on 11)

The storage device according to claim 11, wherein the remapping unit comprises:
a generating unit, configured to generate a remapping key for the storage sub-region; and
an operating unit, configured to perform an XOR operation on the logical address of the storage sub-region and the remapping key to obtain a remapping physical address of the storage sub-region, thereby implementing mapping of the logical address of the storage sub-region to the remapping physical address.

### Claim 13 (depends on 12)

The storage device according to claim 12, wherein a logical address of a storage block in the storage sub-region comprises a storage sub-region key and a storage block key, the storage sub-region key is used to identify the storage sub-region, and the storage block key is used to identify the storage block in the storage sub-region;
the generating unit comprises:
a first generating sub-unit, configured to generate a remapping key for the storage sub-region, wherein the number of bits of the remapping key is the same as the number of bits of the logical address of the storage block in the storage sub-region; and
the operating unit comprises:
an operating sub-unit, configured to perform an XOR operation on a logical address of each storage block in the storage sub-region and the remapping key to obtain a remapping physical address of each storage block, thereby implementing mapping of the logical address of the storage sub-region to the remapping physical address.

### Claim 14 (depends on 13)

The storage device according to claim 13, wherein the logical address of the storage block in the storage sub-region is represented by a binary number string MA whose length is Log2N, consecutive Log2(N/n) bits in the binary number string MA are a storage sub-region key, and consecutive Log2n bits in the binary number string MA are a storage block key, wherein N is the total number of storage blocks in the storage region, and n is the number of storage blocks in each storage sub-region;
the first generating sub-unit is specifically configured to generate a remapping key for the storage sub-region, wherein the length of the remapping key is Log2N; and
the operating sub-unit is specifically configured to perform an XOR operation on a logical address MA of each storage block in the storage sub-region and the remapping key (Key) to obtain a remapping physical address RMA of each storage block, that is, RMA=MA XOR Key, wherein XOR represents the XOR operation.

### Claim 15 (depends on 11)

The storage device according to claim 11, wherein the recording unit comprises:
a determining unit, configured to determine, according to an address of a storage block that corresponds to each write operation, a storage sub-region to which the storage block belongs; and
a counting unit, configured to record the accumulated number of write operations of the storage sub-region.

### Claim 16 (depends on 11)

The storage device according to claim 11, further comprising:
a return-to-zero unit, configured to return the accumulated number of write operations of the storage sub-region to zero, and instruct the storage sub-region to enter a next remapping round.

### Claim 17 (depends on 16)

The storage device according to claim 16, wherein
the remapping unit is further configured to, when the storage sub-region enters the next remapping round, generate a new remapping key of the current remapping round for the storage sub-region, and when the new remapping key is the same as a remapping key of a previous remapping round, perform an XOR operation on the logical address of the storage sub-region and the remapping key to obtain a remapping physical address of the storage sub-region in the current remapping round.

### Claim 18 (depends on 16)

The storage device according to claim 16, wherein the remapping unit is further configured to, when the storage sub-region enters the next remapping round, generate anew remapping key for the storage sub-region, and when the new remapping key is different from a remapping key of a previous remapping round, determine whether a remapping physical address of the storage sub-region in the current remapping round is the same as a remapping physical address of a partner storage sub-region of the storage sub-region; and if the two are the same, update a remapping key of the partner storage sub-region according to the remapping key of the storage sub-region to obtain an updated remapping key of the partner storage region, and determine the remapping physical address of the partner storage sub-region according to the updated remapping key of the partner storage sub-region.

### Claim 19 (depends on 11)

The storage device according to claim 11, further comprising:
a logical address determining unit, configured to determine a logical address of a storage sub-region to which an access operation address belongs; and
a translating unit, configured to translate the logical address of the storage sub-region into a physical block address.

### Claim 20 (depends on 19)

The storage device according to claim 19, wherein the translating unit comprises:
a first physical address determining unit, configured to determine a physical address to which the logical address of the storage sub-region is mapped in a previous remapping round;
a second physical address determining unit, configured to determine a physical address to which the logical address of the storage sub-region is mapped in a current remapping round; and
a translating sub-unit, configured to, when address remapping of the storage sub-region or a partner storage sub-region of the storage sub-region is completed in the current remapping round, determine that the physical block address that is obtained after the translation is the physical address to which the logical address of the storage sub-region is mapped in the current remapping round; otherwise, determine that the physical block address that is obtained after the translation is the physical address to which the logical address of the storage sub-region is mapped in the previous remapping round.

### Claim 21 (depends on 11)

An information system, comprising a central processor and at least one storage device according to claim 11, wherein
the central processor is configured to control the storage device, and the storage device is configured to store or access information according to an instruction of the central processor.
