CN102354318B - Device and method for reducing ad hoc query languages in database system - Google Patents
Device and method for reducing ad hoc query languages in database system Download PDFInfo
- Publication number
- CN102354318B CN102354318B CN 201110284581 CN201110284581A CN102354318B CN 102354318 B CN102354318 B CN 102354318B CN 201110284581 CN201110284581 CN 201110284581 CN 201110284581 A CN201110284581 A CN 201110284581A CN 102354318 B CN102354318 B CN 102354318B
- Authority
- CN
- China
- Prior art keywords
- variable
- query statement
- serial data
- module
- database systems
- 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.)
- Active
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a device for reducing ad hoc query languages in a database system, which comprises an acquisition module, a generation module, a conversion module and an analytic module, wherein the acquisition module is used for acquiring similar variables from condition variables when the number of the condition variables is variable; the generation module is used for summarizing the similar variables by using collection objects in the programming language so as to generate at least a variable set object; the conversion module is used for converting the at least a variable set objectinto at least an XML (extensive makeup language) data string based on a format corresponding to the data structure type according to a data structure type used by the programming language; and the analytic module is used for analyzing the XML data string into a result set in a subquery mode by using an analytic function. Accordingly, the invention also provides a method for reducing ad hoc query languages in a database system. Through the technical scheme of the invention, the data conditions of input condition query languages with various length and number are subjected to format summarization, so that the query languages of the same type are implemented by using use a same query plan, thereby reducing the number of ad hoc query languages and improving the query efficiency.
Description
Technical field
The present invention relates to inquiring technology, in particular to the apparatus and method that reduce extemporaneous query statement in the Database Systems.
Background technology
ERP system is the huge and complicated large-scale application system of a class function, wherein exists many complicated service to calculate.This type systematic all is based on large-scale relational database system usually, and the business in the application system is calculated has very big part to be carried out by database.The performance of Database Systems will directly determine the performance of ERP system, and Database Systems are the easiest, and what bottleneck occurs is cpu resource.A large amount of extemporaneous inquiries needs Database Systems to carry out the executive plan compiling frequently, and this compiling is consumption data storehouse cpu resource greatly, influences fluency and user's experience effect of system.At present, reduce extemporaneous inquiry usual way and have two kinds: the mandatory parameters mechanism of using the variable binding mode or using Database Systems to provide in the program, but it is simple that these two kinds of methods only are only applicable to query statement, the scene that the conditional-variable number is fixing, when the conditional-variable number of query statement not fixedly the time with ineffective, even system done harm rather than good.
Therefore, the technology that needs a kind of new extemporaneous inquiry of minimizing can be carried out form to the data qualification of the initial conditions query statement of on-fixed length, quantity and be gathered, and makes query statement of the same type use identical inquiry plan, to realize reducing extemporaneous query statement quantity, improve search efficiency.
Summary of the invention
The present invention just is being based on the problems referred to above, the extemporaneous technology of inquiring about of a kind of new minimizing has been proposed, can carry out form to the data qualification of the initial conditions query statement of on-fixed length, quantity gathers, make query statement of the same type use identical inquiry plan, to realize reducing extemporaneous query statement quantity, improve search efficiency.
In view of this, the present invention proposes a kind of device that reduces in the Database Systems extemporaneous query statement, comprising: acquisition module, not fixedly the time, obtain the same class variable in the described conditional-variable in the number of the conditional-variable that participates in inquiry; Generation module utilizes the collection object in the programming language to gather described same class variable, generates at least one variable collection object; Modular converter according to the type of data structure that described programming language uses, is at least one XML serial data with described at least one variable collection object according to the format conversion corresponding to described type of data structure; Parsing module uses analytical function described XML serial data to be resolved to the result set of subquery mode.In this technical scheme, by will gathering to collection object with class variable, and this collection object is carried out conversion and the parsing of XML serial data, thereby be implemented under the initial conditions of on-fixed length, quantity, reduce extemporaneous query statement.Here the conditional-variable that gathers can comprise polytype, thereby can obtain a plurality of collection objects when gathering, and handles simultaneously in subsequent treatment.
In technique scheme, preferably, also comprise: mark module, carry out mark obtaining described position with class variable; And return module, the result set of described subquery mode is back to described mark.In this technical scheme, after obtaining conditional-variable and handle from A, the result who obtains also needs to return the A place, by carrying out mark when obtaining, thereby can guarantee that the result who obtains is able in time, correctly handles.
In technique scheme, preferably, also comprise: judge module, judge the legitimacy of described XML serial data; And correcting module, when mistake appears in described XML serial data, described mistake is revised.In this technical scheme, the XML serial data grammar mistake etc. may occur when generating, and therefore need carry out validity checking, and corrects when finding mistake, improves result's reliability.
In technique scheme, preferably, also comprise: temporary storage module in definition temporary storage area, the inside of described analytical function, is used for the described XML serial data that described judgement and/or described parsing are carried out in storage.In this technical scheme, the XML serial data can go out a temporary storage area in the internal separation of analytical function as intermediate data, be equivalent to buffer memory, thereby the XML serial data is kept in and handled, and need not transfer the XML serial data at every turn from the outside, improve operation efficiency.
In technique scheme, preferably, also comprise: the function creation module, create described analytical function, and described analytical function is stored in the described database.In this technical scheme, before setting up said apparatus, need be at the situation that may occur in service, the analytical function that prestores and need use situation such as occurs resolving thereby avoid being in operation, and improves reliability of operation.
According to another aspect of the invention, a kind of method that reduces extemporaneous query statement in the Database Systems has also been proposed, comprise: step 202, in the number of the conditional-variable that participates in inquiry not fixedly the time, obtain the same class variable in the described conditional-variable, and utilize the collection object in the programming language to gather described same class variable, generate at least one variable collection object; Step 204 according to the type of data structure that described programming language uses, is at least one XML serial data with described at least one variable collection object according to the format conversion corresponding to described type of data structure; Step 206 uses analytical function described at least one XML serial data to be resolved to the result set of subquery mode.In this technical scheme, by will gathering to collection object with class variable, and this collection object is carried out conversion and the parsing of XML serial data, thereby be implemented under the initial conditions of on-fixed length, quantity, reduce extemporaneous query statement.Here the conditional-variable that gathers can comprise polytype, thereby can obtain a plurality of collection objects when gathering, and handles simultaneously in subsequent treatment.
In technique scheme, preferably, described step 202 also comprises: carry out mark obtaining described position with class variable; And described step 206 also comprises: the result set of described subquery mode is back to described mark.In this technical scheme, after obtaining conditional-variable and handle from A, the result who obtains also needs to return the A place, by carrying out mark when obtaining, thereby can guarantee that the result who obtains is able in time, correctly handles.
In technique scheme, preferably, before described step 206, also comprise: judge the legitimacy of described XML serial data, and when mistake appears in described XML serial data, described mistake is revised.In this technical scheme, the XML serial data grammar mistake etc. may occur when generating, and therefore need carry out validity checking, and corrects when finding mistake, improves result's reliability.
In technique scheme, preferably, in described step 206, also comprise: in definition temporary storage area, the inside of described analytical function, described temporary storage area is used for the described XML serial data that described judgement and/or described parsing are carried out in storage.In this technical scheme, the XML serial data can go out a temporary storage area in the internal separation of analytical function as intermediate data, be equivalent to buffer memory, thereby the XML serial data is kept in and handled, and need not transfer the XML serial data at every turn from the outside, improve operation efficiency.
In technique scheme, preferably, also comprise: create described analytical function, and described analytical function is stored in the described database.In this technical scheme, before setting up said apparatus, need be at the situation that may occur in service, the analytical function that prestores and need use situation such as occurs resolving thereby avoid being in operation, and improves reliability of operation.
By above technical scheme, can carry out form to the data qualification of the initial conditions query statement of on-fixed length, quantity and gather, make query statement of the same type use identical inquiry plan, to realize reducing extemporaneous query statement quantity, improve search efficiency.
Description of drawings
Fig. 1 shows the block diagram that reduces the device of extemporaneous query statement in the Database Systems according to an embodiment of the invention;
Fig. 2 shows the process flow diagram that reduces the method for extemporaneous query statement in the Database Systems according to an embodiment of the invention;
Fig. 3 shows the schematic flow diagram that carries out data base querying according to an embodiment of the invention; And
Fig. 4 shows the schematic flow diagram that reduces the method for extemporaneous query statement in the Database Systems according to an embodiment of the invention.
Embodiment
In order more to be expressly understood above-mentioned purpose of the present invention, feature and advantage, below in conjunction with the drawings and specific embodiments the present invention is further described in detail.
Set forth a lot of details in the following description so that fully understand the present invention, still, the present invention can also adopt other to be different from other modes described here and implement, and therefore, the present invention is not limited to the restriction of following public specific embodiment.
Fig. 1 shows the block diagram that reduces the device of extemporaneous query statement in the Database Systems according to an embodiment of the invention.
As shown in Figure 1, the device 100 that reduces in the Database Systems extemporaneous query statement according to an embodiment of the invention comprises: acquisition module 102, not fixedly the time, obtain the same class variable in the conditional-variable in the number of the conditional-variable that participates in inquiry; Generation module 104 utilizes the collection object in the programming language to gather same class variable, generates at least one variable collection object; Modular converter 106 according to the type of data structure that programming language uses, is at least one XML serial data with at least one variable collection object according to the format conversion corresponding to type of data structure; Parsing module 108 uses analytical function the XML serial data to be resolved to the result set of subquery mode; Mark module 110 carries out mark in the position that obtains with class variable; Return module 112, the result set of subquery mode is back to mark; Judge module 114, the legitimacy of judgement XML serial data; Correcting module 116 when mistake appears in the XML serial data, is revised mistake; Temporary storage module 118 in definition temporary storage area, the inside of analytical function, is used for the XML serial data that storage is judged and/or resolved; Function creation module 120 is created analytical function, and analytical function is stored in the database.In this technical scheme, by will gathering to collection object with class variable, and this collection object is carried out conversion and the parsing of XML serial data, thereby be implemented under the initial conditions of on-fixed length, quantity, reduce extemporaneous query statement.Here the conditional-variable that gathers can comprise polytype, thereby can obtain a plurality of collection objects when gathering, and handles simultaneously in subsequent treatment.
In technique scheme, after obtaining conditional-variable and handle from A, the result who obtains also needs to return the A place, by carrying out mark when obtaining, thereby can guarantee that the result who obtains is able in time, correctly handles.
In technique scheme, the XML serial data grammar mistake etc. may occur when generating, and therefore need carry out validity checking, and corrects when finding mistake, improves result's reliability.
In technique scheme, the XML serial data can go out a temporary storage area in the internal separation of analytical function as intermediate data, be equivalent to buffer memory, thereby the XML serial data is kept in and handled, and need not transfer the XML serial data at every turn from the outside, improve operation efficiency.
In technique scheme, before setting up said apparatus 100, need be at the situation that may occur in service, the analytical function that prestores and need use situation such as occurs resolving thereby avoid being in operation, and improves reliability of operation.
Fig. 2 shows the process flow diagram that reduces the method for extemporaneous query statement in the Database Systems according to an embodiment of the invention.
As shown in Figure 2, the method that reduces extemporaneous query statement in the Database Systems according to an embodiment of the invention comprises: step 202, in the number of the conditional-variable that participates in inquiry not fixedly the time, obtain the same class variable in the conditional-variable, and utilize the collection object in the programming language to gather same class variable, generate at least one variable collection object; Step 204 according to the type of data structure that programming language uses, is at least one XML serial data with at least one variable collection object according to the format conversion corresponding to type of data structure; Step 206 uses analytical function at least one XML serial data to be resolved to the result set of subquery mode.In this technical scheme, by will gathering to collection object with class variable, and this collection object is carried out conversion and the parsing of XML serial data, thereby be implemented under the initial conditions of on-fixed length, quantity, reduce extemporaneous query statement.Here the conditional-variable that gathers can comprise polytype, thereby can obtain a plurality of collection objects when gathering, and handles simultaneously in subsequent treatment.
In technique scheme, step 202 also comprises: carry out mark in the position that obtains with class variable; And step 206 also comprises: the result set of subquery mode is back to mark.In this technical scheme, after obtaining conditional-variable and handle from A, the result who obtains also needs to return the A place, by carrying out mark when obtaining, thereby can guarantee that the result who obtains is able in time, correctly handles.
In technique scheme, before step 206, also comprise: judge the legitimacy of XML serial data, and when mistake appears in the XML serial data, mistake is revised.In this technical scheme, the XML serial data grammar mistake etc. may occur when generating, and therefore need carry out validity checking, and corrects when finding mistake, improves result's reliability.
In technique scheme, in step 206, also comprise: in definition temporary storage area, the inside of analytical function, the temporary storage area is used for the XML serial data that storage is judged and/or resolved.In this technical scheme, the XML serial data can go out a temporary storage area in the internal separation of analytical function as intermediate data, be equivalent to buffer memory, thereby the XML serial data is kept in and handled, and need not transfer the XML serial data at every turn from the outside, improve operation efficiency.
In technique scheme, also comprise: create analytical function, and analytical function is stored in the database.In this technical scheme, before setting up said apparatus, need be at the situation that may occur in service, the analytical function that prestores and need use situation such as occurs resolving thereby avoid being in operation, and improves reliability of operation.
Fig. 3 shows the schematic flow diagram that carries out data base querying according to an embodiment of the invention.
As shown in Figure 3, when carrying out data base querying, step is as follows:
Fig. 4 shows the schematic flow diagram that reduces the method for extemporaneous query statement in the Database Systems according to an embodiment of the invention.
As shown in Figure 4, it is as follows to reduce in the Database Systems method step of extemporaneous query statement according to an embodiment of the invention:
In addition, before setting up whole inquiry system, the analytical function that also needs need use in the time of will resolving the XML serial data in advance is stored in the device 4082, and the device 4082 here can be memory storage or database;
More than be described with reference to the accompanying drawings technical scheme of the present invention, considered that the above only is the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.
Claims (10)
1. a device that reduces extemporaneous query statement in the Database Systems is characterized in that, comprising:
Acquisition module not fixedly the time, obtains the same class variable in the described conditional-variable in the number of the conditional-variable that participates in inquiry;
Generation module, utilize the collection object in the programming language to gather described same class variable, generate at least one variable collection object, wherein, described gathering describedly comprises with class variable: the data qualification of the initial conditions query statement of on-fixed length, quantity is carried out form gather;
Modular converter according to the type of data structure that described programming language uses, is at least one XML serial data with described at least one variable collection object according to the format conversion corresponding to described type of data structure;
Parsing module uses analytical function described XML serial data to be resolved to the result set of subquery mode.
2. the device of extemporaneous query statement in the minimizing Database Systems according to claim 1 is characterized in that, also comprises:
Mark module carries out mark obtaining described position with class variable; And
Return module, the result set of described subquery mode is back to described mark.
3. the device of extemporaneous query statement in the minimizing Database Systems according to claim 1 is characterized in that, also comprises: judge module, judge the legitimacy of described XML serial data; And
Correcting module when mistake appears in described XML serial data, is revised described mistake.
4. the device of extemporaneous query statement in the minimizing Database Systems according to claim 3 is characterized in that, also comprises:
Temporary storage module in definition temporary storage area, the inside of described analytical function, is used for the described XML serial data that described judgement and/or described parsing are carried out in storage.
5. the device of extemporaneous query statement in the minimizing Database Systems according to claim 4 is characterized in that, also comprises:
The function creation module is created described analytical function, and described analytical function is stored in the described database.
6. a method that reduces extemporaneous query statement in the Database Systems is characterized in that, comprising:
Step 202, in the number of the conditional-variable that participates in inquiry not fixedly the time, obtain the same class variable in the described conditional-variable, and utilize the collection object in the programming language to gather described same class variable, generate at least one variable collection object, wherein, described gathering describedly comprises with class variable: the data qualification of the initial conditions query statement of on-fixed length, quantity is carried out form gather;
Step 204 according to the type of data structure that described programming language uses, is at least one XML serial data with described at least one variable collection object according to the format conversion corresponding to described type of data structure;
Step 206 uses analytical function described at least one XML serial data to be resolved to the result set of subquery mode.
7. the method for extemporaneous query statement in the minimizing Database Systems according to claim 6 is characterized in that described step 202 also comprises: carry out mark obtaining described position with class variable; And
Described step 206 also comprises: the result set of described subquery mode is back to described mark.
8. the method for extemporaneous query statement in the minimizing Database Systems according to claim 6, it is characterized in that, before described step 206, also comprise: the legitimacy of judging described XML serial data, and when mistake appears in described XML serial data, described mistake is revised.
9. the method for extemporaneous query statement in the minimizing Database Systems according to claim 8, it is characterized in that, in described step 206, also comprise: in definition temporary storage area, the inside of described analytical function, described temporary storage area is used for the described XML serial data that described judgement and/or described parsing are carried out in storage.
10. the method for extemporaneous query statement in the minimizing Database Systems according to claim 9 is characterized in that, also comprises: create described analytical function, and described analytical function is stored in the described database.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201110284581 CN102354318B (en) | 2011-09-22 | 2011-09-22 | Device and method for reducing ad hoc query languages in database system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201110284581 CN102354318B (en) | 2011-09-22 | 2011-09-22 | Device and method for reducing ad hoc query languages in database system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102354318A CN102354318A (en) | 2012-02-15 |
CN102354318B true CN102354318B (en) | 2013-09-11 |
Family
ID=45577883
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 201110284581 Active CN102354318B (en) | 2011-09-22 | 2011-09-22 | Device and method for reducing ad hoc query languages in database system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102354318B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9390080B2 (en) | 2012-10-25 | 2016-07-12 | Walker Reading Technologies, Inc. | Sentence parsing correction system |
US10650089B1 (en) | 2012-10-25 | 2020-05-12 | Walker Reading Technologies | Sentence parsing correction system |
CN104239508B (en) * | 2014-09-12 | 2017-05-10 | 中国工商银行股份有限公司 | Data query method and data query device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1881208A (en) * | 2005-06-14 | 2006-12-20 | 联想(北京)有限公司 | Construction method for dynamic structured query language statement |
CN101923551A (en) * | 2009-06-12 | 2010-12-22 | Sap股份公司 | Information value-driven and real time-approximating decision support |
CN101984439A (en) * | 2010-12-09 | 2011-03-09 | 上海市共进通信技术有限公司 | Method for realizing optimization of data source extensive makeup language (XML) query system based on sub-queries |
CN102012945A (en) * | 2010-12-16 | 2011-04-13 | 重庆国际复合材料有限公司 | User-oriented database management system |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7076493B2 (en) * | 2004-05-28 | 2006-07-11 | Metadata, Llc | Defining a data dependency path through a body of related data |
US20060173813A1 (en) * | 2005-01-04 | 2006-08-03 | San Antonio Independent School District | System and method of providing ad hoc query capabilities to complex database systems |
-
2011
- 2011-09-22 CN CN 201110284581 patent/CN102354318B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1881208A (en) * | 2005-06-14 | 2006-12-20 | 联想(北京)有限公司 | Construction method for dynamic structured query language statement |
CN101923551A (en) * | 2009-06-12 | 2010-12-22 | Sap股份公司 | Information value-driven and real time-approximating decision support |
CN101984439A (en) * | 2010-12-09 | 2011-03-09 | 上海市共进通信技术有限公司 | Method for realizing optimization of data source extensive makeup language (XML) query system based on sub-queries |
CN102012945A (en) * | 2010-12-16 | 2011-04-13 | 重庆国际复合材料有限公司 | User-oriented database management system |
Also Published As
Publication number | Publication date |
---|---|
CN102354318A (en) | 2012-02-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106777101B (en) | Data processing engine | |
US7933894B2 (en) | Parameter-sensitive plans for structural scenarios | |
CN105335403B (en) | Database access method and device and database system | |
CN102609451A (en) | SQL (structured query language) query plan generation method oriented to streaming data processing | |
US8965918B2 (en) | Decomposed query conditions | |
US20180081956A1 (en) | Method for automatically synchronizing multi-source heterogeneous data resources | |
CN102880468B (en) | Code intelligent prompting method and system for electronic control unit (ECU) program development | |
US7370043B1 (en) | Method and system for upgrade validation of database query plans | |
EP3254191B1 (en) | Apparatus and method for using parameterized intermediate representation for just-in-time compilation in database query execution engine | |
CN103020301B (en) | A kind of multidimensional data query and storage means and system | |
CN103761080A (en) | Structured query language (SQL) based MapReduce operation generating method and system | |
CN104899295B (en) | A kind of heterogeneous data source data relation analysis method | |
US20090112799A1 (en) | Database Statistics for Optimization of Database Queries Containing User-Defined Functions | |
CN104885078A (en) | Method for two-stage query optimization in massively parallel processing database clusters | |
CN101727320A (en) | Method and tools for identifying impact of database changes on an application | |
CN105718593A (en) | Database query optimization method and system | |
CN102799624B (en) | Large-scale graph data query method in distributed environment based on Datalog | |
CN112988782B (en) | Hive-supported interactive query method and device and storage medium | |
CN104036007A (en) | Method and device for querying distributed databases | |
CN111078702A (en) | SQL sentence classification management and unified query method and device | |
US10073873B2 (en) | System and method for column-specific materialization scheduling | |
EP3384385A1 (en) | Methods and systems for mapping object oriented/functional languages to database languages | |
CN104391923A (en) | Data set query method and apparatus | |
CN102354318B (en) | Device and method for reducing ad hoc query languages in database system | |
CN102004639A (en) | Embedded script generation module and method for generating embedded script |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C56 | Change in the name or address of the patentee |
Owner name: YONYOU NETWORK TECHNOLOGY CO., LTD. Free format text: FORMER NAME: UFIDA SOFTWARE CO., LTD. |
|
CP03 | Change of name, title or address |
Address after: 100094 Haidian District North Road, Beijing, No. 68 Patentee after: Yonyou Network Technology Co., Ltd. Address before: 100094 Beijing city Haidian District North Road No. 68, UFIDA Software Park Patentee before: UFIDA Software Co., Ltd. |