# US 11,113,276 B2 · Querying a database

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

- Number: US 11,113,276 B2
- Document ID: US11113276B2
- Status: Granted
- Kind: B2
- Application number: 15/870,225
- Filed: 2018-01-12
- Published: 2018-05-17
- Granted: 2021-09-07
- Earliest claimed: 2015-07-27
- Assignees: Advanced New Technologies Co., Ltd.
- Applicants: Advanced New Technologies Co., Ltd.
- Inventors: Hang Zhao
- Web page: https://patentgrep.com/patent/US11113276B2

## CPC

- G06F 16/24535: {of sub-queries or views}
- G06F 16/00: Information retrieval; Database structures therefor; File system structures therefor
- G06F 16/24542: {Plan optimisation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A query is received from a user. A query event type and a query time range associated with the query are determined. An estimated amount of data to be queried associated with the determined query time range is determined based on at least a historical number of the query event type of the user. An allowable amount of data to be queried supported by a database for a single query is determined. One or more sub-queries for the received query are generated. Each sub-query is associated with a different time period within the determined query time range. A corresponding amount of data to be queried associated with each time period is less than, or equal to, the determined allowable amount of data to be queried. The database is queried with the generated one or more sub-queries.

## Claims

### Claim 1

A computer-implemented method, comprising:
receiving, as a received query, a query from a user;
determining a query event type and a query time range associated with the query;
determining an estimated amount of data to be queried associated with the query time range based on at least a historical number of the query event type of the user, wherein the historical number comprises a quantity of events of the query event type that occurred in a past time period, and wherein determining the estimated amount of data to be queried comprises:
dividing the historical number by the past time period to determine an average number of the query event type of the user; and
multiplying the average number of the query event type of the user and the query time range to determine the estimated amount of data to be queried;
determining an allowable amount of data to be queried supported by a database for a single query;
determining, based on the estimated amount of data to be queried and the allowable amount of data to be queried, a quantity N of one or more sub-queries to be generated;
dividing the query time range into N time periods, wherein N−1 time periods of the N time periods have equal lengths of time;
generating, as generated one or more sub-queries, the quantity N of one or more sub-queries for the received query, wherein each sub-query is used to query data in a different time period of the N time periods, and wherein a corresponding amount of data to be queried associated with each time period is less than, or equal to, the allowable amount of data to be queried; and
querying the database with the generated one or more sub-queries.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein the historical number of the query event type of the user is an additional average number or a maximum number of the query event type of the user in a fixed time period.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein determining the estimated amount of data to be queried comprises:
determining whether the historical number of the query event type of the user is greater than, or equal to, a first predefined threshold and is less than, or equal to, a second predefined threshold; and
in response to determining that the historical number of the query event type of the user is greater than, or equal to, the first predefined threshold and is less than, or equal to, the second predefined threshold, determining the estimated amount of data to be queried associated with the query time range.

### Claim 4 (depends on 3)

The computer-implemented method of claim 3, further comprising:
determining that the historical number of the query event type of the user is less than the first predefined threshold; and
in response to determining that the historical number of the query event type of the user is less than the first predefined threshold, generating one or more additional sub-queries for the received query based on a predefined duration.

### Claim 5 (depends on 3)

The computer-implemented method of claim 3, further comprising:
determining that the historical number of the query event type of the user is greater than the second predefined threshold; and
in response to determining that the historical number of the query event type of the user is greater than the second predefined threshold, performing a delayed querying process for the received query.

### Claim 6 (depends on 5)

The computer-implemented method of claim 5, wherein performing the delayed querying process for the received query comprises querying a backup database associated with the database.

### Claim 7 (depends on 5)

The computer-implemented method of claim 5, wherein performing the delayed querying process for the received query comprises setting a delayed response identifier for the query.

### Claim 8

A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:
receiving, as a received query, a query from a user;
determining a query event type and a query time range associated with the query;
determining an estimated amount of data to be queried associated with the query time range based on at least a historical number of the query event type of the user, wherein the historical number comprises a quantity of events of the query event type that occurred in a past time period, and wherein determining the estimated amount of data to be queried comprises:
dividing the historical number by the past time period to determine an average number of the query event type of the user; and
multiplying the average number of the query event type of the user and the query time range to determine the estimated amount of data to be queried;
determining an allowable amount of data to be queried supported by a database for a single query;
determining, based on the estimated amount of data to be queried and the allowable amount of data to be queried, a quantity N of one or more sub-queries to be generated;
dividing the query time range into N time periods, wherein N−1 time periods of the N time periods have equal lengths of time;
generating, as generated one or more sub-queries, the quantity N of one or more sub-queries for the received query, wherein each sub-query is used to query data in a different time period of the N time periods, and wherein a corresponding amount of data to be queried associated with each time period is less than, or equal to, the allowable amount of data to be queried; and
querying the database with the generated one or more sub-queries.

### Claim 9 (depends on 8)

The non-transitory, computer-readable medium of claim 8, wherein the historical number of the query event type of the user is an additional average number or a maximum number of the query event type of the user in a fixed time period.

### Claim 10 (depends on 8)

The non-transitory, computer-readable medium of claim 8, wherein determining the estimated amount of data to be queried comprises:
determining whether the historical number of the query event type of the user is greater than, or equal to, a first predefined threshold and is less than, or equal to, a second predefined threshold; and
in response to determining that the historical number of the query event type of the user is greater than, or equal to, the first predefined threshold and is less than, or equal to, the second predefined threshold, determining the estimated amount of data to be queried associated with the query time range.

### Claim 11 (depends on 10)

The non-transitory, computer-readable medium of claim 10, the operations further comprising:
determining that the historical number of the query event type of the user is less than the first predefined threshold; and
in response to determining that the historical number of the query event type of the user is less than the first predefined threshold, generating one or more additional sub-queries for the received query based on a predefined duration.

### Claim 12 (depends on 10)

The non-transitory, computer-readable medium of claim 10, the operations further comprising:
determining that the historical number of the query event type of the user is greater than the second predefined threshold; and
in response to determining that the historical number of the query event type of the user is greater than the second predefined threshold, performing a delayed querying process for the received query.

### Claim 13 (depends on 12)

The non-transitory, computer-readable medium of claim 12, wherein performing the delayed querying process for the received query comprises querying a backup database associated with the database.

### Claim 14 (depends on 12)

The non-transitory, computer-readable medium of claim 12, wherein performing the delayed querying process for the received query comprises setting a delayed response identifier for the query.

### Claim 15

A computer-implemented system, comprising:
one or more computers; and
one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform one or more operations comprising:
receiving, as a received query, a query from a user;
determining a query event type and a query time range associated with the query;
determining an estimated amount of data to be queried associated with the query time range based on at least a historical number of the query event type of the user, wherein the historical number comprises a quantity of events of the query event type that occurred in a past time period, and wherein determining the estimated amount of data to be queried comprises:
dividing the historical number by the past time period to determine an average number of the query event type of the user; and
multiplying the average number of the query event type of the user and the query time range to determine the estimated amount of data to be queried;
determining an allowable amount of data to be queried supported by a database for a single query;
determining, based on the estimated amount of data to be queried and the allowable amount of data to be queried, a quantity N of one or more sub-queries to be generated;
dividing the query time range into N time periods, wherein N−1 time periods of the N time periods have equal lengths of time;
generating, as generated one or more sub-queries, the quantity N of one or more sub-queries for the received query, wherein each sub-query is used to query data in a different time period of the N time periods, and wherein a corresponding amount of data to be queried associated with each time period is less than, or equal to, the allowable amount of data to be queried; and
querying the database with the generated one or more sub-queries.

### Claim 16 (depends on 15)

The computer-implemented system of claim 15, wherein the historical number of the query event type of the user is an additional average number or a maximum number of the query event type of the user in a fixed time period.

### Claim 17 (depends on 15)

The computer-implemented system of claim 15, wherein determining the estimated amount of data to be queried comprises:
determining whether the historical number of the query event type of the user is greater than, or equal to, a first predefined threshold and is less than, or equal to, a second predefined threshold; and
in response to determining that the historical number of the query event type of the user is greater than, or equal to, the first predefined threshold and is less than, or equal to, the second predefined threshold, determining the estimated amount of data to be queried associated with the query time range.

### Claim 18 (depends on 17)

The computer-implemented system of claim 17, the operations further comprising:
determining that the historical number of the query event type of the user is less than the first predefined threshold; and
in response to determining that the historical number of the query event type of the user is less than the first predefined threshold, generating one or more additional sub-queries for the received query based on a predefined duration.

### Claim 19 (depends on 17)

The computer-implemented system of claim 17, the operations further comprising:
determining that the historical number of the query event type of the user is greater than the second predefined threshold; and
in response to determining that the historical number of the query event type of the user is greater than the second predefined threshold, performing a delayed querying process for the received query.

### Claim 20 (depends on 19)

The computer-implemented system of claim 19, wherein performing the delayed querying process for the received query comprises querying a backup database associated with the database.
