Query request processing method and apparatus for time series database

A query request and database technology, applied in the database field, can solve the problems of reducing system processing efficiency, prolonging the overall waiting time of the system, waiting in line, etc., and achieve the effect of improving processing efficiency, reducing overall waiting time, and avoiding impact

Active Publication Date: 2017-02-08
BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF4 Cites 13 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] If the system is occupied by a lot of computing resources by a large number of slow queries, it will take longer for fast queries, and may even require waiting in a queue. For example, a fast query that only takes 100 milliseconds to complete

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Query request processing method and apparatus for time series database
  • Query request processing method and apparatus for time series database
  • Query request processing method and apparatus for time series database

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0068] figure 1 It is a flow chart of an embodiment of the query request processing method of the time series database described in the present invention, such as figure 1 As shown, including the following specific implementation methods:

[0069] In 11, when receiving the user's query request, determine the query type of the query request, the query type includes: fast query and slow query;

[0070] In 12, if it is a fast query, the query request is added to the queue of the first thread pool; if it is a slow query, the query request is added to the queue of the second thread pool.

[0071] To isolate fast queries and slow queries, it is mainly implemented by placing fast queries and slow queries in different thread pools. Both thread pools have their own queues, and query requests will only be processed in the thread pool to which they belong. Queue in the queue, therefore, the slow query will not affect the fast query, that is, the slow query will not block the fast query...

Embodiment 2

[0104] Based on the above introduction, figure 2 It is a flowchart of a preferred embodiment of the query request processing method of the time series database described in the present invention, such as figure 2 As shown, the following specific implementation methods are included.

[0105] In 21, a query request from a user is received.

[0106] In step 22, the query time range is calculated according to the start time and end time of the query data carried in the query request.

[0107] Query time range = end time - start time.

[0108] In 23, the table writing frequency of the table to be queried carried in the query request within the latest predetermined time period is obtained.

[0109] In step 24, it is determined whether the query request further carries a filter condition, if not, execute step 25, and if yes, execute step 26.

[0110] That is to say, the received query request will carry the following information:

[0111] 1) The table to be queried;

[0112] ...

Embodiment 3

[0127] image 3 It is a schematic diagram of the composition and structure of the embodiment of the query request processing device of the time series database according to the present invention, as shown in image 3 As shown, it includes: a receiving unit 31 , a processing unit 32 and a distribution unit 33 .

[0128] The receiving unit 31 is configured to receive a query request from a user, and send the query request to the processing unit 32 and the distribution unit 33 .

[0129] The processing unit 32 is configured to determine the query type of the query request, the query types include: fast query and slow query, and send the determination result to the distribution unit 33 .

[0130] The distribution unit 33 is configured to add the query request to the queue of the first thread pool when the determined result is a fast query, and add the query request to the queue of the second thread pool when the determined result is a slow query.

[0131] To isolate fast queries...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a query request processing method and apparatus for a time series database. The method comprises the steps of determining a query type of a query request when the query request of a user is received, wherein the query type includes quick query and slow query; if the query type is the quick query, adding the query request to a queue of a first thread pool; and if the query type if the slow query, adding the query request to a queue of a second thread pool. By applying the scheme provided by the method and the apparatus, the processing efficiency and the like of a system can be improved.

Description

[0001] 【Technical field】 [0002] The invention relates to database technology, in particular to a query request processing method and device for a time series database. [0003] 【Background technique】 [0004] A time-series database is a database that stores massive time-series data. Time-series data means that each data corresponds to a time stamp. A time-series database can support users to query the massive data in it. [0005] The time-series database can support multiple users to use at the same time. Multiple users can submit multiple query requests at the same time, and one user can also submit multiple query requests at the same time. These query requests can be divided into two query types, that is, consume less computing resources, and Fast queries that take a relatively short time, and slow queries that consume more computing resources and take a long time. [0006] If the system is occupied by a lot of computing resources by a large number of slow queries, it will...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F17/30
Inventor 简恒懿沈达宇
Owner BEIJING BAIDU NETCOM SCI & TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products