# US 10,872,101 B2 · Distributed database processing method and device

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

- Number: US 10,872,101 B2
- Document ID: US10872101B2
- Status: Granted
- Kind: B2
- Application number: 15/943,348
- Filed: 2018-04-02
- Published: 2018-08-09
- Granted: 2020-12-22
- Earliest claimed: 2015-11-26
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Zhenfeng Li; Li Yao; Wei Zhang
- Web page: https://patentgrep.com/patent/US10872101B2

## CPC

- G06F 16/278: {Data partitioning, e.g. horizontal or vertical partitioning}
- G06F 16/2272: {Management thereof}
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F 16/24534: {Query rewriting; Transformation}
- G06F 16/2471: {Distributed queries}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments of the present invention relate to the field of storage technologies, and provide a distributed database processing method. A database processing device receives an access request; obtains, from a partition routing table of the data table according to the query index field and the value of the query index field, partition information and a value that correspond to the query index field; and sends, according to the partition information and the value of the partition information that correspond to the query index field and the value of the query index field, the access request to a database corresponding to the partition information and the value of the partition information.

## Claims

### Claim 1

A method comprising:
receiving, by a database processing device, a first access request for a first data table, wherein the first access request comprises a first query index field and a value of the first query index field, wherein the first query index field is non-partition information of the first data table;
obtaining multiple partition routing tables associated with the first data table;
determining, from the multiple partition routing tables associated with the first data table, a first partition routing table that is associated with non-partition information; and
obtaining, from the first partition routing table that is associated with non-partition information, partition information and values of the partition information;
wherein the first partition routing table stores correspondences between the values of the partition information and values of the non-partition information; and
sending, according to the partition information and the value of the partition information, the first access request to a database corresponding to the partition information and the value of the partition information.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the first access request further includes a to-be-accessed first target field, wherein before the sending the first access request to a database corresponding to the partition information and the value of the partition information, the method further comprises:
updating the first access request according to the partition information and the value of the partition information, wherein an updated first access request comprises the partition information, the value of the partition information, and the to-be-accessed first target field; and
the sending the first access request to a database corresponding to the partition information and the value of the partition information comprises:
sending the updated first access request to the database corresponding to the partition information and the value of the partition information.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the first access request further includes a to-be-accessed first target field, wherein before the receiving a first access request, the method further comprises:
receiving an insertion request, wherein the insertion request comprises to-be-inserted data, and wherein the to-be-inserted data comprises the value of the partition information, the value of the first query index field, and a value of the to-be-accessed first target field;
inserting the to-be-inserted data into a partition table of the database according to the value of the partition information;
determining that a partition routing table associated with the first query index field exists; and
inserting the value of the first query index field and the value of the partition information into the partition routing table associated with the first query index field.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the method further comprises:
receiving a second access request, wherein the second access request comprises a second query index field, a value of the second query index field, and a to-be-accessed second target field, wherein the second query index field includes partition information of a second data table; and
sending, according to the second query index field and the value of the second query index field, the second access request to a database corresponding to the value of the second query index field for processing.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the partition information comprises a partition field or a partition carrying field, wherein a mapping relationship exists between the partition carrying field and the partition field when the partition information comprises a partition carrying field.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the first access request does not include partition information of the first data table.

### Claim 7 (depends on 1)

The method according to claim 1 further, wherein obtaining the partition information and the value of the partition information comprises sending a query request, to a distributed data service (DDS), for querying the partition routing table of the first data table for the partition information and the value of the partition information.

### Claim 8 (depends on 7)

The method according to claim 7, wherein sending, according to the partition information and the value of the partition information, the first access request to a database corresponding to the partition information and the value of the partition information comprises sending, to the DDS, an updated first access request comprising the partition information and the value of the partition information, and wherein the DDS send the updated first access request to the database corresponding to the partition information and the value of the partition information.

### Claim 9

An apparatus, comprising:
a processor; and
a non-transitory computer readable medium connected to the processor and having stored thereon instructions that, when executed, cause the processor to:
receive a first access request for a first data table, wherein the first access request comprises a first query index field, a value of the first query index field, and a to-be-accessed first target field, wherein the first query index field is non-partition information of the first data table;
obtain multiple partition routing tables associated with the first data table;
determine, from the multiple partition routing tables associated with the first data table, a first partition routing table that is associated with non-partition information; and
obtain, from the first partition routing table that is associated with non-partition information, partition information and values of the partition information;
wherein the first partition routing table stores correspondences between the values of the partition information and values of the non-partition information; and
send, according to the partition information and the value of the partition information, the first access request to a database corresponding to the partition information and the value of the partition information.

### Claim 10 (depends on 9)

The apparatus according to claim 9, wherein the non-transitory computer readable medium further has stored thereon instructions, that when executed, cause the processor to: update the first access request according to the partition information and the value of the partition information, wherein an updated first access request comprises the partition information, the value, and the to-be-accessed first target field; and
send the updated first access request to the database corresponding to the partition information and the value of the partition information.

### Claim 11 (depends on 9)

The apparatus according to claim 9, wherein the non-transitory computer readable medium further has stored thereon instructions, that when executed, cause the processor to:
receive an insertion request, wherein the insertion request comprises to-be-inserted data, and wherein the to-be-inserted data comprises the value of the partition information, the value of the first query index field, and a value of the to-be-accessed first target field;
insert the to-be-inserted data into a partition table of the database according to the value of the partition information;
determine that a partition routing table associated with the first query index field exists; and
insert the value of the first query index field and the value of the partition information into the partition routing table associated with the first query index field.

### Claim 12 (depends on 9)

The apparatus according to claim 9, wherein the non-transitory computer readable medium further has stored thereon instructions, that when executed, cause the processor to:
receive a second access request, wherein the second access request comprises a second query index field, a value of the second query index field, and a to-be-accessed second target field, wherein the second query index field includes partition information of a second data table; and
send, according to the second query index field and the value of the second query index field, the second access request to a database corresponding to the partition information of the second data table for processing.

### Claim 13 (depends on 9)

The apparatus according to claim 9, wherein the partition information comprises a partition field or a partition carrying field, wherein a mapping relationship exists between the partition carrying field and the partition field when the partition information comprises the partition carrying field.

### Claim 14 (depends on 9)

The apparatus according to claim 9, wherein the first access request does not include partition information of the first data table.

### Claim 15 (depends on 1)

A distributed database processing device, comprising a processor and a memory, wherein
the memory stores a computer readable program; and
the processor runs the program in the memory, to complete the method according to claim 1.
