CN102402515A - General custom query system and method - Google Patents

General custom query system and method Download PDF

Info

Publication number
CN102402515A
CN102402515A CN2010102782541A CN201010278254A CN102402515A CN 102402515 A CN102402515 A CN 102402515A CN 2010102782541 A CN2010102782541 A CN 2010102782541A CN 201010278254 A CN201010278254 A CN 201010278254A CN 102402515 A CN102402515 A CN 102402515A
Authority
CN
China
Prior art keywords
inquiry
query
question blank
unit
data
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
CN2010102782541A
Other languages
Chinese (zh)
Inventor
冯波
肖建良
吴华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen City Penghaiyun Electronic Data Exchange Co Ltd
Original Assignee
Shenzhen City Penghaiyun Electronic Data Exchange Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen City Penghaiyun Electronic Data Exchange Co Ltd filed Critical Shenzhen City Penghaiyun Electronic Data Exchange Co Ltd
Priority to CN2010102782541A priority Critical patent/CN102402515A/en
Publication of CN102402515A publication Critical patent/CN102402515A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention relates to a general custom query system, which is used for querying data from a database. The system comprises a query table creating unit, a query group creating unit and a query creating unit, wherein the query table creating unit is used for creating query tables; each query table is associated with a table in a source database and comprises one or more fields of the table in the database; the query group creating unit is used for creating query groups; each query group comprises one or more fields from at least one query table; the query creating unit is used for creating queries; each query comprises a related query group and a query logic; and the query logic is based on the value of one or more fields in the query group. The invention also relates to a general custom query method. The general custom query system can be embedded into any Java 2 enterprise edition (J2EE) technology-based service system without secondary development, and codes are highly reused.

Description

General self-defined inquiry system and method
Technical field
The present invention relates to field of computer data processing, more specifically, the present invention relates to a kind of general self-defined inquiry system and method.
Background technology
Along with the development of development of technology with society, it is more and more important that information sharing becomes, and in order to solve the data sharing problem, prior art realizes data sharing through the mode of setting up large-scale central database.All peripheral systems link to each other with central database, and all data that need share are all by the central database centralized management, and peripheral system obtains needed data through the visit central database.
At present, the operation system of peripheral system adopts WEB application mode visit central database usually.Yet in the exploitation of above-mentioned business, to the design of data query, generally can only be according to the specific corresponding inquiry of business need design, function singleness, not reusable.If the user has new data query requirement, often need carry out secondary development, increase corresponding query function, the wasting manpower and material resources; And can only conditional permission user set up querying condition on their own.
Summary of the invention
The technical matters that the present invention will solve is, and is single to query function in the above-mentioned existing business system, increase query task and need the problem of exploitation again, and a kind of general self-defined inquiry system and method is provided.
The technical scheme that the present invention solves the problems of the technologies described above is, a kind of general self-defined inquiry system is provided, and is used for from data base querying, comprises that question blank creates unit, inquiry creation unit and inquiry and create the unit, wherein:
Said question blank is created the unit, is used to create question blank, and in each question blank and the source database one shows related and comprises one or more fields of showing in the said database;
Said inquiry creation unit is used to create the inquiry group, and each inquiry group comprises from the one or more fields at least one question blank;
The unit is created in said inquiry, is used for creating inquiry, and each inquiry comprises inquiry group and the query logic that relates to, and said query logic is based on the value of one or more fields in the said inquiry group.
In general self-defined inquiry of the present invention system, also comprise the execution query unit, be used to carry out said inquiry and create the inquiry created the unit to obtain data and to export Query Result from database.
In general self-defined inquiry of the present invention system, said inquiry creation unit comprises field code conversion subelement, and the name translation that is used for the question blank field is self-defining title.
In general self-defined inquiry of the present invention system, said inquiry creation unit comprises the related subelement of creating, and is used to create the association between two or more question blanks, and at least one field in each related question blank meets correlation logic.
In general self-defined inquiry of the present invention system, said inquiry is created the unit and is comprised output-index definition subelement, is used for selecting one or more fields as output data from the inquiry group;
In general self-defined inquiry of the present invention system, said inquiry is created the unit and is comprised:
Parametric variable definition subelement is used to create parametric variable, and said parametric variable is used to carry out the parameter input;
Query logic definition subelement is used to create query logic, and each query logic comprises field, relation character and parametric variable.
The present invention also provides a kind of general user-defined searching method, is used for may further comprise the steps from the data base querying data:
A, create question blank, in each question blank and the source database one shows related and comprises one or more fields of showing in the said database;
B, establishment inquiry group, each inquiry group comprises from the one or more fields at least one question blank;
C, establishment inquiry, each inquiry comprises inquiry group and the query logic that relates to, said query logic is based on the value of one or more fields in the said inquiry group.
In general user-defined searching method of the present invention, comprise also after the said step c that the inquiry of creating the said inquiry establishment of execution unit is to obtain data and to export Query Result from database.
In general user-defined searching method of the present invention, comprise among the said step a that the name translation with field in the question blank is self-defining title.
In general user-defined searching method of the present invention, comprise the association of creating between two or more question blanks among the said step b, at least one field in each related question blank meets correlation logic.
General self-defined inquiry system and method for the present invention through data source definitions, inquiry creation and inquiry mode definition, has been realized self-defining inquiry establishment, can satisfy all users' query demand.The present invention can embed in any operation system based on the J2EE technology, and need not secondary development, highly reuses code.
Description of drawings
Fig. 1 is the synoptic diagram of the general self-defined inquiry system embodiment of the present invention;
Fig. 2 is the process flow diagram of the general user-defined searching method embodiment of the present invention.
Embodiment
The present invention is based on system R, is the inquiry subsystem that also can be repeatedly used through User Defined, and this subsystem can be embedded in any WEB application software based on the J2EE technology.
As shown in Figure 1, be the synoptic diagram of the general self-defined inquiry system embodiment of the present invention, this system is used for from the data base querying specific data.In the present embodiment, inquiry system comprises question blank establishment unit 11, inquiry creation unit 12 and inquiry establishment unit 13.Above-mentioned each unit can be positioned at same physical equipment, also can be positioned at a plurality of equipment that connect through network.
Question blank is created unit 11 and is used to create question blank, and the table related (or corresponding) in each question blank and the source database also comprises one or more fields of correspondence table in the database.Through creating question blank, the field information of correlation table and correlation table in the required database of using in the definable inquiry promptly obtains the data source of inquiry.In the present embodiment, question blank is created the question blank of being created unit 11 and can be associated with the tables of data in a plurality of disparate databases.For example question blank create unit 11 can create with first database in the first corresponding question blank of tables of data A, this first question blank comprises all field O, P, the Q among the tables of data A; Create simultaneously with second database in the second corresponding question blank of tables of data B, this second question blank comprises all field R, S, the T among the tables of data B.
Inquiry creation unit 12 is used to create the inquiry group, and each inquiry group comprises from the one or more fields at least one question blank.Above-mentioned inquiry group is mainly used in the scope of confirming data query, the data that clearly need inquire about related table, and table with show between relation.For example when the data of inquiry only relate to the field 0 among the tables of data A in first database (when inquiring about qualified data in the field 0 from tables of data A); Then inquire about the inquiry group of creating creation unit 12 and only comprise field 0, this field 0 obtains the data of its field 0 from tables of data A through first question blank.
Inquiry is created unit 13 and is used for creating inquiry, and each inquiry comprises inquiry group and the query logic (being querying condition) that relates to, and above-mentioned query logic is based on the value of one or more fields in the inquiry group.For example, above-mentioned inquiry can for: the value of the field Q of tables of data A is greater than all list items of designated value in first database.
In another embodiment of the present invention, also can comprise and carry out the query unit (not shown).This execution inquiry is single to be used to carry out inquiry and to create the inquiry created unit 13 to obtain data query and to export Query Result from correspondence database.
More directly perceived for the Query Result that makes output, inquiry creation unit 12 can comprise a field code conversion subelement.The name translation that this field code conversion subelement is used for the question blank field is self-defining title, thereby converts field title abstract in the data of database table into content that the terminal user can directly understand, makes Query Result more directly perceived.
In addition, in order to realize the query composition of data in the multidata table, above-mentioned inquiry creation unit 12 can comprise a related subelement of creating.This association is created subelement and is used for relating to the association between two above question blanks of two above tables of data (i.e. when inquiry group comprises the field that is positioned at different question blanks more than two) establishment in inquiry, and at least one field in each related question blank meets correlation logic.
For example when the data of inquiry relate in first database among the field P among the tables of data A and second database field R among the tables of data B; Then inquire about the inquiry group of creating creation unit 12 and comprise field P and field R; Wherein field P is through the data of first question blank from its field of tables of data A acquisition P, and field R obtains the data of its field R from tables of data B through second question blank.At this moment, the related subelement of creating need be created the association between the first inquiry watchcase, second question blank, thereby the contact of setting up list item in two tables makes a plurality of field groups synthetic " Virtual table " in the inquiry group.
In order to define the output result, unit 13 is created in inquiry can comprise an output-index definition subelement.This output-index definition subelement is used for selecting one or more fields as output data from the inquiry group, thereby the output result is the table of being made up of one or more fields of above-mentioned selection.
In addition, inquiry establishment unit 13 also can comprise parametric variable definition subelement and query logic definition subelement.Wherein parametric variable definition subelement is used to create parametric variable, and this parametric variable is used to carry out the parameter input.Query logic definition subelement; Be used to create query logic, each query logic comprise field, relation character (for example comprise, do not comprise, mate, do not match, equal, be not equal to, greater than, more than or equal to, less than, smaller or equal to, be not equal to etc.) and parametric variable.For example when parametric variable definition subelement defined parameters variable X, query logic is that field 0 equals X, and then when carrying out inquiry, when the value of the parametric variable X of user's input is 6, Query Result is that all values is 6 list item in the field 0.Above-mentioned query logic can carry out the combination of multiword section, and promptly query logic comprises the relation character computing to a plurality of fields.
In other embodiments of the invention, unit 13 is created in inquiry also can comprise subquery variable-definition subelement, with the result of subquery as parametric variable, thereby realize complicated query logic more; Unit 13 is created in inquiry also can comprise Query Result ordering definition subelement, is used to define the DISPLAY ORDER of Query Result.
As shown in Figure 3, be the process flow diagram of the general user-defined searching method embodiment of the present invention, this method is used for from the data base querying specific data.In the present embodiment, this method may further comprise the steps:
Step S21: create question blank, the table related (or corresponding) in each question blank and the source database also comprises one or more fields of correspondence table in the database.Through creating question blank, the field information of correlation table and correlation table in the required database of using in the definable inquiry promptly obtains the data source of inquiry.The question blank of creating in this step can be associated with the tables of data in a plurality of disparate databases.For example create with first database in the first corresponding question blank of tables of data A, this first question blank comprises all field O, P, the Q among the tables of data A; Create with second database in the second corresponding question blank of tables of data B, this second question blank comprises all field R, S, the T among the tables of data B.
Step S22: create the inquiry group, each inquiry group comprises from the one or more fields at least one question blank.Above-mentioned inquiry group is mainly used in the scope of confirming data query, the data that clearly need inquire about related table, and table with show between relation.For example when the data of inquiry only relate to the field 0 among the tables of data A in first database (when inquiring about qualified data in the field 0 from tables of data A); The inquiry group of then creating only comprises field 0, and this field 0 obtains the data of its field 0 from tables of data A through first question blank.
Step S23: create inquiry, each inquiry comprises inquiry group and the query logic (being querying condition) that relates to, and above-mentioned query logic is based on the value of one or more fields in the inquiry group.For example, above-mentioned inquiry can for: the value of the field Q of tables of data A is greater than all list items of designated value in first database.
In another embodiment of the present invention, said method can comprise that also the inquiry of creating among the execution in step S23 is to obtain data query and to export Query Result from correspondence database.
For the Query Result that makes output more directly perceived; The name translation of field is the step of self-defining title in step S22, can comprising question blank; Thereby convert field title abstract in the data of database table into content that the terminal user can directly understand, make Query Result more directly perceived.
In addition; In order to realize the query composition of data in the multidata table; Can comprise among the step S22: relate to two above tables of data (i.e. when inquiry group comprises the field that is arranged in different question blanks more than two) in inquiry and create the association between two above question blanks, at least one field in each related question blank meets correlation logic.
For example when the data of inquiry relate in first database among the field P among the tables of data A and second database field R among the tables of data B; Then inquire about the inquiry group of creating creation unit 12 and comprise field P and field R; Wherein field P is through the data of first question blank from its field of tables of data A acquisition P, and field R obtains the data of its field R from tables of data B through second question blank.At this moment, the related subelement of creating need be created the association between the first inquiry watchcase, second question blank, thereby the contact of setting up list item in two tables makes a plurality of field groups synthetic " Virtual table " in the inquiry group.
In order to define the output result, in step S23, can comprise: from the inquiry group, select one or more fields as output data, thereby the output result is the table of being made up of one or more fields of above-mentioned selection.
In addition; Also can comprise the step of creating parametric variable and creating query logic among the step S23; Wherein this parametric variable is used to carry out parameter input, each query logic comprise field, relation character (for example comprise, do not comprise, mate, do not match, equal, be not equal to, greater than, more than or equal to, less than, smaller or equal to, be not equal to etc.) and parametric variable.
For example when parametric variable definition subelement defined parameters variable X, query logic is that field 0 equals X, and then when carrying out inquiry, when the value of the parametric variable X of user's input is 6, Query Result is that all values is 6 list item in the field 0.Above-mentioned query logic can carry out the combination of multiword section, and promptly query logic comprises the relation character computing to a plurality of fields.
The above; Be merely the preferable embodiment of the present invention, but protection scope of the present invention is not limited thereto, any technician who is familiar with the present technique field is in the technical scope that the present invention discloses; The variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.

Claims (10)

1. a general self-defined inquiry system is used for it is characterized in that from the data base querying data, comprises that question blank creates unit, inquiry creation unit and inquiry and create the unit, wherein:
Said question blank is created the unit, is used to create question blank, and in each question blank and the source database one shows related and comprises one or more fields of showing in the said database;
Said inquiry creation unit is used to create the inquiry group, and each inquiry group comprises from the one or more fields at least one question blank;
The unit is created in said inquiry, is used for creating inquiry, and each inquiry comprises inquiry group and the query logic that relates to, and said query logic is based on the value of one or more fields in the said inquiry group.
2. general self-defined inquiry according to claim 1 system is characterized in that, also comprises the execution query unit, is used to carry out said inquiry and creates the inquiry created the unit to obtain data and to export Query Result from database.
3. general self-defined inquiry according to claim 1 system is characterized in that said inquiry creation unit comprises field code conversion subelement, and the name translation that is used for the question blank field is self-defining title.
4. general self-defined inquiry according to claim 1 system; It is characterized in that; Said inquiry creation unit comprises the related subelement of creating, and is used to create the association between two or more question blanks, and at least one field in each related question blank meets correlation logic.
5. general self-defined inquiry according to claim 1 system is characterized in that said inquiry is created the unit and comprised output-index definition subelement, is used for selecting one or more fields as output data from the inquiry group;
6. general self-defined inquiry according to claim 5 system is characterized in that said inquiry is created the unit and comprised:
Parametric variable definition subelement is used to create parametric variable, and said parametric variable is used to carry out the parameter input;
Query logic definition subelement is used to create query logic, and each query logic comprises field, relation character and parametric variable.
7. a general user-defined searching method is used for it is characterized in that from the data base querying data, may further comprise the steps:
A, create question blank, in each question blank and the source database one shows related and comprises one or more fields of showing in the said database;
B, establishment inquiry group, each inquiry group comprises from the one or more fields at least one question blank;
C, establishment inquiry, each inquiry comprises inquiry group and the query logic that relates to, said query logic is based on the value of one or more fields in the said inquiry group.
8. general user-defined searching method according to claim 7 is characterized in that, comprises also after the said step c that the inquiry of creating the said inquiry establishment of execution unit is to obtain data and to export Query Result from database.
9. general user-defined searching method according to claim 7 is characterized in that, comprises among the said step a that the name translation with field in the question blank is self-defining title.
10. general user-defined searching method according to claim 7 is characterized in that, comprises the association of creating between two or more question blanks among the said step b, and at least one field in each related question blank meets correlation logic.
CN2010102782541A 2010-09-10 2010-09-10 General custom query system and method Pending CN102402515A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010102782541A CN102402515A (en) 2010-09-10 2010-09-10 General custom query system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010102782541A CN102402515A (en) 2010-09-10 2010-09-10 General custom query system and method

Publications (1)

Publication Number Publication Date
CN102402515A true CN102402515A (en) 2012-04-04

Family

ID=45884731

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010102782541A Pending CN102402515A (en) 2010-09-10 2010-09-10 General custom query system and method

Country Status (1)

Country Link
CN (1) CN102402515A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104778253A (en) * 2015-04-20 2015-07-15 北京京东尚科信息技术有限公司 Method and device for providing data
CN105589952A (en) * 2015-12-21 2016-05-18 成都科来软件有限公司 General network statistic data querying method and system
CN107273369A (en) * 2016-04-06 2017-10-20 阿里巴巴集团控股有限公司 A kind of table data modification method and device
CN108038135A (en) * 2017-11-21 2018-05-15 平安科技(深圳)有限公司 Electronic device, the method for multilist correlation inquiry and storage medium
CN109710674A (en) * 2018-12-26 2019-05-03 重庆誉存大数据科技有限公司 A kind of rule engine system of semi-structured text data and preposition cut-in method
CN110430022A (en) * 2019-08-19 2019-11-08 深圳市鹏海运电子数据交换有限公司 Data transmission method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101046811A (en) * 2006-06-07 2007-10-03 华为技术有限公司 Data integral service system and method
CN101241434A (en) * 2008-03-04 2008-08-13 浪潮集团山东通用软件有限公司 Form self-defining method
CN101576914A (en) * 2009-06-22 2009-11-11 用友软件股份有限公司 Method and device for providing service data
CN101788996A (en) * 2009-11-19 2010-07-28 山东浪潮齐鲁软件产业股份有限公司 User-defined searching method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101046811A (en) * 2006-06-07 2007-10-03 华为技术有限公司 Data integral service system and method
CN101241434A (en) * 2008-03-04 2008-08-13 浪潮集团山东通用软件有限公司 Form self-defining method
CN101576914A (en) * 2009-06-22 2009-11-11 用友软件股份有限公司 Method and device for providing service data
CN101788996A (en) * 2009-11-19 2010-07-28 山东浪潮齐鲁软件产业股份有限公司 User-defined searching method

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104778253A (en) * 2015-04-20 2015-07-15 北京京东尚科信息技术有限公司 Method and device for providing data
CN104778253B (en) * 2015-04-20 2018-09-14 北京京东尚科信息技术有限公司 A kind of method and apparatus that data are provided
CN105589952A (en) * 2015-12-21 2016-05-18 成都科来软件有限公司 General network statistic data querying method and system
CN107273369A (en) * 2016-04-06 2017-10-20 阿里巴巴集团控股有限公司 A kind of table data modification method and device
CN107273369B (en) * 2016-04-06 2020-11-20 创新先进技术有限公司 Table data modification method and device
CN108038135A (en) * 2017-11-21 2018-05-15 平安科技(深圳)有限公司 Electronic device, the method for multilist correlation inquiry and storage medium
CN109710674A (en) * 2018-12-26 2019-05-03 重庆誉存大数据科技有限公司 A kind of rule engine system of semi-structured text data and preposition cut-in method
CN110430022A (en) * 2019-08-19 2019-11-08 深圳市鹏海运电子数据交换有限公司 Data transmission method and device

Similar Documents

Publication Publication Date Title
US9747360B2 (en) Mapping non-relational database objects into a relational database model
CN101256650B (en) Method and system for extracting enterprise data based on service entity
CN102012945B (en) User-oriented database management system
CN102402515A (en) General custom query system and method
CN102799644B (en) Based on data base dynamic inquiry system and the data base dynamic inquiry method of metadata
CN103412868B (en) Document generates method and device
CN105022615A (en) Interface generating method and system
CN100578498C (en) Data integral service system and method
CN102541529A (en) Query page generating device and method
CN105224377A (en) A kind of method by metadata automatic generating software project code file and device
CN101093524A (en) Authorization process system based on hierarchy
CN102163188A (en) Generation method and device thereof for EXCEL report in application system
CN101739460A (en) Grid-based spatial data source unification service system and method
CN101706800A (en) Finding method and system of associated invoice
CN103164573B (en) PDM managing and designing system
CN103186455A (en) Method and system for generating automatic test script on page
CN101211360A (en) System and method for processing a plurality of data form of report forms data source
CN110929280A (en) System and method for realizing data authority control based on metadata in big data environment
CN103544211A (en) General inquiry system and method for converting objects into SQL statements
CN105975489A (en) Metadata-based online SQL code completion method
CN106708946A (en) Universal API table query method
CN101425060A (en) Database data table generating method
CN102567517A (en) Device and method for issuing data of database
CN111651758A (en) Method for auditing result set of relational database of operation and maintenance auditing system
CN102982414A (en) Data generating device and method

Legal Events

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

Application publication date: 20120404