CN104008191A - Data inquiring method - Google Patents

Data inquiring method Download PDF

Info

Publication number
CN104008191A
CN104008191A CN201410260746.6A CN201410260746A CN104008191A CN 104008191 A CN104008191 A CN 104008191A CN 201410260746 A CN201410260746 A CN 201410260746A CN 104008191 A CN104008191 A CN 104008191A
Authority
CN
China
Prior art keywords
data
order
query
key word
application server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410260746.6A
Other languages
Chinese (zh)
Other versions
CN104008191B (en
Inventor
唐超
马丽伟
秦波
王�锋
赵晓平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201410260746.6A priority Critical patent/CN104008191B/en
Publication of CN104008191A publication Critical patent/CN104008191A/en
Application granted granted Critical
Publication of CN104008191B publication Critical patent/CN104008191B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Fuzzy Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data inquiring method. The method includes the steps that a client sends a data inquiring command to a database application server; the database application server optimizes the data inquiring command, and when the data inquiring command includes preset complex operation keywords, the query field range of the optimized data inquiring command includes fields, corresponding to the complex operation keywords, in the data inquiring command; the database application server sends the optimized data inquiring command to a distributed data server storing corresponding data, and the distributed data server sends the data corresponding to the query field range in the optimized data inquiring command and stored in the distributed data server to the database application server; the database application server inquires and processes the data from the distributed data server according to the data inquiring command before optimization, and feeds back an inquiring and processing result to the client. By means of the method, complex database inquiring can be achieved.

Description

A kind of data enquire method
Technical field
The present invention relates to database technology, particularly relate to a kind of data enquire method.
Background technology
At present, along with the widespread use of database technology, data scale and visit capacity are increasingly huge, and traditional centralized data base cannot meet the application needs of this large-scale data.For this problem, introduce at present distributed data base system, by data are carried out to burst, each data slot is distributed on many data servers and carries out storage administration, to realize the distributed storage of large-scale data.
At present in distributed data base system, the normal mode that adopts horizontal fragmentation is carried out data fragmentation, under which, will choose some service fields as splitting key, according to described fractionation key, all tuples of holotopy will be divided into some disjoint subsets, the fragment that each subset is relation.In the time that client need to be from Database Systems data query, corresponding SQL query order need to be sent to Database Systems, by system, according to this SQL query order, in all tuple data that the machine is preserved, the data of the service fields (being the field after select in SQL query order) of the final inquiry of this SQL query order send to client.The all data that according to this SQL query order, related data server sent again by client are processed, and obtain final Query Result.
Data query scheme in above-mentioned distributed system is not supported complicated SQL query order, for example, and the querying command that comprises the operation such as packet (GROUP), sequence (ORDER).Because, the data that in above-mentioned query scheme, each related data server sends are only field corresponding to select order, this field is often inconsistent with the service fields of the operation such as GROUP, ORDER institute foundation, like this, the data of obtaining due to client are only the data of select order corresponding field, therefore cannot be to the processing such as (GROUP), sequence (ORDER) of dividing into groups of received data.
As can be seen here, the data enquire method of existing distributed system cannot meet the complex query operational requirements of client.
Summary of the invention
In view of this, fundamental purpose of the present invention is to provide a kind of data enquire method, and the method can realize the complex query of client to Database Systems.
In order to achieve the above object, the technical scheme that the present invention proposes is:
A kind of data enquire method, comprising:
A, client send data query order to database application server;
B, described database application server are optimized described data query order, wherein, in the time that described data query order comprises default complex operations key word, in the inquiry word segment limit of the data query order after optimization, comprise the field of described complex operations key word correspondence in described data query order;
C, described database application server send to the data query order after described optimization the Distributed database service device of storage corresponding data, and described in the data query order after the described optimization that described Distributed database service device is preserved self, data corresponding to inquiry word segment limit send to described database application server;
The data query order before according to described optimization of d, described database application server, carries out query processing to the data that are received from described Distributed database service device, and gives described client by described query processing result feedback.
In sum, the data enquire method that the present invention proposes, before data query order is sent to Distributed database service device, first be optimized, make Distributed database service device the order based on after optimizing return to the data for realizing complex query, thereby make database application server can complete complicated query processing, realize the complex query of client to Database Systems.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of the embodiment of the present invention one.
Embodiment
For making the object, technical solutions and advantages of the present invention clearer, the present invention is described in further detail below in conjunction with the accompanying drawings and the specific embodiments.
Core concept of the present invention is: Database Systems are received after the inquiry request of client, complex operations key word in this inquiry request is identified as GROUP, ORDER key word, the field of their correspondences is increased in the inquiry word segment limit of inquiry request, then inquiry request is issued to each Distributed database service device, like this, can from each Distributed database service device, get the data of complex operations field that key word limits, thereby can further complete complicated query processing operation based on these data.
Fig. 1 is the schematic flow sheet of the embodiment of the present invention one, and as shown in Figure 1, this embodiment mainly comprises:
Step 101, client send data query order to database application server.
Here, described database application server is exactly the server that database application service is directly externally provided.The same existing system of concrete methods of realizing of this step, does not repeat them here.
Step 102, described database application server are optimized described data query order, wherein, in the time that described data query order comprises default complex operations key word, in the inquiry word segment limit of the data query order after optimization, comprise the field of described complex operations key word correspondence in described data query order.
Particularly, described complex operations key word comprises grouping (GROUP) and sequence (ORDER).In such cases, preferably, can realize above-mentioned optimization by following step:
Step 1021, described data query order is resolved, obtain corresponding syntax tree.
Here, concrete analytic method, by those skilled in the art are grasped, does not repeat them here.
Step 1022, the inquiry word segment limit of inquiry after (select) key word in described syntax tree is kept in Query List.
Here, utilize an intermediate storage parameter (being Query List) to preserve the inquiry word segment limit of current inquiry, to judge whether field corresponding complex operations key word to be increased in inquiry word segment limit based on this parameter in subsequent step.
Step 1023, travel through described syntax tree and determine whether to exist GROUP key word, if existed, judge whether the grouping field after described GROUP key word is present in described Query List, if there is no, the grouping field after described GROUP key word is increased to the afterbody of inquiring about field in described Query List and described syntax tree.
This step is for being increased to corresponding GROUP key word grouping field in inquiry word segment limit, so that the after this querying command of Distributed database service device based on after optimizing, the data of grouping field corresponding GROUP key word are sent to database application server, so that database application server can be based on these data query manipulation that divides into groups accordingly.
Step 1024, travel through described syntax tree and determine whether to exist ORDER key word, if existed, judge whether the sort field after described ORDER key word is present in described Query List, if there is no, the sort field after described ORDER key word is increased to the afterbody of inquiring about field in described Query List and described syntax tree.
This step is for being increased to corresponding ORDER key word sort field in inquiry word segment limit, so that the after this querying command of Distributed database service device based on after optimizing, the data of sort field corresponding ORDER key word are sent to database application server, so that database application server can be based on these data query manipulation that sorts accordingly.
Step 1025, according to current described syntax tree, obtain the data query order after described optimization.
This step, for the syntax tree after optimizing is converted into corresponding querying command, is ordered based on this for Distributed database service device, complex query is operated to needed data and send to database application server.
Here, obtain the concrete grammar of querying command according to syntax tree by ability technician is grasped, do not repeat them here.
Step 103, described database application server send to the data query order after described optimization the Distributed database service device of storage corresponding data, and described in the data query order after the described optimization that described Distributed database service device is preserved self, data corresponding to inquiry word segment limit send to described database application server.
The data query order before according to described optimization of step 104, described database application server, carries out query processing to the data that are received from described Distributed database service device, and gives described client by described query processing result feedback.
In this step, in the data of returning due to each Distributed database service device, will comprise the data for complex query operation, therefore, database application server can these data based on receiving carry out complicated query manipulation (as grouping, sequence etc.) processing.
Here, give the concrete grammar of described client by those skilled in the art are grasped described query processing result feedback, do not repeat them here.
In sum, these are only preferred embodiment of the present invention, be not intended to limit protection scope of the present invention.Within the spirit and principles in the present invention all, any amendment of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (3)

1. a data enquire method, is characterized in that, comprising:
A, client send data query order to database application server;
B, described database application server are optimized described data query order, wherein, in the time that described data query order comprises default complex operations key word, in the inquiry word segment limit of the data query order after optimization, comprise the field of described complex operations key word correspondence in described data query order;
C, described database application server send to the data query order after described optimization the Distributed database service device of storage corresponding data, and described in the data query order after the described optimization that described Distributed database service device is preserved self, data corresponding to inquiry word segment limit send to described database application server;
The data query order before according to described optimization of d, described database application server, carries out query processing to the data that are received from described Distributed database service device, and gives described client by described query processing result feedback.
2. method according to claim 1, is characterized in that, described complex operations key word comprises grouping GROUP and sequence ORDER.
3. method according to claim 2, is characterized in that, the described optimization in step b comprises:
Described data query order is resolved, obtain corresponding syntax tree;
The inquiry word segment limit of inquiring about in described syntax tree after select key word is kept in Query List;
Travel through described syntax tree and determine whether to exist GROUP key word, if existed, judge whether the grouping field after described GROUP key word is present in described Query List, if there is no, the grouping field after described GROUP key word is increased to the afterbody of inquiring about field in described Query List and described syntax tree;
Travel through described syntax tree and determine whether to exist ORDER key word, if existed, judge whether the sort field after described ORDER key word is present in described Query List, if there is no, the sort field after described ORDER key word is increased to the afterbody of inquiring about field in described Query List and described syntax tree;
According to current described syntax tree, obtain the data query order after described optimization.
CN201410260746.6A 2014-06-12 2014-06-12 A kind of data query method Active CN104008191B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410260746.6A CN104008191B (en) 2014-06-12 2014-06-12 A kind of data query method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410260746.6A CN104008191B (en) 2014-06-12 2014-06-12 A kind of data query method

Publications (2)

Publication Number Publication Date
CN104008191A true CN104008191A (en) 2014-08-27
CN104008191B CN104008191B (en) 2018-09-28

Family

ID=51368848

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410260746.6A Active CN104008191B (en) 2014-06-12 2014-06-12 A kind of data query method

Country Status (1)

Country Link
CN (1) CN104008191B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106326428A (en) * 2016-08-24 2017-01-11 华青融天(北京)技术股份有限公司 Data processing method and device
CN107741937A (en) * 2016-09-13 2018-02-27 腾讯科技(深圳)有限公司 A kind of data query method and device
CN110808901A (en) * 2019-11-07 2020-02-18 微位(深圳)网络科技有限公司 Distributed burning-after-reading method and system for messages

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101477524A (en) * 2008-12-11 2009-07-08 金蝶软件(中国)有限公司 System performance optimization method and system based on materialized view
CN101609473A (en) * 2009-07-30 2009-12-23 金蝶软件(中国)有限公司 A kind of method of Structured Query Language (SQL) of reconstruct report query and device
CN102521406A (en) * 2011-12-26 2012-06-27 中国科学院计算技术研究所 Distributed query method and system for complex task of querying massive structured data
US20120166446A1 (en) * 2010-12-23 2012-06-28 Ianywhere Solutions, Inc. Indexing spatial data with a quadtree index having cost-based query decomposition
CN103761080A (en) * 2013-12-25 2014-04-30 中国农业大学 Structured query language (SQL) based MapReduce operation generating method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101477524A (en) * 2008-12-11 2009-07-08 金蝶软件(中国)有限公司 System performance optimization method and system based on materialized view
CN101609473A (en) * 2009-07-30 2009-12-23 金蝶软件(中国)有限公司 A kind of method of Structured Query Language (SQL) of reconstruct report query and device
US20120166446A1 (en) * 2010-12-23 2012-06-28 Ianywhere Solutions, Inc. Indexing spatial data with a quadtree index having cost-based query decomposition
CN102521406A (en) * 2011-12-26 2012-06-27 中国科学院计算技术研究所 Distributed query method and system for complex task of querying massive structured data
CN103761080A (en) * 2013-12-25 2014-04-30 中国农业大学 Structured query language (SQL) based MapReduce operation generating method and system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106326428A (en) * 2016-08-24 2017-01-11 华青融天(北京)技术股份有限公司 Data processing method and device
CN107741937A (en) * 2016-09-13 2018-02-27 腾讯科技(深圳)有限公司 A kind of data query method and device
CN107741937B (en) * 2016-09-13 2020-04-28 腾讯科技(深圳)有限公司 Data query method and device
CN110808901A (en) * 2019-11-07 2020-02-18 微位(深圳)网络科技有限公司 Distributed burning-after-reading method and system for messages

Also Published As

Publication number Publication date
CN104008191B (en) 2018-09-28

Similar Documents

Publication Publication Date Title
US9639567B2 (en) For all entries processing
JP6338817B2 (en) Data management system and method using database middleware
CN103761318B (en) A kind of method and system of relationship type synchronization of data in heterogeneous database
JP6967615B2 (en) Distributed search and index update methods, systems, servers and computer equipment
CN103729471A (en) Method and device for database query
CN104008199B (en) A kind of data query method
WO2013033030A1 (en) Column domain dictionary compression
CN103034735A (en) Big data distributed file export method
CN105100050A (en) User permission management method and system
CN104268298A (en) Method for creating database index and inquiring data
CN104504030B (en) A kind of indexing means towards power dispatching automation magnanimity message
CN106168963B (en) Real-time streaming data processing method and device and server
CN111858760B (en) Data processing method and device for heterogeneous database
CN103823846A (en) Method for storing and querying big data on basis of graph theories
CN111177148A (en) Method for automatically building and dividing tables of hydropower database
WO2017088666A1 (en) Data storage method and coordinator node
CN104598587A (en) Invoice authenticity inquiry method and system
CN104008191A (en) Data inquiring method
CN105786843A (en) Multi-language implementation method for applications and multi-language information query method and device
CN105227386B (en) For dividing the method, apparatus and system of population statistics online user number
EP3866022A3 (en) Transaction processing method and device, electronic device and readable storage medium
CN102915344A (en) SQL (structured query language) statement processing method and device
CN104050297A (en) Inquiry transaction distribution method and device
CN105005572A (en) Database mapping method and device
CN106970943A (en) Fusion query method based on heterogeneous data source and distributed file system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant