CN104361040A - Method and device for customized query - Google Patents

Method and device for customized query Download PDF

Info

Publication number
CN104361040A
CN104361040A CN201410593649.9A CN201410593649A CN104361040A CN 104361040 A CN104361040 A CN 104361040A CN 201410593649 A CN201410593649 A CN 201410593649A CN 104361040 A CN104361040 A CN 104361040A
Authority
CN
China
Prior art keywords
information
model
variable
querying condition
user terminal
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
CN201410593649.9A
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.)
China Construction Bank Corp
Original Assignee
China Construction Bank 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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN201410593649.9A priority Critical patent/CN104361040A/en
Publication of CN104361040A publication Critical patent/CN104361040A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention relates to the technical field of communication, and discloses a method for customized query. The method comprises the following steps: storing parameters corresponding to models in a system parameter table, wherein the parameters comprise a model information table, a variable information table, a query condition table and an SQL (structured query language) sentence table; receiving model names transmitted by a user terminal, and dynamically generating a variable column list according to the model names; receiving the query condition information transmitted by the user terminal, wherein the query condition information carries variables selected by a user according to the variable list; performing information query according to the query condition information, and displaying a query result at the user terminal. The embodiment of the invention further provides a device for the customized query. Through the adoption of the embodiment of the invention, the purposes of unifying background logics and reducing the consumption of resources of a system database are realized.

Description

A kind of method of custom-built query and device
Technical field
The present invention relates to data management field, particularly relate to a kind of method and device of custom-built query.
Background technology
Model is according to data analysis thinking, and the analytical procedure correlation analysis such as the choosing of data, the screening of data, the calculating of numerical value and grouping being gathered combines, and forms one for analyzing the model of certain problem.
At present, custom-built query adopt method have: one, adopt different interface development enquiry module, two, by model derive for other users directly.
Adopt different interface development enquiry module, when an increase query logic, then need to increase new interface, make development process elongated, and background logic disunity.Model is derived for other users directly, makes the uncontrollable adjustment parameter of user, cause background data base resource cost excessive, even cause database corruption.
Summary of the invention
The embodiment of the present invention provides a kind of method and device of custom-built query, for realizing the unification of background logic and reducing expending of system data base resource.
First aspect present invention provides a kind of method of custom-built query, comprising:
Be stored in system parameter table by the parameter corresponding with model, described parameter comprises model information table, variable information table, querying condition table and SQL statement table;
Receive the model name that user terminal sends, dynamically generate variable list according to described model name;
Receive the querying condition information that described user terminal sends, described conditional information comprises the querying condition of variable that user selects according to described variable list and increase;
According to described querying condition information, carry out information inquiry, and Query Result is shown on described user terminal.
Second aspect present invention provides a kind of device of custom-built query, comprising:
Storage unit, for being stored in system parameter table by the parameter corresponding with model, described parameter comprises model information table, variable information table, querying condition table and SQL statement table;
Receiving element, for receiving the model name that user terminal sends;
Generation unit, for dynamically generating variable list according to described model name;
Receiving element, also for receiving the querying condition information that described user terminal sends, described conditional information comprises the querying condition of variable that user selects according to described variable list and increase;
Enquiry module, for according to described querying condition information, carries out information inquiry;
Display unit, for showing Query Result on described user terminal.
Implement the embodiment of the present invention, there is following beneficial effect:
In the embodiment of the present invention, thus to achieve model conversion flexibly for fixing inquiry and avoid the inquiry of system printenv, make the unification of background logic and reduce expending of system data base resource.
Implement the embodiment of the present invention, there is following beneficial effect:
The embodiment of the present invention, first the parameter corresponding with model is stored in system parameter table, user is made to select the model for inquiring about by unified query interface, then the model name that user terminal sends is received, dynamically variable list is generated according to described model name, subsequently receive the querying condition information that described user terminal sends, described querying condition information carries the variable that user selects according to described variable list, according to described querying condition information, carry out information inquiry, and Query Result is shown on described user terminal, achieve the unification of background logic and reduce expending of system data base resource.
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.
The embodiment schematic flow sheet of the method for a kind of custom-built query that Fig. 1 provides for the embodiment of the present invention;
The embodiment schematic flow sheet of the method for the another kind of custom-built query that Fig. 2 provides for the embodiment of the present invention;
The schematic flow sheet of the information inquiry of a kind of method for inquiring customization that Fig. 3 provides for this bright embodiment;
The example structure schematic diagram of the device of a kind of custom-built query that Fig. 4 provides for the embodiment of the present invention;
The example structure schematic diagram of the device of the another kind of custom-built query that Fig. 5 provides for the embodiment of the present invention;
The structural representation of the enquiry module of the device of a kind of custom-built query that Fig. 6 provides for the embodiment of the present 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 making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
The described user terminal mentioned in the embodiment of the present invention can comprise the internet devices such as PC, smart mobile phone (as Android phone, iOS mobile phone etc.), panel computer, palm PC, mobile internet device (MID, Mobile Internet Devices) or wearable intelligent equipment.
It is fixing inquiry that the method for the custom-built query of the embodiment of the present invention can be applied to audit model rapid translating flexibly, or is fixing inquiry by data model rapid translating, etc.
The embodiment of the present invention provides a kind of method and system of custom-built query, for realizing the unification of background logic and reducing expending of back-end data base resource.Describe in detail respectively below.
Refer to Fig. 1, the embodiment schematic flow sheet of the method for a kind of custom-built query that Fig. 1 provides for the embodiment of the present invention.As shown in Figure 1, the method for this custom-built query can comprise the following steps:
S101, be stored in system parameter table by the parameter corresponding with model, described parameter comprises model information table, variable information table, querying condition table and SQL statement table.
In the embodiment that some are feasible, by the statement of model is converted to parameter, and the parameter corresponding with above-mentioned model is stored in inquiry system parameter list, realize the unification of query logic, this parameter comprises model information table, variable information table, querying condition table and SQL statement table, and the design of above-mentioned four parameter lists is as shown in table 1:
Table 1
The model name that S102, reception user terminal send, dynamically generates variable list according to above-mentioned model name.
In the embodiment that some are feasible, at unified query interface, selected for user by model information table generation model drop-down menu, user is by after model drop-down menu preference pattern, the title of the model that inquiry system is selected according to user dynamically generates choice variable list and selects for user, and user can select a variable or multiple variable to input according to above-mentioned variable list.
S103, receive described user terminal send querying condition information, described querying condition information carries the variable that user selects according to described variable list.
In the embodiment that some are feasible, by unified query interface, the variable that user selects according to above-mentioned variable list or multiple variable, or the querying condition information that user increases, the querying condition information of the variable that above-mentioned user selects by user terminal or increase sends to inquiry system.
S104, according to described querying condition information, carry out information inquiry, and Query Result is shown on described user terminal.
In the embodiment that some are feasible, the model that inquiry system is selected according to user and variable, call the perform statement corresponding with above-mentioned model, generate execution analysis code according to above-mentioned perform statement and carry out execution analysis, and the result of the inquiry of execution analysis is shown on described user terminal.
In the embodiment of the present invention, first the parameter corresponding with model is stored in system parameter table, user is made to select the model for inquiring about by unified query interface, then the model name that user terminal sends is received, dynamically variable list is generated according to described model name, subsequently receive the querying condition information that described user terminal sends, described querying condition information carries the variable that user selects according to described variable list, according to described querying condition information, carry out information inquiry, and Query Result is shown on described user terminal, achieve the unification of background logic and reduce expending of system data base resource.
Below in conjunction with accompanying drawing 2 and accompanying drawing 3, the embodiment of the method for the another kind of custom-built query that the embodiment of the present invention provides is described in detail.
Refer to Fig. 2, the embodiment schematic flow sheet of the method for a kind of custom-built query that Fig. 2 provides for the embodiment of the present invention.As shown in Figure 2, the method for this custom-built query can comprise the following steps:
S201, obtain perform statement according to the execution step of described model.
In the embodiment that some are feasible, first create a source file, above-mentioned source file name is defined according to model name and number of steps, the condition selected according to User Defined again carries out the splicing of anolytic sentence, the anolytic sentence of splicing is outputted in above-mentioned source file, again by adopting the Include method of SAS to quote source file, unified submission to by anolytic sentence performs, and obtains the perform statement of above-mentioned model.
According to model name and number of steps definition source filename, set up source body of an instrument as follows:
%let stepname=&target..source;
/ * start to generate source file */
data_null_;
file spsource("&stepname")lrecl=32767;
put"rsubmit;";
run;
Model is made up of multiple step, system by above-mentioned model anolytic sentence in steps splice, and the text spliced statement being outputted to source file is as follows:
Adopt the Include method of SAS to quote source file, unified text anolytic sentence submission performed is as follows:
S202, extract described perform statement, generate the parameter corresponding with described model.
In the embodiment that some are feasible, the source file of generation being removed the part that the downloading data produced after each step is run carries out showing, forming SQL statement table by submitting statement ExecP9SQL, ExecP9CreateTable, DownloadP92SAS, the UploadSAS2P9 on backstage and the local suite performing 5 classes to.The screening conditions of each statement are formed variable information table as variable.The value mode of above-mentioned variable is formed querying condition table as querying condition.The information related to by described model running is as the essential information formation model information table of model.
S203, the parameter corresponding with model to be stored in system parameter table.
The model name that S204, reception user terminal send.
S205, the model information corresponding with described model name according to the acquisition of described model name.
In the embodiment that some are feasible, user selects this time for after the model inquired about in model list, the model information that the name acquiring of the model that inquiry system is selected according to user is corresponding with above-mentioned model name, above-mentioned model information comprises pattern number, model describes, authority list and authority list label information.
S206, judge whether authority list exists the table do not had in the expression list of user grants access.
In the embodiment that some are feasible, judge whether above-mentioned authority list exists the table do not had in the table inventory of user grants access, if judge to there is the table do not had in user grants access in described authority list, now illustrate that this user does not obtain whole authorities of required access list, now return information to user terminal, this information cannot use this model to inquire about for pointing out user, the table inventory of above-mentioned user grants access is carry out authorizing in user management, at subscriber administration interface, table authority can be authorized to certain user, the tables of data set that designated user can be accessed.
S207, prompting user can use described model to inquire about, and dynamically generate variable list according to described model name.
In the embodiment that some are feasible, when there is not if judge the table do not had in user grants access in described authority list, information is returned to described user terminal, above-mentioned information is used for prompting and described model can be used to inquire about, and from system variable information table, obtain the variable information table corresponding with above-mentioned model name according to above-mentioned model name, and dynamically generate choice variable list for user's selection.
The querying condition that S208, reception user terminal send, according to querying condition, carries out information inquiry, and is shown on described user terminal by Query Result.
In the embodiment that some are feasible, the querying condition that system inputs according to user, the perform statement of calling model, generate execution analysis code according to the perform statement of model and carry out execution analysis, add result and download displaying code, and download displaying code according to result, utilize paging technique to be shown on described user terminal by Query Result.
Add result and download displaying code, and download displaying code according to result, the text utilizing paging technique to be shown on described user terminal by Query Result is as follows:
Refer to Fig. 3, the schematic flow sheet of the information inquiry of a kind of method for inquiring customization that Fig. 3 provides for this bright embodiment.As shown in Figure 3, the method for this custom-built query can comprise the following steps:
The querying condition information that S2101, reception user terminal send.
S2102, judge querying condition information whether carry described user increase querying condition.
In the embodiment that some are feasible, according to the querying condition information that user terminal sends, judge whether above-mentioned querying condition information carries the querying condition information of user's increase, if querying condition information carries the querying condition information that user increases, then the querying condition information of described increase is updated in model parameter information table and interim model parameter table in conjunction with described model information, described model parameter information table for described variable information table is associated with described model information table, the model parameter information table with model name of generation.
S2103, judge whether user have selected variable according to querying condition information.
In the embodiment that some are feasible, system first judged whether user have selected variable on the subscriber terminal before sending execution inquiry request, if the non-selected variable of user, user's choice variable is pointed out to inquire about, thus avoid inquiry system and occur the situation that printenv is inquired about, improve utilization factor and the elevator system stability of system.
S2104, judge whether the group parameter corresponding with variable is sky.
In the embodiment that some are feasible, judge that user have selected variable on the subscriber terminal according to inquiry querying condition, the information of then carrying according to described variable judges whether the group parameter corresponding with variable is empty, if judge, above-mentioned group of parameter is as empty, now illustrate that above-mentioned variable is for can input variable, inquiry system can judge whether user selects must directly obtain the inquiry of query statement performing database by defeated variable.
S2105, judging according to querying condition whether user have selected must defeated variable.
In the embodiment that some are feasible, if when the corresponding group parameter of above-mentioned variable is not empty, illustrate that the group at described variable place must have at least one must defeated variable, then inquiry system judge whether user have selected according to querying condition information must defeated variable, if judge user not have selected on the subscriber terminal must defeated variable time, return information to user terminal, described information must defeated variable for pointing out user to select.The variable with identical group # is same group, and same group of variable has a variable at least for must defeated item, can control like this must defeated item and non-must defeated item, described must defeated variable can be one or more, and the embodiment of the present invention is not construed as limiting.
S2106, model based coding obtain SQL information and the querying condition information of the model corresponding with described model from system parameter table.
In the embodiment that some are feasible, judge that user have selected on the subscriber terminal must after defeated variable, from the SQL information table system parameter table, the SQL statement of the model corresponding with model is obtained according to model based coding, obtain the conditional information of the model corresponding with model from the querying condition table system parameter table, being passed on a skill of craft to others by the conditional information of the SQL statement of the model got and model, %toolmodel is grand carries out background process.
Model parameter information table after S2107, renewal and the querying condition information formation condition macro-variable corresponding with described model.
In the embodiment that some are feasible, the text generating macro-variable according to the model parameter information table imported into and Model Condition information is as follows:
S2108, condition macro-variable is attached in SQL statement, generates backstage run time version and carry out execution analysis.
In the embodiment that some are feasible, according to the SQL information table imported into by resolve method, condition macro-variable is attached in SQL statement, as follows according to the text that ExecP9SQL, ExecP9CreateTable, DownloadP92SAS, UploadSAS2P9 and the local suite backstage code performing 5 classes output in source file:
The embodiment of the present invention, first the parameter corresponding with model is stored in system parameter table, user is made to select the model for inquiring about by unified query interface, then the model name that user terminal sends is received, dynamically variable list is generated according to described model name, subsequently receive the querying condition information that described user terminal sends, described querying condition information carries the variable that user selects according to described variable list, according to described querying condition information, carry out information inquiry, and Query Result is shown on described user terminal, achieve the unification of background logic and reduce expending of system data base resource.
Refer to Fig. 4, the example structure schematic diagram of the device of a kind of custom-built query that Fig. 4 provides for the embodiment of the present invention.As shown in Figure 4, the device of this custom-built query can comprise the following steps:
Storage unit 101, for being stored in system parameter table by the parameter corresponding with model, described parameter comprises model information table, variable information table, querying condition table and SQL statement table.
Receiving element 102, for receiving the model name that user terminal sends.
Generation unit 103, for dynamically generating variable list according to described model name.
Receiving element 104, also for receiving the querying condition information that described user terminal sends, described querying condition information carries the variable that user selects according to described variable list.
Enquiry module 105, for according to described querying condition information, carries out information inquiry.
Display unit 106, for showing Query Result on described user terminal.
The embodiment of the present invention, the parameter corresponding with model is first stored in system parameter table by storage unit 101, user is made to select the model for inquiring about by unified query interface, then receiving element 102 receives the model name that user terminal sends, productive unit 103 dynamically generates variable list according to described model name, subsequently receiving element 102 receives the querying condition information that described user terminal sends, described querying condition information carries the variable that user selects according to described variable list, enquiry module 105 is according to described querying condition information, carry out information inquiry, Query Result is shown by display unit 106 on described user terminal, achieve the unification of background logic and reduce expending of system data base resource.In specific implementation, the step S101-S104 in the first embodiment of the disposal route of the failure message that the implementation of the device of above-mentioned custom-built query can provide see the embodiment of the present invention, does not repeat them here.
Below in conjunction with accompanying drawing 5 and accompanying drawing 6, the embodiment of the device of the another kind of custom-built query that the embodiment of the present invention provides is described in detail.
Refer to Fig. 5, the example structure schematic diagram of the device of a kind of custom-built query that Fig. 5 provides for the embodiment of the present invention.As shown in Figure 5, the device of this custom-built query can comprise the following steps:
Acquiring unit 201, obtains perform statement for the execution step according to described model.
Generation unit 202, also for extracting described perform statement, generates the parameter corresponding with described model.
Storage unit 203, for being stored in system parameter table by the parameter corresponding with model, described parameter comprises model information table, variable information table, querying condition table and SQL statement table.
Receiving element 204, for receiving the model name that user terminal sends.
Acquiring unit 201, also for obtaining the model information corresponding with described model name according to described model name, described model information comprises pattern number, model description, authority list and authority list label information;
Judging unit 205, for judging whether described authority list exists the table do not had in the table inventory of user grants access;
Return unit 206, during for judging that described authority list does not exist the table do not had in the table inventory of described user grants access at described judging unit, return information to described user terminal, described information can use described model to inquire about for pointing out described user.
Productive unit 202, also for according to described pattern number, obtains the variable information corresponding with described pattern number, and dynamically generates choice variable list from described system parameter table.
Receiving element 204, also for receiving the querying condition information that described user terminal sends, described querying condition information carries the variable that user selects according to described variable list.
Enquiry module 207, for according to described querying condition information, carries out information inquiry.
Display unit 208, for showing Query Result on described user terminal.
In the embodiment that some are feasible, described display unit downloads displaying code specifically for adding result, utilizes paging technique to be shown on described user terminal by Query Result.
Refer to Fig. 6, the structural representation of the enquiry module of the device of a kind of custom-built query that Fig. 6 provides for the embodiment of the present invention.As shown in Figure 6, the device of this custom-built query can comprise the following steps:
Judgment sub-unit 1401, for judging whether to exist the variable that described user selects on described user terminal according to described querying condition information.
Judgment sub-unit 1401, also for when described judgment sub-unit judges that user have selected variable, judges whether the group parameter corresponding with described variable is empty.
Judgment sub-unit 1401, also for judging described group of parameter in described judgment sub-unit not as empty, then according to described querying condition information judge whether to exist whether described user select on described user terminal corresponding with described group of parameter must defeated variable.
Obtain subelement 1402, must defeated variable for judging in described judgment sub-unit that described user has selected, then obtain query statement.
Performance element 1403, the query statement also for obtaining according to described acquisition subelement performs data query analysis.
In the embodiment that some are feasible, described performance element 1403 specifically for obtaining SQL information and the querying condition information of the model corresponding with described model from described system parameter table according to described model based coding, according to the described model parameter information table after renewal and the querying condition information formation condition macro-variable corresponding with described model, described condition macro-variable is attached in SQL statement, generates backstage run time version and carry out execution analysis.
Further, return subelement, also for judgment sub-unit judge described user non-selected must defeated variable time, return information to described user terminal, described information for point out described user select must defeated variable.
Described acquisition subelement 1402, also for judging that in described judgment sub-unit the group parameter corresponding with described variable is as time empty, obtains query statement.
Described performance element 1403, the query statement also for obtaining according to described acquisition subelement performs data query analysis.
The embodiment of the present invention, acquiring unit 201 obtains perform statement according to the execution step of described model, generation unit 202 extracts described perform statement, generate the parameter corresponding with described model, the parameter corresponding with model is stored in system parameter table by storage unit 203, user is made to select the model for inquiring about by unified query interface, then receiving element 204 receives the model name that user terminal sends, productive unit 202 dynamically generates variable list according to described model name, subsequently receiving element 204 receives the querying condition information that described user terminal sends, described querying condition information carries the variable that user selects according to described variable list, enquiry module 207 is according to described querying condition information, carry out information inquiry, Query Result is shown by display unit 208 on described user terminal, achieve the unification of background logic and reduce expending of system data base resource.In specific implementation, the step S201-S208 in the second embodiment of the disposal route of the failure message that the implementation of the device of above-mentioned custom-built query can provide see the embodiment of the present invention, does not repeat them here.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, described program can be stored in-computer read/write memory medium in, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc.
Above disclosedly be only present pre-ferred embodiments, certainly can not limit the interest field of the present invention with this, therefore according to the equivalent variations that the claims in the present invention are done, still belong to the scope that the present invention is contained.

Claims (28)

1. a method for custom-built query, is characterized in that, comprising:
Be stored in system parameter table by the parameter corresponding with model, described parameter comprises model information table, variable information table, querying condition table and SQL statement table;
Receive the model name that user terminal sends, and dynamically generate variable list according to described model name;
Receive the querying condition information that described user terminal sends, described querying condition information carries the variable that user selects according to described variable list;
According to described querying condition information, carry out information inquiry, and Query Result is shown on described user terminal.
2. method according to claim 1, is characterized in that, described the parameter corresponding with model is stored in system parameter table before, also comprise:
Execution step according to described model obtains perform statement;
Extract described perform statement, generate the parameter corresponding with described model.
3. method according to claim 2, is characterized in that, the described execution step according to described model obtains perform statement, comprising:
According to described model name and number of steps definition source file;
Carry out the splicing of anolytic sentence according to the condition selected, and described splicing statement is imported in source file;
Described source file is submitted to and performs, export the perform statement corresponding with described model.
4. method according to claim 2, is characterized in that, the described perform statement of described extraction, forms the parameter corresponding with described model, comprising:
Described source file is removed the statement being used for data display part after each step is run and form described SQL statement table;
The screening conditions of each statement are formed described variable information table as variable;
The value mode of described variable is formed described querying condition table as querying condition;
The information related to by described model running forms described model information table as the essential information of model.
5. method according to claim 1, is characterized in that, after the model name that described reception user terminal sends, also comprises:
Obtain the model information corresponding with described model name according to described model name, described model information comprises pattern number, model description, authority list and authority list label information;
Judge whether described authority list exists the table do not had in the table inventory of user grants access, if there is not the table do not had in the table inventory of described user grants access in described authority list, then return information to described user terminal, described information can use described model to inquire about for pointing out described user.
6. method according to claim 5, is characterized in that, described method also comprises:
If described authority list exists the table do not had in the table inventory of user grants access, then send information to described user terminal, described information can not use described model to inquire about for pointing out user.
7. method according to claim 1, is characterized in that, describedly dynamically generates choice variable list according to described model name and comprises:
According to described pattern number, from described system parameter table, obtain the variable information corresponding with described pattern number, and dynamically generate choice variable list.
8. method according to claim 1, is characterized in that, after the querying condition information that the described user terminal of described reception sends, also comprises:
Judge whether described querying condition information carries the querying condition of described user increase;
If described querying condition information carries the querying condition that described user increases, then the querying condition information of described increase is updated in model parameter information table and interim model parameter table in conjunction with described model information, described model parameter information table for described variable information table is associated with described model information table, the model parameter information table with model name of generation.
9. method according to claim 1, is characterized in that, described according to described querying condition information, carries out information inquiry, comprising:
Judge whether to exist according to described querying condition information the variable that described user selects on described user terminal;
If described user have selected variable, then judge whether the group parameter corresponding with described variable is empty;
If described group of parameter is not empty, then according to described querying condition information judge whether to exist whether described user select on described user terminal corresponding with described group of parameter must defeated variable;
Must defeated variable, the then analysis of acquisition query statement execution data query if described user has selected.
10. method according to claim 9, is characterized in that, described method also comprises:
If the non-selected variable of described user, then return information to described user terminal, described information is for pointing out described user's choice variable.
11. methods according to claim 9, is characterized in that, described method also comprises:
Must defeated variable if described user is non-selected, then return information to described user terminal, described information must defeated variable for pointing out described user to select.
12. methods according to claim 9, is characterized in that, described method also comprises:
If the group parameter corresponding with described variable is empty, then obtains query statement and perform data query analysis.
13. methods according to claim 9 and 12, is characterized in that, the described query statement that then obtains performs data analysis, comprising:
From described system parameter table, SQL information and the querying condition information of the model corresponding with described model is obtained according to described model based coding;
According to the described model parameter information table after renewal and the querying condition information formation condition macro-variable corresponding with described model;
Described condition macro-variable is attached in SQL statement, generates backstage run time version and carry out execution analysis.
14. methods according to claim 1, is characterized in that, described displaying on described user terminal by Query Result comprises:
Add result and download displaying code, and utilize paging technique to be shown on described user terminal by Query Result.
The device of 15. 1 kinds of custom-built queries, is characterized in that, comprising:
Storage unit, for being stored in system parameter table by the parameter corresponding with model, described parameter comprises model information table, variable information table, querying condition table and SQL statement table;
Receiving element, for receiving the model name that user terminal sends;
Generation unit, for dynamically generating variable list according to described model name;
Receiving element, also for receiving the querying condition information that described user terminal sends, described querying condition information carries the variable that user selects according to described variable list;
Enquiry module, for according to described querying condition information, carries out information inquiry;
Display unit, for showing Query Result on described user terminal.
16. devices according to claim 15, is characterized in that, described device also comprises:
Acquiring unit, obtains perform statement for the execution step according to described model;
Generation unit, also for extracting described perform statement, generates the parameter corresponding with described model.
17. devices according to claim 16, is characterized in that, described acquiring unit specifically for:
According to described model name and number of steps definition source file, carry out the splicing of anolytic sentence according to the condition selected, and described splicing statement is imported in source file, described source file is submitted to performing, export the perform statement corresponding with described model.
18. devices according to claim 16, is characterized in that, described generation unit specifically for:
Described source file is removed the statement being used for data display part after each step is run and form described SQL statement table, the screening conditions of each statement are formed described variable information table as variable, the value mode of described variable is formed described querying condition table as querying condition, and the information related to by described model running forms described model information table as the essential information of model.
19. devices according to claim 15, is characterized in that, described device also comprises:
Described acquiring unit, also for obtaining the model information corresponding with described model name according to described model name, described model information comprises pattern number, model description, authority list and authority list label information;
Judging unit, for judging whether described authority list exists the table do not had in the table inventory of user grants access;
Return unit, during for judging that described authority list does not exist the table do not had in the table inventory of described user grants access at described judging unit, return information to described user terminal, described information can use described model to inquire about for pointing out described user.
20. devices according to claim 19, is characterized in that, described in return unit, also for
When described judging unit judges that described authority list exists the table do not had in the table inventory of described user grants access, send information to described user terminal, described information can not use described model to inquire about for pointing out user.
21. devices according to claim 15, is characterized in that, described generation unit specifically for:
According to described pattern number, from described system parameter table, obtain the variable information corresponding with described pattern number, and dynamically generate choice variable list.
22. devices according to claim 15, is characterized in that, described device also comprises:
Described judging unit, also for judging whether described querying condition information carries the querying condition of described user increase;
Updating block, during for judging that at described judging unit described querying condition information carries the querying condition of described user increase, the querying condition information of described increase is updated in model parameter information table and interim model parameter table in conjunction with described model information, described model parameter information table for described variable information table is associated with described model information table, the model parameter information table with model name of generation.
23. devices according to claim 15, is characterized in that, described enquiry module, comprising:
Judgment sub-unit, for judging whether to exist the variable that described user selects on described user terminal according to described querying condition information;
Described judgment sub-unit, also for when described judgment sub-unit judges that user have selected variable, judges whether the group parameter corresponding with described variable is empty;
Described judgment sub-unit, also for judging described group of parameter in described judgment sub-unit not as empty, then according to described querying condition information judge whether to exist whether described user select on described user terminal corresponding with described group of parameter must defeated variable;
Obtain subelement, must defeated variable for judging in described judgment sub-unit that described user has selected, then obtain query statement;
Performance element, the query statement also for obtaining according to described acquisition subelement performs data query analysis.
24. devices according to claim 23, is characterized in that, described device also comprises:
Return subelement, during for judging the non-selected variable of described user in described judgment sub-unit, return information to described user terminal, described information is for pointing out described user's choice variable.
25. devices according to claim 23, is characterized in that, described device also comprises:
Describedly return subelement, also for judgment sub-unit judge described user non-selected must defeated variable time, return information to described user terminal, described information must defeated variable for pointing out described user to select.
26. devices according to claim 23, is characterized in that, described device also comprises:
Described acquisition subelement, also for judging that in described judgment sub-unit the group parameter corresponding with described variable is as time empty, obtains query statement;
Described performance element, the query statement also for obtaining according to described acquisition subelement performs data query analysis.
27. devices according to claim 23 and 26, is characterized in that, described performance element specifically for:
From described system parameter table, SQL information and the querying condition information of the model corresponding with described model is obtained according to described model based coding, according to the described model parameter information table after renewal and the querying condition information formation condition macro-variable corresponding with described model, described condition macro-variable is attached in SQL statement, generates backstage run time version and carry out execution analysis.
28. devices according to claim 15, is characterized in that, described display unit specifically for:
Add result and download displaying code, utilize paging technique to be shown on described user terminal by Query Result.
CN201410593649.9A 2014-10-29 2014-10-29 Method and device for customized query Pending CN104361040A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410593649.9A CN104361040A (en) 2014-10-29 2014-10-29 Method and device for customized query

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410593649.9A CN104361040A (en) 2014-10-29 2014-10-29 Method and device for customized query

Publications (1)

Publication Number Publication Date
CN104361040A true CN104361040A (en) 2015-02-18

Family

ID=52528301

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410593649.9A Pending CN104361040A (en) 2014-10-29 2014-10-29 Method and device for customized query

Country Status (1)

Country Link
CN (1) CN104361040A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105824637A (en) * 2016-03-17 2016-08-03 中国银行股份有限公司 Customized query method and system
CN106294569A (en) * 2016-07-27 2017-01-04 北京奇虎科技有限公司 A kind of customization searching method and device
CN106777076A (en) * 2016-12-13 2017-05-31 广东金赋科技股份有限公司 A kind of SQL limits inquiry clause generation method and combinational logic filter
CN106980670A (en) * 2017-03-23 2017-07-25 深圳市证通电子股份有限公司 Transaction message generation method and system
CN111241130A (en) * 2019-12-29 2020-06-05 航天信息股份有限公司 SQL language-based grammar statement extension method and system
CN111291003A (en) * 2020-01-21 2020-06-16 浙江工商大学 Data reading method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101350023A (en) * 2008-08-29 2009-01-21 北京航空航天大学 Method and platform capable of customizing enquiry based on service combination
US20110072411A1 (en) * 2009-09-22 2011-03-24 International Business Machines Corporation User customizable queries to populate model diagrams
CN102004766A (en) * 2010-11-09 2011-04-06 北京神州泰岳软件股份有限公司 Query method and system for configurable information based on information system
CN102163223A (en) * 2011-04-02 2011-08-24 锐词文化发展(北京)有限公司 Self-service query method and device thereof for background data
CN102810094A (en) * 2011-05-31 2012-12-05 中兴通讯股份有限公司 Report generation method and device
CN103093000A (en) * 2013-02-25 2013-05-08 用友软件股份有限公司 Database query modeling system and database query modeling method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101350023A (en) * 2008-08-29 2009-01-21 北京航空航天大学 Method and platform capable of customizing enquiry based on service combination
US20110072411A1 (en) * 2009-09-22 2011-03-24 International Business Machines Corporation User customizable queries to populate model diagrams
CN102004766A (en) * 2010-11-09 2011-04-06 北京神州泰岳软件股份有限公司 Query method and system for configurable information based on information system
CN102163223A (en) * 2011-04-02 2011-08-24 锐词文化发展(北京)有限公司 Self-service query method and device thereof for background data
CN102810094A (en) * 2011-05-31 2012-12-05 中兴通讯股份有限公司 Report generation method and device
CN103093000A (en) * 2013-02-25 2013-05-08 用友软件股份有限公司 Database query modeling system and database query modeling method

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105824637A (en) * 2016-03-17 2016-08-03 中国银行股份有限公司 Customized query method and system
CN105824637B (en) * 2016-03-17 2019-03-12 中国银行股份有限公司 Method for inquiring customization and system
CN106294569A (en) * 2016-07-27 2017-01-04 北京奇虎科技有限公司 A kind of customization searching method and device
CN106777076A (en) * 2016-12-13 2017-05-31 广东金赋科技股份有限公司 A kind of SQL limits inquiry clause generation method and combinational logic filter
CN106777076B (en) * 2016-12-13 2020-05-05 广东金赋科技股份有限公司 SQL limited query clause generation method and combinational logic filter
CN106980670A (en) * 2017-03-23 2017-07-25 深圳市证通电子股份有限公司 Transaction message generation method and system
CN111241130A (en) * 2019-12-29 2020-06-05 航天信息股份有限公司 SQL language-based grammar statement extension method and system
CN111241130B (en) * 2019-12-29 2024-05-28 航天信息股份有限公司 SQL language-based grammar statement expansion method and system
CN111291003A (en) * 2020-01-21 2020-06-16 浙江工商大学 Data reading method and device and electronic equipment
CN111291003B (en) * 2020-01-21 2021-01-05 浙江工商大学 Data reading method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN104361040A (en) Method and device for customized query
CN103136342B (en) The searching method of application A PP, system and search server
CN106406844B (en) Method and device for realizing public number menu of communication interaction platform
CN108197091B (en) Method, system and related equipment for creating data table
CN105335132A (en) Method, apparatus and system for user-defined application function
CN110866029B (en) sql statement construction method, device, server and readable storage medium
CN110555030A (en) SQL statement processing method and device
CN104699845A (en) Question-style search word based providing method and device of search results
CN113760948A (en) Data query method and device
CN105827841A (en) Icon display method and device
CN110807002A (en) Report generation method, system and equipment based on workflow and storage medium
CN110941779A (en) Page loading method and device, storage medium and electronic equipment
CN110990008B (en) Page updating method and device, storage medium and electronic equipment
CN103678706A (en) Picture recognition method, system, equipment and device based on screenshot information
CN101727505B (en) Efficient data processing method and device
CN113282591B (en) Authority filtering method, authority filtering device, computer equipment and storage medium
CN102968445B (en) Based on the application call method and apparatus of browser input
CN112131230B (en) Application software as a service (SaaS) realization method, device, equipment and storage medium
CN108959294B (en) Method and device for accessing search engine
KR101743731B1 (en) Method and apparatus for processing quary based on ontology generated by collaborating distributed data
CN112214236B (en) Method for building management system of application architecture of software rapid development platform
CN102945157B (en) Software transfer method and apparatus
CN104715066A (en) Searching optimization method, searching optimization device and searching optimization system
CN103631886A (en) Method and device for inputting on browser side
CN117009430A (en) Data management method, device, storage medium and electronic equipment

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20150218