# US 2017/0285956 A1 · Storage Space Management Method and Apparatus

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

- Number: US 2017/0285956 A1
- Document ID: US20170285956A1
- Status: Published application
- Kind: A1
- Application number: 15/625,385
- Filed: 2017-06-16
- Published: 2017-10-05
- Earliest claimed: 2014-12-16
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Changliang Xue; Wenlong Huang; Guanyu Zhu; Jun Xu
- Web page: https://patentgrep.com/patent/US20170285956A1

## CPC

- G06F 3/064: {Management of blocks}
- G06F 3/0616: {in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]}
- G06F 3/0679: {Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]}
- G06F 16/00: Information retrieval; Database structures therefor; File system structures therefor
- G06F 16/583: using metadata automatically derived from the content
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

A storage space management method and apparatus, where the method and apparatus are applied to a non-volatile memory (NVM). In a feature set that includes M image features of M idle blocks in storage space of the NVM, an idle block whose image feature is highly similar to an image feature of data to be written into the NVM is determined such that the data is written into the idle block. In this way, wear and energy consumption problems are considered during storage space allocation, and a write operation of an idle block in storage space of an NVM can consume less energy, thereby extending a life span of the NVM and reducing write operation energy consumption.

## Claims

### Claim 1

A storage space management method, comprising:
obtaining an image feature of data to be written into a non-volatile memory (NVM);
identifying a first image feature that is most similar to the image feature of the data in a feature set of storage space of the NVM, wherein M image features obtained according to M idle blocks in the storage space of the NVM are comprised in the feature set, wherein a size of each idle block in the storage space is equivalent to a size of the data, wherein the M idle blocks comprise an invalid data block and an area in which no data is written in the storage space of the NVM, and wherein M is a natural number; and
writing the data into an idle block having the first image feature.

### Claim 2 (depends on 1)

The method according to claim 1, further comprising calculating an image feature of each of the M idle blocks in the storage space of the NVM.

### Claim 3 (depends on 2)

The method according to claim 2, wherein calculating the image feature of each of the M idle blocks in the storage space of the NVM comprises:
traversing an idle block i in the storage space of the NVM using a preset window;
obtaining a local binary pattern (LBP) eigenvector of the idle block i (Xi), wherein the Xi=(LBPi1, LBPi2, . . . , LBPiN), wherein N is determined according to a size of the idle block i and a size of the preset window, wherein LBPin is an LBP operator corresponding to each preset window in the idle block i, wherein the
LBP
in
=
∑
j
=
0
J
-
1

s
j

2
j
,
wherein J indicates a total quantity of bits obtained after the LBP operator is converted into binary, and wherein the s=0 or 1; and
obtaining an image feature of the idle block i (Ti) according to the Xi and a ratio of 0 to 1 in the idle block i (Pi), wherein the Ti=αXi+βPi, wherein α and β indicate weights, and wherein α+β=1.

### Claim 4 (depends on 3)

The method according to claim 3, wherein obtaining the image feature of the data to be written into the NVM comprises:
traversing the data using the preset window;
obtaining an LBP eigenvector of the data (X), wherein the X=(LBP1, LBP2, . . . , LBPN), and wherein the and
LBP
n
=
∑
j
=
0
J
-
1

s
j

2
j
;
obtaining an image feature of the data (T) according to the X and a ratio of 0 to 1 in the data (P), wherein the T=αX+βP.

### Claim 5 (depends on 4)

The method according to claim 4, wherein the feature set comprises a plurality of B+ trees, wherein nodes of the plurality of B+ trees comprise the M image features of the M idle blocks in the storage space of the NVM, and wherein identifying the first image feature that is most similar to the image feature of the data comprises:
identifying a first B+ tree according to an Euclidean distance from the image feature of the data to a root node of each B+ tree in the plurality of B+ trees, wherein the first B+ tree is a B+ tree with a shortest Euclidean distance in Euclidean distances from the root node of each of all the B+ trees to the image feature of the data;
calculating an Euclidean distance between the image feature of the data and each node in the first B+ tree; and
identifying that a first image feature with a shortest Euclidean distance in the Euclidean distances between the image feature of the data and all nodes in the first B+ tree is the first image feature that is most similar to the image feature of the data.

### Claim 6 (depends on 1)

The method according to claim 1, further comprising marking a status of the idle block having the first image feature as ‘used’.

### Claim 7 (depends on 1)

The method according to claim 1, further comprising:
obtaining an image feature of a recycled invalid data block when the invalid data block in the storage space of the NVM is recycled, wherein the invalid data block is a data block in which stored data is in an invalid state in the storage space of the NVM; and
updating the feature set of the storage space of the NVM according to the image feature of the recycled invalid data block.

### Claim 8

A storage space management apparatus, comprising:
a receiver configured to receive data to be written into a non-volatile memory (NVM);
a processor coupled to the receiver and configured to:
obtain an image feature of the data to be written into the NVM;
identify a first image feature that is most similar to the image feature of the data in a feature set of storage space of the NVM, wherein M image features obtained according to M idle blocks in the storage space of the NVM are comprised in the feature set, wherein a size of each idle block in the storage space is equivalent to a size of the data, wherein the M idle blocks comprise an invalid data block and an area in which no data is written in the storage space of the NVM, and wherein M is a natural number; and
write the data into an idle block having the first image feature.

### Claim 9 (depends on 8)

The apparatus according to claim 8, wherein the processor is further configured to calculate an image feature of each of the M idle blocks in the storage space of the NVM.

### Claim 10 (depends on 9)

The apparatus according to claim 9, wherein the processor is further configured to:
traverse an idle block i in the storage space of the NVM using a preset window;
obtain a local binary pattern (LBP) eigenvector of the idle block i (Xi), wherein the Xi=(LBPi1, LBPi2, . . . , LBPiN), wherein N is determined according to a size of the idle block i and a size of the preset window, wherein the LBPin is an LBP operator corresponding to each preset window in the idle block i, wherein the
LBP
in
=
∑
j
=
0
J
-
1

s
j

2
j
,
wherein J indicates a total quantity of bits obtained after the LBP operator is converted into binary, and wherein the sj=0 or 1; and
obtain an image feature of the idle block i (Ti) according to the Xi and a ratio of 0 to 1 in the idle block i (Pi) wherein the Ti=αXi+βPi, wherein α and β indicate weights, and wherein α+β1.

### Claim 11 (depends on 10)

The apparatus according to claim 10, wherein the processor is further configured to:
traverse the data using the preset window;
obtain an LBP eigenvector of the data (X), wherein the X=(LBP1, LBP2, . . . , LBPN), and wherein the
LBP
n
=
∑
j
=
0
J
-
1

s
j

2
j
;
and
obtain an image feature of the data (T) according to the X and a ratio of 0 to 1 in the data (P), wherein the T=αX+βP.

### Claim 12 (depends on 11)

The apparatus according to claim 11, wherein the feature set comprises a plurality of B+ trees, wherein nodes of the plurality of B+ trees comprise the M image features of the M idle blocks in the storage space of the NVM, and wherein the processor is further configured to:
identify a first B+ tree according to an Euclidean distance from the image feature of the data to a root node of each B+ tree in the plurality of B+ trees, wherein the first B+ tree is a B+ tree with a shortest Euclidean distance in Euclidean distances from the root node of each of all the B+ trees to the image feature of the data;
calculate an Euclidean distance between the image feature of the data and each node in the first B+ tree; and
identify that a first image feature with a shortest Euclidean distance in the Euclidean distances between the image feature of the data and all nodes in the first B+ tree is the first image feature that is most similar to the image feature of the data.

### Claim 13 (depends on 9)

The apparatus according to claim 9, wherein the processor is further configured to mark a status of the idle block having the first image feature as ‘used’ after the data is written into the idle block having the first image feature.

### Claim 14 (depends on 9)

The apparatus according to claim 9, wherein the processor is further configured to:
obtain an image feature of a recycled invalid data block when the invalid data block in the storage space of the NVM is recycled, wherein the invalid data block is a data block in which stored data is in an invalid state in the storage space of the NVM; and
update the feature set of the storage space of the NVM according to the image feature of the recycled invalid data block.
