CN107577741A - A kind of processing method and processing device of data query - Google Patents

A kind of processing method and processing device of data query Download PDF

Info

Publication number
CN107577741A
CN107577741A CN201710749608.8A CN201710749608A CN107577741A CN 107577741 A CN107577741 A CN 107577741A CN 201710749608 A CN201710749608 A CN 201710749608A CN 107577741 A CN107577741 A CN 107577741A
Authority
CN
China
Prior art keywords
query statement
query
data
judge
common template
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.)
Pending
Application number
CN201710749608.8A
Other languages
Chinese (zh)
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.)
Shenzhen Huaao Data Technology Co Ltd
Original Assignee
Shenzhen Huaao Data 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 Shenzhen Huaao Data Technology Co Ltd filed Critical Shenzhen Huaao Data Technology Co Ltd
Priority to CN201710749608.8A priority Critical patent/CN107577741A/en
Publication of CN107577741A publication Critical patent/CN107577741A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention provides a kind of processing method and processing device of data query.Methods described, including:Obtain the query statement of the inquiry data of user's input;It is common template or personalized query statement to judge the query statement, obtains judged result;According to the judged result, corresponding data are inquired about from distributed data base;By the data output of inquiry to user.By judging that query statement is common template or personalized query statement, corresponding data are inquired about from distributed data base further according to judged result, so, can not only meet the needs of user individual inquiry, moreover, will not cause to block to conventional query.

Description

A kind of processing method and processing device of data query
Technical field
The present invention relates to field of computer technology, and in particular to a kind of processing method and processing device of data query.
Background technology
At present, user is when inquiring about data, can be inquired about according to the query interface of backstage configuration, can also with Put the sql sentences that interface oneself configuration needs;But when user oneself configures interface, many interfaces will be produced, also, The query statement of each interface is different from, and not only queries is big, and inquiry differs greatly, and backstage needs to be looked into according to different Ask sentence to be inquired about from database, so, just aggravated the burden of database, certain shadow can be caused to data access Ring.
The content of the invention
, can the invention provides a kind of processing method and processing device of data query for drawbacks described above of the prior art With the query statement according to different types, corresponding data are inquired about from distributed data base, the negative of database can be reduced Load.
In a first aspect, a kind of processing method of data query provided by the invention, including:
Obtain the query statement of the inquiry data of user's input;
It is common template or personalized query statement to judge the query statement, obtains judged result;
According to the judged result, corresponding data are inquired about from distributed data base;
By the data output of inquiry to user.
Optionally, the distributed data base, including:First database and the second database;
It is described according to the judged result, the step of corresponding data are inquired about from distributed data base, including:
If the query statement is common template, according to the query statement, phase is inquired about from first database The data answered;
If the query statement is not common template, but personalized query statement, then according to the query statement, from institute State and corresponding data are inquired about in the second database.
Optionally, it is described to judge that the query statement is common template or personalized query statement, judged result is obtained, Including:
Judge whether the query statement is conjunctive query sentence, it is common template or individual character to obtain the query statement Change the judged result of query statement, the judged result is:
If it is conjunctive query sentence to judge the query statement, the query statement is personalized query statement;
If it is not conjunctive query sentence to judge the query statement, the query statement is common template.
Optionally, it is described to judge that the query statement is common template or personalized query statement, judged result is obtained, Including:
The query statement is matched with common template, judges that the query statement is Universal Die according to matching result Plate or personalized query statement, judged result are:
If the match is successful, judge the query statement for common template;
If without the match is successful, judge the query statement for personalized query statement.
Second aspect, a kind of processing unit of data query provided by the invention, including:
Query statement acquisition module, the query statement of the inquiry data for obtaining user's input;
Query statement judge module, for judging that the query statement is common template or personalized query statement, obtain Obtain judged result;
Enquiry module, for according to the judged result, corresponding data to be inquired about from distributed data base;
Output module, for by the data output of inquiry to user.
Optionally, the distributed data base, including:First database and the second database;
The enquiry module, is specifically used for:
If the judged result of the query statement judge module is that the query statement is common template, looked into according to Sentence is ask, corresponding data are inquired about from first database;
If the judged result of the query statement judge module is that the query statement is personalized query statement, basis The query statement, corresponding data are inquired about from second database.
Optionally, the query statement judge module, including:
First judging unit, for judging whether the query statement is conjunctive query sentence, obtain the query statement It is the judged result of common template or personalized query statement, the judged result is:
If it is conjunctive query sentence to judge the query statement, the query statement is personalized query statement;
If it is not conjunctive query sentence to judge the query statement, the query statement is common template.
Optionally, the query statement judge module, including:
Matching unit, for the query statement to be matched with common template;
Second judging unit, for judging that the query statement is common template or personalized inquiry according to matching result Sentence, judged result are:
If the match is successful, judge the query statement for common template;
If without the match is successful, judge the query statement for personalized query statement.
From above technical scheme, the present invention provides a kind of processing method of data query, by judging query statement It is common template or personalized query statement, inquires about corresponding data from distributed data base further according to judged result, this Sample, can not only meet the needs of user individual inquiry, moreover, will not cause to block to conventional query.
A kind of processing unit of data query provided by the invention, the processing method with above-mentioned data query is for identical Inventive concept, there is identical beneficial effect.
Brief description of the drawings
, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical scheme of the prior art The required accompanying drawing used is briefly described in embodiment or description of the prior art.In all of the figs, similar element Or part is typically identified by similar reference.In accompanying drawing, each element or part might not be drawn according to the ratio of reality.
Fig. 1 shows that first embodiment of the invention provides a kind of flow chart of the processing method of data query;
Fig. 2 shows that second embodiment of the invention provides a kind of schematic diagram of the processing unit of data query.
Embodiment
The embodiment of technical solution of the present invention is described in detail below in conjunction with accompanying drawing.Following examples are only used for Clearly illustrate technical scheme, therefore be intended only as example, and the protection of the present invention can not be limited with this Scope.
It should be noted that unless otherwise indicated, technical term or scientific terminology used in this application should be this hair The ordinary meaning that bright one of ordinary skill in the art are understood.
The invention provides a kind of processing method and processing device of data query.Below in conjunction with the accompanying drawings to embodiments of the invention Illustrate.
Fig. 1 shows a kind of flow chart of the processing method for data query that first embodiment of the invention is provided.Such as Fig. 1 Shown, a kind of processing method for data query that first embodiment of the invention provides comprises the following steps:
Step S101:Obtain the query statement of the inquiry data of user's input.
Step S102:It is common template or personalized query statement to judge the query statement, obtains judged result.
Step S103:According to the judged result, corresponding data are inquired about from distributed data base.
Step S104:By the data output of inquiry to user.
Wherein, common template refers to general, the fixed query statement of system configuration.Personalized query statement refers to use The query statement that family configures in configuration interface oneself.User can be associated in configuration interface configuration querying sentence by defining The modes such as table, screening conditions, screening field are completed.
Wherein it is possible to obtain the query statement of a user or multiple users input simultaneously, this is all in the guarantor of the present invention In the range of shield.
By judging that query statement is common template or personalized query statement, further according to judged result from distributed number According to corresponding data are inquired about in storehouse, so, can not only meet the needs of user individual inquiry, moreover, will not look into conventional Inquiry causes to block.
In a specific embodiment provided by the invention, the distributed data base, including:First database and second Database;It is described according to the judged result, the step of corresponding data are inquired about from distributed data base, including:It is if described Query statement is common template, then according to the query statement, corresponding data are inquired about from first database;It is if described Query statement is not common template, but personalized query statement, then according to the query statement, from second database Inquire about corresponding data.
Wherein, the first database corresponds to the data of common template inquiry;Second database corresponds to personalized query statement and looked into The data of inquiry.First database and the second database can store duplicate data.Common template can inquire about the first number According to the data in a tables of data in storehouse;One or more data that personalized query statement can be inquired about in the second database Data in table.Tables of data in first database is consistent with the tables of data in the second database.
When it is common template to determine query statement, then inquired about according to the query statement from the first database corresponding Data.When it is personalized query statement to determine query statement, then need to inquire about corresponding data from the second database. So, when there is the query statement of the common template for receiving user's input and personalized inquiry simultaneously, it is possible to while basis Both query statements are inquired about, and can't be clashed.
Wherein, can be by multiple identical common template query statements of acquisition when inquiring about data according to common template Merger is carried out, optimizes the query statement of common template, and then improve query rate.
It is described to judge that the query statement is common template or individual character in a specific embodiment provided by the invention Change query statement, obtain judged result, can include:Judge whether the query statement is conjunctive query sentence, described in acquisition Query statement is the judged result of common template or personalized query statement, and the judged result is:
If it is conjunctive query sentence to judge the query statement, the query statement is personalized query statement;If sentence The query statement that breaks is not conjunctive query sentence, then the query statement is common template.
When judging query statement, first query statement can be parsed, judge that the data of query statement inquiry are present In a tables of data or in multiple tables of data, that is to say, that judge the data link of query statement inquiry is a data Table or multiple tables of data;If a tables of data, then it is common template to show the query statement;If multiple tables of data, then It is personalized query statement to show the query statement.
For example, by the from clause in SQL statement, can directly judge to need to use several tables of data;Pass through The keywords such as exist, in may determine whether subquery, and then judge whether also other query statements.
It is described to judge that the query statement is common template or individual character in a specific embodiment provided by the invention Change query statement, obtain judged result, including:The query statement is matched with common template, sentenced according to matching result The query statement that breaks is common template or personalized query statement, judged result are:
If the match is successful, judge the query statement for common template;If without the match is successful, the inquiry is judged Sentence is personalized query statement.
, can also be by the querying condition of the query statement of reception and inquiry field and common template when judging query statement Querying condition and inquiry field be compared, if equally, showing that the match is successful, then judge query statement for common template; If querying condition and any one condition inquired about in field or field differ, show without the match is successful, then judge to look into Inquiry sentence is personalized query statement.
In general, a large amount of query statements are all common templates, and only a small number of query statements are personalized inquiry language Sentence.Because personalization inquiry may produce complicated calculations, when performance and the response of slow whole database can be dragged under serious conditions Between, therefore in inquiry, common template inquiry and personalized inquiry are separated to inquire about, it can make common template inquiry is quick to ring Answer, the speed of most of data query can't be influenceed.Generally, sixteen principles can be used, according to a small number of personalized inquiry languages Sentence inquires about data in the second database, data is inquired about in the first database according to common template query statement, so, not only It disclosure satisfy that the demand of user individual inquiry, additionally it is possible to make most of inquiry normal response, meet the needs of most of users.
In above-mentioned first embodiment, there is provided a kind of processing method of data query, corresponding, the application A kind of processing unit of data query is also provided.Fig. 2 is refer to, it is a kind of data query that second embodiment of the invention provides Processing unit schematic diagram.Because device embodiment is substantially similar to embodiment of the method, so describe fairly simple, it is related Part illustrates referring to the part of embodiment of the method.Device embodiment described below is only schematical.
A kind of processing unit for data query that second embodiment of the invention provides, including:
Query statement acquisition module 101, the query statement of the inquiry data for obtaining user's input;
Query statement judge module 102, for judging that the query statement is common template or personalized query statement, Obtain judged result;
Enquiry module 103, for according to the judged result, corresponding data to be inquired about from distributed data base;
Output module 104, for by the data output of inquiry to user.
In a specific embodiment provided by the invention, the distributed data base, including:First database and second Database;
The enquiry module 103, is specifically used for:
If the judged result of the query statement judge module is that the query statement is common template, looked into according to Sentence is ask, corresponding data are inquired about from first database;
If the judged result of the query statement judge module is that the query statement is personalized query statement, basis The query statement, corresponding data are inquired about from second database.
In a specific embodiment provided by the invention, the query statement judge module 102, including:
First judging unit, for judging whether the query statement is conjunctive query sentence, obtain the query statement It is the judged result of common template or personalized query statement, the judged result is:
If it is conjunctive query sentence to judge the query statement, the query statement is personalized query statement;
If it is not conjunctive query sentence to judge the query statement, the query statement is common template.
In a specific embodiment provided by the invention, the query statement judge module 102, including:
Matching unit, for the query statement to be matched with common template;
Second judging unit, for judging that the query statement is common template or personalized inquiry according to matching result Sentence, judged result are:
If the match is successful, judge the query statement for common template;
If without the match is successful, judge the query statement for personalized query statement.
More than, a kind of embodiment explanation of the processing unit of the data query provided for second embodiment of the invention.
A kind of processing unit of data query provided by the invention is with the processing method of above-mentioned data query for identical Inventive concept, there is identical beneficial effect, here is omitted.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example " or " some show The description of example " etc. means that combining specific features, structure, material or feature that the embodiment or example describe is contained in the present invention At least one embodiment or example in.In this manual, the schematic representation of above-mentioned term is not required to be directed to Identical embodiment or example.Moreover, specific features, structure, material or the feature of description can be in any one or more realities Apply and combined in an appropriate manner in example or example.In addition, in the case of not conflicting, those skilled in the art can incite somebody to action Different embodiments or example and the feature of different embodiments or example described in this specification are combined and combined.Need Illustrate, the flow chart and block diagram in accompanying drawing of the present invention show according to the device of multiple embodiments of the present invention, method and Architectural framework in the cards, function and the operation of acquisition machine program product.At this point, each side in flow chart or block diagram Frame can represent a part for a module, program segment or code, and a part for the module, program segment or code includes one Or multiple executable instructions for being used to realize defined logic function.It should also be noted that some as replace realization in, side The function of being marked in frame can also be with different from the order marked in accompanying drawing generation.For example, two continuous square frames are actual On can perform substantially in parallel, they can also be performed in the opposite order sometimes, and this is depending on involved function.Also It is noted that the combination of each square frame and block diagram in block diagram and/or flow chart and/or the square frame in flow chart, Ke Yiyong Function as defined in execution or the special hardware based device of action are realized, or can be referred to specialized hardware and acquisition machine The combination of order is realized.
It is apparent to those skilled in the art that for convenience and simplicity of description, the device of foregoing description, The specific work process of device and unit, the corresponding process in preceding method embodiment is may be referred to, will not be repeated here.
In several embodiments provided herein, it should be understood that disclosed device, apparatus and method, can be with Realize by another way.Device embodiment described above is only schematical, for example, the division of the unit, Only a kind of division of logic function, can there is other dividing mode when actually realizing, in another example, multiple units or component can To combine or be desirably integrated into another device, or some features can be ignored, or not perform.
The unit illustrated as separating component can be or may not be physically separate, show as unit The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units it is integrated in a unit.
If the function is realized in the form of SFU software functional unit and is used as independent production marketing or in use, can be with It is stored in an acquisition machine read/write memory medium.Based on such understanding, technical scheme is substantially in other words The part to be contributed to prior art or the part of the technical scheme can be embodied in the form of software product, and this is obtained Machine software product is stored in a storage medium, including some instructions are causing an acquisition machine machine (can be People obtains machine, server, or net machine etc.) perform all or part of step of each embodiment methods described of the present invention. And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with the medium of store program codes.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent The present invention is described in detail with reference to foregoing embodiments for pipe, it will be understood by those within the art that:Its according to The technical scheme described in foregoing embodiments can so be modified, either which part or all technical characteristic are entered Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology The scope of scheme, it all should cover among the claim of the present invention and the scope of specification.

Claims (8)

  1. A kind of 1. processing method of data query, it is characterised in that including:
    Obtain the query statement of the inquiry data of user's input;
    It is common template or personalized query statement to judge the query statement, obtains judged result;
    According to the judged result, corresponding data are inquired about from distributed data base;
    By the data output of inquiry to user.
  2. 2. the processing method of data query according to claim 1, it is characterised in that the distributed data base, including: First database and the second database;
    It is described according to the judged result, the step of corresponding data are inquired about from distributed data base, including:
    If the query statement is common template, according to the query statement, inquired about from first database corresponding Data;
    If the query statement is not common template, but personalized query statement, then according to the query statement, from described Corresponding data are inquired about in two databases.
  3. 3. the processing method of data query according to claim 2, it is characterised in that described to judge that the query statement is Common template or personalized query statement, judged result is obtained, including:
    Judge whether the query statement is conjunctive query sentence, it is that common template or personalization are looked into obtain the query statement The judged result of sentence is ask, the judged result is:
    If it is conjunctive query sentence to judge the query statement, the query statement is personalized query statement;
    If it is not conjunctive query sentence to judge the query statement, the query statement is common template.
  4. 4. the processing method of data query according to claim 2, it is characterised in that described to judge that the query statement is Common template or personalized query statement, judged result is obtained, including:
    The query statement is matched with common template, according to matching result judge the query statement be common template also It is personalized query statement, judged result is:
    If the match is successful, judge the query statement for common template;
    If without the match is successful, judge the query statement for personalized query statement.
  5. A kind of 5. processing unit of data query, it is characterised in that including:
    Query statement acquisition module, the query statement of the inquiry data for obtaining user's input;
    Query statement judge module, for judging that the query statement is common template or personalized query statement, sentenced Disconnected result;
    Enquiry module, for according to the judged result, corresponding data to be inquired about from distributed data base;
    Output module, for by the data output of inquiry to user.
  6. 6. the processing unit of data query according to claim 5, it is characterised in that the distributed data base, including: First database and the second database;
    The enquiry module, is specifically used for:
    If the judged result of the query statement judge module is that the query statement is common template, according to the inquiry language Sentence, corresponding data are inquired about from first database;
    If the judged result of the query statement judge module is that the query statement is personalized query statement, according to Query statement, corresponding data are inquired about from second database.
  7. 7. the processing unit of data query according to claim 6, it is characterised in that the query statement judge module, Including:
    First judging unit, for judging whether the query statement is conjunctive query sentence, it is logical to obtain the query statement With template or the judged result of personalized query statement, the judged result is:
    If it is conjunctive query sentence to judge the query statement, the query statement is personalized query statement;
    If it is not conjunctive query sentence to judge the query statement, the query statement is common template.
  8. 8. the processing unit of data query according to claim 6, it is characterised in that the query statement judge module, Including:
    Matching unit, for the query statement to be matched with common template;
    Second judging unit, for judging that the query statement is common template or personalized inquiry language according to matching result Sentence, judged result are:
    If the match is successful, judge the query statement for common template;
    If without the match is successful, judge the query statement for personalized query statement.
CN201710749608.8A 2017-08-28 2017-08-28 A kind of processing method and processing device of data query Pending CN107577741A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710749608.8A CN107577741A (en) 2017-08-28 2017-08-28 A kind of processing method and processing device of data query

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710749608.8A CN107577741A (en) 2017-08-28 2017-08-28 A kind of processing method and processing device of data query

Publications (1)

Publication Number Publication Date
CN107577741A true CN107577741A (en) 2018-01-12

Family

ID=61029869

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710749608.8A Pending CN107577741A (en) 2017-08-28 2017-08-28 A kind of processing method and processing device of data query

Country Status (1)

Country Link
CN (1) CN107577741A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109241050A (en) * 2018-07-10 2019-01-18 阿里巴巴集团控股有限公司 A kind of data query method, apparatus and system, electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102163195A (en) * 2010-02-22 2011-08-24 北京东方通科技股份有限公司 Query optimization method based on unified view of distributed heterogeneous database
CN102479223A (en) * 2010-11-25 2012-05-30 中国移动通信集团浙江有限公司 Data query method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102163195A (en) * 2010-02-22 2011-08-24 北京东方通科技股份有限公司 Query optimization method based on unified view of distributed heterogeneous database
CN102479223A (en) * 2010-11-25 2012-05-30 中国移动通信集团浙江有限公司 Data query method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109241050A (en) * 2018-07-10 2019-01-18 阿里巴巴集团控股有限公司 A kind of data query method, apparatus and system, electronic equipment
CN109241050B (en) * 2018-07-10 2021-08-27 创新先进技术有限公司 Data query method, device and system and electronic equipment

Similar Documents

Publication Publication Date Title
US11068439B2 (en) Unsupervised method for enriching RDF data sources from denormalized data
US20180246955A1 (en) Method and device for searching legal provision
US7996392B2 (en) Changing ranking algorithms based on customer settings
US9690846B2 (en) Intelligent navigation of a category system
CA2484009A1 (en) Managing expressions in a database system
US10599692B2 (en) Modification of a saved database query based on a change in the meaning of a query value over time
EP1738290A1 (en) Partial query caching
US8229940B2 (en) Query predicate generator to construct a database query predicate from received query conditions
US8145626B2 (en) Method and system for data processing using multidimensional filtering
US7660814B2 (en) Techniques for mapping a physical table to multiple virtual tables
CN109783498B (en) Data processing method and device, electronic equipment and storage medium
CN107577741A (en) A kind of processing method and processing device of data query
JP2017219899A (en) Knowledge search device, knowledge search method and knowledge search program
CN112256745A (en) Retail data analysis method
CN107004002A (en) According to the set of structural data generation unstructured searching inquiry
US10671810B2 (en) Citation explanations
CN102955779A (en) Method and device for searching software
US20080215539A1 (en) Data ordering for derived columns in a database system
CN108984582A (en) A kind of inquiry request processing method
JP2018022217A (en) Knowledge search device, knowledge search method and knowledge search program
US7412452B2 (en) Data storage and retrieval system with intensional category representations to provide dynamic categorization of information items
CN106933928A (en) Task storage method and device based on external data file
WO2016184921A1 (en) Method and system for searching a database having data sets
CN101576897A (en) File content retrieval system and file content retrieval method
CN108614900A (en) A kind of data method for quickly retrieving and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20180112

RJ01 Rejection of invention patent application after publication