CN108153776A - Data query method and device - Google Patents
Data query method and device Download PDFInfo
- Publication number
- CN108153776A CN108153776A CN201611105428.8A CN201611105428A CN108153776A CN 108153776 A CN108153776 A CN 108153776A CN 201611105428 A CN201611105428 A CN 201611105428A CN 108153776 A CN108153776 A CN 108153776A
- Authority
- CN
- China
- Prior art keywords
- database
- data
- index
- dimension
- inquiry
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2453—Query optimisation
- G06F16/24534—Query rewriting; Transformation
- G06F16/24542—Plan optimisation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Operations Research (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 invention discloses a kind of data query method and devices, are related to database technical field, for solving the problem of that the existing mode inquiry velocity that data query is only carried out in a fixed database is slow less efficient.The present invention main technical schemes be:Determine the inquiry dimension and index of data to be checked, inquire dimension and index that metadata in database to be selected includes, the inquiry dimension of data to be checked and index are compared with metadata includes in database to be selected dimension and index, selection inquiry database, according to the inquiry dimension and index of data to be checked, and the metadata in inquiry database creates query case, and data query is carried out in database is inquired by query case.Invention is mainly used for data query.
Description
Technical field
The present invention relates to database technical field more particularly to a kind of data query method and devices.
Background technology
Growing with internet, the application of database is also more and more extensive, and the mass data epoch have arrived.
Many times, when staff needs to inquire data, can querying condition be determined according to business demand, then according to querying condition
The inquiry of data needed for being carried out in the database of selection, it is ensured that can be required for quick search obtains in database mass data
Data it is particularly significant.
Current data query mode is:Staff determines querying condition according to business demand first, and then basis is looked into
Inquiry condition carries out the inquiry of data in some fixed database.But it is carried out in a database according to querying condition
The inquiry of data when querying condition range is excessive, can find out largely with the relevant data of querying condition, occur what is inquired
The excessive situation of data volume, causes inquiry velocity excessively slow.For example, existing inquire ten hospitals the 4th in Beijing according to business demand
The number of hospitalized in season after being inquired in the database according to this querying condition, can obtain ten datas, per data packet
Number of hospitalized containing hospital's fourth quarter;When business demand changes into inquiry Beijing's Nei Yibaijia hospitals fourth quarter
During number of hospitalized, 100 datas will be obtained, the number of hospitalized of hospital's fourth quarter is included per data.With lookup
The range of condition expands, and the data volume inquired also, when query context is excessive, can just will appear the number inquired with becoming more
It is excessively slow so as to cause inquiry velocity according to measuring excessive situation, thus it is existing only in some fixed database into line number
It is investigated that the mode inquiry velocity ask is slow, it is less efficient.
Invention content
In view of the above problems, the present invention provides a kind of data query method and device, and main purpose is to reduce in data
It is inquired in library the data required time, and then improves the efficiency of data query.
In order to achieve the above objectives, present invention generally provides following technical solutions:
On the one hand, an embodiment of the present invention provides a kind of data query method, this method includes:
Determine the inquiry dimension and index of data to be checked;
Inquire dimension and index that metadata in database to be selected includes;
The dimension and index that metadata in the inquiry dimension and index of data to be checked and database to be selected is included into
Row compares, selection inquiry database;
Metadata in the inquiry dimension and index of data to be checked and inquiry database creates query case;
Data query is carried out in database is inquired by query case.
Preferably, before metadata includes in database to be selected is inquired dimension and index, this method further includes:
Preset inquiry dimension and index are pre-reserved in the metadata of database to be selected.
Preferably, dimension and index that metadata in database to be selected includes are inquired, including:
The first data interchange format file is added in the interface for connecting database to be selected;
By containing preset inquiry dimension and index in the first data interchange format file polling database to be selected
Metadata.
Preferably, the dimension that metadata in the inquiry dimension and index of data to be checked and database to be selected is included and
Index is compared, selection inquiry database, including:
Judge data to be checked inquiry dimension and index whether with metadata includes in database to be selected dimension and
Index is identical;
If so, database to be selected is determined as to inquire database;
If it is not, being then determined as the original database for receiving inquiry request to inquire database, original database is initially receives
The database of request of data to be checked.
Preferably, after being determined as the original database for receiving inquiry request to inquire database, this method further includes:
It is received in connection in the interface of the original database of inquiry request and adds the second data interchange format file;
It is received by the second data interchange format file polling in the original database of inquiry request containing dimension and index
Metadata;
The inquiry dimension and index of data to be checked are carried out summarizing calculating according to metadata middle finger target calculation.
Preferably, data query is carried out in database is inquired by query case, including:
According to corresponding field in inquiry dimension in metadata and the data type of index, the source table of data and source table
Name obtains data to be checked from inquiry database.
On the other hand, the embodiment of the present invention also provides a kind of data query arrangement, which includes:
Determination unit, for determining the inquiry dimension of data to be checked and index;
First query unit, for inquiring the dimension and index that metadata in database to be selected includes;
Selecting unit, for include metadata in the inquiry dimension and index of data to be checked and database to be selected
Dimension and index are compared, selection inquiry database;
Creating unit, for the metadata in the inquiry dimension and index according to data to be checked and inquiry database
Create query case;
Second query unit carries out data query for passing through query case in database is inquired.
Preferably, which further includes:
Storage unit, will be preset for before metadata includes in database to be selected is inquired dimension and index
Inquiry dimension and index are pre-reserved in the metadata of database to be selected.
Preferably, the first query unit includes:
Add module, for adding the first data interchange format file in the interface for connecting database to be selected;
Enquiry module contains preset inquiry for passing through in the first data interchange format file polling database to be selected
The metadata of dimension and index.
Preferably, selecting unit includes:
Judgment module, for judge the inquiry dimension of data to be checked and index whether with metadata in database to be selected
Comprising dimension it is identical with index;
Determining module, if included for metadata in the inquiry dimension and index of data to be checked and database to be selected
Dimension is identical with index, then is determined as database to be selected inquiring database;If the inquiry dimension and index of data to be checked
It is different from the dimension and index that metadata includes in database to be selected, then the original database for receiving inquiry request is determined as looking into
Database is ask, original database is to initially receive the database of request of data to be checked.
By above-mentioned technical proposal, technical solution provided in an embodiment of the present invention at least has following advantages:
Data query method and device provided in an embodiment of the present invention, it is first determined the inquiry dimension of data to be checked and refer to
Mark, then inquire dimension and index that metadata in database select includes, then by the inquiry dimension of data to be checked with
Index is compared with metadata includes in database to be selected dimension and index, selection inquiry database, further according to be checked
The metadata ask in the inquiry dimension and index and inquiry database of data creates query case, finally by query case
Data query is carried out in database is inquired.The embodiment of the present invention can be selected according to the inquiry dimension and index of data to be checked
The database inquired compared with prior art, can reduce inquiry data required time in the database, Jin Erti
The high efficiency of data query.
Description of the drawings
By reading the detailed description of hereafter preferred embodiment, it is various other the advantages of and benefit it is common for this field
Technical staff will become clear.Attached drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention
Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 is a kind of data query method flow diagram provided in an embodiment of the present invention;
Fig. 2 is another data query method flow diagram provided in an embodiment of the present invention;
Fig. 3 is a kind of composition frame chart of data query arrangement provided in an embodiment of the present invention;
Fig. 4 is the composition frame chart of another data query arrangement provided in an embodiment of the present invention.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
Completely it is communicated to those skilled in the art.
The advantages of to make technical solution of the present invention, is clearer, and the present invention is made specifically with reference to the accompanying drawings and examples
It is bright.
An embodiment of the present invention provides a kind of data query method, as shown in Figure 1, this method is applied to according to number to be checked
According to inquiry dimension and the database inquired of index selection, so as to accelerate to inquire the speed of data, this present invention is implemented
Example provides step in detail below:
101st, the inquiry dimension and index of data to be checked are determined.
Wherein, dimension and index are the terms being commonly used in data analysis, and dimension refers to certain to things or phenomenon
Attribute or feature, index refer to weigh the specific element of dimension by sum or ratio.
In embodiments of the present invention, the inquiry dimension and index of data to be checked according to business demand, can be determined, first
It is determined to carry out the querying condition for inquiring data according to specific business demand, corresponding be somebody's turn to do then is determined according to specific querying condition
The inquiry dimension and index of querying condition.
For example, it is needed to inquire Beijing, Shanghai and three ground of Guangzhou all hospital's third quarters in the database according to business demand
The relevant data of growth ratio of degree, the number of hospitalized and corresponding number of hospitalized of fourth quarter, it is first determined querying condition is
Beijing, Shanghai, Guangzhou, hospital, the third season, fourth quarter, number of hospitalized and number of hospitalized growth ratio, then determine pair
The dimension and index of querying condition are answered, wherein dimension includes Beijing, the specific dimension values in Shanghai and three, Guangzhou, time for city
Including two specific dimension values of the third season and fourth quarter, index is hospital name, number of hospitalized and the corresponding people that is hospitalized
Several growth ratios.
102nd, dimension and index that metadata in database to be selected includes are inquired.
Wherein, metadata is also known as broker data, relaying data are the data of data attribute in descriptive data base, and metadata can
Staff to be helped easily to inquire the data needed in the database.
It should be noted that database to be selected can be one or more databases in embodiments of the present invention, when treating
When to select database be one, dimension and index that metadata in the database includes are inquired;When database to be selected is two
When, dimension and index that metadata in the two databases includes are inquired respectively, and so on.The embodiment of the present invention treats selection
Database is only that the situation of one is explained, and database to be selected is multiple situation, is not illustrated herein.
In embodiments of the present invention, it is obtained in database to be selected by inquiring the metadata in database to be selected and included
Dimension and index.
103rd, by the inquiry dimension of data to be checked and index and metadata includes in database to be selected dimension and refer to
Mark is compared, selection inquiry database.
In embodiments of the present invention, by metadata packet in the inquiry dimension and index of data to be checked and database to be selected
The dimension and index contained is compared, select inquiry database detailed process for:First according to specific business demand, determine
Inquiry dimension and index that inquiry data use are carried out, then inquires the dimension and index included in database to be selected, finally
It will carry out the inquiry dimension that uses of inquiry data and index be compared with the dimension and index included in database to be selected, root
It determines to carry out the database for inquiring the data according to comparison result.
104th, it is real to create inquiry for the metadata in the inquiry dimension and index of data to be checked and inquiry database
Example.
Wherein, query case is used for according to the inquiry dimension and index for summarizing the data to be checked after calculating by inquiring number
Data to be checked are obtained in the database according to the metadata in library.
In embodiments of the present invention, after determining that selection carries out inquiring the database of data, make according to inquiry data are carried out
The metadata inquired in the inquiry database of dimension and index and selection creates the query case for inquiring the database, inquiry
Example is specifically used for according to the inquiry dimension and index summarized after calculating by inquiring the metadata in database in the database
It is middle to obtain data to be checked.
105th, data query is carried out in database is inquired by query case.
In embodiments of the present invention, the inquiry database of selection is looked by the query case created in step 104
It askes, the individual data of a rule that the data at this moment acquired are inquired not according to querying condition, but by all lists
The data file of an entirety is obtained after only data summarization, avoids the occurrence of that the data volume inquired is excessive to lead to inquiry velocity
Slow situation is crossed, so as to reduce the inquiry data required time in the database, improves the efficiency of data query.
For example, it is needed to inquire Beijing, Shanghai and three ground of Guangzhou all hospital's third seasons, fourth quarter according to business demand
Number of hospitalized and corresponding number of hospitalized the relevant data of growth ratio, it is first determined the dimension of inquiry for city and when
Between, city includes Beijing, the specific dimension values in Shanghai and three, Guangzhou, and the time includes the third season and fourth quarter two is specific
Dimension values, index is the growth ratio of hospital name, number of hospitalized and corresponding number of hospitalized, then according to specific inquiry
Dimension and index select the database inquired as database A, further according in specific inquiry dimension and index and database A
Metadata create the query case of inquiry database A, database A is finally inquired according to the query case of establishment, comprising
Beijing, Shanghai and three ground of Guangzhou all hospital's third seasons, fourth quarter number of hospitalized and corresponding number of hospitalized growth
The data of ratio, since query case is in the inquiry database according to inquiry dimension, index and the selection summarized after calculating
What metadata created, therefore it is not to include the third of wherein one hospital in Beijing, Shanghai and Guangzhou respectively to inquire the data obtained
Season, fourth quarter number of hospitalized and corresponding number of hospitalized is calculated according to the third season, fourth quarter number of hospitalized increases
The individual data of a rule of long ratio, but directly obtain and include Beijing, all hospitals in Shanghai and three ground of Guangzhou after summarizing
The data file of one entirety of the growth ratio of the third season, the number of hospitalized of fourth quarter and corresponding number of hospitalized.
A kind of data query method provided in an embodiment of the present invention, it is first determined the inquiry dimension of data to be checked and refer to
Mark, then inquire dimension and index that metadata in database select includes, then by the inquiry dimension of data to be checked with
Index is compared with metadata includes in database to be selected dimension and index, selection inquiry database, further according to be checked
The metadata ask in the inquiry dimension and index and inquiry database of data creates query case, finally by query case
Data query is carried out in database is inquired.The embodiment of the present invention can be selected according to the inquiry dimension and index of data to be checked
The database inquired compared with prior art, can reduce inquiry data required time in the database, Jin Erti
The high efficiency of data query.
Below in order to be explained in more detail, an embodiment of the present invention provides another data query methods, particularly select
The specific method for selecting inquiry database and the specific processing method to inquiry dimension and index, specifically as shown in Fig. 2, this method
Included step is:
201st, the inquiry dimension and index of data to be checked are determined.
Wherein, the inquiry dimension of data to be checked and the detailed description of index are determined about step 201, it can be with reference chart 1
The description of corresponding part, the embodiment of the present invention will not be described in great detail herein.
202nd, preset inquiry dimension and index are pre-reserved in the metadata of database to be selected.
Wherein, preset inquiry dimension and index are advance according to the dominant query direction that business demand determines for staff
Setting.
In embodiments of the present invention, preset inquiry dimension and index are pre-reserved to the metadata of database to be selected
In detailed process be:The dominant query direction that staff determines according to business demand first presets corresponding inquiry dimension
Then degree and index carry out summarizing calculating to the preset inquiry associated index of dimension, finally will be by summarizing calculating
Inquiry dimension and index are saved in the metadata of database to be selected.
For example, staff determines the dominant query direction of inquiry database according to business demand first, such as:Inquire data
Library acquisition and the relevant data of hospital, the acquisition of inquiry database and the relevant data of school etc., then basis determines main
The corresponding inquiry dimension of direction setting and associated index are inquired, such as:It is each in inquiry city to determine an inquiry direction
The number of hospitalized of hospital, corresponding dimension include each city such as Beijing, Shanghai for " city ", dimension " time " including the time,
Season, month etc., index " hospital name ", index " number of hospitalized ", index " growth ratio of corresponding number of hospitalized " etc.,
Again the dimension and associated index of these settings are carried out summarizing calculating, such as:According to dimension " city " Beijing, dimension " time "
January, second month, the third moon, index " hospital name " Beijing First Hospital, the second hospital of Beijing, index " number of hospitalized ", warp
It crosses after summarizing calculating and obtains the number of hospitalized of Beijing First Hospital first quarter and the people that is hospitalized of Beijing the second hospital first quarter
Number;According to dimension " city " Beijing, dimension " time " third season, fourth quarter, index " hospital name " Beijing First Hospital,
The second hospital of Beijing, index " number of hospitalized ", index " growth ratio of corresponding number of hospitalized " obtain after summarizing and calculating
The ratio and the comparison of Beijing First Hospital fourth quarter that comparison third season Beijing First Hospital fourth quarter number of hospitalized increases
The ratio that third season number of hospitalized increases finally will be saved in data to be selected by the inquiry dimension and index that summarize calculating
In the metadata in library.
203rd, dimension and index that metadata in database to be selected includes are inquired.
For the embodiment of the present invention, step 203 includes:The friendship of the first data is added in the interface for connecting database to be selected
Formatted file is changed, by containing preset inquiry dimension and index in the first data interchange format file polling database to be selected
Metadata.
Wherein, database to be selected is the preset inquiry dimension of preservation mentioned in step 202 and the database of index.
In embodiments of the present invention, first in API (the Application Programming for connecting database to be selected
Interface, application programming interface) middle addition one JSON (JavaScript Object Notation, light weight series
According to exchange format) file, then by the JSON file pollings database to be selected of addition containing it is preset inquiry dimension and
The metadata of index.
204th, judge data to be checked inquiry dimension and index whether with metadata includes in database to be selected dimension
Degree is identical with index.
In embodiments of the present invention, will carry out the inquiry dimension that uses of inquiry data and index with it is first in database select
The dimension and index that data include are compared, wherein metadata includes in database to be selected dimension and index are step
The process mentioned in 202 summarizes the inquiry dimension and index of calculating, judges to carry out inquiry dimension and index that inquiry data use
It is whether identical with the dimension and index that metadata includes in database to be selected.
For example, database to be selected is database A, will be stored in first by the inquiry dimension and index X that summarize calculating
In the metadata of database A, then determine to carry out the inquiry dimension and index that inquiry data use according to specific business demand
Y, finally judge to carry out the inquiry dimension that uses of inquiry data and index Y whether with metadata in database A include by remittance
The inquiry dimension always calculated is identical with index X, to select the database for carrying out inquiring the data.
205a, if so, by database to be selected be determined as inquire database.
In embodiments of the present invention, if carry out the inquiry dimension that uses of inquiry data and index with it is first in database select
The dimension that data include is identical with index, then database to be selected is determined as to the database for carrying out inquiring the data.
For example, mention in step 204, if in carrying out inquiry dimension and index Y and database A that inquiry data use
The inquiry dimension that the process that metadata includes summarizes calculating is identical with index X, then is determined as carrying out inquiring the data by database A
Database.
205b, if it is not, then by the original database for receiving inquiry request be determined as inquire database.
Wherein, original database is to initially receive the database of request of data to be checked.
In embodiments of the present invention, if carry out the inquiry dimension that uses of inquiry data and index with it is first in database select
The original database for receiving inquiry request, then is determined as the data for carrying out inquiring the data by the dimension that data include and index difference
Library.
For example, the original database for receiving inquiry request is database B, mention in step 204, if carrying out inquiry data
Through that the inquiry dimension and index Y that use are included with metadata in database A summarizing calculating inquiry dimension and index X not
Together, then database B is determined as the database for carrying out inquiring the data.
206b, the second data interchange format file is added in the interface of the original database of connection reception inquiry request.
In embodiments of the present invention, it after it is inquiry database to determine the original database for receiving inquiry request, is connecting
It receives and a JSON file is added in the API of the original database of inquiry request, for the original database of inquire-receive inquiry request
In metadata.
Contain dimension in 207b, the original database by the second data interchange format file polling reception inquiry request and refer to
Target metadata.
In embodiments of the present invention, pass through the JSON files added in step 206b, the former number of inquire-receive inquiry request
According to the metadata containing dimension and index in library.
208b, the inquiry dimension and index of data to be checked are carried out summarizing meter according to metadata middle finger target calculation
It calculates.
In embodiments of the present invention, it is logical first after it is inquiry database to determine the original database for receiving inquiry request
Cross the metadata in the JSON file polling original databases added in the API of connection original database in step 206b, Ran Hougen
It carries out summarizing calculating to carrying out the inquiry dimension that uses of inquiry data and index according to metadata middle finger target calculation.
209th, it is real to create inquiry for the metadata in the inquiry dimension and index of data to be checked and inquiry database
Example.
Wherein, first number about step 209 in the inquiry dimension and index of data to be checked and inquiry database
According to the detailed description for creating query case, will can no longer be gone to live in the household of one's in-laws on getting married herein with the description of 1 corresponding part of reference chart, the embodiment of the present invention
It states.
210th, it is corresponding in dimension and the data type of index, the source table of data and source table according to being inquired in metadata
Field name obtains data to be checked from inquiry database.
Wherein, the data type for inquiring dimension and index is the classification to inquiry dimension and index, and the source table of data is
The tables of data of data to be checked is stored in database, the corresponding entitled data to be checked of field are corresponding in the table of source in the table of source
Field title.
In embodiments of the present invention, determine that correspondence is looked into metadata according to the inquiry dimension and index that summarize after calculating first
Corresponding field name in dimension and the data type of index, the source table of data, source table is ask, then according to inquiry dimension and is referred to
It obtains and treats in the database that corresponding field name is inquired in selection in target data type, the source table of data, source table
Inquire data.
For example, it is needed to inquire Beijing, Shanghai and three ground of Guangzhou all hospital's third seasons, fourth quarter according to business demand
Number of hospitalized and corresponding number of hospitalized growth ratio, wherein the dimension inquired for city, the time, index for hospital name
The growth ratio of title, number of hospitalized and corresponding number of hospitalized determines that inquiry database is according to inquiry dimension and index first
Then database A determines metadata correspondence inquiry dimension in database A according to the inquiry dimension and index that summarize after calculating and refers to
Corresponding field name in target data type, the source table of data, source table, such as:The dimension of inquiry is city Beijing and time
The third season, fourth quarter, the index of inquiry is the growth ratio of hospital name, number of hospitalized and corresponding number of hospitalized, corresponding
The data type for inquiring dimension and index is respectively a, b, c, d, e, and the tables of data that data to be checked are stored in database A is B,
Data to be checked corresponding entitled C of field in tables of data B, according to inquiry dimension and data type a, b, c, d sum number of index
According to table B, the corresponding field name C also in tables of data B is obtained in database A comprising Beijing all hospital's third seasons, the
The data of the number of hospitalized of the fourth quater and corresponding number of hospitalized growth ratio.
Another kind data query method provided in an embodiment of the present invention according to the inquiry dimensions of data to be checked and can refer to
The database that mark selection is inquired, by carrying out summarizing the data being calculated after summarizing to inquiry dimension and index, with showing
There is technology to compare, the excessive situation for causing inquiry velocity excessively slow of the data volume inquired is avoided the occurrence of, so as to reduce in database
The middle inquiry data required time, and then improve the efficiency of data query.
Further, as the realization to the above method, an embodiment of the present invention provides a kind of data query arrangement, specifically
As shown in figure 3, the device includes:Determination unit 31, the first query unit 32, selecting unit 33, creating unit 34, second are inquired
Unit 35.
Determination unit 31 can be used to determine the inquiry dimension and index of data to be checked;
First query unit 32 can be used for inquiring metadata includes in database to be selected dimension and index;
Selecting unit 33 can be used for the inquiry dimension of data to be checked for determining determination unit 31 and index and first
Query unit 32 is inquired the dimension and index that metadata includes in obtained database to be selected and is compared, selection inquiry data
Library;
Creating unit 34 can be used for the inquiry dimension and index of the data to be checked determined according to determination unit 31, with
And the metadata in inquiry database creates query case;
Second query unit 35 can be used for what is selected by the query case that creating unit 34 creates in selecting unit 33
Data query is carried out in inquiry database.
It should be noted that other of each functional unit involved by a kind of data query arrangement provided in an embodiment of the present invention
Corresponding description can be described with the corresponding of method shown in reference chart 1, and details are not described herein, it should be understood that the dress in the present embodiment
Put the full content that can be corresponded to and realize in preceding method embodiment.
A kind of data query arrangement provided in an embodiment of the present invention, it is first determined the inquiry dimension of data to be checked and refer to
Mark, then inquire dimension and index that metadata in database select includes, then by the inquiry dimension of data to be checked with
Index is compared with metadata includes in database to be selected dimension and index, selection inquiry database, further according to be checked
The metadata ask in the inquiry dimension and index and inquiry database of data creates query case, finally by query case
Data query is carried out in database is inquired.The embodiment of the present invention can be selected according to the inquiry dimension and index of data to be checked
The database inquired compared with prior art, can reduce inquiry data required time in the database, Jin Erti
The high efficiency of data query.
Further, as the realization to the above method, an embodiment of the present invention provides another data query arrangement, tools
Body is as shown in figure 4, the device further includes:
Storage unit 36 can be used for before dimension and index that the metadata in database to be selected is inquired includes, will
Preset inquiry dimension and index are pre-reserved in the metadata of database to be selected.
Further, as shown in figure 4, the first query unit 32 includes:
Add module 321 can be used in the interface for connecting database to be selected adding the first data interchange format text
Part;
It is to be selected to can be used for the first data interchange format file polling added by add module 321 for enquiry module 322
Select the metadata containing preset inquiry dimension and index in database.
Further, as shown in figure 4, selecting unit 33 includes:
Judgment module 331, can be used for judging data to be checked inquiry dimension and index whether with database to be selected
The dimension that middle metadata includes is identical with index;
Determining module 332, if can be used for first number in the inquiry dimension of data to be checked and index and database to be selected
According to comprising dimension it is identical with index, then by database to be selected be determined as inquire database;If the inquiry dimension of data to be checked
Degree and index are different from the dimension and index that metadata includes in database to be selected, then the original database that will receive inquiry request
It is determined as inquiring database, original database is to initially receive the database of request of data to be checked.
It should be noted that other of each functional unit involved by a kind of data query arrangement provided in an embodiment of the present invention
Corresponding description can be described with the corresponding of method shown in reference chart 2, and details are not described herein, it should be understood that the dress in the present embodiment
Put the full content that can be corresponded to and realize in preceding method embodiment.
Another kind data query arrangement provided in an embodiment of the present invention, according to the inquiry dimensions of data to be checked and can refer to
The database that mark selection is inquired, by carrying out summarizing the data being calculated after summarizing to inquiry dimension and index, with showing
There is technology to compare, the excessive situation for causing inquiry velocity excessively slow of the data volume inquired is avoided the occurrence of, so as to reduce in database
The middle inquiry data required time, and then improve the efficiency of data query.
The data query arrangement includes processor and memory, and above-mentioned determination unit, the first query unit, selection are single
Member, creating unit, the second query unit and storage unit etc. in memory, are performed as program unit storage by processor
Above procedure unit stored in memory realizes corresponding function.
Comprising kernel in processor, gone in memory to transfer corresponding program unit by kernel.Kernel can set one
Or more, by adjusting kernel parameter the data required time is inquired in the database to reduce, and then improve data and look into
The efficiency of inquiry.
Memory may include computer-readable medium in volatile memory, random access memory (RAM) and/
Or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM), memory includes at least one deposit
Store up chip.
Present invention also provides a kind of computer program products, first when being performed on data processing equipment, being adapted for carrying out
The program code of beginningization there are as below methods step:Determine the inquiry dimension and index of data to be checked;Inquire database to be selected
The dimension and index that middle metadata includes;By metadata packet in the inquiry dimension and index of data to be checked and database to be selected
The dimension and index contained is compared, selection inquiry database;According to the inquiry dimension and index of data to be checked and inquiry
Metadata in database creates query case;Data query is carried out in database is inquired by query case.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system or computer program
Product.Therefore, the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware can be used in the application
Apply the form of example.Moreover, the computer for wherein including computer usable program code in one or more can be used in the application
The computer program production that usable storage medium is implemented on (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The application is with reference to the flow according to the method for the embodiment of the present application, equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that it can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
The processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that the instruction performed by computer or the processor of other programmable data processing devices is generated for real
The device of function specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction generation being stored in the computer-readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps are performed on calculation machine or other programmable devices to generate computer implemented processing, so as in computer or
The instruction offer performed on other programmable devices is used to implement in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include computer-readable medium in volatile memory, random access memory (RAM) and/
Or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable Jie
The example of matter.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer-readable instruction, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, CD-ROM read-only memory (CD-ROM),
Digital versatile disc (DVD) or other optical storages, magnetic tape cassette, the storage of tape magnetic rigid disk or other magnetic storage apparatus
Or any other non-transmission medium, available for storing the information that can be accessed by a computing device.It defines, calculates according to herein
Machine readable medium does not include temporary computer readable media (transitory media), such as data-signal and carrier wave of modulation.
It these are only embodiments herein, be not limited to the application.To those skilled in the art,
The application can have various modifications and variations.All any modifications made within spirit herein and principle, equivalent replacement,
Improve etc., it should be included within the scope of claims hereof.
Claims (10)
- A kind of 1. data query method, which is characterized in that including:Determine the inquiry dimension and index of data to be checked;Inquire dimension and index that metadata in database to be selected includes;By the inquiry dimension of the data to be checked and index and metadata includes in the database to be selected dimension and refer to Mark is compared, selection inquiry database;It is real that metadata in the inquiry dimension of the data to be checked and index and the inquiry database creates inquiry Example;Data query is carried out in the inquiry database by the query case.
- 2. according to the method described in claim 1, it is characterized in that, inquire what metadata in database to be selected included described Before dimension and index, the method further includes:Preset inquiry dimension and index are pre-reserved in the metadata of the database to be selected.
- 3. according to the method described in claim 2, it is characterized in that, described inquire the dimension that metadata includes in database to be selected Degree and index, including:The first data interchange format file is added in the interface of database to be selected described in connection;By containing the preset inquiry dimension in database to be selected described in the first data interchange format file polling With the metadata of index.
- 4. the according to the method described in claim 1, it is characterized in that, inquiry dimension and index by the data to be checked It is compared with metadata includes in the database to be selected dimension and index, selection inquiry database, including:Judge the data to be checked inquiry dimension and index whether with metadata includes in the database to be selected dimension Degree is identical with index;If so, the database to be selected is determined as to inquire database;If it is not, being then determined as the original database for receiving inquiry request to inquire database, the original database is initially receives The database of the request of data to be checked.
- 5. according to the method described in claim 4, it is characterized in that, the original database for receiving inquiry request is determined as described It inquires after database, the method further includes:The second data interchange format file is added in the interface for connecting the original database for receiving inquiry request;Contain dimension in original database by receiving inquiry request described in the second data interchange format file polling and refer to Target metadata;The inquiry dimension and index of the data to be checked are carried out summarizing meter according to the metadata middle finger target calculation It calculates.
- 6. according to claim 1-5 any one of them methods, which is characterized in that described to be looked by the query case described It askes in database and carries out data query, including:It is inquired according to the metadata corresponding in dimension and the data type of index, the source table of data and source table Field name obtains the data to be checked from the inquiry database.
- 7. a kind of data query arrangement, which is characterized in that including:Determination unit, for determining the inquiry dimension of data to be checked and index;First query unit, for inquiring the dimension and index that metadata in database to be selected includes;Selecting unit, for by the inquiry dimension of the data to be checked and index and metadata packet in the database to be selected The dimension and index contained is compared, selection inquiry database;Creating unit, for the member in the inquiry dimension according to the data to be checked and index and the inquiry database Data creation query case;Second query unit carries out data query for passing through the query case in the inquiry database.
- 8. device according to claim 7, which is characterized in that described device further includes:Storage unit, will be preset for before the dimension and index inquired metadata in database to be selected and included Inquiry dimension and index are pre-reserved in the metadata of the database to be selected.
- 9. device according to claim 8, which is characterized in that first query unit includes:Add module, for adding the first data interchange format file in the interface of database to be selected described in connection;Enquiry module, for passing through in database to be selected described in the first data interchange format file polling containing described pre- If inquiry dimension and index the metadata.
- 10. device according to claim 7, which is characterized in that the selecting unit includes:Judgment module, for judge the inquiry dimension of the data to be checked and index whether with it is first in the database to be selected The dimension that data include is identical with index;Determining module, if inquiry dimension and index for the data to be checked and metadata packet in the database to be selected The dimension contained is identical with index, then is determined as the database to be selected inquiring database;If the data to be checked are looked into It askes dimension and index is different from the dimension and index that metadata includes in the database to be selected, then will receive inquiry request Original database is determined as inquiring database, and the original database is to initially receive the database of the request of data to be checked.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611105428.8A CN108153776A (en) | 2016-12-05 | 2016-12-05 | Data query method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611105428.8A CN108153776A (en) | 2016-12-05 | 2016-12-05 | Data query method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108153776A true CN108153776A (en) | 2018-06-12 |
Family
ID=62471079
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611105428.8A Pending CN108153776A (en) | 2016-12-05 | 2016-12-05 | Data query method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108153776A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109189812A (en) * | 2018-08-14 | 2019-01-11 | 中国平安人寿保险股份有限公司 | A kind of index querying method, computer readable storage medium and server |
CN109189790A (en) * | 2018-08-23 | 2019-01-11 | 平安科技(深圳)有限公司 | Data managing method, device, computer equipment and storage medium |
CN109902100A (en) * | 2019-01-31 | 2019-06-18 | 平安科技(深圳)有限公司 | Report form inquiring method, device and storage medium |
CN111367907A (en) * | 2020-02-18 | 2020-07-03 | 北京百分点信息科技有限公司 | Data retrieval statement generation method and device |
CN113190605A (en) * | 2021-04-30 | 2021-07-30 | 携程商旅信息服务(上海)有限公司 | Ticket price display method and system, electronic equipment and storage medium |
WO2021191702A1 (en) * | 2020-03-24 | 2021-09-30 | International Business Machines Corporation | Offloading statistics collection |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090198643A1 (en) * | 2008-01-31 | 2009-08-06 | Business Objects, S.A. | Apparatus and method for utilizing density metadata to process multi-dimensional data |
CN104408169A (en) * | 2014-12-09 | 2015-03-11 | 北京国双科技有限公司 | Multi-dimensional expression language based dimension query method and device |
CN104408180A (en) * | 2014-12-15 | 2015-03-11 | 北京国双科技有限公司 | Stored data inquiring method and device |
CN104750776A (en) * | 2013-12-30 | 2015-07-01 | Sap欧洲公司 | Accessing information content in a database platform using metadata |
CN104809130A (en) * | 2014-01-27 | 2015-07-29 | 腾讯科技(深圳)有限公司 | Method, equipment and system for data query |
CN105488048A (en) * | 2014-09-16 | 2016-04-13 | 中兴通讯股份有限公司 | Data query method and device |
-
2016
- 2016-12-05 CN CN201611105428.8A patent/CN108153776A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090198643A1 (en) * | 2008-01-31 | 2009-08-06 | Business Objects, S.A. | Apparatus and method for utilizing density metadata to process multi-dimensional data |
CN104750776A (en) * | 2013-12-30 | 2015-07-01 | Sap欧洲公司 | Accessing information content in a database platform using metadata |
CN104809130A (en) * | 2014-01-27 | 2015-07-29 | 腾讯科技(深圳)有限公司 | Method, equipment and system for data query |
CN105488048A (en) * | 2014-09-16 | 2016-04-13 | 中兴通讯股份有限公司 | Data query method and device |
CN104408169A (en) * | 2014-12-09 | 2015-03-11 | 北京国双科技有限公司 | Multi-dimensional expression language based dimension query method and device |
CN104408180A (en) * | 2014-12-15 | 2015-03-11 | 北京国双科技有限公司 | Stored data inquiring method and device |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109189812A (en) * | 2018-08-14 | 2019-01-11 | 中国平安人寿保险股份有限公司 | A kind of index querying method, computer readable storage medium and server |
CN109189790A (en) * | 2018-08-23 | 2019-01-11 | 平安科技(深圳)有限公司 | Data managing method, device, computer equipment and storage medium |
CN109902100A (en) * | 2019-01-31 | 2019-06-18 | 平安科技(深圳)有限公司 | Report form inquiring method, device and storage medium |
CN111367907A (en) * | 2020-02-18 | 2020-07-03 | 北京百分点信息科技有限公司 | Data retrieval statement generation method and device |
CN111367907B (en) * | 2020-02-18 | 2022-11-15 | 北京百分点科技集团股份有限公司 | Data retrieval statement generation method and device |
WO2021191702A1 (en) * | 2020-03-24 | 2021-09-30 | International Business Machines Corporation | Offloading statistics collection |
US11182386B2 (en) | 2020-03-24 | 2021-11-23 | International Business Machines Corporation | Offloading statistics collection |
GB2609576A (en) * | 2020-03-24 | 2023-02-08 | Ibm | Offloading statistics collection |
CN113190605A (en) * | 2021-04-30 | 2021-07-30 | 携程商旅信息服务(上海)有限公司 | Ticket price display method and system, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108153776A (en) | Data query method and device | |
US11042279B2 (en) | Generating graphical marks for graphical views of a data source | |
CN110019540B (en) | Implementation method, display method, device and equipment of enterprise atlas | |
US20170300490A1 (en) | Distributed offline indexing | |
CN108932257A (en) | The querying method and device of multi-dimensional data | |
US8880502B2 (en) | Searching a range in a set of values in a network with distributed storage entities | |
CN104283933B (en) | Method, client and the system of downloading data | |
JP2015531126A (en) | Method and apparatus for realizing product characteristic navigation | |
AU2014201505A1 (en) | Data clustering | |
CN106407303A (en) | Data storage method and apparatus, and data query method and apparatus | |
CN102985909A (en) | Method and apparatus for providing highly-scalable network storage for well-gridded objects | |
CN106326309A (en) | Data query method and device | |
CN107168977A (en) | A kind of optimization method and device of data query | |
WO2008073189A2 (en) | Hilbert ordering of multidimensional tuples within computing systems | |
CN103823846A (en) | Method for storing and querying big data on basis of graph theories | |
CN109767274B (en) | Method and system for carrying out associated storage on massive invoice data | |
CN107239485A (en) | Database operation method, apparatus and system | |
CN112204543A (en) | Frequent pattern analysis for distributed systems | |
CN109753504A (en) | Data query method and device | |
CN110457182A (en) | A kind of load balancing cluster example operating index monitoring system | |
CN104424325B (en) | Data query method and apparatus | |
JP2017531877A (en) | Access control for objects with attributes defined for a hierarchically organized domain containing a fixed number of values | |
US8924273B2 (en) | Simplifying migration from one financial consolidation application to another | |
CA3017606A1 (en) | Rule based hierarchical configuration | |
CN109426439A (en) | The method and device of dilatation is carried out to distributed memory system |
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 |
Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing Applicant after: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd. Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing Applicant before: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd. |
|
CB02 | Change of applicant information | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180612 |
|
RJ01 | Rejection of invention patent application after publication |