CN104714973A - Method and device for processing query statements - Google Patents

Method and device for processing query statements Download PDF

Info

Publication number
CN104714973A
CN104714973A CN201310692597.6A CN201310692597A CN104714973A CN 104714973 A CN104714973 A CN 104714973A CN 201310692597 A CN201310692597 A CN 201310692597A CN 104714973 A CN104714973 A CN 104714973A
Authority
CN
China
Prior art keywords
query
query statement
processing procedure
statement
operational version
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
CN201310692597.6A
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.)
Aisino Corp
Original Assignee
Aisino Corp
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 Aisino Corp filed Critical Aisino Corp
Priority to CN201310692597.6A priority Critical patent/CN104714973A/en
Publication of CN104714973A publication Critical patent/CN104714973A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

The invention discloses a method and device for processing query statements. The method for processing the query statements comprises six continuous processing procedures of query condition dynamic addition, query parameter switch, query statement analysis, a paging query function, a sorting function and a grouping function, a user can choose which procedure to use and which procedure not to use freely through configuring a usage scheme in use of the processing procedures, but an established sequence must be followed; after the usage scheme is determined, when the user submits the query statements and a parameter set, the method for processing the query statements can perform the processing procedures of each query statement according to the usage scheme; when all the processing procedures of the query statement are finished, new query statements and a new parameter set are generated, and the new query statements and the new parameter set are submitted to a query module to execute query.

Description

A kind of method and apparatus processing query statement
Technical field
The present invention relates to data base querying field, in particular to a kind of method and apparatus processing query statement.
Background technology
At present each large-scale web(network on the market) system, large-scale KXG all ubiquity large data library inquiry demand, the past when carrying out data base querying be usually all write dead in each functional module.But along with the development of software engineering, increasing software systems all attempt adopting platform-type exploitation, to reducing overall R&D costs and R&D cycle.Under so overall background, various general polling scheme arises.An important technical task nearly all cannot be walked around in all general polling schemes, that is exactly a series of processing procedures to query statement, such as to the dynamic interpolation querying condition of original query statement, carry out parameter processing, paging, sequence, grouping etc.
Under such background, each fatware manufacturer is proposed different from the parsing of query statement and the scheme of process and design separately, but the problem of these schemes and design ubiquity two aspects:
1) use of developer is not conceived to.Here to parsing and the process of query statement, its object is exactly will provide general development platform for developer, provides general query function.Therefore, this function for customers are developers, should consider that developer uses in design more convenient, easy-to-use and flexible, to design, exploitation and maintenance in the future, change in easy to understand, be easy to amendment.Therefore the present invention has taken into full account the problem of these aspects, and is widely used in actual items.
2) complex disposal process and inconvenience safeguard.Similar most variations all attempts carrying out a series of process to query statement, but these processing procedures do not form process relatively independent one by one by effective decoupling zero, are supplied to developer's unrestricted choice.Make these processing procedures be not easy to safeguard Just because of this, be also not easy to change with reply change in the future.
Summary of the invention
The invention provides a kind of method and apparatus processing query statement, in order to pass through the process to query statement, developer can be facilitated on the one hand with more flexible patten's design query function easily, the functions such as dynamic queries condition, high-efficient pagination inquiry, dynamic order and grouping are provided on the other hand, for large-scale management system general polling platform creates condition for original query statement.
For achieving the above object, the invention provides a kind of method processing query statement, comprising the following steps:
Step S100: provide six continuous print processing procedures: querying condition dynamically adds, query argument conversion, query statement parsing, paging query function, ranking function and block functions, user is when using above processing procedure, can by configuration operational version, freely select which process of which process need not, but must both definite sequences be observed;
Step S200: after operational version is determined, when submit queries statement and parameter set, this method and device will, according to operational version, go to perform each query statement processing procedure successively;
Step S300: after completing all query statement processing procedures, by the new query statement of generation and parameter set, submit Query module performs inquiry.
More preferably, described step S100 comprises the steps:
Step S110: for user provides six continuous print processing procedures: querying condition dynamically adds, query argument conversion, query statement parsing, paging query function, ranking function and block functions, these processing procedures are separate, user can freely select which process of which process need not, but must both definite sequences be observed;
Step S120: user, by configuration file or database table, defines one or more operational version, in each operational version, which processing procedure definition will use, and the execution sequence of processing procedure.User must select at least one operational version, and each operational version must have at least one processing procedure, and execution sequence must observe the request for utilization of this processing procedure;
More preferably, described step S200 comprises the steps:
Step S210: when submit queries statement and parameter set, operational version used should be determined.According to the definition of this operational version, successively query statement and parameter set are processed;
Step S220: user can get the bid at query statement the query interface of casting mark key word, in the processing procedure that querying condition dynamically adds, these marks can be searched for out, and replace with the querying condition that this mark key word defines;
Step S230: query argument translation process, by the parameter with mark in original query statement and parameter set thereof, is converted to query interface and parameter array thereof that JDBC can identify;
Step S240: query statement dissection process process, resolves to 6 inquiry clauses by main query statement outermost in original query statement: select, from, where, group by, having, order by, for processing procedure is below offered help;
Step S250: paging query function treatment process, for original query statement provides the ability with high-efficient pagination inquiry;
Step S260: ranking function processing procedure and block functions processing procedure, is respectively the query capability that original query statement provides dynamic order and grouping.
More preferably, described step S300 comprises the steps:
Step S310: re-start assembled to 6 inquiry clauses completing process, form new query statement and parameter array;
Step S320: new query statement and parameter array submit Query module are performed inquiry.
For achieving the above object, present invention also offers a kind of device processing query statement, comprising:
Scheme determination module, provide six continuous print processing procedures: querying condition dynamically adds, query argument conversion, query statement parsing, paging query function, ranking function and block functions, user is when using above processing procedure, can by configuration operational version, freely select which process of which process need not, but must both definite sequences be observed;
Processing procedure execution module, after operational version is determined, when submit queries statement and parameter set, according to operational version, goes to perform each query statement processing procedure successively;
Submit Query module, after completing all query statement processing procedures, by the new query statement of generation and parameter set, submit Query module performs inquiry.
Further, described scheme determination module is specifically for performing following steps:
For user provides six continuous print processing procedures: querying condition dynamically adds, query argument conversion, query statement parsing, paging query function, ranking function and block functions, these processing procedures are separate, user can freely select which process of which process need not, but must both definite sequences be observed;
User is by configuration file or database table, define one or more operational version, in each operational version, which processing procedure definition will use, and the execution sequence of processing procedure, user must select at least one operational version, each operational version must have at least one processing procedure, and execution sequence must observe the request for utilization of this processing procedure.
Further, described processing procedure execution module is specifically for performing following steps:
When submit queries statement and parameter set, operational version used should be determined, according to the definition of this operational version, successively query statement and parameter set be processed;
User can get the bid at query statement the query interface of casting mark key word, in the processing procedure that querying condition dynamically adds, these marks can be searched for out, and replace with the querying condition that this mark key word defines;
Query argument translation process, by the parameter with mark in original query statement and parameter set thereof, is converted to query interface and parameter array thereof that JDBC can identify;
Query statement dissection process process, resolves to 6 inquiry clauses by main query statement outermost in original query statement: select, from, where, group by, having, order by, for processing procedure is below offered help;
Paging query function treatment process, for original query statement provides the ability with high-efficient pagination inquiry;
Ranking function processing procedure and block functions processing procedure, be respectively the query capability that original query statement provides dynamic order and grouping.
Further, described submit Query module is specifically for performing following steps:
Re-start assembled to 6 inquiry clauses completing process, form new query statement and parameter array;
New query statement and parameter array submit Query module are performed inquiry.
The present invention provides many convenient, easy-to-use with function flexibly for developer carries out data query, and its process query statement method and apparatus of the same type with other compares, and it is advantageous that:
1) for large-scale web system various data query function provides powerful platform support, can greatly improve its efficiency of research and development, make maintenance convenient and swift with change.
2) provide more easy easy-to-use query interface notation methods, make developer convenient when adding variable for query statement.
3) provide easier, understandable dynamic filtration condition solutions, make developer be that inquiry form interpolation filtercondition is simple.
4) encapsulate the specific implementation of the schemes such as paging query, sequence, grouping, reduce the technical threshold of research and development, improve running efficiency of system
5) providing easy easy-to-use extensive interface, making other system can expand new function according to the needs of self when using of the present invention.
6) the present invention can be applied in developing instrument or development platform, can be also that other system uses as independently device.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the method flow diagram of the process query statement of one embodiment of the invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not paying the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
The problem to be solved in the present invention is how for large software management system provides a convenience to develop, runs efficient data query solution.Solve this problem and mainly will solve following problem: for query statement provides Parameterization Scheme, provides the scheme of dynamically interpolation querying condition, provides the scheme of paging query, provides sequence and grouping scheme.Meanwhile, the starting point of the present invention be for developer provide convenience, fast and flexibly data query scheme, because this has been a series of design:
First, developer, when writing query statement, need not mark question mark, make parameter array, adopt unfriendly for developer in this way, be unfavorable for maintenance in the future and change as JDBC requires.Present invention employs convenient mode, with the form mark of ": var " such variable name in query statement, and with name-be worth right form to transmit query argument.Adopt in such a way, developer at query statement optional position mark variable, can use any amount, with random order mark variable.Finally, the present invention will arrange reference order for developer, the query statement that formation JDBC can identify and parameter array.
Secondly, the invention provides a kind of scheme of dynamic queries condition, namely in query statement with the form mark dynamic condition of ": variable name+key word ", as mark ": nameEquals ".When user does not use this condition when inputting filtercondition, then this mark is directly removed; And when user employs this condition and have input filter value, the present invention will identify such as the key word of " Equals ", and be translated into the querying condition of such as " name=:nameEquals ", dynamically add in query statement.
The present invention also provides the functions such as paging query, sequence, grouping, summation for developer.As long as developer contains page, size variable and then performs paging query in the parameter transmitted; Contain the variablees such as ordering and then perform sequence; Contain the variablees such as groupBy, having then to divide into groups; Developer performs count () method and then performs summation to former query statement.All these functions are all realize on the basis adjusted original query statement.
Finally, the present invention is the design that query processing process provides operational version.All processing procedures are packaged into six processing procedures by the present invention: dynamic queries condition handling process, query argument translation process, query statement dissection process process, paging query processing procedure, ordering process and packet transaction process.Developer can design one or more operational version, and which process is each operational version can define is used, and which process is not used.But the process used in all operational versions all must according to both definite sequence execution.Then, each polling routine just freely can choose the process which scheme execution query statement the end uses, and finally performs inquiry.
The present invention, when specifically using, provides three use scenes:
1) query statement is configured in query statement configuration file by developer.When front end sends inquiry request, call this method and device and provide query statement to number and query argument collection.The method and device, by searching query statement configuration file, after obtaining corresponding query statement, perform the processing procedure that this method and device define, are finally supplied to the discernible query statement of JDBC and parameter array together with query argument collection.
2) query statement is preserved in the query statement information table of database by developer.When front end sends inquiry request, call this method and device and provide query statement to number and query argument collection.The method and device, by searching query statement information table, after obtaining corresponding query statement, perform the processing procedure that this method and device define, are finally supplied to the discernible query statement of JDBC and parameter array together with query argument collection.
3) developer calls this method and device in a program and provides query statement and query argument collection.This method and device perform to this query statement and query argument collection the processing procedure that this method and device define, and are finally supplied to the discernible query statement of JDBC and parameter array.
The process that the process of the present invention to query statement is divided into the process of dynamically interpolation querying condition, the process of query argument conversion, query statement to resolve, the process of paging query function, the process of ranking function, and these six processes of the process of block functions.Six functions, 7 of being encapsulated in respectively under SqlProcessor interface realize in class, are injected into SqlProxy class in the mode relying on injection.SqlProxy is a proxy class, and it receives the original query statement that provides of CLIENT PROGRAM from JdbcSupport, and the parameter of query statement, and each then adopting the thinking of Command Design Mode to go to call under SqlProcessor interface successively realizes class.Developer, when designing, can define one or more operational version by configuration file, for each scheme defines processing procedure, the execution sequence (configuring as follows) used:
Process provides the processing scheme (process scheme) of general query statement and the processing scheme (count scheme) of summation query statement at present, developer can carry out on this basis adjusting and expand.Each operational version has a processing procedure at least, some processing procedure can choice for use with do not use, but must to perform according to set order.The processing procedure do not used does not configure in operational version.
In addition, developer can select by configuration information in this configuration file, to change in the configuration information table of write into Databasce, to obtain allocation plan more flexibly.Configuration information table is as follows:
Table 1: operational version information table (QRY_SCHEMA)
Table 2: scheme processing procedure table (QRY_SCHEMA_PROCESSOR)
Developer also direct service routine can not be called by configuration information.
Upon power-up of the system, the present invention will read these configuration informations, form each operational version according to configuration.
When user proposes inquiry request, this method and device query statement numbering (or query statement) will be passed to by JdbcSupport, and corresponding query argument collection.This method and device, according to the difference of the use-pattern of developer, process with three kinds of methods:
1) if query statement is configured in query statement configuration file by developer, then to this method and device and provide query statement number with query argument collection.The method and device, by searching query statement configuration file, after obtaining corresponding query statement, perform the processing procedure that this method and device define, are finally supplied to the discernible query statement of JDBC and parameter array together with query argument collection.
2) if query statement is preserved in the query statement information table of database by developer, then to this method and device and provide query statement number with query argument collection.The method and device, by searching query statement information table, after obtaining corresponding query statement, perform the processing procedure that this method and device define, are finally supplied to the discernible query statement of JDBC and parameter array together with query argument collection.
3) if developer calls this method and device in a program and provides query statement and query argument collection, then this method and device perform to this query statement and query argument collection the processing procedure that this method and device define, and are finally supplied to the discernible query statement of JDBC and parameter array.
Finally, after the present invention completes all processing procedures, then return to the discernible query statement of enquiry module JDBC and parameter array, really perform inquiry by enquiry module.
Below six processing procedures are described in detail.
1, dynamically querying condition is added
In large software management system, usually there is such demand, be just available to the alternative filtercondition of user.When user will use some filtercondition to perform inquiry, to these filtercondition input inquiry conditions, perform inquiry, then these querying conditions can dynamically add in query statement by system, do not have the filtercondition of input value then not add in query statement to those.The present invention provides the support of this dynamic queries condition too.Application claims developer, when writing query statement, writes following mark:
Select*from User where userId=:userid:nameEquals
Here variable nameEquals comprises key word Equals, then the present invention is when processing this query statement, if user have input this condition, then this variable is joined query argument to concentrate, query argument has concentrated this variable will by query statement: nameEquals is converted to name=:nameEquals; If not then from query statement, remove this mark.Similarly, if query statement is like this:
Select*from User where:hiredateLower:hiredateUpper
The present invention can go to check query argument, if there are this 2 parameters, can be converted to:
Select*from User where hiredate>=:hiredateLower and hiredate<=:hiredateUpper
Here Lower and Upper is also key word, and developer can also go definition by configuration file oneself and add key word and expression formula thereof.
By the key word of predefined, the present invention is when processing query statement, and the query argument will submitted to according to user, dynamically adds and remove filtercondition.
2, query argument conversion
If when developer writes query statement, represent the variable in query statement with the form of ": var ", as:
Select*from User where userId=:userid
In this embodiment, userid is exactly a query interface.After developer writes query statement, just whole query statement can be passed to enquiry module as a character string.Meanwhile, by query interface and value thereof with name-be worth right form to pass to enquiry module, as:
Map params=new HashMap();
params.add(“userid”,”000001”);
After query statement and query interface pass over by CLIENT PROGRAM, first the query interface in query statement identifies by the present invention, is converted into the form that JDBC can identify, as:
Select*from User where userId=
Meanwhile, be the array form that JDBC can identify by query argument by original name-be worth right formal transformation, as:
Object[]paramArray=new Object[]{”000001”};
Particularly, if query statement is complicated, usually same query argument exists multiple at each diverse location of query statement.At this moment, except being question mark by this variable transitions, also multiple variate-value to be retained in order in array, as:
Select t.id,t.name,t.sex,
(select dept.name where department dept where dept.dept_id=t.dept_id and dept.name like‘%:key%’)deptName
Form employee t Where t.sex=:sex
and exists(select1where department dept where dept.dept_id=t.dept_id and dept.name like‘%:key%’);
Suppose that the parametric variable transmitted is: key=" hr ", sex=" and M ", then being converted to through this step:
Select t.id,t.name,t.sex,
(select dept.name where department dept where dept.dept_id=t.dept_id and dept.name like‘%?%’)deptName
Form employee t Where t.sex=
and exists(select1where department dept where dept.dept_id=t.dept_id and dept.name like‘%?%’);
And produce parameter array:
Object[]paramArray=new Object[]{”hr”,”M”,”hr”};
Through above Parameter Switch, by parametric form easy to use for open personnel, the form that JDBC can identify could be converted to, create conditions for enquiry module performs inquiry.
3, query statement is resolved
In order to process below, the present invention here resolves query statement.But as previously described, the present invention resolves completely to whole query statement, but outermost main query statement is resolved, resolve to these 6 clauses of select, from, where, group by, having, order by by main query statement, with an object, they are stored respectively.
Do not process the statement that shape operates as union in query statement analytical algorithm of the present invention, need query statement to be split into two query statements if there is these situations and process respectively, or covered at a skin query statement.
4, paging query function
If deliver variable page and size during developer's Transfer Parameters, then the present invention will provide the function of paging query to this inquiry.In very-large database environment, the optimal case of paging query is by processing query statement, makes the data of its inquiry needed for this page.Meanwhile, during first time inquiry, former query statement is converted to count (*) inquiry to calculate total amount of data, and calculates the information such as " n-th page/m page altogether " and " xth bar/y bar altogether " together with page with size variable.
5, sequence and block functions
If developer has just finished writing order by or group by statement when writing query statement, the process of system to sequence and block functions need not bother certainly like this, but is not often like this in practical application.Just take sequence for example, many inquiry forms are just the order of order by query statement order by default.When user has hit gauge outfit at use form process mid-point, then form will remove original order, the gauge outfit clicked be sorted according to user.Note, ranking function mentioned here is not this page of sequence, but full sort result.In order to realize this function, system needs to adjust original query statement, the order by clause in former query statement is removed, replaces with new order by clause and be inserted in query statement.
However, owing to being previously the parsing of query statement, such problem is processed not so difficult.No matter be group by, having, or order is by clause, the clause after to fractionation is only needed to replace.Finally when enquiry module starts to perform inquiry, each clause after upgrading is re-started assembled, forms new query statement, just can be queried by enquiry module.
Fig. 1 is the method flow diagram of the process query statement of one embodiment of the invention; As shown in the figure, the method comprises the following steps:
Step S100: provide six continuous print processing procedures: querying condition dynamically adds, query argument conversion, query statement parsing, paging query function, ranking function and block functions, user is when using above processing procedure, can by configuration operational version, freely select which process of which process need not, but must both definite sequences be observed;
Step S200: after operational version is determined, when submit queries statement and parameter set, this method and device will, according to operational version, go to perform each query statement processing procedure successively;
Step S300: after completing all query statement processing procedures, by the new query statement of generation and parameter set, submit Query module performs inquiry.
More preferably, described step S100 comprises the steps:
Step S110: for user provides six continuous print processing procedures: querying condition dynamically adds, query argument conversion, query statement parsing, paging query function, ranking function and block functions, these processing procedures are separate, user can freely select which process of which process need not, but must both definite sequences be observed;
Step S120: user, by configuration file or database table, defines one or more operational version, in each operational version, which processing procedure definition will use, and the execution sequence of processing procedure.User must select at least one operational version, and each operational version must have at least one processing procedure, and execution sequence must observe the request for utilization of this processing procedure;
More preferably, described step S200 comprises the steps:
Step S210: when submit queries statement and parameter set, operational version used should be determined.According to the definition of this operational version, successively query statement and parameter set are processed;
Step S220: user can get the bid at query statement the query interface of casting mark key word, in the processing procedure that querying condition dynamically adds, these marks can be searched for out, and replace with the querying condition that this mark key word defines;
Step S230: query argument translation process, by the parameter with mark in original query statement and parameter set thereof, is converted to query interface and parameter array thereof that JDBC can identify;
Step S240: query statement dissection process process, resolves to 6 inquiry clauses by main query statement outermost in original query statement: select, from, where, group by, having, order by, for processing procedure is below offered help;
Step S250: paging query function treatment process, for original query statement provides the ability with high-efficient pagination inquiry;
Step S260: ranking function processing procedure and block functions processing procedure, is respectively the query capability that original query statement provides dynamic order and grouping.
More preferably, described step S300 comprises the steps:
Step S310: re-start assembled to 6 inquiry clauses completing process, form new query statement and parameter array;
Step S320: new query statement and parameter array submit Query module are performed inquiry.
Adapt with said method embodiment, present invention also offers a kind of device embodiment processing query statement, this device comprises:
Scheme determination module, provide six continuous print processing procedures: querying condition dynamically adds, query argument conversion, query statement parsing, paging query function, ranking function and block functions, user is when using above processing procedure, can by configuration operational version, freely select which process of which process need not, but must both definite sequences be observed;
Processing procedure execution module, after operational version is determined, when submit queries statement and parameter set, according to operational version, goes to perform each query statement processing procedure successively;
Submit Query module, after completing all query statement processing procedures, by the new query statement of generation and parameter set, submit Query module performs inquiry.
Further, described scheme determination module is specifically for performing following steps:
For user provides six continuous print processing procedures: querying condition dynamically adds, query argument conversion, query statement parsing, paging query function, ranking function and block functions, these processing procedures are separate, user can freely select which process of which process need not, but must both definite sequences be observed;
User is by configuration file or database table, define one or more operational version, in each operational version, which processing procedure definition will use, and the execution sequence of processing procedure, user must select at least one operational version, each operational version must have at least one processing procedure, and execution sequence must observe the request for utilization of this processing procedure.
Further, described processing procedure execution module is specifically for performing following steps:
When submit queries statement and parameter set, operational version used should be determined, according to the definition of this operational version, successively query statement and parameter set be processed;
User can get the bid at query statement the query interface of casting mark key word, in the processing procedure that querying condition dynamically adds, these marks can be searched for out, and replace with the querying condition that this mark key word defines;
Query argument translation process, by the parameter with mark in original query statement and parameter set thereof, is converted to query interface and parameter array thereof that JDBC can identify;
Query statement dissection process process, resolves to 6 inquiry clauses by main query statement outermost in original query statement: select, from, where, group by, having, order by, for processing procedure is below offered help;
Paging query function treatment process, for original query statement provides the ability with high-efficient pagination inquiry;
Ranking function processing procedure and block functions processing procedure, be respectively the query capability that original query statement provides dynamic order and grouping.
Further, described submit Query module is specifically for performing following steps:
Re-start assembled to 6 inquiry clauses completing process, form new query statement and parameter array;
New query statement and parameter array submit Query module are performed inquiry.
The present invention provides many convenient, easy-to-use with function flexibly for developer carries out data query, and its process query statement method and apparatus of the same type with other compares, and it is advantageous that:
1) for large-scale web system various data query function provides powerful platform support, can greatly improve its efficiency of research and development, make maintenance convenient and swift with change.
2) provide more easy easy-to-use query interface notation methods, make developer convenient when adding variable for query statement.
3) provide easier, understandable dynamic filtration condition solutions, make developer be that inquiry form interpolation filtercondition is simple.
4) encapsulate the specific implementation of the schemes such as paging query, sequence, grouping, reduce the technical threshold of research and development, improve running efficiency of system
5) providing easy easy-to-use extensive interface, making other system can expand new function according to the needs of self when using of the present invention.
6) the present invention can be applied in developing instrument or development platform, can be also that other system uses as independently device.
One of ordinary skill in the art will appreciate that: accompanying drawing is the schematic diagram of an embodiment, the module in accompanying drawing or flow process might not be that enforcement the present invention is necessary.
One of ordinary skill in the art will appreciate that: the module in the device in embodiment can describe according to embodiment and be distributed in the device of embodiment, also can carry out respective change and be arranged in the one or more devices being different from the present embodiment.The module of above-described embodiment can merge into a module, also can split into multiple submodule further.
Last it is noted that above embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to previous embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in previous embodiment, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of embodiment of the present invention technical scheme.

Claims (8)

1. process a method for query statement, it is characterized in that, comprise the following steps:
There is provided six continuous print processing procedures to user: querying condition dynamically adds, query argument conversion, query statement parsing, paging query function, ranking function and block functions, user is when using above processing procedure, by configuration operational version, freely select which process of which process need not, but must both definite sequences be observed;
After operational version is determined, when submit queries statement and parameter set, according to operational version, go successively to perform each query statement processing procedure;
After completing all query statement processing procedures, by the new query statement of generation and parameter set, submit Query module performs inquiry.
2. the method for process query statement according to claim 1, it is characterized in that, provide six continuous print processing procedures to user: querying condition dynamically adds, query argument conversion, query statement parsing, paging query function, ranking function and block functions comprise the following steps:
For user provides six continuous print processing procedures: querying condition dynamically adds, query argument conversion, query statement parsing, paging query function, ranking function and block functions, these processing procedures are separate, user can freely select which process of which process need not, but must both definite sequences be observed;
User is by configuration file or database table, define one or more operational version, in each operational version, which processing procedure definition will use, and the execution sequence of processing procedure, user must select at least one operational version, each operational version must have at least one processing procedure, and execution sequence must observe the request for utilization of this processing procedure.
3. the method for process query statement according to claim 1, is characterized in that, after operational version is determined, when submit queries statement and parameter set, according to operational version, goes to perform each query statement processing procedure successively and comprises the following steps:
When submit queries statement and parameter set, operational version used should be determined, according to the definition of this operational version, successively query statement and parameter set be processed;
User can get the bid at query statement the query interface of casting mark key word, in the processing procedure that querying condition dynamically adds, these marks can be searched for out, and replace with the querying condition that this mark key word defines;
Query argument translation process, by the parameter with mark in original query statement and parameter set thereof, is converted to query interface and parameter array thereof that JDBC can identify;
Query statement dissection process process, resolves to 6 inquiry clauses by main query statement outermost in original query statement: select, from, where, group by, having, order by, for processing procedure is below offered help;
Paging query function treatment process, for original query statement provides the ability with high-efficient pagination inquiry;
Ranking function processing procedure and block functions processing procedure, be respectively the query capability that original query statement provides dynamic order and grouping.
4. the method for process query statement according to claim 1, is characterized in that, after completing all query statement processing procedures, by the new query statement of generation and parameter set, submit Query module performs inquiry and comprises the following steps:
Re-start assembled to 6 inquiry clauses completing process, form new query statement and parameter array;
New query statement and parameter array submit Query module are performed inquiry.
5. process a device for query statement, it is characterized in that, comprising:
Scheme determination module, there is provided six continuous print processing procedures to user: querying condition dynamically adds, query argument conversion, query statement parsing, paging query function, ranking function and block functions, user is when using above processing procedure, can by configuration operational version, freely select which process of which process need not, but must both definite sequences be observed;
Processing procedure execution module, after operational version is determined, when submit queries statement and parameter set, according to operational version, goes to perform each query statement processing procedure successively;
Submit Query module, after completing all query statement processing procedures, by the new query statement of generation and parameter set, submit Query module performs inquiry.
6. the device of process query statement according to claim 5, is characterized in that, described scheme determination module is specifically for performing following steps:
For user provides six continuous print processing procedures: querying condition dynamically adds, query argument conversion, query statement parsing, paging query function, ranking function and block functions, these processing procedures are separate, user can freely select which process of which process need not, but must both definite sequences be observed;
User is by configuration file or database table, define one or more operational version, in each operational version, which processing procedure definition will use, and the execution sequence of processing procedure, user must select at least one operational version, each operational version must have at least one processing procedure, and execution sequence must observe the request for utilization of this processing procedure.
7. the device of process query statement according to claim 5, is characterized in that, described processing procedure execution module is specifically for performing following steps:
When submit queries statement and parameter set, operational version used should be determined, according to the definition of this operational version, successively query statement and parameter set be processed;
User can get the bid at query statement the query interface of casting mark key word, in the processing procedure that querying condition dynamically adds, these marks can be searched for out, and replace with the querying condition that this mark key word defines;
Query argument translation process, by the parameter with mark in original query statement and parameter set thereof, is converted to query interface and parameter array thereof that JDBC can identify;
Query statement dissection process process, resolves to 6 inquiry clauses by main query statement outermost in original query statement: select, from, where, group by, having, order by, for processing procedure is below offered help;
Paging query function treatment process, for original query statement provides the ability with high-efficient pagination inquiry;
Ranking function processing procedure and block functions processing procedure, be respectively the query capability that original query statement provides dynamic order and grouping.
8. the device of process query statement according to claim 5, is characterized in that, described submit Query module is specifically for performing following steps:
Re-start assembled to 6 inquiry clauses completing process, form new query statement and parameter array;
New query statement and parameter array submit Query module are performed inquiry.
CN201310692597.6A 2013-12-17 2013-12-17 Method and device for processing query statements Pending CN104714973A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310692597.6A CN104714973A (en) 2013-12-17 2013-12-17 Method and device for processing query statements

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310692597.6A CN104714973A (en) 2013-12-17 2013-12-17 Method and device for processing query statements

Publications (1)

Publication Number Publication Date
CN104714973A true CN104714973A (en) 2015-06-17

Family

ID=53414316

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310692597.6A Pending CN104714973A (en) 2013-12-17 2013-12-17 Method and device for processing query statements

Country Status (1)

Country Link
CN (1) CN104714973A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107315790A (en) * 2017-06-14 2017-11-03 腾讯科技(深圳)有限公司 A kind of optimization method and device of irrelevant subquery
CN107463662A (en) * 2017-07-31 2017-12-12 拉卡拉支付股份有限公司 A kind of dynamic Sql querying methods, device
CN109471970A (en) * 2018-11-20 2019-03-15 郑州云海信息技术有限公司 Network inquiry method, apparatus and storage medium in a kind of virtual management platform
CN110019335A (en) * 2017-10-17 2019-07-16 航天信息股份有限公司 A kind of method and system carrying out dynamic expansion to SQL query statement based on note
CN112199407A (en) * 2020-10-12 2021-01-08 上海达梦数据库有限公司 Data packet sequencing method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101145162A (en) * 2007-10-31 2008-03-19 金蝶软件(中国)有限公司 Data base dynamic inquiry method and system
CN101350023A (en) * 2008-08-29 2009-01-21 北京航空航天大学 Method and platform capable of customizing enquiry based on service combination
CN102426612A (en) * 2012-01-13 2012-04-25 广州从兴电子开发有限公司 Condition object query method and system
US20120215785A1 (en) * 2010-12-30 2012-08-23 Sanjeev Singh Composite Term Index for Graph Data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101145162A (en) * 2007-10-31 2008-03-19 金蝶软件(中国)有限公司 Data base dynamic inquiry method and system
CN101350023A (en) * 2008-08-29 2009-01-21 北京航空航天大学 Method and platform capable of customizing enquiry based on service combination
US20120215785A1 (en) * 2010-12-30 2012-08-23 Sanjeev Singh Composite Term Index for Graph Data
CN102426612A (en) * 2012-01-13 2012-04-25 广州从兴电子开发有限公司 Condition object query method and system

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107315790A (en) * 2017-06-14 2017-11-03 腾讯科技(深圳)有限公司 A kind of optimization method and device of irrelevant subquery
CN107315790B (en) * 2017-06-14 2021-07-06 腾讯科技(深圳)有限公司 Optimization method and device for non-relevant sub-queries
US11269878B2 (en) 2017-06-14 2022-03-08 Tencent Technology (Shenzhen) Company Limited Uncorrelated subquery optimization method and apparatus, and storage medium
CN107463662A (en) * 2017-07-31 2017-12-12 拉卡拉支付股份有限公司 A kind of dynamic Sql querying methods, device
CN107463662B (en) * 2017-07-31 2019-12-10 拉卡拉支付股份有限公司 Dynamic Sql query method and device
CN110019335A (en) * 2017-10-17 2019-07-16 航天信息股份有限公司 A kind of method and system carrying out dynamic expansion to SQL query statement based on note
CN110019335B (en) * 2017-10-17 2021-05-28 航天信息股份有限公司 Method and system for dynamically expanding SQL query statement based on annotation
CN109471970A (en) * 2018-11-20 2019-03-15 郑州云海信息技术有限公司 Network inquiry method, apparatus and storage medium in a kind of virtual management platform
CN112199407A (en) * 2020-10-12 2021-01-08 上海达梦数据库有限公司 Data packet sequencing method, device, equipment and storage medium
CN112199407B (en) * 2020-10-12 2023-10-27 上海达梦数据库有限公司 Data packet ordering method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109086409B (en) Microservice data processing method and device, electronic equipment and computer readable medium
Lee et al. Scaling queries over big RDF graphs with semantic hash partitioning
EP1639503B1 (en) A data processing method and system
US7844623B2 (en) Method to provide management of query output
US7103590B1 (en) Method and system for pipelined database table functions
CN101436192B (en) Method and apparatus for optimizing inquiry aiming at vertical storage type database
US11386088B2 (en) Expression pushdown optimization for querying in federated database system
US11216455B2 (en) Supporting synergistic and retrofittable graph queries inside a relational database
CN104714974A (en) Method and device for parsing and reprocessing query statement
CN104714973A (en) Method and device for processing query statements
Abdelaziz et al. Combining vertex-centric graph processing with SPARQL for large-scale RDF data analytics
Sun et al. Dima: A distributed in-memory similarity-based query processing system
Zou et al. From a stream of relational queries to distributed stream processing
Gao et al. GLog: A high level graph analysis system using MapReduce
Chantrapornchai et al. TripleID-Q: RDF query processing framework using GPU
Guo et al. Leon: A distributed rdf engine for multi-query processing
Fotouhi et al. Optimal secondary storage access sequence for performing relational join
CN112825068B (en) Data blood margin generation method and device
Kemp et al. Architecture of a mediator for a bioinformatics database federation
Langegger et al. Sharing Data on the Grid using Ontologies and distributed SPARQL Queries
Wu et al. Scalable SAPRQL querying processing on large RDF data in cloud computing environment
Comito et al. XML data integration in OGSA grids
Rajith et al. JARS: join-aware distributed RDF storage
Yasin et al. A comprehensive study for essentiality of graph based distributed sparql query processing
Marotta et al. Managing source schema evolution in web warehouses

Legal Events

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

Application publication date: 20150617

RJ01 Rejection of invention patent application after publication