Data integral service system and method
Technical field
The present invention relates to a kind of data integral service system and method, be particularly related to and a kind ofly can support different data sources, shield the difference in different pieces of information source by unified data access mode, support querying condition flexibly, make full use of the powerful search function of database, thereby and provide powerful data filter function can satisfy the data integral service system and the method for complicated application and development needs.
Background technology
Owing to historical or other reason, many enterprises have had the multiple business system, cause enterprise's internal information isolated island phenomenon more and more serious, according to the IDC report of calendar year 2001, in 1000 tame enterprises of whole world maximum, 14 databases and 48 application systems are on average all arranged, and along with the variation in market, the variation of customer demand, enterprise is also constantly increasing its application.For reducing the consideration of building maintenance cost and improving enterprise competitiveness, become extremely urgent for the integrated of so many application system, each big telecommunications enterprise begins the construction of this respect one after another.Yet, the integrated of types of applications too paid attention in present construction, another problem that is closely related with it is that data integration is then often out in the cold, cause in enterprise's application integration project implementation process, just finding also to need to solve the data integration problem, and because the design in early stage does not fully take into account the demand of data integration, thereby the very big challenge that constituted is visited and used to the data that are distributed in each application system to the unification of data.
Data integration is one of core of enterprise information system, and it provides data to support to other functional module.Every kind of business all has the database of oneself in the old process structure, and these data generally are incomplete, inconsistent.Be integral data, generally need the work such as extraction cleaning conversion of data modeling, uniform data system design exploitation, original system data.Wherein the data message model is the basis, should set up complete information model according to the requirement of operation flow specified data.
The purpose of data integration service is to make its user need not be concerned about the difference between the data source, and concerning the visitor, which kind of type can understand database is, gets final product and only visit its data of being concerned about.But because the difference of data source make to have a lot of constraints when realizing the data integration service, and also there are many deficiencies in the availability of data integration service.(comprising: Oracle, DB2, Informix, Sybase, MSSQL) between the different relational databases, because database producer provides different built-in functions, and the expansion of SQL-92 standard also there is very big-difference, make the SQL statement literary style have very big difference, many times can't use same SQL statement in each data source, as the function " substring " by name of Sybase and MSSQL and called after " substr " among the Oracle when obtaining substring.
In the prior art, adopt following technology to realize the data integration service usually:
Prior art one, data integration service use the SQL grammer identical with relevant database to realize the filtration of data integration service data fully, and just simply query requests being generated SQL statement submits to database during data filter.
The weak point of this technology is:
1, data integration service access person need know the type of data source;
2, the client application exploitation of data integration service changes because of the difference of data source;
3, same data access can't be crossed over the data of different types source;
4, the function that supported by database limits, and can't finish some special data filter.
Prior art two, data integration service provide unified data access, and a kind of mode of simple general-purpose is adopted in the visit of data source, the mode that conducts interviews according to key assignments for example, perhaps the data access mode of accord with SQL-92 standard fully.
The weak point of this technology is:
1, data filter is limited in one's ability, can't satisfy the demand of complicated applications;
2, the rule of data-switching and integration all merges in custom code, changes to be difficult to adapt to neatly.
Prior art three, data integral service system provide unified data access, and the data in the data source are all read in the data integral service system, are finished the filtration of data fully by data integral service system.
The weak point of this technology is:
1, can't use data base optimization device and powerful search function, performance is not high;
2, other database client can't in time be notified the data integration service to the renewal of data;
3, solve data integration by the mode that forms middle database or centralized repository, yet such way has often formed new data silo again.
Summary of the invention
The objective of the invention is at above-mentioned the deficiencies in the prior art, a kind of data integral service system and method are provided, can support different data sources, shield the difference in different pieces of information source by unified data access mode, support querying condition flexibly, make full use of the powerful search function of database, thereby and provide powerful data filter function can satisfy complicated application and development needs.
For achieving the above object, the invention provides a kind of data integral service system, comprising: the data Registering modules, the data area that is used for that data source is provided is registered and is preserved; Described data Registering modules comprises: the registration condition parsing module is used for corresponding condition binary tree is resolved and be converted to the registration condition of the data source of user input; The registration condition modular converter is connected with described registration condition parsing module, is used for the condition binary tree that described registration condition parsing module conversion generates is converted to the numerical range set of corresponding field, and preserves this numerical range set; Described data integral service system also comprises the data query module, be connected with described registration condition modular converter and one or more data source, be used for: the data area that the data source of preserving according to the querying condition and the described registration condition modular converter of user's input provides, submit query requests to and Query Result is exported to the user to the data source of correspondence.
Further, described data query module can specifically comprise: the querying condition parsing module is used for corresponding condition binary tree is resolved and be converted to the querying condition of user's input; The querying condition modular converter is connected with described querying condition parsing module, is used for the condition binary tree that described querying condition parsing module conversion generates is converted to the numerical range set of corresponding field; The data source enquiry module, be connected with described querying condition modular converter, described data Registering modules and described one or more data source, be used for: the data area that the data source that numerical range is gathered and described data Registering modules is preserved that generates according to described querying condition modular converter conversion provides, search and submit Structured Query Language (SQL) (StructuredQuery Language to the data source of correspondence, abbreviation SQL) query requests also obtains Query Result, and Query Result is exported to the user.
Further, described data integral service system also can comprise the Query Result filtering module, is connected with described query processing module, is used for the result to described query processing module inquiry, filters by predefined built-in function.Described data integral service system also can comprise the built-in function storehouse, is connected with described Query Result filtering module, is used to preserve predefined described built-in function.Described data integral service system also can comprise: profile module, be connected with described Query Result filtering module, and be used to preserve configuration file, described configuration file is preserved the correlation parameter of all functions and the definition of rreturn value in the described built-in function storehouse.
For realizing goal of the invention, the present invention also provides a kind of data integration method of servicing, may further comprise the steps: in step 1, the querying condition of user's input is resolved and is converted to the numerical range set of corresponding field; Then in step 2, according to the data area that described numerical range set and the data source of preserving in advance provide, search and submit query requests to and obtain Query Result to the data source of correspondence, Query Result is exported to the user.
Further, also can comprise the operation of preserving the numerical range that described data source provides in advance before the described step 1, specifically may further comprise the steps: in step 01, corresponding condition binary tree is resolved and be converted to the registration condition of the data source of user input; In step 02, described condition binary tree is converted to the numerical range set of corresponding field then, and preserves this numerical range set.Wherein, step 01 can specifically may further comprise the steps: in step 010, the registration condition of the text formatting of the data source of user input is carried out the grammatical analysis of Structured Query Language (SQL), judge whether the grammer of described registration condition is correct, be execution in step 011 then, otherwise finish; In step 011, will be converted to corresponding condition binary tree then through the registration condition after the described grammatical analysis.
Further, described step 1 can specifically may further comprise the steps: in step 10, corresponding condition binary tree is resolved and be converted to the querying condition of user's input; In step 11, described condition binary tree is converted to the numerical range set of corresponding field then.Described step 2 can specifically may further comprise the steps: in step 20, the data area that the data source that numerical range is gathered and described data Registering modules is preserved that generates according to described querying condition modular converter conversion provides is searched and described numerical range is gathered corresponding data source; In step 21, the data area of set of described numerical range and the data source that finds is carried out intersection operation, generate the query requests of corresponding Structured Query Language (SQL) according to operation result; In step 22, the query requests of described Structured Query Language (SQL) is submitted to the described data source that finds and obtained Query Result then, Query Result is exported to the user.
Wherein, step 22 can specifically may further comprise the steps: in step 220, the query requests of described Structured Query Language (SQL) is submitted to the described data source that finds and obtained Query Result; In step 221,, the data in the described Query Result are filtered according to the condition binary tree of described querying condition correspondence one by one then by predefined built-in function; Then in step 222,, filtered data is filtered according to the condition binary tree of described registration condition correspondence one by one by predefined built-in function; In step 223, will export to the user at last through step 222 filtered data.Step 22 also can specifically may further comprise the steps: step 220 ' in, the query requests of described Structured Query Language (SQL) is submitted to the described data source that finds and is obtained Query Result; Then step 221 ' in, by predefined built-in function, the data in the described Query Result are filtered according to the condition binary tree of described registration condition correspondence one by one; Then step 222 ' in, by predefined built-in function filtered data is filtered according to the condition binary tree of described querying condition correspondence one by one; At last step 223 ' in will export to the user through step 222 ' filtered data.
In technique scheme, by the ability that data area is provided of a plurality of data sources is described with the registration condition of text formatting, and this registration condition is converted to the condition binary tree, be converted to data area then; And the querying condition to the text formatting of user input is also done same processing, finally is converted to the data area set; This data area and the set of this data area are carried out intersection operation, the result of intersection operation is converted to complete accord with SQL-92 standard SQL query statement and submits to corresponding data source, thereby can utilize the powerful search function of data source to obtain Query Result rapidly; Further, this Query Result is carried out secondary filtration, thereby abundant filtering function flexibly can be provided, satisfy the demand of complicated applications by powerful built-in function storehouse.
As shown from the above technical solution, the present invention is by adopting the data login mechanism, the ability that data area is provided of different data sources is described and preserved with data area uniformly, thereby shielded the difference in different pieces of information source, for application provides unified data access mode, make the type that when doing application and development, need not be concerned about data source; Further, by querying condition unification similarly is converted to the data area set, and do intersection operation with the data area of data source registration, the intersection operation result is converted to the standard SQL statement to be submitted to corresponding data source and inquires about, thereby can support querying condition flexibly, and can utilize the powerful search capability of data source, make the type of not only can not need when doing application and development being concerned about data source, and can use querying condition flexibly, and improved the efficient of application and development, significantly improved the maintainability of system simultaneously.In addition, by flexible extendible built-in function storehouse is provided, can provide more powerful and data filter function flexibly, thereby can satisfy the application demand of various complexity than the filtering function of data source.
In sum, the present invention is by the total solution of data login mechanism and data query and filtration, can reach and support different data sources, shield the difference in different pieces of information source by unified data access mode, support querying condition flexibly, make full use of the powerful search function of database, thereby and provide powerful data filter function can satisfy the useful technique effect of complicated application and development needs.
Description of drawings
Fig. 1 is the synoptic diagram of the specific embodiment of the invention one;
Fig. 2 is the synoptic diagram of the specific embodiment of the invention two;
Fig. 3 is the synoptic diagram of the specific embodiment of the invention three;
Fig. 4 is the synoptic diagram of the specific embodiment of the invention four;
Fig. 5 is the synoptic diagram of the specific embodiment of the invention five;
Fig. 6 is the synoptic diagram of the specific embodiment of the invention six;
Fig. 7 is the synoptic diagram of the specific embodiment of the invention seven;
Fig. 8 is the synoptic diagram of the specific embodiment of the invention eight;
Fig. 9 is the process flow diagram of the specific embodiment of the invention nine;
Figure 10 is the process flow diagram of the specific embodiment of the invention ten;
Figure 11 is the synoptic diagram of the specific embodiment of the invention ten;
Figure 12 is the process flow diagram of the specific embodiment of the invention 11;
Figure 13 is the process flow diagram of the specific embodiment of the invention 12;
Figure 14 is the process flow diagram of the specific embodiment of the invention 13;
Figure 15 is the process flow diagram of the specific embodiment of the invention 14;
Figure 16 is the process flow diagram of the specific embodiment of the invention 15;
Figure 17 is the process flow diagram of the specific embodiment of the invention 16;
Figure 18 is the process flow diagram of the specific embodiment of the invention 17.
Embodiment
Below in conjunction with drawings and Examples, technical scheme of the present invention is described in further detail.
Fig. 1 is the synoptic diagram of the specific embodiment of the invention one, and a kind of data integral service system A comprises: data Registering modules a, and the data area that is used for that data source is provided is registered and is preserved; Data Registering modules a specifically comprises: registration condition parsing module b2 is used for corresponding condition binary tree is resolved and be converted to the registration condition of the data source of user input; Registration condition modular converter b1, b2 is connected with the registration condition parsing module, is used for the condition binary tree that registration condition parsing module b2 conversion generates is converted to the numerical range set of corresponding field, and preserves this numerical range set; Data integral service system A also comprises data query module b, be connected with registration condition modular converter b1 and one or more data source, be used for: the data area that the data source of preserving according to the querying condition and the registration condition modular converter b1 of user input provides, submit query requests to and Query Result is exported to the user to the data source of correspondence.In this specific embodiment, adopt the data login mechanism, the ability that data area is provided of different data sources is described and preserved with data area uniformly, thereby shielded the difference in different pieces of information source, for application provides unified data access mode, make the type that when doing application and development, need not be concerned about data source.
Fig. 2 is the synoptic diagram of the specific embodiment of the invention two, a kind of data integral service system B, be with the difference of specific embodiment one: registration condition parsing module b2 specifically comprises: registration condition syntax Analysis Module b21 is used for the registration condition of the text formatting of the data source of user input is carried out the grammatical analysis of Structured Query Language (SQL); Registration condition binary tree generation module b22, b21 is connected with the registration condition syntax Analysis Module, is used for the registration condition after the registration condition syntax Analysis Module b21 analysis is converted to corresponding condition binary tree.
Fig. 3 is the synoptic diagram of the specific embodiment of the invention three, a kind of data integral service system C, be with the difference of specific embodiment two: data query module a specifically comprises: querying condition parsing module a1 is used for corresponding condition binary tree is resolved and be converted to the querying condition of user's input; Querying condition modular converter a2, a1 is connected with the querying condition parsing module, is used for the condition binary tree that querying condition parsing module a1 conversion generates is converted to the numerical range set of corresponding field; Data source enquiry module a3, be connected with querying condition modular converter a2, data Registering modules b and described one or more data source, be used for: the data area that the data source that numerical range set that conversion generates according to querying condition modular converter a2 and data Registering modules b preserve provides, search and submit the query requests of Structured Query Language (SQL) to and obtain Query Result, Query Result is exported to the user to the data source of correspondence.In this specific embodiment, further querying condition unification similarly is converted to the data area set, and do intersection operation with the data area of data source registration, the intersection operation result is converted to the standard SQL statement to be submitted to corresponding data source and inquires about, thereby can support querying condition flexibly, and can utilize the powerful search capability of data source, make the type of not only can not need when doing application and development being concerned about data source, and can use querying condition flexibly, and improved the efficient of application and development, significantly improved the maintainability of system simultaneously.
Fig. 4 is the synoptic diagram of the specific embodiment of the invention four, a kind of data integral service system D, be with the difference of specific embodiment three: querying condition parsing module a1 specifically comprises: querying condition syntax Analysis Module a11 is used for the querying condition of the text formatting of user input is carried out the grammatical analysis of Structured Query Language (SQL); Querying condition binary tree generation module a12, a11 is connected with the querying condition syntax Analysis Module, is used for the querying condition after the querying condition syntax Analysis Module a11 analysis is converted to corresponding condition binary tree.
Fig. 5 is the synoptic diagram of the specific embodiment of the invention five, a kind of data integral service system E, be with the difference of specific embodiment four: data source enquiry module a3 specifically comprises: data source is searched module a31, be connected with data Registering modules b with querying condition modular converter a2, be used for: the data area that the data source that numerical range set that conversion generates according to querying condition modular converter a2 and data Registering modules b preserve provides, search and the corresponding data source of described numerical range set; Query processing module a32, search module a31 with data source and described one or more data source is connected, be used for: submit to described data source behind the data area generation data source querying condition according to described numerical range set and described data source, and obtain the Query Result of described data source, Query Result is exported to the user.
Fig. 6 is the synoptic diagram of the specific embodiment of the invention six, a kind of data integral service system F, be with the difference of specific embodiment five: also comprise Query Result filtering module c, a32 is connected with query processing module, be used for result, filter by predefined built-in function to query processing module a32 inquiry.Further, data integral service system F also can comprise: the built-in function storehouse, c is connected with the Query Result filtering module, is used to preserve predefined described built-in function.Data integral service system F yet can comprise: profile module, and c is connected with the Query Result filtering module, is used to preserve configuration file, and described configuration file is preserved the correlation parameter of all functions and the definition of rreturn value in the described built-in function storehouse.In this specific embodiment, further by flexible extendible built-in function or built-in function storehouse are provided, can provide more powerful and data filter function flexibly, thereby can satisfy the application demand of various complexity than the filtering function of data source.
Fig. 7 is the synoptic diagram of the specific embodiment of the invention seven, a kind of data integral service system G, be with the difference of specific embodiment six: Query Result filtering module c1 specifically comprises: registration condition filtering module c11, a32 is connected with query processing module, be used for by predefined built-in function, the data among the result of query processing module a32 inquiry are filtered according to the condition binary tree of registration condition correspondence one by one; Querying condition filtering module c12, c11 is connected with the registration condition filtering module, is used for by predefined built-in function, and registration condition filtering module c11 filtered data is filtered according to the condition binary tree of described querying condition correspondence one by one.
Fig. 8 is the synoptic diagram of the specific embodiment of the invention eight, a kind of data integral service system J, be with the difference of specific embodiment seven: Query Result filtering module c2 specifically comprises: querying condition filtering module c21, a32 is connected with query processing module, be used for by predefined built-in function, the data among the result of query processing module a32 inquiry are filtered according to the condition binary tree of querying condition correspondence one by one; Registration condition filtering module c22, c21 is connected with the querying condition filtering module, is used for by predefined built-in function, and described querying condition filtered data is filtered according to the condition binary tree of described registration condition correspondence one by one.
Fig. 9 is the process flow diagram of the specific embodiment of the invention nine, and a kind of data integration method of servicing may further comprise the steps: in step 1, the querying condition of user's input is resolved and is converted to the numerical range set of corresponding field; Then in step 2, according to the data area that described numerical range set and the data source of preserving in advance provide, search and submit query requests to and obtain Query Result to the data source of correspondence, Query Result is exported to the user.
Figure 10 is the process flow diagram of the specific embodiment of the invention ten, and a kind of data integration method of servicing may further comprise the steps: at first in step 01, corresponding condition binary tree is resolved and be converted to the registration condition of the data source of user's input; In step 02, described condition binary tree is converted to the numerical range set of corresponding field then, and preserves this numerical range set; Then in step 1, the querying condition of user's input is resolved and is converted to the numerical range set of corresponding field; At last in step 2, according to the data area that described numerical range set and the data source of preserving in advance provide, search and submit query requests to and obtain Query Result to the data source of correspondence, Query Result is exported to the user.
Figure 11 is another synoptic diagram of the specific embodiment of the invention ten, data source can provide any data, be provided with by in the data integration service, registering, and in when registration specific data scope flexibly, the description and the querying condition in the SQL statement of data area are similar, and can use the built-in function storehouse of data integration service.For example, the server of certain CDR inquiry only number of providing head is 1 ticket for levels of clients in the telephone number of " 8888 ", and levels of clients is to obtain by telephone number, then in when registration, can the specific data scope be: " PhoneNo like ' 8888% ' and getCustLevel (PhoneNo)=1 ".The ability that data source provides data has been described in data registrations, and the data integration service will analyze the relation of data registration, and which data source whether decision submits to request when handling query requests.The filtercondition of these texts need be converted to the data structure of binary tree, just can easily solve the problem in the programming realization.In the step 01, the data qualification of text mode is converted to the condition binary tree, for example: with data qualification: the binary tree after " ((a>1 and a<200and (b=1 or b=2)) or f1 (a)=1) and f2 (b)=1 " conversion as shown in figure 12.In addition, in step 02, by described condition binary tree being converted to the numerical range set of corresponding field, the leaf node that also is about to binary tree is converted to the concrete data span of corresponding field, just can simply obtain the span of each field by common factor (and in the corresponding filtercondition text) and union (or in the corresponding filtercondition text).Because any relevant database is all supported by the value range query, promptly all support by ">" ">=", "<", the querying condition that "<=", "=" represent.The condition binary tree is converted to data area, the rule of conversion is, only to ">", ">=", "<", "<=", "=" and " like " changes, and built-in function is not done any conversion, because the data base optimization device is when analyzing SQL, can not be converted to scope equally to condition, thereby this implementation can not cause the loss of database retrieval performance through the built-in function conversion.After the condition and the equal translation data scope of querying condition of data registration, in step 2, adopt the intersection of sets set operation, being converted to data area as above-mentioned binary tree is a ∈ (1,200), b ∈ 1,2}.If querying condition is " where a>100 and b>1 ", then Dui Ying data area be a ∈ (100, ∞), b ∈ (1, ∞).Through after the set operation, corresponding data area is a ∈ (100,200), b ∈ { 2}.Data area can be converted to the query SQL statement of complete accord with SQL-92 standard easily, and is as follows: " where a>100 anda<200 and b=2 ".From data area set described above as can be seen, through after the set operation, scope to the query statement of data source is the common factor of registered range and query context, range of choice when database processing is inquired about like this is littler than direct data query source, helps database better choice index.
Figure 12 is the process flow diagram of the specific embodiment of the invention 11, a kind of data integration method of servicing, be with the difference of specific embodiment 11: step 01 specifically may further comprise the steps: in step 010, registration condition to the text formatting of the data source of user input is carried out the grammatical analysis of Structured Query Language (SQL), whether the grammer of judging described registration condition is correct, be execution in step 011 then, otherwise finish; In step 011, will be converted to corresponding condition binary tree then through the registration condition after the described grammatical analysis.
Figure 13 is the process flow diagram of the specific embodiment of the invention 12, and a kind of data integration method of servicing may further comprise the steps: in step 10, corresponding condition binary tree is resolved and be converted to the querying condition of user's input; In step 11, described condition binary tree is converted to the numerical range set of corresponding field then; At last in step 2, according to the data area that described numerical range set and the data source of preserving in advance provide, search and submit query requests to and obtain Query Result to the data source of correspondence, Query Result is exported to the user.
Figure 14 is the process flow diagram of the specific embodiment of the invention 13, a kind of data integration method of servicing, be with the difference of specific embodiment 13: step 10 specifically may further comprise the steps: in step 101, querying condition to the text formatting of user input carries out the grammatical analysis of Structured Query Language (SQL), whether the grammer of judging described querying condition is correct, be execution in step 102 then, otherwise finish; In step 102, will be converted to corresponding condition binary tree then through the querying condition after the described grammatical analysis.
Figure 15 is the process flow diagram of the specific embodiment of the invention 14, a kind of data integration method of servicing, be with the difference of specific embodiment 14: step 2 specifically may further comprise the steps: in step 20, the data area that the data source that numerical range is gathered and described data Registering modules is preserved that generates according to described querying condition modular converter conversion provides is searched and described numerical range is gathered corresponding data source; Then in step 21, the data area of described numerical range set and the data source that finds is carried out intersection operation, generate the query requests of corresponding Structured Query Language (SQL) according to operation result; In step 22, the query requests of described Structured Query Language (SQL) is submitted to the described data source that finds and obtained Query Result at last, Query Result is exported to the user.
Figure 16 is the process flow diagram of the specific embodiment of the invention 15, a kind of data integration method of servicing, be with the difference of specific embodiment 15: in the specific embodiment 15 step 21 in this specific embodiment 16 for step 21 ', specifically comprise: the data area to set of described numerical range and the data source that finds is carried out intersection operation, and judge whether the common factor that computing obtains is empty set, be then to finish, otherwise execution in step 22.
Figure 17 is the process flow diagram of the specific embodiment of the invention 16, a kind of data integration method of servicing, be with the difference of specific embodiment 16: step 22 specifically may further comprise the steps: in step 220, the query requests of described Structured Query Language (SQL) is submitted to the described data source that finds and obtained Query Result; In step 221,, the data in the described Query Result are filtered according to the condition binary tree of described querying condition correspondence one by one then by predefined built-in function; Then in step 222,, filtered data is filtered according to the condition binary tree of described registration condition correspondence one by one by predefined built-in function; In step 223, will export to the user at last through step 222 filtered data.
Figure 18 is the process flow diagram of the specific embodiment of the invention 17, a kind of data integration method of servicing, be with the difference of specific embodiment 16: step 22 specifically may further comprise the steps: step 220 ' in, the query requests of described Structured Query Language (SQL) is submitted to the described data source that finds and is obtained Query Result; Then step 221 ' in, by predefined built-in function, the data in the described Query Result are filtered according to the condition binary tree of described registration condition correspondence one by one; Then step 222 ' in, by predefined built-in function, filtered data is filtered according to the condition binary tree of described querying condition correspondence one by one; At last step 223 ' in, will export to the user through step 222 ' filtered data.
Should be noted that at last: above embodiment is only in order to illustrate that technical scheme of the present invention is not intended to limit; Although the present invention is had been described in detail with reference to preferred embodiment, those of ordinary skill in the field are to be understood that, still can make amendment or the part technical characterictic is equal to replacement, and not break away from the spirit of technical solution of the present invention the specific embodiment of the present invention; It all should be encompassed in the middle of the technical scheme scope that the present invention asks for protection.