# US 12,216,655 B2 · Data association query method and apparatus, device, and storage medium

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

- Number: US 12,216,655 B2
- Document ID: US12216655B2
- Status: Granted
- Kind: B2
- Application number: 18/012,903
- Filed: 2021-06-21
- Published: 2023-08-17
- Granted: 2025-02-04
- Earliest claimed: 2020-06-23
- Assignees: Zte Corporation
- Applicants: Zte Corporation
- Inventors: Taibao Wang; Donghui Xu; Yaofeng Tu; Qiang Zhang; Dezheng Wang
- Web page: https://patentgrep.com/patent/US12216655B2

## CPC

- G06F 16/24542: {Plan optimisation}
- G06F 16/90335: {Query processing}
- G06F 16/244: {Grouping and aggregation}
- G06F 16/24535: {of sub-queries or views}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Provided are a data association query method and apparatus, a device, and a storage medium. The data association query method includes the following: parsing a data query statement to obtain association query information, where the association query information includes query key information of a first association table; determining a query policy according to the query key information, where the query policy includes a partition filtering policy, a scan-while-filter policy and a scan-before-filter policy; and querying data in a second association table based on the query policy.

## Claims

### Claim 1

A data association query method, comprising:
parsing a data query statement to obtain association query information; wherein the association query information comprises query key information of a first association table;
determining a query policy according to the query key information; wherein the query policy comprises a partition filtering policy, a scan-while-filter policy and a scan-before-filter policy; and
querying, based on the query policy, data in a second association table to obtain target data;
wherein determining the query policy according to the query key information comprises:
determining a statement format of the query key information; and
determining the query policy according to the statement format;
wherein determining the query policy according to the statement format comprises:
in response to the statement format being a partition column format, determining the query policy as the partition filtering policy;
accordingly, querying the data in the second association table based on the query policy of the first association table comprises:
filtering out partitions that do not match the query key information from the second association table; and
performing a data query in remaining partitions after filtering according to the query key information.

### Claim 2 (depends on 1)

The data association query method of claim 1, wherein parsing the data query statement to obtain the association query information comprises:
generating a logical plan based on statement logic of the data query statement;
extracting an association query node in the logical plan; and
acquiring association query information corresponding to the association query node.

### Claim 3 (depends on 1)

The data association query method of claim 1, wherein determining the query policy according to the statement format comprises:
in response to the statement format being a non-partition column format, acquiring a storage format of the data in the second association table; and
determining the query policy according to the storage format.

### Claim 4 (depends on 3)

The data association query method of claim 3, wherein determining the query policy according to the storage format comprises:
in response to the storage format being a column-oriented storage format, determining the query policy as the scan-while-filter policy; and
accordingly, querying the data in the second association table based on the query policy comprises:
scanning column-oriented data in the second association table sequentially, and in response to scanning data of a current column, matching a key value of the current column with the query key information;
in response to matching between the key value of the current column and the query key information succeeding, determining data of the current column as the target data; and
in response to matching between the key value of the current column and the query key information failing, skipping the current column, and scanning a next column until the target data is scanned.

### Claim 5 (depends on 3)

The data association query method of claim 3, wherein determining the query policy according to the storage format comprises:
in response to the storage format being a non-column-oriented storage format, determining the query policy as the scan-before-filter policy;
accordingly, querying the data in the second association table based on the query policy comprises:
scanning all the data in the second association table to obtain a key value of the data; and
filtering out data whose key value does not match the query key information to obtain the target data.

### Claim 6

A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor, when executing the computer program, performs the following:
parsing a data query statement to obtain association query information; wherein the association query information comprises query key information of a first association table;
determining a query policy according to the query key information; wherein the query policy comprises a partition filtering policy, a scan-while-filter policy and a scan-before-filter policy; and
querying, based on the query policy, data in a second association table to obtain target data;
wherein the processor is configured to perform determining the query policy according to the query key information by:
determining a statement format of the query key information; and
determining the query policy according to the statement format;
wherein the processor is configured to perform determining the query policy according to the statement format by: in response to the statement format being a partition column format, determining the query policy as the partition filtering policy;
accordingly, the processor is configured to perform querying the data in the second association table based on the query policy of the first association table by:
filtering out partitions that do not match the query key information from the second association table; and
performing a data query in remaining partitions after filtering according to the query key information.

### Claim 7

A non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, performs the following:
parsing a data query statement to obtain association query information; wherein the association query information comprises query key information of a first association table;
determining a query policy according to the query key information; wherein the query policy comprises a partition filtering policy, a scan-while-filter policy and a scan-before-filter policy; and
querying, based on the query policy, data in a second association table to obtain target data;
wherein the computer program is configured to perform determining the query policy according to the query key information by:
determining a statement format of the query key information; and
determining the query policy according to the statement format;
wherein the computer program is configured to perform determining the query policy according to the statement format by: in response to the statement format being a partition column format, determining the query policy as the partition filtering policy;
accordingly, the computer program is configured to perform querying the data in the second association table based on the query policy of the first association table by:
filtering out partitions that do not match the query key information from the second association table; and
performing a data query in remaining partitions after filtering according to the query key information.

### Claim 8 (depends on 6)

The computer device of claim 6, wherein the processor is configured to perform parsing the data query statement to obtain the association query information by:
generating a logical plan based on statement logic of the data query statement;
extracting an association query node in the logical plan; and
acquiring association query information corresponding to the association query node.

### Claim 9 (depends on 6)

The computer device of claim 6, wherein the processor is configured to perform determining the query policy according to the statement format by:
in response to where the statement format being a non-partition column format, acquiring a storage format of the data in the second association table; and
determining the query policy according to the storage format.

### Claim 10 (depends on 9)

The computer device of claim 9, wherein the processor is configured to perform determining the query policy according to the storage format by:
in response to where the storage format being a column-oriented storage format, determining the query policy as the scan-while-filter policy; and
accordingly, the processor is configured to perform querying the data in the second association table based on the query policy by:
scanning column-oriented data in the second association table sequentially, and in response to scanning data of a current column, matching a key value of the current column with the query key information;
in response to matching between the key value of the current column and the query key information succeeding, determining data of the current column as the target data; and
in response to matching between the key value of the current column and the query key information failing, skipping the current column, and scanning a next column until the target data is scanned.

### Claim 11 (depends on 9)

The computer device of claim 9, wherein the processor is configured to perform determining the query policy according to the storage format by:
in response to the storage format being a non-column-oriented storage format, determining the query policy as the scan-before-filter policy;
accordingly, the processor is configured to perform querying the data in the second association table based on the query policy by:
scanning all the data in the second association table to obtain a key value of the data; and
filtering out data whose key value does not match the query key information to obtain the target data.

### Claim 12 (depends on 7)

The non-transitory computer-readable storage medium of claim 7, wherein the computer program is configured to perform parsing the data query statement to obtain the association query information by:
generating a logical plan based on statement logic of the data query statement;
extracting an association query node in the logical plan; and
acquiring association query information corresponding to the association query node.

### Claim 13 (depends on 7)

The non-transitory computer-readable storage medium of claim 7, wherein the computer program is configured to perform determining the query policy according to the statement format by:
in response to the statement format being a non-partition column format, acquiring a storage format of the data in the second association table; and
determining the query policy according to the storage format.

### Claim 14 (depends on 13)

The non-transitory computer-readable storage medium of claim 13, wherein the computer program is configured to perform determining the query policy according to the storage format by:
in response to the storage format being a column-oriented storage format, determining the query policy as the scan-while-filter policy; and
accordingly, the computer program is configured to perform querying the data in the second association table based on the query policy by:
scanning column-oriented data in the second association table sequentially, and in response to scanning data of a current column, matching a key value of the current column with the query key information;
in response to matching between the key value of the current column and the query key information succeeding, determining data of the current column as the target data; and
in response to matching between the key value of the current column and the query key information failing, skipping the current column, and scanning a next column until the target data is scanned.

### Claim 15 (depends on 13)

The non-transitory computer-readable storage medium of claim 13, wherein the computer program is configured to perform determining the query policy according to the storage format by:
in response to the storage format being a non-column-oriented storage format, determining the query policy as the scan-before-filter policy;
accordingly, the computer program is configured to perform querying the data in the second association table based on the query policy by:
scanning all the data in the second association table to obtain a key value of the data; and
filtering out data whose key value does not match the query key information to obtain the target data.
