CN107220376A - A kind of data query method and apparatus - Google Patents

A kind of data query method and apparatus Download PDF

Info

Publication number
CN107220376A
CN107220376A CN201710476723.2A CN201710476723A CN107220376A CN 107220376 A CN107220376 A CN 107220376A CN 201710476723 A CN201710476723 A CN 201710476723A CN 107220376 A CN107220376 A CN 107220376A
Authority
CN
China
Prior art keywords
checked
query
data source
inquiry
dimension
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.)
Granted
Application number
CN201710476723.2A
Other languages
Chinese (zh)
Other versions
CN107220376B (en
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201710476723.2A priority Critical patent/CN107220376B/en
Publication of CN107220376A publication Critical patent/CN107220376A/en
Application granted granted Critical
Publication of CN107220376B publication Critical patent/CN107220376B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • G06F16/24549Run-time optimisation
    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Abstract

The embodiments of the invention provide a kind of data query method and apparatus, wherein, data query method includes:Acquisition includes the first inquiry request of task to be checked and dimension to be checked, according to configuration information, determine in the task to be checked the corresponding data source of each item to be checked under dimension to be checked, determine to belong to each item to be checked of same data source again, generate corresponding second inquiry request, and second inquiry request is used, obtain batch query result from corresponding data source.So as to by the repeatedly behavior of inquiry different data sources in complex logic, merge into the behavior of each data source batch query once, significantly reduce network overhead, effectively improve the search efficiency of data query.

Description

A kind of data query method and apparatus
Technical field
The present embodiments relate to technical field of telecommunications, more particularly to a kind of data query method and apparatus.
Background technology
With developing rapidly for network technology and computer technology, people produce more and more in live and work Data and information.Multiple data sources are there may be in these data, large scale system in order to inquire about, one query request may be needed To be inquired about towards multiple different data sources.And as the complexity of business expansion and logic is improved, for once looking into Ask request may need repeatedly to inquire about same data source, and this will be significantly increased send inquiry request business side and Network I/O consumption between data source, causes that handling capacity is impacted, system delay rise.In extreme circumstances, it is also possible to cause Service is delayed machine, has a strong impact on search efficiency.
Therefore, during data query, how search efficiency is effectively lifted, is technical problem urgently to be resolved hurrily at present.
The content of the invention
The embodiment of the present invention provides a kind of data query method and apparatus, to solve real time data inquiry pair in the prior art The problem of production system is impacted.
In order to solve the above problems, the invention discloses a kind of data query method, including:
The first inquiry request is obtained, first inquiry request includes task to be checked and dimension to be checked;
According to configuration information, the corresponding data source of each item to be checked under dimension to be checked is determined in the task to be checked;
It is determined that belonging to each item to be checked of same data source, corresponding second inquiry request is generated, second inquiry please Ask and carry out batch query for each item to be checked corresponding to the data source;
Using second inquiry request, batch query result is obtained from corresponding data source.
It is preferred that, according to configuration information, determine that each item to be checked is corresponding under dimension to be checked in the task to be checked The step of data source, including:According to the task to be checked and the dimension query configuration information to be checked, configuration information is determined In the inquiry dimension that matches, and query term corresponding with the inquiry dimension of the matching;By the query term inquired It is used as the item to be checked to data source query;The corresponding relation of the query term according to configuration information and data source, it is determined that respectively The corresponding data source of item to be checked.
It is preferred that, according to the task to be checked and the dimension query configuration information to be checked, determine in configuration information The inquiry dimension matched, and with the inquiry dimension of the matching the step of corresponding query term, including:According to described to be checked Job enquiry configuration information is ask, the query task matched in configuration information is determined;According to the dimension to be checked, query configuration The query task matched in information, it is determined that query term corresponding with the inquiry dimension matched.
It is preferred that, it is determined that belong to each item to be checked of same data source, the step of generating corresponding second inquiry request, bag Include:Each item to be checked for belonging to same data source is merged, one group of item to be checked corresponding with data source is generated;For every group Item to be checked adds corresponding inquiry code respectively, generates second inquiry request, inquiry code is used for described in each of which Second inquiry request is initiated to a corresponding data source.
It is preferred that, the data query method also includes the change step of configuration information:Change corresponding to the query task Inquiry dimension;And/or the query term corresponding to the change inquiry dimension.
On the other hand, in order to solve the above problems, the invention also discloses a kind of data query arrangement, including:
First acquisition request module, for obtaining the first inquiry request, first inquiry request includes task to be checked With dimension to be checked;
Data source determining module, for according to configuration information, determining respectively to treat under dimension to be checked in the task to be checked The corresponding data source of query term;
Second request generation module, each item to be checked of same data source is belonged to for determination, and generation corresponding second is looked into Request is ask, second inquiry request is used for each item to be checked corresponding to the data source and carries out batch query;
Query Result acquisition module, for using second inquiry request, obtains batch from corresponding data source and looks into Ask result.
It is preferred that, the data source determining module, including:Item determination sub-module to be checked, for according to described to be checked Task and the dimension query configuration information to be checked, determine the inquiry dimension matched in configuration information, and with described The corresponding query term of inquiry dimension matched somebody with somebody;The query term inquired is used as to the item to be checked to data source query;Data Source determination sub-module, for the query term according to configuration information and the corresponding relation of data source, determines that each item to be checked is right The data source answered.
It is preferred that, the item determination sub-module to be checked, including:First matching unit, for according to described to be checked Business query configuration information, determines the query task matched in configuration information;Second matching unit, for according to described to be checked The query task matched in dimension, query configuration information, it is determined that query term corresponding with the inquiry dimension matched.
It is preferred that, the second request generation module, including:Submodule is grouped, for each of same data source will to be belonged to Item to be checked is merged, and generates one group of item to be checked corresponding with data source;Submodule is assembled, for for every group of item to be checked Corresponding inquiry code is added respectively, generates second inquiry request, inquiry code is used for right to one described in each of which The data source answered initiates second inquiry request.
It is preferred that, described device also includes:Configuration change module, for changing the inquiry dimension corresponding to the query task Degree;And/or the query term corresponding to the change inquiry dimension.
To sum up, the embodiment of the present invention includes the first inquiry request of task to be checked and dimension to be checked, root by obtaining According to configuration information, the corresponding data source of each item to be checked under dimension to be checked is determined in the task to be checked, then determine to belong to same Each item to be checked of one data source, generates corresponding second inquiry request, and uses second inquiry request, from corresponding number Batch query result is obtained according to source.So as to by the repeatedly behavior of inquiry different data sources in complex logic, merge into each data The behavior of source batch query once, significantly reduces network overhead, effectively improves the search efficiency of data query.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by institute in the description to the embodiment of the present invention The accompanying drawing needed to use is briefly described, it should be apparent that, drawings in the following description are only some implementations of the present invention Example, for those of ordinary skill in the art, without having to pay creative labor, can also be according to these accompanying drawings Obtain other 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 structured flowchart of data query arrangement provided in an embodiment of the present invention;
Fig. 4 is the structured flowchart of another data query arrangement provided in an embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is a part of embodiment of the invention, rather than whole embodiments.Based on this hair Embodiment in bright, the every other implementation that those of ordinary skill in the art are obtained under the premise of creative work is not made Example, belongs to the scope of protection of the invention.
Embodiment one
Reference picture 1, gives a kind of data query method flow diagram provided in an embodiment of the present invention.
Step 101, the first inquiry request is obtained.
The data inquiry request that first inquiry request is initiated for business side, including task to be checked and dimension to be checked.Its In, task to be checked refers to the needing to inquire about of the task, and the task to be checked is determined according to pre-defined each query task, is looked into Inquiry task includes:One or more inquiry dimensions, the one or more query terms of each inquiry dimension correspondence, so as to appoint for inquiry Business can be inquired about from one or more inquiry dimensions.Dimension to be checked refers to complete when time task to be checked, needs The one or more dimensions to be inquired about, wherein, each dimension to be checked is used to characterize an inquiry related to task to be checked Angle, such as when inquiring about transaction risk, can angularly be carried out from user behavior information, user mobile phone number and user identity card Inquiry.
Step 102, according to configuration information, the data source of each item to be checked under dimension to be checked in task to be checked is determined.
The configuration information is used for various query tasks in management system, including:Pre-defined each query task, with And each query term and the corresponding relation of data source in each query task.Specifically, each query task can include at least one Individual inquiry dimension, each inquiry dimension at least includes a query term, and each query term one data source of correspondence.It is i.e. each to look into Item is ask from unique corresponding data source query data.
Specifically, according to the task to be checked and dimension query configuration information to be checked, it may be determined that phase in configuration information The inquiry dimension of matching, and query term corresponding with the inquiry dimension of the matching, and then determine corresponding to the task to be checked Each item to be checked.And according to query term in configuration information and the corresponding relation of data source, determine the corresponding number of each item to be checked According to source.
Step 103, it is determined that belonging to each item to be checked of same data source, corresponding second inquiry request is generated.
Because each query term is from unique corresponding data source query data, therefore can be according to data source to respectively treating Query term is grouped, and each item to be checked for belonging to same data source is merged, and one group corresponding with data source of generation is treated Query term.
It is same data source because each item to be checked is corresponding in every group of item to be checked, and each inquiry code is used for one Individual corresponding data source initiates the second inquiry request, therefore every group of item to be checked only needs to add one query code, you can generation The second inquiry request of data is inquired about to corresponding data source, so as to only need one query request just can be carried out to multiple queries Inquiry.Wherein, the second inquiry request is the data inquiry request in the data-oriented source by integrating, and the first inquiry request is industry The data inquiry request that business side is initiated, by the combination of this two sections of inquiry requests of the first inquiry request and the second inquiry request, is replaced In generation, is initiated by business side and region be directly facing the one query request of data source in the prior art, so as in two sections of inquiry requests Between each query term is configured, to improve the efficiency of data query.Compared to needing in the prior art for each query term Addition inquiry code, and generate corresponding multiple queries request respectively respectively, could obtain corresponding Query Result, the present embodiment Significantly reduce the quantity for the inquiry request that data query is carried out to data source.
Step 104, using the second inquiry request, batch query result is obtained from corresponding data source.
After the second inquiry request is generated, second inquiry request can be sent to corresponding data source, with inquiry character The record of the value of each item to be checked in second inquiry request is closed, and regard the record inquired as the second inquiry request Batch query result.
In summary, the first inquiry that the embodiment of the present invention includes task to be checked and dimension to be checked by acquisition please Ask, according to configuration information, determine in the task to be checked the corresponding data source of each item to be checked under dimension to be checked, then determine category In each item to be checked of same data source, corresponding second inquiry request is generated, and use second inquiry request, from corresponding Data source obtain batch query result.So as to by the repeatedly behavior of inquiry different data sources in complex logic, merge into each The behavior of data source batch query once, significantly reduces network overhead, effectively improves the search efficiency of data query.
Embodiment two
On the basis of above-described embodiment, the present embodiment is discussed further data query method.
With the upgrading of the change of system environments, and inquiry means, in order to complete a certain query task, the application is implemented In example, the corresponding relation between query task and inquiry dimension, and/or pair between inquiry dimension and query term can also be changed It should be related to, so as to adjust the query strategy to each query task at any time so that configuration is more flexible.For example, in purchase meeting When member's service needs to be paid, in order to ensure transaction security, it is necessary to " transaction risk inquiry " this query task be performed, with true Recognize current trading environment whether safe enough.If inquiry dimension corresponding with query task " transaction risk inquiry " in former configuration information Spend for user behavior information, user identity card and traction equipment.With enriching constantly for cell-phone function, user's hand can also be passed through Machine number determines transaction risk, therefore configuration information can be changed, and increases in " transaction risk inquiry " this query task Plus user mobile phone number this inquiry dimension.And for example, if in former configuration information with user mobile phone number this inquiry dimension is corresponding looks into Asking item is, whether the mobile phone is marked as cheating mobile phone, and whether the mobile phone is marked as malice mobile phone.In order to strengthen user The inquiry effect of this inquiry dimension of cell-phone number, can increase whether the mobile phone belongs to this small size query term of mobile phone.With confidence After breath change, user can input task to be checked and dimension to be checked according to the configuration information after change, corresponding to realize Inquire about effect.
The change of dimension is inquired about in query task to cause the increase and decrease of correspondence query term.When needing newly-increased query term, also The information according to each newly-increased affiliated data source of query term is needed, each newly-increased query term and the corresponding relation of each data source is configured.With Guarantee can inquire the corresponding data source of each item to be checked by task to be checked and dimension to be checked.
Reference picture 2, gives another data query method flow diagram provided in an embodiment of the present invention:
Step 201, the first inquiry request is obtained.
Being different from each inquiry request business side in the prior art initiated needs comprising inquiry code, is obtained in the present embodiment The first inquiry request taken can be without comprising inquiry code, after according to data source by each item packet combining to be checked, in life Into the inquiry code corresponding with data source of addition during the second inquiry request.The task to be checked of user's input can be to be checked The title of inquiry task.For example, when being inquired about in air control system transaction risk this query task, user can input pre- The query task title " transaction risk inquiry " first defined, and corresponding each dimension to be checked:User behavior information, user's hand Machine number and user identity are demonstrate,proved.
Due to first inquiry request can without comprising inquiry code, but generate the second inquiry request when add again Inquiry code in configuration information, therefore when change inquiry code, without changing code one by one to a large amount of inquiry requests, only need The inquiry code changed in configuration information, is easy to code administration, reduces duplicated code.
Step 202, according to task to be checked and dimension query configuration information to be checked, determine what is matched in configuration information Inquire about dimension, and query term corresponding with the inquiry dimension of the matching.
Specifically, can determine that the inquiry matched in configuration information is appointed first according to job enquiry configuration information to be checked Business, further according to dimension to be checked, the query task matched in query configuration information, it is determined that corresponding with the inquiry dimension matched Query term.For example, can be determined according to " transaction risk inquiry " this job enquiry configuration information to be checked in configuration information Inquiry dimension corresponding with the query task that this matches may be 4 in the query task matched, configuration information, be respectively User behavior information, user mobile phone number, user identity card and traction equipment.If the dimension to be checked of user's input is user behavior Information, user mobile phone number and user identity card, then determine corresponding with the inquiry dimension matched according to this 3 dimensions to be checked Query term.
Step 203, the query term inquired is used as to the item to be checked to data source query.
The query term inquired according to configuration information, be complete correspondence query task needed for item to be checked, by Each item to be checked of data source query, just results in the Query Result that the query task needs to obtain.
Step 204, according to query term in configuration information and the corresponding relation of data source, the corresponding number of each item to be checked is determined According to source.
Due to being pre-configured with the corresponding relation of query term and data source in configuration information, therefore confidence can be matched somebody with somebody by this Breath, it is determined that data source corresponding with each item to be checked that query term matches.
Wherein, data source can be relevant database, distributed data base, the types of databases such as cache database.
Step 205, each item to be checked for belonging to same data source is merged, one group corresponding with data source of generation is treated Query term.
Each item to be checked and the corresponding relation of data source be, each query term is from a unique corresponding data source query number According to each data source corresponds to different query terms respectively, therefore each item to be checked can be grouped based on data source.Will category One group is merged into the item to be checked of same data source, so that different data sources correspond to different groups of items to be checked respectively.Example Such as, if query term a1, a2, a3 corresponding datas source A, query term b1, b2, b3, b4 corresponding data source B, query term in configuration information C1, c2, c3 corresponding data source C.When item to be checked is a1, a2, b2, b3, b4, c2, c3, item a1, a2 to be checked can be entered Row merges, and generates one group of item to be checked corresponding with data source A, and item b2, b3, b4 to be checked are merged, and generates and number Merged according to the corresponding one group of item to be checked of source B, then by item c2, c3 to be checked, generate it is corresponding with data source C one group it is to be checked Ask item.
Step 206, it is that every group of item to be checked adds corresponding inquiry code respectively, generates the second inquiry request.
Each inquiry code for different data sources can be packaged in advance respectively, when each item to be checked completes packet Afterwards, the corresponding inquiry code of data source belonging to each group item to be checked can be directly added, and then generates the second inquiry request.
In order that from data source query to data it is more easy-to-use, can also configure the query term correspondence value record number According to type, if such as query term name, then the data type for configuring the query term is text type, if the query term birthday, then The data type for configuring the query term is date type.
Step 207, using the second inquiry request, batch query result is obtained from corresponding data source.
Generate after the second inquiry request, can be obtained by calling system and the interface of data source from corresponding data source The batch query result of each group query term.So as to only need that to the progress one query of same data source multiple queries can be obtained Query Result, the network I/O being greatly reduced between the business side for initiating the first inquiry request and data source is consumed.
In summary, the embodiment of the present invention is by predefining configuration information so that the adjustment to query task can be with body In the change of present configuration information, when obtaining the first inquiry request, it can be inquired about according to task to be checked and dimension to be checked Configuration information after adjustment, to obtain corresponding item to be checked, is closed further according to query term in configuration information is corresponding with data source System, each item to be checked for belonging to same data source is merged, and generates the second inquiry request, and please using second inquiry Ask, batch query result is obtained from corresponding data source.Because newly-increased inquiry without changing code one by one, configuration only need to be changed Information just can be realized, so as to not only significantly reduce network overhead, search efficiency also greatly improved.
It should be noted that for embodiment of the method, in order to be briefly described, therefore it to be all expressed as to a series of action group Close, but those skilled in the art should know, the embodiment of the present invention is not limited by described sequence of movement, because according to According to the embodiment of the present invention, some steps can be carried out sequentially or simultaneously using other.Secondly, those skilled in the art also should Know, embodiment described in this description belongs to preferred embodiment, the involved action not necessarily present invention is implemented Necessary to example.
Embodiment three
On the basis of above-described embodiment, the present embodiment additionally provides a kind of data query arrangement.
Reference picture 3 gives a kind of structured flowchart of data query arrangement provided in an embodiment of the present invention, can specifically wrap Include following module:
First acquisition request module 31, for obtaining the first inquiry request, the first inquiry request include task to be checked and Dimension to be checked;
Data source determining module 32, it is each to be checked under dimension to be checked for according to configuration information, determining in task to be checked Ask the corresponding data source of item;
Second request generation module 33, each item to be checked of same data source, generation corresponding second are belonged to for determination Inquiry request, the second inquiry request is used for each item to be checked corresponding to data source and carries out batch query;
Query Result acquisition module 34, for using the second inquiry request, batch query is obtained from corresponding data source As a result.
In summary, the embodiment of the present invention is obtained by the first acquisition request module 31 includes task to be checked and to be checked First inquiry request of dimension, and by data source determining module 32 according to configuration information, determine to be checked in the task to be checked The corresponding data source of each item to be checked under dimension, then determine to belong to each to be checked of same data source by the second request generation module 33 Item is ask, corresponding second inquiry request is generated, and second inquiry request is used by Query Result acquisition module 34, from corresponding Data source obtain batch query result.So as to by the repeatedly behavior of inquiry different data sources in complex logic, merge into each The behavior of data source batch query once, significantly reduces network overhead, effectively improves the search efficiency of data query.
Reference picture 4, in the optional implementation of the present invention, on the basis of Fig. 3, gives the embodiment of the present invention The structured flowchart of another data query arrangement provided.
Specifically, data source determining module 32 includes following submodule:
Item determination sub-module 321 to be checked, for according to task to be checked and dimension query configuration information to be checked, it is determined that The inquiry dimension matched in configuration information, and query term corresponding with the inquiry dimension of matching;By the query term inquired It is used as the item to be checked to data source query;
Data source determination sub-module 322, for the corresponding relation according to query term in configuration information and data source, it is determined that respectively The corresponding data source of item to be checked.
Wherein, item determination sub-module 321 to be checked is again including such as lower unit:
First matching unit 3211, for according to job enquiry configuration information to be checked, determining to match in configuration information Query task;
Second matching unit 3212, for according to dimension to be checked, the query task matched in query configuration information, really Fixed query term corresponding with the inquiry dimension matched.
In addition, the second request generation module 33 includes following submodule:
Submodule 331 is grouped, for each item to be checked for belonging to same data source to be merged, generation and data source pair The one group of item to be checked answered;
Submodule 332 is assembled, for adding corresponding inquiry code respectively for every group of item to be checked, the inquiry of generation second please Ask, each of which inquiry code is used to initiate the second inquiry request to a corresponding data source.
Data query arrangement also includes:
Configuration change module 35, for changing the inquiry dimension corresponding to query task;And/or change inquiry dimension institute is right The query term answered.
In summary, the embodiment of the present invention predefines configuration information by configuration change module 35 so that inquiry is appointed The adjustment of business can be embodied in the change of configuration information, can when the first acquisition request module 31 obtains the first inquiry request With the configuration information after being adjusted by data source determining module 32 according to task to be checked and dimension to be checked inquiry, to obtain correspondence Item to be checked, then by second request generation module 33 according to query term in configuration information and the corresponding relation of data source, will belong to Merged in each item to be checked of same data source, generate the second inquiry request, and used by Query Result acquisition module 34 Second inquiry request, batch query result is obtained from corresponding data source.Because newly-increased inquiry without changing code one by one, Configuration information, which only need to be changed, just can realize, so as to not only significantly reduce network overhead, search efficiency also greatly improved.
For device embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, it is related Part illustrates referring to the part of embodiment of the method.
Each embodiment in this specification is described by the way of progressive, what each embodiment was stressed be with Between the difference of other embodiment, each embodiment identical similar part mutually referring to.
It should be understood by those skilled in the art that, the embodiment of the embodiment of the present invention can be provided as method, device or calculate Machine program product.Therefore, the embodiment of the present invention can using complete hardware embodiment, complete software embodiment or combine software and The form of the embodiment of hardware aspect.Moreover, the embodiment of the present invention can use it is one or more wherein include computer can With in the computer-usable storage medium (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.) of program code The form of the computer program product of implementation.
The embodiment of the present invention is with reference to method according to embodiments of the present invention, terminal device (system) and computer program The flow chart and/or block diagram of product is described.It should be understood that can be by computer program instructions implementation process figure and/or block diagram In each flow and/or square frame and the flow in flow chart and/or block diagram and/or the combination of square frame.These can be provided Computer program instructions are set to all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing terminals Standby processor is to produce a machine so that held by the processor of computer or other programmable data processing terminal equipments Capable instruction is produced for realizing in one flow of flow chart or multiple flows and/or one square frame of block diagram or multiple square frames The device for the function of specifying.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing terminal equipments In the computer-readable memory worked in a specific way so that the instruction being stored in the computer-readable memory produces bag The manufacture of command device is included, the command device is realized in one flow of flow chart or multiple flows and/or one side of block diagram The function of being specified in frame or multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing terminal equipments so that Series of operation steps is performed on computer or other programmable terminal equipments to produce computer implemented processing, so that The instruction performed on computer or other programmable terminal equipments is provided for realizing in one flow of flow chart or multiple flows And/or specified in one square frame of block diagram or multiple square frames function the step of.
Although having been described for the preferred embodiment of the embodiment of the present invention, those skilled in the art once know base This creative concept, then can make other change and modification to these embodiments.So, appended claims are intended to be construed to Including preferred embodiment and fall into having altered and changing for range of embodiment of the invention.
Finally, in addition it is also necessary to explanation, herein, such as first and second or the like relational terms be used merely to by One entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operation Between there is any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant meaning Covering including for nonexcludability, so that process, method, article or terminal device including a series of key elements are not only wrapped Those key elements, but also other key elements including being not expressly set out are included, or also include being this process, method, article Or the intrinsic key element of terminal device.In the absence of more restrictions, by wanting that sentence "including a ..." is limited Element, it is not excluded that also there is other identical element in the process including key element, method, article or terminal device.
Above to a kind of data query method and apparatus provided by the present invention, it is described in detail, it is used herein Specific case is set forth to the principle and embodiment of the present invention, and the explanation of above example is only intended to help and understands The method and its core concept of the present invention;Simultaneously for those of ordinary skill in the art, according to the thought of the present invention, in tool It will change in body embodiment and application, to sum up, this specification content should not be construed as the limit to the present invention System.

Claims (10)

1. a kind of data query method, it is characterised in that methods described includes:
The first inquiry request is obtained, first inquiry request includes task to be checked and dimension to be checked;
According to configuration information, the corresponding data source of each item to be checked under dimension to be checked is determined in the task to be checked;
It is determined that belonging to each item to be checked of same data source, corresponding second inquiry request is generated, second inquiry request is used In to the corresponding each item progress batch query to be checked of the data source;
Using second inquiry request, batch query result is obtained from corresponding data source.
2. according to the method described in claim 1, it is characterised in that described according to configuration information, determine the task to be checked In under dimension to be checked the step of each item to be checked corresponding data source, including:
According to the task to be checked and the dimension query configuration information to be checked, the inquiry matched in configuration information is determined Dimension, and query term corresponding with the inquiry dimension of the matching;
The query term inquired is used as to the item to be checked to data source query;
The corresponding relation of the query term according to configuration information and data source, determines the corresponding data source of each item to be checked.
3. method according to claim 2, it is characterised in that described according to the task to be checked and the dimension to be checked Query configuration information is spent, the inquiry dimension matched in configuration information is determined, and it is corresponding with the inquiry dimension of the matching The step of query term, including:
According to the job enquiry configuration information to be checked, the query task matched in configuration information is determined;
According to the dimension to be checked, the query task matched in query configuration information, it is determined that with the inquiry dimension that matches Corresponding query term.
4. according to the method described in claim 1, it is characterised in that each item to be checked for determining to belong to same data source, The step of generating corresponding second inquiry request, including:
Each item to be checked for belonging to same data source is merged, one group of item to be checked corresponding with data source is generated;
Corresponding inquiry code is added respectively for every group of item to be checked, second inquiry request is generated, and is looked into described in each of which Asking code is used to initiate second inquiry request to a corresponding data source.
5. according to the method described in claim 1, it is characterised in that the change step also including configuration information:
Change the inquiry dimension corresponding to the query task;And/or
Query term corresponding to the change inquiry dimension.
6. a kind of data query arrangement, it is characterised in that described device includes:
First acquisition request module, for obtaining the first inquiry request, first inquiry request includes task to be checked and treated Inquire about dimension;
Data source determining module, it is each to be checked under dimension to be checked for according to configuration information, determining in the task to be checked The corresponding data source of item;
Second request generation module, each item to be checked of same data source is belonged to for determination, and generating corresponding second inquiry please Ask, second inquiry request is used for each item to be checked corresponding to the data source and carries out batch query;
Query Result acquisition module, for using second inquiry request, batch query knot is obtained from corresponding data source Really.
7. device according to claim 6, it is characterised in that the data source determining module, including:
Item determination sub-module to be checked, for according to the task to be checked and the dimension query configuration information to be checked, really Determine the inquiry dimension matched in configuration information, and query term corresponding with the inquiry dimension of the matching;By what is inquired The query term is used as the item to be checked to data source query;
Data source determination sub-module, for the query term according to configuration information and the corresponding relation of data source, it is determined that respectively treating The corresponding data source of query term.
8. device according to claim 7, it is characterised in that the item determination sub-module to be checked, including:
First matching unit, for according to the job enquiry configuration information to be checked, determining that what is matched in configuration information looks into Inquiry task;
Second matching unit, for according to the dimension to be checked, the query task matched in query configuration information, it is determined that with The corresponding query term of inquiry dimension matched.
9. device according to claim 6, it is characterised in that the second request generation module, including:
Submodule is grouped, for each item to be checked for belonging to same data source to be merged, generation corresponding with data source one Group item to be checked;
Submodule is assembled, for adding corresponding inquiry code respectively for every group of item to be checked, second inquiry request is generated, Code is inquired about described in each of which to be used to initiate second inquiry request to a corresponding data source.
10. device according to claim 6, it is characterised in that described device also includes:
Configuration change module, for changing the inquiry dimension corresponding to the query task;And/or change the inquiry dimension institute Corresponding query term.
CN201710476723.2A 2017-06-21 2017-06-21 Data query method and device Active CN107220376B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710476723.2A CN107220376B (en) 2017-06-21 2017-06-21 Data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710476723.2A CN107220376B (en) 2017-06-21 2017-06-21 Data query method and device

Publications (2)

Publication Number Publication Date
CN107220376A true CN107220376A (en) 2017-09-29
CN107220376B CN107220376B (en) 2020-10-27

Family

ID=59949901

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710476723.2A Active CN107220376B (en) 2017-06-21 2017-06-21 Data query method and device

Country Status (1)

Country Link
CN (1) CN107220376B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110297955A (en) * 2019-06-20 2019-10-01 阿里巴巴集团控股有限公司 A kind of information query method, device, equipment and medium
CN110309181A (en) * 2019-06-18 2019-10-08 平安普惠企业管理有限公司 A kind of data query method and relevant apparatus
CN110942046A (en) * 2019-12-05 2020-03-31 腾讯云计算(北京)有限责任公司 Image retrieval method, device, equipment and storage medium
CN113064928A (en) * 2021-04-25 2021-07-02 深圳壹账通智能科技有限公司 Report data query method and device, electronic equipment and storage medium
CN113177062A (en) * 2021-05-25 2021-07-27 深圳前海微众银行股份有限公司 Data query method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102222108A (en) * 2011-06-28 2011-10-19 用友软件股份有限公司 Scripting method and device
CN103500188A (en) * 2013-09-13 2014-01-08 北京奇虎科技有限公司 Method and system for generating data sheet
CN103631951A (en) * 2013-12-12 2014-03-12 用友软件股份有限公司 Batch access function merging method and device based on metadata
CN104933115A (en) * 2015-06-05 2015-09-23 北京京东尚科信息技术有限公司 Multi-dimensional analysis method and system
CN105677683A (en) * 2014-11-21 2016-06-15 华为技术有限公司 Batch data query method and device
CN105740344A (en) * 2016-01-25 2016-07-06 中国科学院计算技术研究所 Sql statement combination method and system independent of database
CN106570022A (en) * 2015-10-10 2017-04-19 阿里巴巴集团控股有限公司 Cross-data-source query method, apparatus and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102222108A (en) * 2011-06-28 2011-10-19 用友软件股份有限公司 Scripting method and device
CN103500188A (en) * 2013-09-13 2014-01-08 北京奇虎科技有限公司 Method and system for generating data sheet
CN103631951A (en) * 2013-12-12 2014-03-12 用友软件股份有限公司 Batch access function merging method and device based on metadata
CN105677683A (en) * 2014-11-21 2016-06-15 华为技术有限公司 Batch data query method and device
CN104933115A (en) * 2015-06-05 2015-09-23 北京京东尚科信息技术有限公司 Multi-dimensional analysis method and system
CN106570022A (en) * 2015-10-10 2017-04-19 阿里巴巴集团控股有限公司 Cross-data-source query method, apparatus and system
CN105740344A (en) * 2016-01-25 2016-07-06 中国科学院计算技术研究所 Sql statement combination method and system independent of database

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309181A (en) * 2019-06-18 2019-10-08 平安普惠企业管理有限公司 A kind of data query method and relevant apparatus
CN110297955A (en) * 2019-06-20 2019-10-01 阿里巴巴集团控股有限公司 A kind of information query method, device, equipment and medium
CN110297955B (en) * 2019-06-20 2023-03-24 创新先进技术有限公司 Information query method, device, equipment and medium
CN110942046A (en) * 2019-12-05 2020-03-31 腾讯云计算(北京)有限责任公司 Image retrieval method, device, equipment and storage medium
CN110942046B (en) * 2019-12-05 2023-04-07 腾讯云计算(北京)有限责任公司 Image retrieval method, device, equipment and storage medium
CN113064928A (en) * 2021-04-25 2021-07-02 深圳壹账通智能科技有限公司 Report data query method and device, electronic equipment and storage medium
CN113177062A (en) * 2021-05-25 2021-07-27 深圳前海微众银行股份有限公司 Data query method and device

Also Published As

Publication number Publication date
CN107220376B (en) 2020-10-27

Similar Documents

Publication Publication Date Title
CN107220376A (en) A kind of data query method and apparatus
US11514045B2 (en) Structured cluster execution for data streams
CN107688500A (en) A kind of distributed task scheduling processing method, device, system and equipment
CN109144997A (en) Data correlation method, device and storage medium
CN109308357A (en) It is a kind of for obtaining the method, apparatus and equipment of answer information
CN105100050B (en) Method for managing user right and system
CN107622102B (en) Entity card number generation method and terminal device
CN107705151A (en) Advertisement putting regulation and control show method and device
CN106412067B (en) Data hierarchy generation method based on industry control agreement fuzz testing
CN105138547B (en) A kind of data search method and device
CN107391142A (en) The method and device that a kind of application is split
US20050071370A1 (en) Automatic machine for production of sequences based on profiles as well as method for automatic production of sequences
CN105550851A (en) Business flow generation method and system
CN109213758B (en) Data access method, device, equipment and computer readable storage medium
US8768913B2 (en) Multi-source searching in a data driven application
CN107729423A (en) A kind of big data processing method and processing device
CN107766378A (en) Sending method and device, the distributed data base system of solicited message
CN109597882A (en) A kind of scene session service treating method and apparatus
CN112115276A (en) Intelligent customer service method, device, equipment and storage medium based on knowledge graph
CN107133243A (en) A kind of data processing method and server
CN110009514A (en) Extracting method, device, terminal and the computer readable storage medium of data
CN107357831A (en) Configurable flow instance data distribution formula storage method and system
CN106227597A (en) Task priority treating method and apparatus
CN109800078A (en) A kind of task processing method, task distribution terminal and task execution terminal
CN108170860A (en) Data query method, apparatus, electronic equipment and computer readable storage medium

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
GR01 Patent grant
GR01 Patent grant