# US 2024/0004839 A1 · Data compression 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 2024/0004839 A1
- Document ID: US20240004839A1
- Status: Published application
- Kind: A1
- Application number: 18/470,210
- Filed: 2023-09-19
- Published: 2024-01-04
- Earliest claimed: 2021-03-30
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Jinkang WU; Jianhong TU; Jianqiang SHEN; Shaohui QUAN
- Web page: https://patentgrep.com/patent/US20240004839A1

## CPC

- G06F 16/1744: {using compression, e.g. sparse files}
- H03M 7/3064: {Segmenting}
- G06F 3/0608: {Saving storage space on storage systems}
- G06F 3/0641: {De-duplication techniques}
- H03M 7/3071: {Prediction}
- H03M 7/6011: {Encoder aspects}
- H03M 7/6029: {Pipelining}
- H03M 7/6064: {Selection of Compressor}
- 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

Embodiments of this disclosure provide for a data compression method and a related data compression apparatus. In the method, to-be-compressed data and a length limit value for data compression are obtained. When the length of the data obtained by compressing the to-be-compressed data is greater than the length limit value, the to-be-compressed data is segmented based on the length limit value during compression. After the to-be-compressed data is segmented, the to-be-compressed data includes at least two compressed files after compression and a length of each compressed file is less than the length limit value.

## Claims

### Claim 1

A data compression method, wherein the method comprises:
obtaining to-be-compressed data and a length limit value for data compression; and
when a length of data obtained by compressing the to-be-compressed data is greater than the length limit value, segmenting the to-be-compressed data based on the length limit value in a process of compressing the to-be-compressed data, wherein the to-be-compressed data comprises at least two compressed files after compression and a length of each compressed file is less than the length limit value.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the segmenting of the to-be-compressed data based on the length limit value comprises:
predicting a length of each compressed data block, and accumulating a length of a currently predicted data block and lengths of data blocks before the currently predicted data block to obtain a first predicted compression length; and
when the first predicted compression length is greater than the length limit value, performing the compression based on the data blocks before the currently predicted data block, wherein:
compressed data forms a first compressed file, and
the first compressed file belongs to the at least two compressed files.

### Claim 3 (depends on 2)

The method according to claim 2, wherein there are N data blocks before the currently predicted data block and the performing of the compression based on the data blocks before the currently predicted data block comprises:
performing merging and compression from a first data block to an (N−k)th data block, wherein:
N is a natural number greater than or equal to 2, and k is a natural number less than N; and
when a length of the compressed data is less than or equal to the length limit value, using the compressed data as the first compressed file.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the method further comprises:
continuing to predict the length of the compressed data block after the (N−k)th data block so as to continue to segment remaining data of the to-be-compressed data.

### Claim 5 (depends on 2)

The method according to claim 2, wherein there are N data blocks before the currently predicted data block, and the performing of the compression based on the data blocks before the currently predicted data block comprises:
performing merging and compression from a first data block to an (N−k)th data block, wherein:
N is a natural number greater than or equal to 2, and k is a natural number less than N; and
when a length of the compressed data is greater than the length limit value, performing merging and compression from a first data block to an (N−k−1)th data block.

### Claim 6

A data compression apparatus, wherein the apparatus comprises:
at least one processor; and
one or more memories coupled to the at least one processor and storing programming instructions for execution by the at least one processor to perform operations comprising:
obtaining to-be-compressed data and a length limit value for data compression; and
when a length of data obtained by compressing the to-be-compressed data is greater than the length limit value, segmenting the to-be-compressed data based on the length limit value in a process of compressing the to-be-compressed data, wherein the to-be-compressed data comprises at least two compressed files after compression and a length of each compressed file is less than the length limit value.

### Claim 7 (depends on 6)

The apparatus according to claim 6, wherein the segmenting of the to-be-compressed data based on the length limit value comprises:
predicting a length of each compressed data block, and accumulating a length of a currently predicted data block and lengths of data blocks before the currently predicted data block to obtain a first predicted compression length; and
when the first predicted compression length is greater than the length limit value, performing the compression based on the data blocks before the currently predicted data block, wherein compressed data forms a first compressed file, and the first compressed file belongs to the at least two compressed files.

### Claim 8 (depends on 7)

The apparatus according to claim 7, wherein there are N data blocks before the currently predicted data block and the performing of the compression based on the data blocks before the currently predicted data block comprises:
performing merging and compression from a first data block to an (N−k)th data block, wherein:
N is a natural number greater than or equal to 2, and k is a natural number less than N; and
when a length of the compressed data is less than or equal to the length limit value, using the compressed data as the first compressed file.

### Claim 9 (depends on 8)

The apparatus according to claim 8, wherein the operations further comprises:
continuing to predict the length of the compressed data block after the (N−k)th data block so as to continue to segment remaining data of the to-be-compressed data.

### Claim 10 (depends on 7)

The method according to claim 7, wherein there are N data blocks before the currently predicted data block, and the performing of the compression based on the data blocks before the currently predicted data block comprises:
performing merging and compression from a first data block to an (N−k)th data block, wherein:
N is a natural number greater than or equal to 2, and k is a natural number less than N; and
when a length of the compressed data is greater than the length limit value, performing merging and compression from a first data block to an (N−k−1)th data block.

### Claim 11

A non-transitory computer-readable storage medium, wherein the computer-readable storage medium stores a computer program; and when the computer program is executed on a computer, the computer is enabled to perform the method of:
obtaining to-be-compressed data and a length limit value for data compression; and
when a length of data obtained by compressing the to-be-compressed data is greater than the length limit value, segmenting the to-be-compressed data based on the length limit value in a process of compressing the to-be-compressed data, wherein the to-be-compressed data comprises at least two compressed files after compression and a length of each compressed file is less than the length limit value.

### Claim 12 (depends on 11)

The computer-readable storage medium according to claim 11, wherein the segmenting of the to-be-compressed data based on the length limit value comprises:
predicting a length of each compressed data block, and accumulating a length of a currently predicted data block and lengths of data blocks before the currently predicted data block to obtain a first predicted compression length; and
when the first predicted compression length is greater than the length limit value, performing the compression based on the data blocks before the currently predicted data block, wherein compressed data forms a first compressed file, and the first compressed file belongs to the at least two compressed files.

### Claim 13 (depends on 12)

The computer-readable storage medium according to claim 12, wherein there are N data blocks before the currently predicted data block, and the performing of the compression based on the data blocks before the currently predicted data block comprises:
performing merging and compression from a first data block to an (N−k)th data block, wherein:
N is a natural number greater than or equal to 2, and k is a natural number less than N; and
when a length of the compressed data is less than or equal to the length limit value, using the compressed data as the first compressed file.

### Claim 14 (depends on 13)

The computer-readable storage medium according to claim 13, wherein the method further comprises:
continuing to predict the length of the compressed data block after the (N−k)th data block so as to continue to segment remaining data of the to-be-compressed data.

### Claim 15 (depends on 12)

The computer-readable storage medium according to claim 12, wherein there are N data blocks before the currently predicted data block, and the performing of the compression based on the data blocks before the currently predicted data block comprises:
performing merging and compression from a first data block to an (N−k)th data block, wherein:
N is a natural number greater than or equal to 2, and k is a natural number less than N; and
when a length of the compressed data is greater than the length limit value, performing merging and compression on a first data block to an (N−k−1)th data block.

### Claim 16 (depends on 1)

A device comprising a processor and a memory that is communicatively coupled to the processor, the processor being configured to implement the method according to claim 1.
