A kind of dynamic routing system and its working method of Multi-target Data service layer
Technical field
The present invention relates to a kind of data access systems.
Background technique
The data service layer implementation of existing application system, as shown in Figure 1, user is through view layer to service logic interface
Data access request is issued, service logic interface is connected with data service layer, by accessing data after the parsing to operation code
Library.Currently, the development of information system cloud data service technology, provides newly to the data access mode of large-scale telematics system
Thinking, the current data access technology framework of large-scale operating information system are directlyed adopt without normal direction cloud data service smooth transition
It is a kind of that without the data service technology sufficiently verified, there are great application risks.At present lack in the industry it is a kind of it is effective strategy exist
Under the premise of ensureing existing system stable operation, sufficiently carry out the verifying of cloud data access technology.
If realizing the concurrent access of legacy data service layer and cloud data service layer using existing Business Logic,
Need to change the program and source code of service logic interface, as shown in Fig. 2, needing between service logic interface and data service layer
Increase data service layer selecting module, the function of data service layer selecting module is patrolled by software realization because being related to business
The modification of volume interface routine and source code, is easily destroyed original program structure and stability, therefore in subsequent modification, perfect
Lack flexibility in journey, is unfavorable for exploration, research and the verifying of subsequent all kinds of heterogeneous databases and data service layer technology.
Summary of the invention
The technical problem to be solved in the present invention and the technical assignment of proposition are to be improved and improved to prior art,
The dynamic routing system and its working method of a kind of Multi-target Data service layer are provided, to reach the mesh for guaranteeing system stability
's.For this purpose, the present invention takes following technical scheme.
A kind of dynamic routing system of Multi-target Data service layer, characterized by comprising:
Views module, for the input of order and the output of data;
Service logic interface is connected with views module, as man-machine interface;
Dynamic router is connected with service logic interface and data service module and cloud data service module, is used for basis
The request selecting access connection data service module or cloud data service module of service logic interface;
Dynamic routing configuration module is connected with views module for completing the configuration of dynamic routing, enables users to pass through
Views module is written and read dynamic routing configuration module;
General data service module connects dynamic router and general database, for parsing and accessing general database;
Cloud data service module connects dynamic router, for accessing cloud database.
The technical program maintains original general technical framework, view and the interface definition of application system, service logic connects
The implementation of mouth and legacy data library service layer.Increase dynamic routing function between service logic interface and data service layer
Can, dynamic routing is acted on by dynamic routing configuration file, completes the execution selection and control of data service layer.
As further improving and supplementing to above-mentioned technical proposal, the invention also includes following additional technical features.
A kind of working method of the dynamic routing system of Multi-target Data service layer, it is characterised in that: the following steps are included:
1) user is issued by views module and is requested;
2) user's request is sent to dynamic router by service logic interface;
3) dynamic router is requested according to dynamic routing configuration and user, completes the execution selection and control of data service module
System, data service module includes general data service module and cloud data service module.
When needing to modify the access and selection to data service module, dynamic routing is modified by views module and configures mould
Relevant parameter in block.
The utility model has the advantages that the technical program adds dynamic routing engine between data service layer and Business Logic, pass through
Dynamic routing configuration file is read to select different data services, original data service layer may be selected and commence business, it can also
To select cloud data service layer, the verifying of cloud data service technology is carried out.If you need to modify access and selection to data service layer, only
The relevant parameter in dynamic routing configuration file need to be modified, it is not necessary to modify service logic interface program and source codes, maintain
Original general technical framework, view and the interface of application system defines, service logic interface and legacy data library service layer
Implementation guarantees the stability of original application system Business Logic.
Detailed description of the invention
Fig. 1 is a kind of prior art flowchart for being only applicable to traditional data services.
Fig. 2 is prior art flowchart that is a kind of while being suitable for traditional data services and cloud data service.
Fig. 3 is flow chart of the invention.
Specific embodiment
Technical solution of the present invention is described in further detail below in conjunction with Figure of description.
A kind of dynamic routing system of Multi-target Data service layer, comprising:
Views module, for the input of order and the output of data;
Service logic interface is connected with views module, as man-machine interface;
Dynamic router is connected with service logic interface and data service module and cloud data service module, is used for basis
The request selecting access connection data service module or cloud data service module of service logic interface;
Dynamic routing configuration module is connected with views module for completing the configuration of dynamic routing, enables users to pass through
Views module is written and read dynamic routing configuration module;
General data service module connects dynamic router and general database, for parsing and accessing general database;
Cloud data service module connects dynamic router, for accessing cloud database.
As shown in figure 3, a kind of working method of the dynamic routing system of Multi-target Data service layer the following steps are included:
1) user is issued by views module and is requested;
2) user's request is sent to dynamic router by service logic interface;
3) dynamic router is requested according to dynamic routing configuration and user, completes the execution selection and control of data service module
System, data service module includes general data service module and cloud data service module;
4) when needing to modify the access and selection to data service module, dynamic routing configuration is modified by views module
Relevant parameter in module.
The dynamic routing system and its working method of a kind of Multi-target Data service layer shown in figure 3 above are of the invention
Specific embodiment has embodied substantive distinguishing features of the present invention and progress, can use needs according to actual, open in of the invention
Under showing, the equivalent modifications of shape, structure etc., the column in the protection scope of this programme are carried out to it.