Dynamic routing system and the method for work thereof of a kind of Multi-target Data service layer
Technical field
The present invention relates to a kind of data access system.
Background technology
The data service layer implementation of existing application system, as shown in Figure 1, user sends data access request through view layer to service logic interface, and service logic interface is connected with data service layer, by accessing database after the parsing of operation code.At present, the development of infosystem cloud data service technology, new approaches are provided to the data access mode of large-scale telematics system, the current data access technology framework of large-scale operating information system cannot, to the smooth transition of cloud data, services, directly adopt a kind of data service technology without fully checking to have the risk of application greatly.Lack in the industry at present a kind of effective strategy and ensureing under the prerequisite of existing system stable operation, fully carry out the checking of cloud data access technology.
If use existing Business Logic, realize the concurrent access of legacy data service layer and cloud data service layer, need to change program and the source code of service logic interface, as shown in Figure 2, between service logic interface and data service layer, need to increase data service layer and select module, data service layer selects the function of module to be realized by software, because relate to the modification of service logic interface routine and source code, easily destroy original program structure and stability, therefore in follow-up modification, improve and in process, lack dirigibility, be unfavorable for the exploration of follow-up all kinds of heterogeneous database and data service layer technology, research and checking.
Summary of the invention
The technical assignment of the technical problem to be solved in the present invention and proposition is that prior art scheme is improved and improved, and provides dynamic routing system and the method for work thereof of a kind of Multi-target Data service layer, to reach the object that guarantees system stability.For this reason, the present invention takes following technical scheme.
A dynamic routing system for Multi-target Data service layer, is characterized in that comprising:
Views module, for the input of ordering and the output of data;
Service logic interface, is connected with views module, as man-machine interface;
Dynamic router, is connected with cloud data service module with service logic interface and data service module, for selecting access connection data service module or cloud data service module according to the request of service logic interface;
Dynamic routing configuration module, for completing the configuration of dynamic routing, it is connected with views module, makes user to dynamic routing configuration module, carry out read-write operation by views module;
General data service module, connects dynamic router and general database, for resolving and access general database;
Cloud data service module, connects dynamic router, for accessing cloud database.
The technical program has maintained the implementation of original general technical framework, view and interface definition, service logic interface and the legacy data storehouse service layer of application system.Between service logic interface and data service layer, increase dynamic routing function, by dynamic routing configuration file, act on dynamic routing, the execution that completes data service layer is selected and controls.
As the further of technique scheme improved and supplemented, the present invention also comprises following additional technical feature.
A method of work for the dynamic routing system of Multi-target Data service layer, is characterized in that: comprise the following steps:
1) user sends request by views module;
2) service logic interface is sent to dynamic router by user's request;
3) dynamic router is according to dynamic routing configuration and user's request, and the execution that completes data service module is selected and controls, and data service module comprises general data service module and cloud data service module.
When needs are revised the access of data service module and selected, by views module, revise the relevant parameter in dynamic routing configuration module.
Beneficial effect: the technical program is set up dynamic routing engine between data service layer and Business Logic, by reading dynamic routing configuration file, select different data, services, can select original data service layer to commence business, also can select cloud data service layer, carry out the checking of cloud data service technology.As need are revised the access of data service layer and selection, only need to revise the relevant parameter in dynamic routing configuration file, without revising service logic interface routine and source code, maintain the implementation of original general technical framework, view and interface definition, service logic interface and the legacy data storehouse service layer of application system, guaranteed the stability of original application system Business Logic.
Accompanying drawing explanation
Fig. 1 is a kind of prior art process flow diagram that is only applicable to traditional data services.
Fig. 2 is a kind of prior art process flow diagram that is simultaneously applicable to traditional data services and cloud data, services.
Fig. 3 is process flow diagram of the present invention.
Embodiment
Below in conjunction with Figure of description, technical scheme of the present invention is described in further detail.
A dynamic routing system for Multi-target Data service layer, comprising:
Views module, for the input of ordering and the output of data;
Service logic interface, is connected with views module, as man-machine interface;
Dynamic router, is connected with cloud data service module with service logic interface and data service module, for selecting access connection data service module or cloud data service module according to the request of service logic interface;
Dynamic routing configuration module, for completing the configuration of dynamic routing, it is connected with views module, makes user to dynamic routing configuration module, carry out read-write operation by views module;
General data service module, connects dynamic router and general database, for resolving and access general database;
Cloud data service module, connects dynamic router, for accessing cloud database.
As shown in Figure 3, the method for work of the dynamic routing system of a kind of Multi-target Data service layer comprises the following steps:
1) user sends request by views module;
2) service logic interface is sent to dynamic router by user's request;
3) dynamic router is according to dynamic routing configuration and user's request, and the execution that completes data service module is selected and controls, and data service module comprises general data service module and cloud data service module;
4) when needs are revised the access of data service module and selected, by views module, revise the relevant parameter in dynamic routing configuration module.
Dynamic routing system and the method for work thereof of a kind of Multi-target Data service layer shown in above Fig. 3 are specific embodiments of the invention; substantive distinguishing features of the present invention and progress have been embodied; can be according to actual use needs; under enlightenment of the present invention; it is carried out to the equivalent modifications of the aspects such as shape, structure, all at the row of the protection domain of this programme.