Specific embodiment
In order to make those skilled in the art more fully understand the technical solution in this specification embodiment, below in conjunction with this
Attached drawing in specification embodiment is described in detail the technical solution in this specification embodiment, it is clear that described
Embodiment is only a part of the embodiment of this specification, instead of all the embodiments.The embodiment of base in this manual,
Those of ordinary skill in the art's every other embodiment obtained, all should belong to the range of protection.
In order to solve when business side increases a kind of data query requirements newly, the R&D personnel to be needed to arrange in the prior art
Phase carries out the encapsulation of data-query interfaces, and handles the otherness under different tenants, implements entire publication process, Cai Nengshi later
The technical support of data query requirements now newly-increased to this causes to expend technical support cost, influences entire technical research team
Working efficiency the problem of, this specification provides a kind of multi-data source integrated data query method.
Firstly, from business support layer face, to business framework needed for realizing the integrated data query method of the multi-data source
It is illustrated.As shown in Figure 1, being the business framework for the data query method for realizing that the multi-data source that this specification provides is integrated
A kind of example.
Business framework exemplified by Fig. 1 have two layers it is abstract, respectively data source level of abstraction and show level of abstraction, it is as follows,
The incidence relation between two level of abstractions and two level of abstractions is described respectively:
(1) data source level of abstraction:
For encapsulating atom interface comprising bottom data layer and atom interface layer.Wherein, bottom data layer provides a variety of
Data, such as event data, analysis data etc.;Atom interface layer is then located at the upper layer of bottom data layer, is packaged with multiple originals
Sub-interface, it will be appreciated by persons skilled in the art that atom interface is the minimum envelope for carrying out data query for network request
Unit is filled, for example, the membership information inquiry encapsulation for international payment domain is a kind of atom interface, namely passes through the atom interface
Available membership information;Transaction Information inquiry encapsulation for international payment domain is also a kind of atom interface, namely by being somebody's turn to do
The available Transaction Information of atom interface.
Based on foregoing description, it can be understood as data source level of abstraction includes reflecting between atom interface and bottom data one by one
Relationship is penetrated, namely the bottom data of the atom interface mappings can be extracted by a certain atom interface.
(2) show level of abstraction:
For encapsulation of data source comprising data active layer and query configuration layer.Wherein, data active layer provides multiple data
Source, such as event information data source, user information data source, trading information data source etc., these data sources are drawn based on business
Point;Query configuration layer is then located at the upper layer of data active layer, this layer is the configuration layer provided to business side, passes through query configuration
Layer, business can be pre-configured with the mapping relations between data attribute and data source property, wherein the mapping relations can be one
An at least data source property, data source category mentioned here can be mapped to more mapping relations namely a data attribute
Property may include dataSource link, field name.For example, by taking this data attribute of the IP address information of user as an example, mapping
Data source property may include ipCountry, ipState, ipCity these three fields in event information data source.
(3) incidence relation between data source level of abstraction and exhibiting abstraction layer:
As shown in Figure 1, data source level of abstraction with show between level of abstraction by data active layer it is associated with atom interface layer,
Wherein, data active layer is located at the upper layer of atom interface layer, and seen from the above description, multiple data sources provided by data active layer are
Based on delineation of activities, for example, order information data source can provide the letter such as the name of product of purchase and the chained address of product
Breath, so that different data sources can correspond to multiple atom interfaces, therefore, the configuration mode between data active layer and atom interface layer
In, the mapping relations that can be pre-configured between data source property and atom interface, further, due to having between different tenants
Business otherness, for example, for the link address information of the product of purchase, in AliExpress (global speed is sold logical) tenant
Under, it can be obtained by the atom interface in electric business domain, and in the case where Lazada (reaches) tenant to praise, then it can pass through event information
Atom interface obtains, and is based on this, then can in advance under tenant's dimension, for different tenants configure different data source property with
Mapping relations between atom interface.
By this kind of processing mode, the business otherness of different tenants can be shielded, to ensure one in service logic
Cause property realizes the decoupling that the technical support of lower layer and upper-layer service are realized, is conducive to the long term maintenance of later period system code;Together
When, when business side increases a kind of query demand newly, data source property is pre-defined by business side, without technical research
Personnel participate in, so that manpower and material resources are liberated, the working efficiency for the R&D team that develops skill.
It is as follows, on the basis of business framework shown in Fig. 1, the multi-data source that following embodiments provide this specification is shown
Integrated data query method is illustrated:
Fig. 2 is referred to, the data query side integrated for a kind of multi-data source that one exemplary embodiment of this specification provides
The embodiment flow chart of method, this method may comprise steps of:
Step 202: receiving data inquiry request, the data inquiry request carries the data attribute of data to be checked.
In this specification embodiment, by taking the IP address of a certain user is inquired by business side as an example, business side, which can pass through, is
Platform of uniting initiates data inquiry request, which carries the data attribute of data to be checked, such as IP address.
Step 204: according to the mapping relations between preconfigured data attribute and data source property, determining number to be checked
According to data attribute mapping target data source attribute, wherein data source property includes dataSource link, field name.
In this specification embodiment, system platform then can according to preconfigured data attribute and data source property it
Between mapping relations, obtain data attribute mapped data source property involved in step 202, for convenience, will
The data source property is known as target data source attribute.
Using data attribute as IP address for example, dataSource link included by target data source attribute can for event believe
Data source is ceased, field name may include these three field names of ipCountry, ipState, ipCity.
It should be noted that in the example above only by taking a dataSource link as an example, in practical applications, the phase based on Fig. 1
Closing the mapping relations described it is found that between data attribute and data source property can be one-to-many mapping relations, thus, at this
In step, accessed target data source attribute may include more than two dataSource links, and each dataSource link can correspond to again
At least one field name.
Step 206: according to the mapping relations between preconfigured data source property and atom interface, determining target data
The target atoms interface of source attribute mapping.
Step 208: according to the mapping relations between preconfigured atom interface and bottom data, being connect by target atoms
Mouth extracts data from the bottom data that it is mapped, and obtains data to be checked.
It is as follows, step 206 and step 208 are illustrated:
In this specification embodiment, involved by the target data source attribute that can successively determine in traversal step 204
Each data source, for the data source currently traversed, can according to preconfigured data source property and atom interface it
Between mapping relations, determine the data source property mapping atom interface the atom interface is known as target for convenience
Atom interface.
It should be noted that based on the associated description in above-mentioned Fig. 1 it is found that due to having business difference between different tenants
Property, so as to from the dimension of tenant, be configured in advance for different tenants between different data source property and atom interface
Mapping relations, then, in this specification embodiment, mentioned in step 202 to data inquiry request can also carry
Tenant's information of data tenant to be checked, in step 206, then can determine to be directed to and be somebody's turn to do according to tenant's information
Mapping relations between the preconfigured data source property of the tenant that tenant's information is identified and atom interface, then, according to this
Mapping relations determine target atoms interface.
Further, then it can pass through target according to the mapping relations between preconfigured atom interface and bottom data
Atom interface extracts data from the bottom data that it is mapped.
It is subsequent, continue to traverse next data source, until having traversed each data source involved by target data source attribute.
Seen from the above description, one data source of every traversal, then can extract one piece of data, in this specification embodiment
In, these data can be spliced according to preconfigured data format, using the data obtained after splicing as to be checked
Data.
For example, preconfigured data format is as follows:
{ eventDataSource:ipCity }
{ eventDataSource:ipState }
{ eventDataSource:ipCountry }; 
The practical significance of the data format is, by the ipCity, ipState extracted from event information data source:
These three fields of ipCountry are spliced with space.
Technical solution provided by this specification embodiment, by receiving data inquiry request, which is taken
Data attribute with data to be checked, according to the mapping relations between preconfigured data attribute and data source property, really
The target data source attribute of the data attribute mapping of the fixed data to be checked, connects according to preconfigured data source property with atom
Mapping relations between mouthful determine the target atoms interface of target data source attribute mapping, finally according to preconfigured original
Mapping relations between sub-interface and bottom data extract data from the bottom data that it is mapped by target atoms interface,
Data to be checked are obtained, may be implemented when business side increases a kind of query demand newly, efficiency data query, and saving technique are improved
Support cost, the working efficiency for the R&D team that develops skill.
Corresponding to above method embodiment, this specification embodiment also provides a kind of data query dress that multi-data source is integrated
It sets, refers to Fig. 3, for the reality for the data query device that a kind of multi-data source that one exemplary embodiment of this specification provides integrates
A block diagram is applied, the apparatus may include: receiving module 31, the first determining module 32, the second determining module 33 and data are extracted
Module 34.
Wherein, receiving module 31, inquiry request, the data inquiry request carry data to be checked for receiving data
Data attribute;
First determining module 32, for according to the mapping relations between preconfigured data attribute and data source property,
Determine the target data source data of the data attribute mapping of the data to be checked, wherein the data source property includes data
Parent name, field name;
Second determining module 33, for according to the mapping relations between preconfigured data source property and atom interface,
Determine the target atoms interface of the target data source attribute mapping;
Data extraction module 34, for leading to according to the mapping relations between preconfigured atom interface and bottom data
It crosses the target atoms interface and extracts data from the bottom data that it is mapped, obtain the data to be checked.
In one embodiment, there are mapping relations between the data attribute and at least one data source property;
There are mapping relations between the data source property and at least one atom interface.
In one embodiment, under tenant's dimension, different data source property and atom interface are configured for different tenants
Between mapping relations.
In one embodiment, the data inquiry request also carries tenant's letter of the data tenant to be checked
Breath;
Second determining module includes (not showing that in Fig. 3):
Relationship determines submodule, for determining pre- for the data tenant to be checked according to tenant's information
Mapping relations between the data source property first configured and atom interface;
Target determines submodule, for being directed to the preconfigured data source of data tenant to be checked according to described
Mapping relations between attribute and atom interface determine the target atoms interface of the target data source attribute mapping.
In one embodiment, the data extraction module includes (not showing that in Fig. 3):
Extracting sub-module, for passing through institute according to the mapping relations between preconfigured atom interface and bottom data
It states target atoms interface and extracts data from the bottom data that it is mapped;
Splicing submodule will splice for splicing the data extracted according to preconfigured data format
The data obtained afterwards are as the data to be checked.
It is understood that receiving module 31, the first determining module 32, the second determining module 33 and data extract mould
Module of the block 34 as four kinds of functional independences can both be configured in a device simultaneously as shown in Figure 3, can also individually be configured
In a device, therefore structure shown in Fig. 3 should not be construed as the restriction to this specification example scheme.
In addition, the function of modules and the realization process of effect are specifically detailed in the above method corresponding step in above-mentioned apparatus
Rapid realization process, details are not described herein.
This specification embodiment also provides a kind of computer equipment, includes at least memory, processor and is stored in
On reservoir and the computer program that can run on a processor, wherein processor realizes one kind above-mentioned when executing described program
The integrated data query method of multi-data source, this method include at least: receiving data inquiry request, the data inquiry request is taken
Data attribute with data to be checked;According to the mapping relations between preconfigured data attribute and data source property, really
Set the goal data source property, wherein the data source property includes dataSource link, field name;According to preconfigured data source
Mapping relations between attribute and atom interface determine the target atoms interface of the target data source attribute mapping;According to pre-
Mapping relations between the atom interface first configured and bottom data, the bottom number mapped by the target atoms interface from it
According to middle extraction data, the data to be checked are obtained.
Fig. 4 shows one kind provided by this specification embodiment, and more specifically service server hardware configuration is illustrated
Figure, which may include: processor 410, memory 420, input/output interface 430, communication interface 440 and bus 450.
Wherein processor 410, memory 420, input/output interface 430 and communication interface 440 pass through between the realization of bus 450
Communication connection inside equipment.
Processor 410 can use general CPU (Central Processing Unit, central processing unit), micro process
Device, application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or one or
The modes such as multiple integrated circuits are realized, for executing relative program, to realize technical solution provided by this specification embodiment.
Memory 420 can use ROM (Read Only Memory, read-only memory), RAM (RandomAccess
Memory, random access memory), static storage device, the forms such as dynamic memory realize.Memory 420 can store
Operating system and other applications are realizing technical solution provided by this specification embodiment by software or firmware
When, relevant program code is stored in memory 420, and execution is called by processor 410.
Input/output interface 430 is for connecting input/output module, to realize information input and output.Input and output/
Module can be used as component Configuration (not shown) in a device, can also be external in equipment to provide corresponding function.Wherein
Input equipment may include keyboard, mouse, touch screen, microphone, various kinds of sensors etc., output equipment may include display,
Loudspeaker, vibrator, indicator light etc..
Communication interface 440 is used for connection communication module (not shown), to realize the communication of this equipment and other equipment
Interaction.Wherein communication module can be realized by wired mode (such as USB, cable etc.) and be communicated, can also be wirelessly
(such as mobile network, WIFI, bluetooth etc.) realizes communication.
Bus 450 includes an access, in various components (such as the processor 410, memory 420, input/output of equipment
Interface 430 and communication interface 440) between transmit information.
It should be noted that although above equipment illustrates only processor 410, memory 420, input/output interface
430, communication interface 440 and bus 450, but in the specific implementation process, which can also include realizing to operate normally
Necessary other assemblies.In addition, it will be appreciated by those skilled in the art that, it can also be only comprising realizing in above equipment
Component necessary to this specification example scheme, without including all components shown in figure.
This specification embodiment also provides a kind of computer readable storage medium, is stored thereon with computer program, the journey
It realizes that a kind of integrated data query method of multi-data source above-mentioned, this method include at least when sequence is executed by processor: receiving
Data inquiry request, the data inquiry request carry the data attribute of data to be checked;According to preconfigured data category
Mapping relations between property and data source property, determine target data source attribute, wherein the data source property includes data source
Name, field name;According to the mapping relations between preconfigured data source property and atom interface, the target data source is determined
The target atoms interface of attribute mapping;According to the mapping relations between preconfigured atom interface and bottom data, pass through institute
It states target atoms interface and extracts data from the bottom data that it is mapped, obtain the data to be checked.
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 instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (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), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitorymedia), such as the data-signal and carrier wave of modulation.
As seen through the above description of the embodiments, those skilled in the art can be understood that this specification
Embodiment can be realized by means of software and necessary general hardware platform.Based on this understanding, this specification is implemented
Substantially the part that contributes to existing technology can be embodied in the form of software products the technical solution of example in other words,
The computer software product can store in storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions are to make
It is each to obtain computer equipment (can be personal computer, server or the network equipment etc.) execution this specification embodiment
Method described in certain parts of a embodiment or embodiment.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.A kind of typically to realize that equipment is computer, the concrete form of computer can
To be personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
In device, navigation equipment, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment
The combination of any several equipment.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device reality
For applying example, since it is substantially similar to the method embodiment, so describing fairly simple, related place is referring to embodiment of the method
Part explanation.The apparatus embodiments described above are merely exemplary, wherein described be used as separate part description
Module may or may not be physically separated, can be each module when implementing this specification example scheme
Function realize in the same or multiple software and or hardware.Can also select according to the actual needs part therein or
Person's whole module achieves the purpose of the solution of this embodiment.Those of ordinary skill in the art are not the case where making the creative labor
Under, it can it understands and implements.
The above is only the specific embodiment of this specification embodiment, it is noted that for the general of the art
For logical technical staff, under the premise of not departing from this specification embodiment principle, several improvements and modifications can also be made, this
A little improvements and modifications also should be regarded as the protection scope of this specification embodiment.