# US 2026/0099477 A1 · Column data compression

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

- Number: US 2026/0099477 A1
- Document ID: US20260099477A1
- Status: Published application
- Kind: A1
- Application number: 19/417,142
- Filed: 2025-12-11
- Published: 2026-04-09
- Earliest claimed: 2023-09-06
- Assignees: Beijing OceanBase Technology Co., Ltd.
- Applicants: Beijing Oceanbase Technology Co., Ltd.
- Inventors: Heng YE; Quanwei WAN
- Web page: https://patentgrep.com/patent/US20260099477A1

## CPC

- G06F 16/221: {Column-oriented storage; Management thereof}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

This specification provides a column data compression method and apparatus, and a storage medium. The method includes: separately encoding the column data in a plurality of encoding schemes at a column level, to obtain at least one data stream corresponding to each encoding scheme; determining a target encoding scheme in which smallest storage space is occupied in the plurality of encoding schemes; determining a target compression algorithm with a highest compression rate at a stream level; and compressing at least one target data stream corresponding to the target encoding scheme based on the target compression algorithm, and storing compressed target data stream in a database. In the present specification, the column data can be encoded and compressed at at least two levels: the column level and the stream level, to improve a compression rate of the column data, and save more storage space.

## Claims

### Claim 1

A column data compression method, comprising:
separately encoding column data based on a plurality of encoding schemes at a column level, to obtain at least one data stream corresponding to each encoding scheme of the plurality of encoding schemes;
determining a target encoding scheme that occupies a smallest storage space among the plurality of encoding schemes;
determining a target compression algorithm with a highest compression rate at a stream level; and
compressing the at least one target data stream corresponding to the target encoding scheme based on the target compression algorithm.

### Claim 2 (depends on 1)

The method according to claim 1, wherein a storage type of the column data is integer data, and the separately encoding the column data based on a plurality of encoding schemes at a column level, to obtain at least one data stream corresponding to each encoding scheme comprises:
encoding the column data in an integer column encoding scheme, to obtain a first integer stream, wherein the first integer stream includes each integer element in a current column; and
encoding the column data in a dictionary column encoding scheme, to obtain a second integer stream and a first index stream, wherein the second integer stream includes integer elements that are different from one another in a current column, and the first index stream is configured to query the second integer stream.

### Claim 3 (depends on 2)

The method according to claim 2, further comprising:
determining at least one candidate integer type based on a greatest value of the integer elements in the current column, wherein a storage space occupied by each candidate integer type of the at least one candidate integer type is greater than or equal to a storage space occupied by the greatest value; and
determining a candidate integer type that occupies a smallest storage space among the at least one candidate integer type as an integer type corresponding to the integer column encoding scheme.

### Claim 4 (depends on 1)

The method according to claim 1, wherein a storage type of the column data is a string, each string has an invariable length, and the separately encoding the column data based on a plurality of encoding schemes at a column level, to obtain at least one data stream corresponding to each encoding scheme comprises:
encoding the column data in a string column encoding scheme, to obtain a first string stream, wherein the first string stream includes each string in a current column; and
encoding the column data in a dictionary column encoding scheme, to obtain a second string stream and a second index stream, wherein the second string stream includes strings that are different from one another in the current column, and the second index stream is configured to query the second string stream.

### Claim 5 (depends on 1)

The method according to claim 1, wherein a storage type of the column data is a string, each string has a variable length, and the separately encoding the column data based on a plurality of encoding schemes at a column level, to obtain at least one data stream corresponding to each encoding scheme comprises:
encoding the column data in a string column encoding scheme, to obtain a third string stream and a third integer stream, wherein the third string stream includes each string in a current column, and the third integer stream is configured to determine a length of each string in the third string stream; and
encoding the column data in a dictionary column encoding scheme, to obtain a fourth string stream, a fourth integer stream, and a third index stream, wherein the fourth string stream includes strings that are different from one another in the current column, the fourth integer stream is configured to determine a length of each string in the fourth string stream, and the third index stream is configured to query the fourth string stream.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the determining a target compression algorithm with a highest compression rate at a stream level comprises:
separately compressing, based on each of at least one candidate compression algorithm, at least a part of data included in the at least one target data stream, to obtain compressed data; and
determining a candidate compression algorithm corresponding to compressed data that occupies smallest storage space among the at least one candidate compression algorithm as the target compression algorithm.

### Claim 7 (depends on 6)

The method according to claim 6, further comprising:
sampling, based on a sampling rate, data in the at least one target data stream, to obtain sampled data,
wherein the separately compressing, based on each of at least one candidate compression algorithm, at least a part of data included in the at least one target data stream, to obtain compressed data comprises:
separately compressing the sampled data based on each candidate compression algorithm, to obtain the compressed data.

### Claim 8

An electronic system, comprising:
one or more processors; and
one or more storage devices, individually or collectively, having computer executable instructions stored thereon, the computer executable instructions, when executed by the one or more processors, enabling the one or more processors, individually or collectively, to implement actions including:
separately encoding column data based on a plurality of encoding schemes at a column level, to obtain at least one data stream corresponding to each encoding scheme of the plurality of encoding schemes;
determining a target encoding scheme that occupies a smallest storage space among the plurality of encoding schemes;
determining a target compression algorithm with a highest compression rate at a stream level; and
compressing the at least one target data stream corresponding to the target encoding scheme based on the target compression algorithm.

### Claim 9 (depends on 8)

The electronic system according to claim 8, wherein a storage type of the column data is integer data, and the separately encoding the column data based on a plurality of encoding schemes at a column level, to obtain at least one data stream corresponding to each encoding scheme comprises:
encoding the column data in an integer column encoding scheme, to obtain a first integer stream, wherein the first integer stream includes each integer element in a current column; and
encoding the column data in a dictionary column encoding scheme, to obtain a second integer stream and a first index stream, wherein the second integer stream includes integer elements that are different from one another in a current column, and the first index stream is configured to query the second integer stream.

### Claim 10 (depends on 9)

The electronic system according to claim 9, wherein the actions further include:
determining at least one candidate integer type based on a greatest value of the integer elements in the current column, wherein a storage space occupied by each candidate integer type of the at least one candidate integer type is greater than or equal to a storage space occupied by the greatest value; and
determining a candidate integer type that occupies a smallest storage space among the at least one candidate integer type as an integer type corresponding to the integer column encoding scheme.

### Claim 11 (depends on 8)

The electronic system according to claim 8, wherein a storage type of the column data is a string, each string has an invariable length, and the separately encoding the column data based on a plurality of encoding schemes at a column level, to obtain at least one data stream corresponding to each encoding scheme comprises:
encoding the column data in a string column encoding scheme, to obtain a first string stream, wherein the first string stream includes each string in a current column; and
encoding the column data in a dictionary column encoding scheme, to obtain a second string stream and a second index stream, wherein the second string stream includes strings that are different from one another in the current column, and the second index stream is configured to query the second string stream.

### Claim 12 (depends on 8)

The electronic system according to claim 8, wherein a storage type of the column data is a string, each string has a variable length, and the separately encoding the column data based on a plurality of encoding schemes at a column level, to obtain at least one data stream corresponding to each encoding scheme comprises:
encoding the column data in a string column encoding scheme, to obtain a third string stream and a third integer stream, wherein the third string stream includes each string in a current column, and the third integer stream is configured to determine a length of each string in the third string stream; and
encoding the column data in a dictionary column encoding scheme, to obtain a fourth string stream, a fourth integer stream, and a third index stream, wherein the fourth string stream includes strings that are different from one another in the current column, the fourth integer stream is configured to determine a length of each string in the fourth string stream, and the third index stream is configured to query the fourth string stream.

### Claim 13 (depends on 8)

The electronic system according to claim 8, wherein the determining a target compression algorithm with a highest compression rate at a stream level comprises:
separately compressing, based on each of at least one candidate compression algorithm, at least a part of data included in the at least one target data stream, to obtain compressed data; and
determining a candidate compression algorithm corresponding to compressed data that occupies smallest storage space among the at least one candidate compression algorithm as the target compression algorithm.

### Claim 14 (depends on 13)

The electronic system according to claim 13, wherein the actions further include:
sampling, based on a sampling rate, data in the at least one target data stream, to obtain sampled data,
wherein the separately compressing, based on each of at least one candidate compression algorithm, at least a part of data included in the at least one target data stream, to obtain compressed data comprises:
separately compressing the sampled data based on each candidate compression algorithm, to obtain the compressed data.

### Claim 15

A computer-readable storage medium, having computer executable instructions stored thereon, the computer executable instructions, when executed by one or more processors, enabling the one or more processors to, individually or collectively, implement actions comprising:
separately encoding column data based on a plurality of encoding schemes at a column level, to obtain at least one data stream corresponding to each encoding scheme of the plurality of encoding schemes;
determining a target encoding scheme that occupies a smallest storage space among the plurality of encoding schemes;
determining a target compression algorithm with a highest compression rate at a stream level; and
compressing the at least one target data stream corresponding to the target encoding scheme based on the target compression algorithm.

### Claim 16 (depends on 15)

The computer-readable storage medium according to claim 15, wherein a storage type of the column data is integer data, and the separately encoding the column data based on a plurality of encoding schemes at a column level, to obtain at least one data stream corresponding to each encoding scheme comprises:
encoding the column data in an integer column encoding scheme, to obtain a first integer stream, wherein the first integer stream includes each integer element in a current column; and
encoding the column data in a dictionary column encoding scheme, to obtain a second integer stream and a first index stream, wherein the second integer stream includes integer elements that are different from one another in a current column, and the first index stream is configured to query the second integer stream.

### Claim 17 (depends on 16)

The computer-readable storage medium according to claim 16, wherein the actions further include:
determining at least one candidate integer type based on a greatest value of the integer elements in the current column, wherein a storage space occupied by each candidate integer type of the at least one candidate integer type is greater than or equal to a storage space occupied by the greatest value; and
determining a candidate integer type that occupies a smallest storage space among the at least one candidate integer type as an integer type corresponding to the integer column encoding scheme.

### Claim 18 (depends on 15)

The computer-readable storage medium according to claim 15, wherein a storage type of the column data is a string, each string has an invariable length, and the separately encoding the column data based on a plurality of encoding schemes at a column level, to obtain at least one data stream corresponding to each encoding scheme comprises:
encoding the column data in a string column encoding scheme, to obtain a first string stream, wherein the first string stream includes each string in a current column; and
encoding the column data in a dictionary column encoding scheme, to obtain a second string stream and a second index stream, wherein the second string stream includes strings that are different from one another in the current column, and the second index stream is configured to query the second string stream.

### Claim 19 (depends on 15)

The computer-readable storage medium according to claim 15, wherein a storage type of the column data is a string, each string has a variable length, and the separately encoding the column data based on a plurality of encoding schemes at a column level, to obtain at least one data stream corresponding to each encoding scheme comprises:
encoding the column data in a string column encoding scheme, to obtain a third string stream and a third integer stream, wherein the third string stream includes each string in a current column, and the third integer stream is configured to determine a length of each string in the third string stream; and
encoding the column data in a dictionary column encoding scheme, to obtain a fourth string stream, a fourth integer stream, and a third index stream, wherein the fourth string stream includes strings that are different from one another in the current column, the fourth integer stream is configured to determine a length of each string in the fourth string stream, and the third index stream is configured to query the fourth string stream.

### Claim 20 (depends on 15)

The computer-readable storage medium according to claim 15, wherein the determining a target compression algorithm with a highest compression rate at a stream level comprises:
separately compressing, based on each of at least one candidate compression algorithm, at least a part of data included in the at least one target data stream, to obtain compressed data; and
determining a candidate compression algorithm corresponding to compressed data that occupies smallest storage space among the at least one candidate compression algorithm as the target compression algorithm.
