# US 2025/0209073 A1 · Methods, systems, electronic devices, and storage mediums for querying sharded nosql data

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

- Number: US 2025/0209073 A1
- Document ID: US20250209073A1
- Status: Published application
- Kind: A1
- Application number: 19/078,315
- Filed: 2025-03-13
- Published: 2025-06-26
- Earliest claimed: 2022-09-13
- Assignees: Zhejiang Dahua Technology Co., Ltd.
- Applicants: Zhejiang Dahua Technology Co., Ltd.
- Inventors: Huihua SHI; Linhao ZHU; Mingwei ZHOU
- Web page: https://patentgrep.com/patent/US20250209073A1

## CPC

- G06F 16/24542: {Plan optimisation}
- G06F 16/3334: {Selection or weighting of terms from queries, including natural language queries}
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Some embodiments of the present disclosure provide methods and systems for querying sharded NoSQL data. The method may include obtaining an index setting and an associated field; determining routing values based on the associated field; establishing an index group including a plurality of indexes, at least a portion of the plurality of indexes having the associated field; dividing each of the plurality of indexes into a plurality of shards based on the index setting and the routing values; obtaining an association query request based on the associated field; and in response to receiving the association query request, determining a query result based on the plurality of shards.

## Claims

### Claim 1

A method for querying sharded NoSQL data, comprising:
obtaining an index setting and an associated field;
determining routing values based on the associated field;
establishing an index group including a plurality of indexes, at least a portion of the plurality of indexes having the associated field;
dividing each of the plurality of indexes into a plurality of shards based on the index setting and the routing values;
obtaining an association query request based on the associated field; and
in response to receiving the association query request, determining a query result based on the plurality of shards.

### Claim 2 (depends on 1)

The method of claim 1, wherein the association query request includes the associated field, a query condition based on the index group, and a query order of an index within the index group.

### Claim 3 (depends on 2)

The method of claim 2, wherein the query order is determined based on a satisfaction degree of the query condition and a query type, and the query type includes an intersection query or a union query.

### Claim 4 (depends on 1)

The method of claim 1, wherein the determining a query result based on the index group includes:
obtaining a sharded query result by performing a sharded query on each of the plurality of indexes in the index group; the sharded query performed on each of the plurality of shards including a parallel processing; and
determining the query result by merging the sharded query results.

### Claim 5 (depends on 4)

The method of claim 4, wherein the sharded query includes:
determining a first result by performing a first query based on a first index in the index group;
determining a second result by performing a second query based on the first result and a second index; and
determining the query result based on the second result.

### Claim 6 (depends on 4)

The method of claim 4, wherein the sharded query further includes:
obtaining a plurality of first scrolling results by performing a first query on a first index in a scrolling manner;
obtaining at least one second scrolling result by performing a second query in a scrolling manner based on at least one of the first scrolling results and a second index; and
in response to a determination that the at least one second scrolling result satisfies a first predetermined condition, terminating the second query.

### Claim 7 (depends on 6)

The method of claim 6, wherein the sharded query is performed by a query node, and the sharded query further includes:
in response to a determination that the third query is terminated, sending, by the query node, the at least one second scrolling result to a coordination node;
aggregating, by the coordination node, the at least one second scrolling result to form an aggregated result; and
in response to a determination that the aggregated result satisfies a second predetermined condition, informing the query node to terminate the first query.

### Claim 8 (depends on 4)

The method of claim 4, wherein the index group includes at least three indexes, the sharded query includes:
performing the sharded query on each index in the index group based on a query order; and
determining the query result based on the sharded query result.

### Claim 9 (depends on 1)

The method of claim 1, wherein the plurality of indexes includes at least three indexes and at least two different second associated fields, one of the second associated fields being same as or different from the associated field, and determining the routing values includes:
obtaining a splicing result by splicing the associated fields based on a predetermined order;
obtaining a mapping result by performing a mapping operation on the splicing result; and
determining the routing values based on the mapping result.

### Claim at position 10

10-18. (canceled)

### Claim 19

An electronic device comprising a storage and a processor, wherein the processor is configured to execute program instructions stored in the storage to implement a method for querying sharded NoSQL data, comprising:
obtaining an index setting and an associated field;
determining routing values based on the associated field;
establishing an index group including a plurality of indexes, at least a portion of the plurality of indexes having the associated field;
dividing each of the plurality of indexes into a plurality of shards based on the index setting and the routing values;
obtaining an association query request based on the associated field; and
in response to receiving the association query request, determining a query result based on the plurality of shards.

### Claim 20

A computer-readable storage medium storing computer instructions, wherein when reading the computer instructions in the storage medium, a computer performs a method of for querying sharded NoSQL data, comprising:
obtaining an index setting and an associated field;
determining routing values based on the associated field;
establishing an index group including a plurality of indexes, at least a portion of the plurality of indexes having the associated field;
dividing each of the plurality of indexes into a plurality of shards based on the index setting and the routing values;
obtaining an association query request based on the associated field; and
in response to receiving the association query request, determining a query result based on the plurality of shards.

### Claim 21 (depends on 19)

The system of claim 19, wherein the association query request includes the associated field, a query condition based on the index group, and a query order of an index within the index group.

### Claim 22 (depends on 21)

The system of claim 21, wherein the query order is determined based on a satisfaction degree of the query condition and a query type, and the query type includes an intersection query or a union query.

### Claim 23 (depends on 19)

The system of claim 19, wherein the determining a query result based on the index group includes:
obtaining a sharded query result by performing a sharded query on each of the plurality of indexes in the index group; the sharded query performed on each of the plurality of shards including a parallel processing; and
determining the query result by merging the sharded query results.

### Claim 24 (depends on 23)

The system of claim 23, wherein the sharded query includes:
determining a first result by performing a first query based on a first index in the index group;
determining a second result by performing a second query based on the first result and a second index; and
determining the query result based on the second result.

### Claim 25 (depends on 23)

The system of claim 23, wherein the sharded query further includes:
obtaining a plurality of first scrolling results by performing a first query on a first index in a scrolling manner;
obtaining at least one second scrolling result by performing a second query in a scrolling manner based on at least one of the first scrolling results and a second index; and
in response to a determination that the at least one second scrolling result satisfies a first predetermined condition, terminating the second query.

### Claim 26 (depends on 25)

The system of claim 25, wherein the sharded query is performed by a query node, and the sharded query further includes:
in response to a determination that the third query is terminated, sending, by the query node, the at least one second scrolling result to a coordination node;
aggregating, by the coordination node, the at least one second scrolling result to form an aggregated result; and
in response to a determination that the aggregated result satisfies a second predetermined condition, informing the query node to terminate the first query.

### Claim 27 (depends on 23)

The system of claim 23, wherein the index group includes at least three indexes, the sharded query includes:
performing the sharded query on each index in the index group based on a query order; and
determining the query result based on the sharded query result.

### Claim 28 (depends on 19)

The system of claim 19, wherein the plurality of indexes includes at least three indexes and at least two different second associated fields, one of the second associated fields being same as or different from the associated field, and determining the routing values includes:
obtaining a splicing result by splicing the associated fields based on a predetermined order;
obtaining a mapping result by performing a mapping operation on the splicing result; and
determining the routing values based on the mapping result.

### Claim 29 (depends on 20)

The computer-readable storage medium of claim 20, wherein the plurality of indexes includes at least three indexes and at least two different second associated fields, one of the second associated fields being same as or different from the associated field, and determining the routing values includes:
obtaining a splicing result by splicing the associated fields based on a predetermined order;
obtaining a mapping result by performing a mapping operation on the splicing result; and
determining the routing values based on the mapping result.
