CN110083605A - Traffic table querying method, device, server and computer readable storage medium - Google Patents

Traffic table querying method, device, server and computer readable storage medium Download PDF

Info

Publication number
CN110083605A
CN110083605A CN201910335731.4A CN201910335731A CN110083605A CN 110083605 A CN110083605 A CN 110083605A CN 201910335731 A CN201910335731 A CN 201910335731A CN 110083605 A CN110083605 A CN 110083605A
Authority
CN
China
Prior art keywords
inquiry
traffic
name
parameter
column name
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
CN201910335731.4A
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.)
New Tianjin By Information Technology Co Ltd
Tianjin Meiteng Technology Co Ltd
Original Assignee
New Tianjin By Information Technology Co Ltd
Tianjin Meiteng Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New Tianjin By Information Technology Co Ltd, Tianjin Meiteng Technology Co Ltd filed Critical New Tianjin By Information Technology Co Ltd
Priority to CN201910335731.4A priority Critical patent/CN110083605A/en
Publication of CN110083605A publication Critical patent/CN110083605A/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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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/25Integrating or interfacing systems involving database management systems

Abstract

The embodiment of the present invention provides a kind of traffic table querying method.Wherein, this method comprises: the metadata table constructed in advance is saved in the database, the metadata table and standardized query interface predetermined have corresponding relationship, and the metadata table is used to describe the structure of inquiry business table;In response to upper layer application by the inquiry request for calling the standardized query interface to initiate, query interface parameter is parsed from the inquiry request;At least partly structure according to the inquiry business table of metadata table description determines the inquiry content of the query interface parameter instruction;At least partly the traffic table in database is inquired according to the inquiry content, obtains query result.According to embodiments of the present invention, it is big that traffic table inquiry mode human cost investment in the prior art can be solved as far as possible, it is difficult to the problem of meeting complex query demand.The embodiment of the present invention also provides a kind of traffic table inquiry unit, server and computer readable storage medium.

Description

Traffic table querying method, device, server and computer readable storage medium
Technical field
The present invention relates to database access fields, in particular to traffic table querying method, device, server and computer can Read storage medium.
Background technique
Traffic table inquiring technology is returned to the data of database by specified requirements, specified format by way of routine interface To front end page.For traffic table inquiring technology, mainly there are hard coded interface polls, Code Generator interface polls two Kind mode.
Currently, hard coded interface polls and Code Generator interface polls have following problem:
1, hard coded interface polls need technical staff for the specific demand of report, hand-coding relevant interface code, There is the investment of biggish human cost.
2, Code Generator interface polls (e.g., mybatisplus) improve the human input of hard coded interface polls Cost generates relevant interface by way of Code Template and inquires code, the disadvantage is that being difficult to meet complicated inquiry, and code Maintenance cost is larger.
Summary of the invention
In view of this, the present invention provides traffic table querying method, device, server and computer readable storage medium, with It is big that traffic table inquiry mode human cost investment in the prior art is solved as far as possible, it is difficult to meet asking for complex query demand Topic.
Specifically, the present invention is achieved through the following technical solutions:
A kind of traffic table querying method, comprising:
The metadata table constructed in advance is saved in the database, the metadata table and standardized query predetermined Interface has corresponding relationship, and the metadata table is used to describe the structure of inquiry business table;
In response to the inquiry request that upper layer application is initiated by the calling standardized query interface, from the inquiry request In parse query interface parameter;
At least partly structure according to the inquiry business table of metadata table description, determines the query interface parameter The inquiry content of instruction;
At least partly the traffic table in database is inquired according to the inquiry content, obtains query result.
Optionally, the metadata table includes at least one tables of data, if including two or more tables of data, institute It states two or more tables of data and constitutes a complete metadata table, for describing the structure of inquiry business table jointly.
Optionally, the metadata table includes at least allocation list, wherein the allocation list includes at least: the master of allocation list Key ID column name, traffic table ID column name and traffic table rank name, and the query interface parameter includes at least traffic table ID, the business Table id is corresponding with the value of traffic table ID column name in the allocation list.
Optionally, the metadata table further includes configuration parameter table, wherein the configuration parameter table includes at least: configuration The major key ID column name of parameter list, the major key ID column name of allocation list, business literary name section column name, traffic table Field Inquiry parameter key column Name and business literary name section operator column name, the query interface parameter further includes parametric variable, and the parametric variable is to include key With the Map data of value, the traffic table Field Inquiry parameter key in key and the configuration parameter table in the Map data The value of column name is corresponding.
Optionally, it is described at least partly according to the metadata table description inquiry business table structure, determine described in The inquiry content of query interface parameter instruction, comprising:
The major key ID column name that corresponding traffic table ranks name and allocation list is found from allocation list according to traffic table ID;
Industry is found from the configuration parameter table according to the major key ID column name of the key and allocation list in query interface parameter Business literary name section column name and business literary name section operator column name simultaneously form table data;
The traffic table ranks the list number of name and business literary name section column name and business literary name section operator column name composition According to the inquiry content indicated for the query interface parameter.
Optionally, the parametric variable further includes querying condition concatenation operator, is used to indicate between multiple queries condition Logical relation.
Optionally, the allocation list further includes view converter parameter column name or traffic table default sort column name.
Optionally, the method also includes:
At least partly structure according to the inquiry business table of metadata table description, determines the query interface parameter The view converter parameter value of the traffic table of instruction;
After obtaining query result, view is carried out to query result according to the view converter parameter value of the traffic table Conversion.
Optionally, it is described at least partly according to the metadata table description inquiry business table structure, determine described in The view converter parameter value of the traffic table of query interface parameter instruction, comprising:
Corresponding view converter parameter column name is found from allocation list according to traffic table ID, and the view is converted Data in device parameter column name are as parameter value.
A kind of traffic table inquiry unit, comprising:
Storage unit, for saving in the database the metadata table constructed in advance, the metadata table is determined with preparatory The standardized query interface of justice has corresponding relationship, and the metadata table is used to describe the structure of inquiry business table;
Resolution unit, the inquiry request for being initiated in response to upper layer application by the calling standardized query interface, Query interface parameter is parsed from the inquiry request;
Content determining unit is inquired, for the knot at least partly according to the inquiry business table of metadata table description Structure determines the inquiry content of the query interface parameter instruction;
Query unit is obtained at least partly inquiring according to the inquiry content the traffic table in database Obtain query result.
Optionally, the metadata table includes at least one tables of data, if including two or more tables of data, institute It states two or more tables of data and constitutes a complete metadata table, for describing the structure of inquiry business table jointly.
Optionally, the metadata table includes at least allocation list, wherein the allocation list includes at least: the master of allocation list Key ID column name, traffic table ID column name and traffic table rank name, and the query interface parameter includes at least traffic table ID, the business Table id is corresponding with the value of traffic table ID column name in the allocation list.
Optionally, the metadata table further includes configuration parameter table, wherein the configuration parameter table includes at least: configuration The major key ID column name of parameter list, the major key ID column name of allocation list, business literary name section column name, traffic table Field Inquiry parameter key column Name and business literary name section operator column name, the query interface parameter further includes parametric variable, and the parametric variable is to include key With the Map data of value, the traffic table Field Inquiry parameter key in key and the configuration parameter table in the Map data The value of column name is corresponding.
Optionally, content determining unit is inquired, comprising:
Allocation list search subelement, for according to traffic table ID found from allocation list corresponding traffic table rank name and The major key ID column name of allocation list;
Allocation list parameter searches subelement, for the major key ID column name according to the key and allocation list in query interface parameter Business literary name section column name and business literary name section operator column name are found from the configuration parameter table and form table data;
Wherein, the traffic table ranks the column of name and business literary name section column name and business literary name section operator column name composition Table data are the inquiry content of query interface parameter instruction.
Optionally, the parametric variable further includes querying condition concatenation operator, is used to indicate between multiple queries condition Logical relation.
Optionally, the allocation list further includes view converter parameter column name or traffic table default sort column name.
Optionally, described device further include:
View converter parameter value-determining unit, for the inquiry business at least partly according to metadata table description The structure of table determines the view converter parameter value of the traffic table of the query interface parameter instruction;
View conversion unit is used for after obtaining query result, according to the view converter parameter value of the traffic table View conversion is carried out to query result.
Optionally, the view converter parameter value-determining unit, comprising:
Allocation list searches subelement, is also used to find corresponding view converter ginseng from allocation list according to traffic table ID Ordered series of numbers name, and using the data in the view converter parameter column name as parameter value.
A kind of server, comprising:
One or more processors;
Memory is set as storing one or more programs;
One or more of programs are executed by one or more of processors, so that one or more of processors Realize described in any item methods.
A kind of computer readable storage medium is stored with computer program on the computer readable storage medium, described Described in any item methods are realized when computer program is executed by processor.
By the above technical solution provided by the invention as it can be seen that
The traffic table querying method of a kind of configurableization of the invention, in the feelings for not having to write or write less correlative code Under condition, using metadata table, the related data query of wanted inquiry business table can be come out by standardized query interface. The development amount of traffic table query interface service, but also quite flexible can be not only reduced, if the structure in traffic table has Change (such as field name variation), meets variation as long as being slightly adjusted the associated metadata in metadata table Demand.The configurable traffic table inquiring technology has following characteristics:
1, query interface defines high unity, externally exposed query interface only one;
The query result of multiplicity is obtained by the variation of query interface parameter, a query interface can not only greatly improve Development efficiency also adds the maintainability of interface, and each query interface includes two query interface parameters, wherein first ginseng Number is traffic table ID (must fill out parameter), one tables of data (can be physical table, view, storing process) in correspondence backstage, second Parameter is parametric variable (parameter is filled out in choosing), shows as the Map data comprising key and value, in each key corresponding data table A field, value can represent the correlation of this field, and third parameter is querying condition concatenation operator, including and With two kinds of or, be non-required item, be and under default situations.
2, data query is carried out by way of splicing data query sentence;
The purpose done so can achieve unrelated with specific business, regardless of generating any traffic table, can pass through splicing The mode of data query sentence comes out its data content exposure.
3, the mode of hard coded is abandoned, the data of inquiry business table are realized in such a way that database metadata table configures;
Interface is provided and configures the page, it can be by business table name, traffic table inquiry field name and field operator etc. as first number According to database is all configured to, for existing tables of data, it can substantially accomplish the metadata table of configuration one in a few minutes, and Once and data list structure changes, and can adjust metadata table at any time.
4, the data for returning to foreground displaying are converted and is encapsulated.
The data that inquiry obtains can directly be returned to traffic table inquiry using can also pass through specified encapsulation After conversion interface (as metadata configurations to database) processing, generates related data and return to traffic table inquiry application, example Such as, basic scheme (line chart, histogram, grouping histogram etc.), completion rate chart, same when ring are converted into than chart, screening Front end page development efficiency can be improved by these standard interfaces abstracted in frame, table etc..
Detailed description of the invention
Fig. 1 is the network architecture schematic diagram of the traffic table inquiry shown in the present invention;
Fig. 2 is a kind of flow chart of traffic table querying method shown in the present invention;
Fig. 3 is a kind of structural block diagram of traffic table inquiry system shown in the present invention;
Fig. 4 is a kind of structural block diagram of traffic table inquiry unit shown in the present invention;
Fig. 5 is a kind of structural block diagram of server shown in the present invention;
Fig. 6 is the structural schematic diagram for realizing the computer system of the traffic table querying method shown according to the present invention.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended The example of device and method being described in detail in claims, some aspects of the invention are consistent.
It is only to be not intended to limit the invention merely for for the purpose of describing particular embodiments in terminology used in the present invention. It is also intended in the present invention and the "an" of singular used in the attached claims, " described " and "the" including majority Form, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein refers to and wraps It may be combined containing one or more associated any or all of project listed.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the present invention A little information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not departing from In the case where the scope of the invention, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as One information.Depending on context, word as used in this " if " can be construed to " ... when " or " when ... When " or " in response to determination ".
It referring to Figure 1, is the network architecture schematic diagram of the traffic table inquiry shown in the present invention.The network architecture includes fortune The inquiry of row traffic table is looked into using 11 client 10, execution traffic table inquiry operation and the traffic table operated on server end 20 The database 30 of inquiry system 21 and storage service table 31 and configurable metadata table 32 is provided with standard on server end 20 Change query interface 22.Wherein, traffic table inquiry is using 11 by calling standardized query interface 22 to operating in server end 20 On traffic table inquiry system 21 send inquiry request A, in response, traffic table inquiry system 21 by metadata table 32 determination The inquiry content of traffic table 31, and traffic table 31 is inquired according to inquiry content, query result is obtained, inquiry knot will be included The inquiry response B of fruit returns to traffic table inquiry using 11.
Wherein, traffic table inquiry system 21 is to operate on server end 20, and have data storage, information processing capability Software systems.Database 30 can be but not limited to various commercialization databases, for example, MySQL, Oracle etc..
Below configurable metadata table 32 and traffic table inquiry system how will be constructed in the detailed elaboration present invention 21, how using configurable metadata table 32, realize that traffic table is looked into the case where not having to write or write less correlative code It askes.
It is used in the database for subsequent query firstly, constructing metadata table in advance and saving, wherein metadata table is used for The structure of inquiry business table is described.Below with allocation list (BsReportCfg) and configuration parameter table (BsReportCfgParam) Illustrate the metadata table of building for the metadata table of composition.
Allocation list is as shown in table 1 below, comprising: major key ID column name, traffic table ID column name, the traffic table of allocation list rank name, View converter parameter column name and traffic table default sort column name.
1 allocation list BsReportCfg of table
Column name Description
id_ReportCfg Major key ID
ReportId Traffic table ID
DbTableName Business table name
ConverVoJsonParam View converter parameter (optional)
DefaultOrderFields Traffic table default sort (optional)
Configuration parameter table is as shown in table 2 below, comprising: the major key ID column name of configuration parameter table, the major key ID column name of allocation list, Business literary name section column name, traffic table Field Inquiry parameter key column name and business literary name section operator column name.Here business literary name Section operator includes but is not limited to: being equal to, is not equal to, being greater than, being greater than or equal to, being less than, being less than or equal to, gathering and be equal to (like) and fuzzy matching (in).
2 configuration parameter table BsReportCfgParam of table
Column name Description
id_ReportCfgParam The major key ID of configuration parameter table
id_ReportCfg The major key ID of allocation list
ParamKey Traffic table Field Inquiry parameter key
DbFieldCode Business literary name section
DbFieldSign Business literary name section operator
Secondly, defining standardized query interface, which includes three parameters, wherein first parameter is business Table id, for that must fill out parameter, second parameter is query interface parameter, is non-required item, for example, key and value can be shown as The Map data of the Json format of storage, third parameter are querying condition concatenation operators, be used to indicate multiple queries condition it Between logical relation comprising and and two kinds of or are non-required item, are and under default situations.
Finally, metadata table and standardized query interface are established corresponding relationship, for assembling inquiry business table data SQL statement.Wherein, the traffic table ID column name in allocation list is corresponding with the traffic table ID in standardized query interface;Configuration ginseng Traffic table Field Inquiry parameter key column name in number table is corresponding with the query interface parameter key in standardized query interface.
Metadata table is being constructed, and after defining standardized query interface, below to traffic table inquiry system 21 How using configurable metadata table 32, traffic table inquiry is realized in the case where not having to write or write less correlative code It is described in detail.Method flow diagram shown in Figure 2, may include steps of:
Step 201: traffic table inquiry is submitted using the requirement configuration querying interface parameters according to standardized query interface Give standardized query interface.
For example, query interface parameter includes traffic table ID and parametric variable, parametric variable can be stored for key and value Json format Map data.
ReportId ": " REPORT01 ", " queryParamMap ": { " key1 ": value1, " key2 ": value2 }, Wherein, traffic table ID is REPORT01, parametric variable queryParamMap, specific structure are as follows: " key1 ": value1, " key2":value2。
Step 202: traffic table inquiry system finds corresponding business table name according to traffic table ID from above-mentioned allocation list The major key ID column name of column name and allocation list.
For example, according to the value REPORT01 of traffic table ID found from allocation list corresponding traffic table rank a Table1 and The major key ID column name of allocation list.
Step 203: traffic table inquiry system is according to the major key ID column name of the key and allocation list in parametric variable from above-mentioned Business literary name section column name and business literary name section operator column name are found in configuration parameter table and form table data.
For example, the key value in the major key ID and query interface parameter queryParamMap that pass through allocation list, above-mentioned Configuration parameter table finds relevant inquiring field information (DbFieldCode, ParamKey, DbFieldSign).Assuming that inquiring two Item record, first is recorded as DbFieldCode=" column1 ", ParamKey=" key1 ", DbFieldSign=" > ", Article 2 is recorded as DbFieldCode=" column2 ", ParamKey=" key2 ", DbFieldSign=" < ".
Step 204: traffic table inquiry system ranks name, business literary name section column name and business literary name section operation using traffic table Fu Lieming forms table data, which constitutes the inquiry content of traffic table.
By taking traffic table is stored in business database SQL as an example, as shown in figure 3, traffic table inquiry system is assembled configured with SQL Device, the SQL assembly device form the SQL statement of inquiry business table according to sql like language specification.For example, spliced data base querying Sentence are as follows: select*from Table1where column1>value1and column2<value2.
It should be noted that parametric variable is that parameter is filled out in choosing, if do not filled in, traffic table is only found from allocation list and is ranked Name and inquires all business datums in related service table as inquiry content, if filled in, by according to the value of parametric variable from Business literary name section column name and business literary name section operator column name are found in configuration parameter table, and according to business literary name section column name and industry Literary name section operator column name of being engaged in inquires corresponding business datum;Wherein business literary name section column name and business literary name section operator column name Table data is formed when carrying out sql like language splicing, the logical relation between them uses the inquiry item in interface parameters Part concatenation operator, if the parameter is not provided with, using the and operator of default.If there is no two or more Querying condition when, the invalid parameters.
Step 205: traffic table inquiry system is using spliced query sentence of database (e.g., SQL statement) in database In inquire include column name and data value query result.
For example, result data are as follows:
[{"column3":valueA,"column4":valueB},{"column3":valueC,"column4": valueD}]。
Step 206: database root is inquired according to query statement, and query result is returned to traffic table inquiry system.
Step 207: query result is returned to traffic table inquiry by standardized query interface and answered by traffic table inquiry system With.
In addition, in the present invention, the traffic table data inquired can be returned directly to traffic table inquiry using, After being handled by specified conversion interface (as metadata configurations to database), generates related data and return to business Table inquiry application.For example, conversion classification includes but is not limited to: basic scheme (line chart, histogram, grouping histogram etc.), complete Front end can be improved by these conversion interfaces abstracted than chart, screening frame, table etc. at rate chart, with when ring Page development efficiency.
It in an embodiment of the invention, can also include view converter parameter column name in above-mentioned allocation list, It can be the Map data of the key and value Json format stored, for the column name of query result data to be substituted for view The column name of converter parameter identification.
It wherein, can be with the traffic table ID of establishing criteria query interface, from above-mentioned allocation list in above-mentioned steps 202 In find the Map data of Json format in corresponding view converter parameter column name.A view is configured in traffic table inquiry system Figure converter, as shown in figure 3, the view converter is carried out pair using the column name in key value in Map data and query result data It answers, and the column name in query result data is replaced with the corresponding value data of the key value in Map data, form standardization and look into Ask the result data that interface finally returns that.
Tentative standard query interface prepares to return to a histogram chart data, wherein including two fields, name table Show abscissa field, value indicates the specific data field of the histogram, wherein the Json format of view converter parameter column name Map data be { " name ": " column3 ", " value ": " column4 " }, then the result data that interface finally returns that are as follows: [{"name":valueA,"value":valueB},{"name":valueC,"value":valueD}]。
In the present invention, metadata table can be only a tables of data, can also simultaneously include two or more tables It is single.It should be understood that if an only tables of data, data can have a redundancy, in practical application, can in conjunction with field quantity with And degree of redundancy determines that a reasonable tables of data number, the present invention do not do specific limit to the number for the list that metadata table includes It is fixed.
Traffic table inquiring technology of the present invention mainly carries out correlation to individual business datum table (physical table, view) and looks into It askes, is particularly suitable for being counted by individual traffic table that ETL process (extracting, conversion, load) generates in data warehouse It is investigated that asking.
By the above technical solution provided by the invention as it can be seen that in the case where not having to write or write less correlative code, Using metadata table, the related data query of wanted inquiry business table can be come out by standardized query interface.Not only The development amount of traffic table query interface service, and quite flexible can be reduced, if the structure in traffic table changes (such as field name variation), as long as the associated metadata in metadata table to be slightly adjusted to the need for meeting variation It asks.The configurable traffic table inquiring technology has following characteristics:
1, query interface defines high unity, externally exposed query interface only one;
The query result of multiplicity is obtained by the variation of query interface parameter, a query interface can not only greatly improve Development efficiency also adds the maintainability of interface, and each query interface includes three query interface parameters, wherein first ginseng Number is traffic table ID (must fill out parameter), one tables of data (can be physical table, view, storing process) in correspondence backstage, second Parameter is parametric variable (parameter is filled out in choosing), shows as the Map data comprising key and value, in each key corresponding data table A field, value can represent the correlation of this field, and third parameter is querying condition concatenation operator, including and With two kinds of or, be non-required item, be and under default situations.When if there is no two or more querying conditions, the ginseng Number is invalid.
2, data query is carried out by way of splicing data query sentence;
The purpose done so can achieve unrelated with specific business, regardless of generating any traffic table, can pass through splicing The mode of data query sentence comes out its data content exposure.
3, the mode of hard coded is abandoned, the data of inquiry business table are realized in such a way that database metadata table configures;
Interface is provided and configures the page, it can be by business table name, traffic table inquiry field name and field operator etc. as first number According to database is all configured to, for existing tables of data, it can substantially accomplish the metadata table of configuration one in a few minutes, and Once and data list structure changes, and can adjust metadata table at any time.
4, the data for returning to foreground displaying are converted and is encapsulated.
The data that inquiry obtains can directly be returned to traffic table inquiry using can also pass through specified encapsulation After conversion interface (as metadata configurations to database) processing, generates related data and return to traffic table inquiry application, example Such as, basic scheme (line chart, histogram, grouping histogram etc.), completion rate chart, same when ring are converted into than chart, screening Front end page development efficiency can be improved by these standard interfaces abstracted in frame, table etc..
Referring to FIG. 4, Fig. 4 is a kind of structural block diagram of traffic table inquiry unit shown in the present invention, it is applied to shown in Fig. 1 Traffic table inquiry system, which includes:
Storage unit 40, for by the metadata table constructed in advance save in the database, the metadata table and in advance The standardized query interface of definition has corresponding relationship, and the metadata table is used to describe the structure of inquiry business table;
Resolution unit 41, for being asked in response to upper layer application by the inquiry for calling the standardized query interface to initiate It asks, query interface parameter is parsed from the inquiry request;
Content determining unit 42 is inquired, for the knot at least partly according to the inquiry business table of metadata table description Structure determines the inquiry content of the query interface parameter instruction;
In yet another embodiment of the present invention, content determining unit is inquired, comprising:
Allocation list search subelement, for according to traffic table ID found from allocation list corresponding traffic table rank name and The major key ID column name of allocation list;
Allocation list parameter searches subelement, for the major key ID column name according to the key and allocation list in query interface parameter Business literary name section column name and business literary name section operator column name are found from the configuration parameter table and form table data;
Wherein, the traffic table ranks the column of name and business literary name section column name and business literary name section operator column name composition Table data are the inquiry content of query interface parameter instruction.
Query unit 43, at least partly inquiring according to the inquiry content the traffic table in database, Obtain query result.
In an embodiment of the invention, the metadata table includes at least one tables of data, if including two Or more than two tables of data, described two or more than two tables of data constitute a complete metadata table, for describing jointly The structure of inquiry business table.
In yet another embodiment of the present invention, the metadata table includes at least allocation list, wherein the allocation list Include at least: major key ID column name, traffic table ID column name and the traffic table of allocation list rank name, and the query interface parameter is at least wrapped Traffic table ID is included, the traffic table ID is corresponding with the value of traffic table ID column name in the allocation list.
In yet another embodiment of the present invention, the metadata table further includes configuration parameter table, wherein the configuration Parameter list includes at least: major key ID column name, the major key ID column name of allocation list, business literary name section column name, business of configuration parameter table Literary name section query argument key column name and business literary name section operator column name, the query interface parameter further includes parametric variable, institute Stating parametric variable is the Map data comprising key and value, the industry in key and the configuration parameter table in the Map data The value for literary name section query argument key column name of being engaged in is corresponding.
In yet another embodiment of the present invention, the allocation list further includes view converter parameter column name and traffic table At least one of default sort column name.
In yet another embodiment of the present invention, described device further include:
View converter parameter value-determining unit, for the inquiry business at least partly according to metadata table description The structure of table determines the view converter parameter value of the traffic table of the query interface parameter instruction;
View conversion unit is used for after obtaining query result, according to the view converter parameter value of the traffic table View conversion is carried out to query result.
Wherein, the view converter parameter value-determining unit includes: that allocation list searches subelement, is also used to according to business Table id finds corresponding view converter parameter column name from allocation list, and by the number in the view converter parameter column name According to as parameter value.
By the above technical solution provided by the invention as it can be seen that in the case where not having to write or write less correlative code, Using metadata table, the related data query of wanted inquiry business table can be come out by standardized query interface.Not only The development amount of traffic table query interface service, and quite flexible can be reduced, if the structure in traffic table changes (such as field name variation), as long as the associated metadata in metadata table to be slightly adjusted to the need for meeting variation It asks.The configurable traffic table inquiring technology has following characteristics:
1, query interface defines high unity, externally exposed query interface only one;
The query result of multiplicity is obtained by the variation of query interface parameter, a query interface can not only greatly improve Development efficiency also adds the maintainability of interface, and each query interface includes two query interface parameters, wherein first ginseng Number is traffic table ID (must fill out parameter), one tables of data (can be physical table, view, storing process) in correspondence backstage, second Parameter is parametric variable (parameter is filled out in choosing), shows as the Map data comprising key and value, in each key corresponding data table A field, value can represent the correlation of this field, and third parameter is querying condition concatenation operator, including and With two kinds of or, be non-required item, be and under default situations.When if there is no two or more querying conditions, the ginseng Number is invalid.
2, data query is carried out by way of splicing data query sentence;
The purpose done so can achieve unrelated with specific business, regardless of generating any traffic table, can pass through splicing The mode of data query sentence comes out its data content exposure.
3, the mode of hard coded is abandoned, the data of inquiry business table are realized in such a way that database metadata table configures;
Interface is provided and configures the page, it can be by business table name, traffic table inquiry field name and field operator etc. as first number According to database is all configured to, for existing tables of data, it can substantially accomplish the metadata table of configuration one in a few minutes, and Once and data list structure changes, and can adjust metadata table at any time.
4, the data for returning to foreground displaying are converted and is encapsulated.
The data that inquiry obtains can directly be returned to traffic table inquiry using can also pass through specified encapsulation After conversion interface (as metadata configurations to database) processing, generates related data and return to traffic table inquiry application, example Such as, basic scheme (line chart, histogram, grouping histogram etc.), completion rate chart, same when ring are converted into than chart, screening Front end page development efficiency can be improved by these standard interfaces abstracted in frame, table etc..
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit The unit of explanation may or may not be physically separated, and component shown as a unit can be or can also be with It is not physical unit, it can it is in one place, or may be distributed over multiple network units.It can be according to actual The purpose for needing to select some or all of the modules therein to realize the present invention program.Those of ordinary skill in the art are not paying Out in the case where creative work, it can understand and implement.
Referring to FIG. 5, Fig. 5 is a kind of structural block diagram of server shown in the present invention, as shown in figure 5, the server 500 include processor 501 and memory 502;Wherein,
The memory 502 is for storing one or more computer instruction, wherein one or more computer refers to It enables and being executed by the processor 501 to realize all or part of the steps in aforementioned approaches method step.
Fig. 6 is the structural schematic diagram for realizing the computer system of the traffic table querying method shown according to the present invention.
As shown in fig. 6, computer system 600 includes central processing unit (CPU) 601, it can be read-only according to being stored in Program in memory (ROM) 602 or be loaded into the program in random access storage device (RAM) 603 from storage section 608 and Execute the various processing in above-mentioned embodiment shown in Fig. 2.In RAM603, be also stored with system 600 operate it is required each Kind program and data.CPU601, ROM602 and RAM603 are connected with each other by bus 604.Input/output (I/O) interface 605 It is also connected to bus 604.
I/O interface 605 is connected to lower component: the importation 606 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 607 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 608 including hard disk etc.; And the communications portion 609 of the network interface card including LAN card, modem etc..Communications portion 609 via such as because The network of spy's net executes communication process.Driver 610 is also connected to I/O interface 605 as needed.Detachable media 611, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 610, in order to read from thereon Computer program be mounted into storage section 608 as needed.
Particularly, it is soft to may be implemented as computer above with reference to Fig. 2 method described for embodiment according to the present invention Part program.For example, embodiments of the present invention include a kind of computer program product comprising be tangibly embodied in and its readable Computer program on medium, the computer program include the program code for executing aforesaid space index establishing method. In such an embodiment, which can be downloaded and installed from network by communications portion 609, and/or It is mounted from detachable media 611.
Flow chart and block diagram in attached drawing illustrate system, method and computer according to the various embodiments of the present invention The architecture, function and operation in the cards of program product.In this regard, each box in course diagram or block diagram can be with A part of a module, section or code is represented, a part of the module, section or code includes one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart, Ke Yiyong The dedicated hardware based system of defined functions or operations is executed to realize, or can be referred to specialized hardware and computer The combination of order is realized.
Being described in unit or module involved in disclosure embodiment can be realized by way of software, can also It is realized in a manner of through hardware.Described unit or module also can be set in the processor, these units or module Title do not constitute the restriction to the unit or module itself under certain conditions.
As on the other hand, the present invention also provides a kind of computer readable storage medium, the computer-readable storage mediums Matter can be computer readable storage medium included in device described in above embodiment;It is also possible to individualism, Without the computer readable storage medium in supplying equipment.Computer-readable recording medium storage has one or more than one journey Sequence, described program is used to execute by one or more than one processor is described in method of the invention.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the present invention.

Claims (10)

1. a kind of traffic table querying method characterized by comprising
The metadata table constructed in advance is saved in the database, the metadata table and standardized query interface predetermined With corresponding relationship, the metadata table is used to describe the structure of inquiry business table;
In response to upper layer application by the inquiry request for calling the standardized query interface to initiate, solved from the inquiry request Query interface parameter is precipitated;
At least partly structure according to the inquiry business table of metadata table description determines the query interface parameter instruction Inquiry content;
At least partly the traffic table in database is inquired according to the inquiry content, obtains query result.
2. the method according to claim 1, wherein the metadata table includes at least one tables of data, if Including two or more tables of data, described two or more than two tables of data constitute a complete metadata table, are used for The structure of common description inquiry business table.
3. according to the method described in claim 2, it is characterized in that, the metadata table includes at least allocation list, wherein described Allocation list includes at least: major key ID column name, traffic table ID column name and the traffic table of allocation list rank name, the query interface parameter Including at least traffic table ID, the traffic table ID is corresponding with the value of traffic table ID column name in the allocation list.
4. according to the method described in claim 3, it is characterized in that, the metadata table further includes configuration parameter table, wherein institute It states configuration parameter table to include at least: the major key ID column name of configuration parameter table, the major key ID column name of allocation list, business literary name section column Name, traffic table Field Inquiry parameter key column name and business literary name section operator column name, the query interface parameter further includes parameter Variable, the parametric variable are the Map data comprising key and value, key and the configuration parameter table in the Map data In traffic table Field Inquiry parameter key column name value it is corresponding.
5. according to the method described in claim 4, it is characterized in that, described at least partly according to metadata table description The structure of inquiry business table determines the inquiry content of the query interface parameter instruction, comprising:
The major key ID column name that corresponding traffic table ranks name and allocation list is found from allocation list according to traffic table ID;
Traffic table is found from the configuration parameter table according to the major key ID column name of the key and allocation list in query interface parameter Field column name and business literary name section operator column name simultaneously form table data;
Wherein, the traffic table ranks the list number of name and business literary name section column name and business literary name section operator column name composition According to the inquiry content indicated for the query interface parameter.
6. the method according to claim 3 or 4, which is characterized in that the allocation list further includes view converter parameter column At least one of name and traffic table default sort column name.
7. the method according to claim 3 or 4, which is characterized in that the parametric variable further includes querying condition connection fortune Operator, the logical relation being used to indicate between multiple queries condition.
8. a kind of traffic table inquiry unit characterized by comprising
Storage unit, for by the metadata table constructed in advance save in the database, the metadata table with it is predetermined Standardized query interface has corresponding relationship, and the metadata table is used to describe the structure of inquiry business table;
Resolution unit, the inquiry request for being initiated in response to upper layer application by the calling standardized query interface, from institute It states and parses query interface parameter in inquiry request;
Content determining unit is inquired, for the structure at least partly according to the inquiry business table of metadata table description, really The inquiry content of the fixed query interface parameter instruction;
Query unit is looked at least partly inquiring according to the inquiry content the traffic table in database Ask result.
9. a kind of server characterized by comprising
One or more processors;
Memory is set as storing one or more programs;
One or more of programs are executed by one or more of processors, so that one or more of processors are realized Such as method of any of claims 1-7.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program realizes such as method of any of claims 1-7 when the computer program is executed by processor.
CN201910335731.4A 2019-04-24 2019-04-24 Traffic table querying method, device, server and computer readable storage medium Pending CN110083605A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910335731.4A CN110083605A (en) 2019-04-24 2019-04-24 Traffic table querying method, device, server and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910335731.4A CN110083605A (en) 2019-04-24 2019-04-24 Traffic table querying method, device, server and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN110083605A true CN110083605A (en) 2019-08-02

Family

ID=67416520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910335731.4A Pending CN110083605A (en) 2019-04-24 2019-04-24 Traffic table querying method, device, server and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110083605A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110717073A (en) * 2019-10-08 2020-01-21 普元信息技术股份有限公司 System and method for realizing process query processing by combining service data in cloud process platform
CN110781184A (en) * 2019-09-16 2020-02-11 平安科技(深圳)有限公司 Data table construction method, device, equipment and storage medium
CN110941950A (en) * 2019-11-26 2020-03-31 北京明略软件系统有限公司 Interface document generation method, device, server and storage medium
CN111191057A (en) * 2019-12-17 2020-05-22 贝壳技术有限公司 User-defined retrieval method and device, electronic equipment and storage medium thereof
CN111241130A (en) * 2019-12-29 2020-06-05 航天信息股份有限公司 SQL language-based grammar statement extension method and system
CN112764744A (en) * 2021-01-25 2021-05-07 芝麻云信(武汉)科技有限公司 Interface service design method for ERP system
CN112925803A (en) * 2021-04-09 2021-06-08 泰康保险集团股份有限公司 Data processing method and device of interface
CN113704225A (en) * 2021-08-20 2021-11-26 济南浪潮数据技术有限公司 Method, system, equipment and storage medium for constructing and using configuration center

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271473A (en) * 2008-04-29 2008-09-24 华为技术有限公司 Data query method, device and system
CN102375854A (en) * 2010-08-23 2012-03-14 杭州华三通信技术有限公司 Method and device for data processing for database
CN103488694A (en) * 2013-09-02 2014-01-01 用友软件股份有限公司 Business data inquiry device and business data inquiry method
CN104123346A (en) * 2014-07-02 2014-10-29 广东电网公司信息中心 Structural data searching method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271473A (en) * 2008-04-29 2008-09-24 华为技术有限公司 Data query method, device and system
CN102375854A (en) * 2010-08-23 2012-03-14 杭州华三通信技术有限公司 Method and device for data processing for database
CN103488694A (en) * 2013-09-02 2014-01-01 用友软件股份有限公司 Business data inquiry device and business data inquiry method
CN104123346A (en) * 2014-07-02 2014-10-29 广东电网公司信息中心 Structural data searching method

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110781184A (en) * 2019-09-16 2020-02-11 平安科技(深圳)有限公司 Data table construction method, device, equipment and storage medium
CN110781184B (en) * 2019-09-16 2023-06-16 平安科技(深圳)有限公司 Data table construction method, device, equipment and storage medium
CN110717073A (en) * 2019-10-08 2020-01-21 普元信息技术股份有限公司 System and method for realizing process query processing by combining service data in cloud process platform
CN110717073B (en) * 2019-10-08 2024-02-06 普元信息技术股份有限公司 System and method for realizing flow query processing by combining business data in cloud flow platform
CN110941950A (en) * 2019-11-26 2020-03-31 北京明略软件系统有限公司 Interface document generation method, device, server and storage medium
CN110941950B (en) * 2019-11-26 2023-03-17 北京明略软件系统有限公司 Interface document generation method, device, server and storage medium
CN111191057A (en) * 2019-12-17 2020-05-22 贝壳技术有限公司 User-defined retrieval method and device, electronic equipment and storage medium thereof
CN111241130A (en) * 2019-12-29 2020-06-05 航天信息股份有限公司 SQL language-based grammar statement extension method and system
CN112764744A (en) * 2021-01-25 2021-05-07 芝麻云信(武汉)科技有限公司 Interface service design method for ERP system
CN112925803A (en) * 2021-04-09 2021-06-08 泰康保险集团股份有限公司 Data processing method and device of interface
CN113704225A (en) * 2021-08-20 2021-11-26 济南浪潮数据技术有限公司 Method, system, equipment and storage medium for constructing and using configuration center
CN113704225B (en) * 2021-08-20 2024-02-13 济南浪潮数据技术有限公司 Method, system, device and storage medium for constructing and using configuration center

Similar Documents

Publication Publication Date Title
CN110083605A (en) Traffic table querying method, device, server and computer readable storage medium
US7469248B2 (en) Common interface to access catalog information from heterogeneous databases
US8200612B2 (en) Efficient SQL access to multidimensional data
US8200684B2 (en) Method and system for dynamic templatized query language in software
US7668798B2 (en) System and method for accessing data in disparate information sources
US8655861B2 (en) Query metadata engine
US7668860B2 (en) Apparatus and method for constructing and using a semantic abstraction for querying hierarchical data
EP1513076A1 (en) Method and computer system for data conversion
US9992269B1 (en) Distributed complex event processing
US20210256079A1 (en) Adapting database queries for data virtualization over combined database stores
US9195729B2 (en) Efficient loading of data in databases
US10360394B2 (en) System and method for creating, tracking, and maintaining big data use cases
US20050050074A1 (en) Efficient loading of data into a relational database
CN103927331A (en) Data querying method, data querying device and data querying system
CN114218218A (en) Data processing method, device and equipment based on data warehouse and storage medium
US20230418824A1 (en) Workload-aware column inprints
CN107729500B (en) Data processing method and device for online analysis processing and background equipment
EP2000927A1 (en) Apparatus and method for abstracting data processing logic in a report
CN109829003A (en) Database backup method and device
US11354313B2 (en) Transforming a user-defined table function to a derived table in a database management system
CN115168474B (en) Internet of things central station system building method based on big data model
US9183317B1 (en) System and method for exporting report results from a reporting system
US7970782B1 (en) Systems and methods for set filtering of data
US11562027B1 (en) Self-service data provisioning system
US11663216B2 (en) Delta database data provisioning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 300381 Tianjin Binhai New Area Binhai Mesozoic and New Eco-city West of Zhongcheng Avenue and South of Zhongbin Avenue Eco-construction Apartment Building 8, Room 1,137

Applicant after: TIANJIN ZHONGXIN ZHIGUAN INFORMATION TECHNOLOGY Co.,Ltd.

Applicant after: Tianjin Meiteng Technology Co.,Ltd.

Address before: 300381 Tianjin Binhai New Area Binhai Mesozoic and New Eco-city West of Zhongcheng Avenue and South of Zhongbin Avenue Eco-construction Apartment Building 8, Room 1,137

Applicant before: TIANJIN ZHONGXIN ZHIGUAN INFORMATION TECHNOLOGY Co.,Ltd.

Applicant before: Tianjin Meiteng Technology Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190802