# US 2022/0342750 A1 · Method and system for facilitating efficient data compression based on error correction code and reorganization of data placement

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

- Number: US 2022/0342750 A1
- Document ID: US20220342750A1
- Status: Published application
- Kind: A1
- Application number: 17/236,526
- Filed: 2021-04-21
- Published: 2022-10-27
- Earliest claimed: 2021-04-21
- Assignees: Alibaba Singapore Holding Private Limited
- Applicants: Alibaba Singapore Holding Private Limited
- Inventors: Shu Li
- Web page: https://patentgrep.com/patent/US20220342750A1

## CPC

- G06F 11/1068: {in sector programmable memories, e.g. flash disk (G06F11/1072 takes precedence)}
- H03M 13/6393: {Rate compatible low-density parity check [LDPC] codes}
- G06F 11/1012: {using codes or arrangements adapted for a specific type of error (G06F11/1048 takes precedence)}
- G06F 12/0246: {in block erasable memory, e.g. flash memory}
- G06F 12/10: Address translation
- H03M 13/116: {Quasi-cyclic LDPC [QC-LDPC] codes, i.e. the parity-check matrix being composed of permutation or circulant sub-matrices}
- H03M 13/616: {Matrix operations, especially for generator matrices or check matrices, e.g. column or row permutations}
- H03M 13/618: {Shortening and extension of codes}
- H03M 13/6312: {Error control coding in combination with data compression}
- H03M 13/6318: {using variable length codes}
- G06F 2212/7209: Validity control, e.g. using flags, time stamps or sequence numbers
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H03M: CODING; DECODING; CODE CONVERSION IN GENERAL (using fluidic means F15C4/00; optical analogue/digital converters G02F7/00; coding, decoding or code conversion, specially adapted for particular applications, see the relevant subclasses, e.g. G01D, G01R, G06F, G06T, G09G, G10L, G11B, G11C, H04B, H04L, H04M, H04N; ciphering or deciphering for cryptography or other purposes involving the need for secrecy G09C)

## Abstract

One embodiment provides a system which facilitates data management. During operation, the system receives, by a storage device, a plurality of data blocks. The system compresses the data blocks to obtain compressed data blocks, and performs error correction code (ECC)-encoding on the compressed data blocks to obtain ECC-encoded data blocks. The system stores the ECC-encoded data blocks in a buffer prior to writing the ECC-encoded data blocks in a non-volatile memory of the storage device, and reorganizes an order of the ECC-encoded data blocks in the buffer to match a size of a physical page of the non-volatile memory. Responsive to a first set of the reorganized ECC-encoded data blocks filling a first physical page, the system writes the first set of the reorganized ECC-encoded data blocks to the first physical page.

## Claims

### Claim 1

A computer-implemented method, comprising:
receiving, by a storage device, a plurality of data blocks;
compressing the data blocks to obtain compressed data blocks;
performing error correction code (ECC)-encoding on the compressed data blocks to obtain ECC-encoded data blocks, wherein performing ECC-encoding on a respective compressed data block to obtain a respective ECC-encoded data block comprises:
reducing a size of a user portion which corresponds to a full parity check matrix to obtain a shortened user portion which corresponds to a size of the respective compressed data block;
performing ECC-encoding on the shortened user portion appended by zeros to obtain parity bits; and
puncturing the parity bits to obtain a punctured parity, wherein the respective obtained ECC-encoded data block comprises the shortened user portion and the punctured parity;
storing the ECC-encoded data blocks in a buffer prior to writing the ECC-encoded data blocks in a non-volatile memory of the storage device;
reorganizing an order of the ECC-encoded data blocks in the buffer to match a size of a physical page of the non-volatile memory;
responsive to a first set of the reorganized ECC-encoded data blocks filling a first physical page, writing the first set of the reorganized ECC-encoded data blocks to the first physical page;
receiving a request to read a data block in the first physical page from the non-volatile memory, wherein the requested data block comprises the respective obtained ECC-encoded data block; and
performing ECC-decoding on the requested data block,
wherein a parity check matrix for the requested data block comprises a plurality of circulants,
wherein a respective circulant comprises an all-zero square matrix or a non-zero square matrix,
wherein a user portion of the parity check matrix corresponds to the shortened user portion of the requested data block appended with user-associated zeros,
wherein a parity portion of the parity check matrix corresponds to the punctured parity of the requested data block appended with parity-associated zeros,
wherein the user portion of the parity check matrix comprises one or more of:
a first portion which includes full circulants and corresponds to the shortened user portion;
a second portion which includes partial circulants and corresponds to both the shortened user portion and a first part of the appended user-associated zeros; and
a third portion which includes full circulants and corresponds to a second part of the appended user-associated zeros; and
wherein the parity portion of the parity check matrix comprises one or more of:
a fourth portion which includes full circulants and corresponds to the punctured parity; and
a fifth portion which includes full circulants and corresponds to the appended parity-associated zeros.

### Claim 2 (depends on 1)

The method of claim 1, wherein the plurality of data blocks are associated with logical block addresses (LBAs), and wherein the method further comprises:
storing, in a data structure, a mapping between:
a logical block address (LBA) for a respective ECC-encoded data block;
a physical page address in the first physical page at which the respective ECC-encoded data block is written; and
an index which indicates a location or offset for the respective ECC-encoded data block in the first physical page.

### Claim 3 (depends on 2)

The method of claim 2, wherein the first set of the reorganized ECC-encoded data blocks written to the first physical page comprises:
a header prepended to a respective ECC-encoded data block; and
a tail appended to the respective ECC-encoded data block,
wherein the header and the tail comprise a repeated pattern which is based on the index for the respective ECC-encoded data block.

### Claim 4

(canceled)

### Claim 5 (depends on 1)

The method of claim 1, wherein the respective obtained ECC-encoded data block is written to the non-volatile memory as part of the first physical page, and wherein the method further comprises:
determining, based on a logical block address (LBA) associated with the requested data block, a physical page address (PPA) at which the requested data block is stored by searching a data structure which stores a mapping between the LBA, the PPA, and an index for the requested data block;
retrieving the requested data block from the determined PPA based on the index to obtain the requested data block;
and
subsequent to performing the ECC-decoding on the requested data block, returning the ECC-decoded data block to a requesting application.

### Claim 6

(canceled)

### Claim 7 (depends on 1)

The method of claim 1, wherein performing the ECC-decoding is based on:
the first portion;
the second portion and further based on a maximal confidence of the partial circulants which correspond to the second part of the appended user-associated zeroes;
the fourth portion; and
the fifth portion and further based on a minimal confidence of the full circulants which correspond to the appended parity-associated zeros.

### Claim 8 (depends on 7)

The method of claim 7, wherein performing the ECC-decoding is further based on bypassing the third portion based on a maximal confidence of all-zero circulants comprising the third portion.

### Claim 9

A computer system, comprising:
a processor; and
a memory coupled to the processor and storing instructions which, when executed by the processor, cause the processor to perform a method, the method comprising:
receiving, by a storage device, a plurality of data blocks;
compressing the data blocks to obtain compressed data blocks;
performing error correction code (ECC)-encoding on the compressed data blocks to obtain ECC-encoded data blocks, wherein performing ECC-encoding on a respective compressed data block to obtain a respective ECC-encoded data block comprises:
reducing a size of a user portion which corresponds to a full parity check matrix to obtain a shortened user portion which corresponds to a size of the respective compressed data block;
performing ECC-encoding on the shortened user portion appended by zeros to obtain parity bits; and
puncturing the parity bits to obtain a punctured parity, wherein the respective obtained ECC-encoded data block comprises the shortened user portion and the punctured parity;
storing the ECC-encoded data blocks in a buffer prior to writing the ECC-encoded data blocks in a non-volatile memory of the storage device;
reorganizing an order of the ECC-encoded data blocks in the buffer to match a size of a physical page of the non-volatile memory;
responsive to a first set of the reorganized ECC-encoded data blocks filling a first physical page, writing the first set of the reorganized ECC-encoded data blocks to the first physical page;
receiving a request to read a data block in the first physical page from the non-volatile memory, wherein the requested data block comprises the respective obtained ECC-encoded data block; and
performing ECC-decoding on the requested data block,
wherein a parity check matrix for the requested data block comprises a plurality of circulants,
wherein a respective circulant comprises an all-zero square matrix or a non-zero square matrix,
wherein a user portion of the parity check matrix corresponds to the shortened user portion of the requested data block appended with user-associated zeros,
wherein a parity portion of the parity check matrix corresponds to the punctured parity of the requested data block appended with parity-associated zeros,
wherein the user portion of the parity check matrix comprises one or more of:
a first portion which includes full circulants and corresponds to the shortened user portion;
a second portion which includes partial circulants and corresponds to both the shortened user portion and a first part of the appended user-associated zeros; and
a third portion which includes full circulants and corresponds to a second part of the appended user-associated zeros; and
wherein the parity portion of the parity check matrix comprises one or more of:
a fourth portion which includes full circulants and corresponds to the punctured parity; and
a fifth portion which includes full circulants and corresponds to the appended parity-associated zeros.

### Claim 10 (depends on 9)

The computer system of claim 9, wherein the plurality of data blocks are associated with logical block addresses (LBAs), and wherein the method further comprises:
storing, in a data structure, a mapping between:
a logical block address (LBA) for a respective ECC-encoded data block;
a physical page address in the first physical page at which the respective ECC-encoded data block is written; and
an index which indicates a location or offset for the respective ECC-encoded data block in the first physical page.

### Claim 11 (depends on 10)

The computer system of claim 10, wherein the first set of the reorganized ECC-encoded data blocks written to the first physical page comprises:
a header prepended to a respective ECC-encoded data block; and
a tail appended to the respective ECC-encoded data block,
wherein the header and the tail comprise a repeated pattern which is based on the index for the respective ECC-encoded data block.

### Claim 12

(canceled)

### Claim 13 (depends on 9)

The computer system of claim 9, wherein the respective obtained ECC-encoded data block is written to the non-volatile memory as part of the first physical page, and wherein the method further comprises:
determining, based on a logical block address (LBA) associated with the requested data block, a physical page address (PPA) at which the requested data block is stored by searching a data structure which stores a mapping between the LBA, the PPA, and an index for the requested data block;
retrieving the requested data block from the determined PPA based on the index to obtain the requested data block;
and
subsequent to performing the ECC-decoding on the requested data block, returning the ECC-decoded data block to a requesting application.

### Claim 14

(canceled)

### Claim 15 (depends on 9)

The computer system of claim 9, wherein performing the ECC-decoding is based on:
the first portion;
the second portion and further based on a maximal confidence of the partial circulants which correspond to the second part of the appended user-associated zeroes;
the fourth portion; and
the fifth portion and further based on a minimal confidence of the full circulants which correspond to the appended parity-associated zeros.

### Claim 16 (depends on 15)

The computer system of claim 15, wherein performing the ECC-decoding is further based on bypassing the third portion based on a maximal confidence of all-zero circulants comprising the third portion.

### Claim 17

A non-transitory computer-readable storage medium storing instructions that when executed by a computer cause the computer to perform a method, the method comprising:
receiving, by a storage device, a plurality of data blocks;
compressing the data blocks to obtain compressed data blocks;
performing error correction code (ECC)-encoding on the compressed data blocks to obtain ECC-encoded data blocks, wherein performing ECC-encoding on a respective compressed data block to obtain a respective ECC-encoded data block comprises:
reducing a size of a user portion which corresponds to a full parity check matrix to obtain a shortened user portion which corresponds to a size of the respective compressed data block;
performing ECC-encoding on the shortened user portion appended by zeros to obtain parity bits; and
puncturing the parity bits to obtain a punctured parity, wherein the respective obtained ECC-encoded data block comprises the shortened user portion and the punctured parity;
storing the ECC-encoded data blocks in a buffer prior to writing the ECC-encoded data blocks in a non-volatile memory of the storage device;
reorganizing an order of the ECC-encoded data blocks in the buffer to match a size of a physical page of the non-volatile memory;
responsive to a first set of the reorganized ECC-encoded data blocks filling a first physical page, writing the first set of the reorganized ECC-encoded data blocks to the first physical page;
receiving a request to read a data block in the first physical page from the non-volatile memory, wherein the requested data block comprises the respective obtained ECC-encoded data block; and
performing ECC-decoding on the requested data block,
wherein a parity check matrix for the requested data block comprises a plurality of circulants,
wherein a respective circulant comprises an all-zero square matrix or a non-zero square matrix,
wherein a user portion of the parity check matrix corresponds to the shortened user portion of the requested data block appended with user-associated zeros,
wherein a parity portion of the parity check matrix corresponds to the punctured parity of the requested data block appended with parity-associated zeros,
wherein the user portion of the parity check matrix comprises one or more of:
a first portion which includes full circulants and corresponds to the shortened user portion;
a second portion which includes partial circulants and corresponds to both the shortened user portion and a first part of the appended user-associated zeros; and
a third portion which includes full circulants and corresponds to a second part of the appended user-associated zeros; and
wherein the parity portion of the parity check matrix comprises one or more of:
a fourth portion which includes full circulants and corresponds to the punctured parity; and
a fifth portion which includes full circulants and corresponds to the appended parity-associated zeros.

### Claim 18

(canceled)

### Claim 19 (depends on 17)

The storage medium of claim 17, wherein the respective obtained ECC-encoded data block is written to the non-volatile memory as part of the first physical page, and wherein the method further comprises:
determining, based on a logical block address (LBA) associated with the requested data block, a physical page address (PPA) at which the requested data block is stored by searching a data structure which stores a mapping between the LBA, the PPA, and an index for the requested data block;
retrieving the requested data block from the determined PPA based on the index to obtain the requested data block;
and
subsequent to performing the ECC-decoding on the requested data block, returning the ECC-decoded data block to a requesting application.

### Claim 20 (depends on 17)

The storage medium of claim 17,
wherein performing the ECC-decoding is based on:
the first portion;
the second portion and further based on a maximal confidence of the partial circulants which correspond to the second part of the appended user-associated zeroes;
the fourth portion; and
the fifth portion and further based on a minimal confidence of the full circulants which correspond to the appended parity-associated zeros; and
wherein performing the ECC-decoding is further based on bypassing the third portion based on a maximal confidence of all-zero circulants comprising the third portion.
