Data bus technical framework description

 

1 Description and conventions

1.1 Convention

1.1.1 Application, the application in this article refers to an application, which can be a windows application, a web site, or a mobile terminal application.

1.1.2 ws service, which in text refers to Web Services service

1.1.3 CXF class library, refers to Apache CXF Services Framework http://cxf.apache.org/

1.2 Raising the question

There are various applications (systems) and various data storage requirements in today's enterprises, but the data between applications cannot be shared in a controllable manner, and due to the limitations of development technology and environment between applications The data sharing of enterprises has set up obstacles. This status quo hinders the exchange and sharing of data between various applications of the enterprise, and also hinders the needs of enterprises for data control, data management, and data security. Platform, application-independent, and spatial-logic-independent system for data integration and distribution to manage existing enterprise data calls - data bus

1.3 Data bus definition

Data Bus (DataBus) integrates various original databases and provides a regular and controllable data link storage service to the outside world.

1.4 Achieving goals

1.4.1 Integrate the original database, can add and delete the existing database

1.4.2 External data storage service function, able to perform external data storage services, including data query, data deletion, data modification, data storage process and function execution

1.4.3 Manage application sources (visitors), and can add, enable, disable, authorize, change authorization, and delete application sources

1.4.4 API functions can be added, deleted, and modified, and API functions can be added, modified, deleted, enabled, and disabled to achieve logical control of responses to external calls. The types of these APIs include database query, modification, Database operations such as delete, stored procedure, and function execution

1.4.5 Controllable operations of visitors, and the ability to control the permissions of visitors, including the database scope, table scope, row scope, and column scope of the query, modification, and deletion operations, and the execution permission of the access operation. The time is controlled. For example, the application source from the new enterprise can be defined as only access to the ta and tb tables of database A for a full period of time, while for the table tc and td, it can be modified and deleted from 12:00 to 18:00. operate

1.4.6 The access records can be queried and monitored, and the operation records of each visitor can be queried historically, and the operations of the visitors can be monitored in real time

1.4.7 Connection security measures, there can be an effective encrypted connection to ensure the security, integrity and verifiability of data even if the network is monitored

1.4.8 Cross-platform, cross-language, cross-space features, can effectively support remote calls on any platform and any language

1.4.9 Data security isolation, which can effectively isolate the direct operation of the visitor on the data and ensure the security of the data

2Technical framework

2.1 The physical hierarchy of the bus program

clip_image004

2.2 The physical topology of the bus program

clip_image006

2.3 Hierarchical view of logic module of bus program architecture

clip_image008

2.4 Logic view of data flow of bus program architecture

clip_image010

3 Program Module Description

3.1 Module Diagram

clip_image012

3.2 Service Host API Layer

3.2.1 Common query module

3.2.1.1 Description, public query module, responsible for querying existing API instances, including status, function parameter description, sample code, service controller, caller and other information

3.2.1.2 Implementation logic, mainly based on the API in the system to provide external query services, so that the caller can get technical support

3.2.2 API instance management module

3.2.2.1 Description, API instance management module, responsible for managing the release of API instances, enabling status, access information, access permission control, status query, etc.

3.2.2.2 Implement logic, maintain and control API instances through the API instance management module, and allow administrators to control API instances

3.2.3 API interface and class generation module

3.2.3.1 Description, API interface and class generation module, which can generate the Java code of the interface and class required for API release according to the instructions of the management module

3.2.3.2 The implementation logic is implemented according to the interface definition of the program and the general class, and the compilable Java code is automatically generated

3.2.4 Java just-in -time compilation module

3.2.4.1 Description, Java just-in-time compilation module, which can compile Java code into Class or Object according to the specified Java file and build path

3.2.4.2 Implement logic, use JavaCompiler provided by jdk, custom compile java code into Class by rewriting SimpleJavaFileObject, ForwardingJavaFileManager, URLClassLoade, and use DynamicClassLoader to implement dynamic instance objects

3.2.5 API function construction module

3.2.5.1 Description, API function construction module, which can realize the construction and publishing functions of API functions, and can send the constructed API functions to the API host module

3.2.5.2 Implement the logic, use the ServerFactoryBean provided by the CXF class library to construct the service element, and add the interceptor callback and access logic in the construction process to realize the security function

3.2.6 API external service host module

3.2.6.1 Description, API external service host module, which can provide webServices services for external access from specified entry points to provide services

3.2.6.2 Implement logic, build ServerFactoryBean through building module, use Create to generate Server, configure Endpoint according to the definition of building module, and implement ws service to provide external access

3.2.7 Access and Security Control Module

3.2.7.1 Description, the access and security control module is the callback of the API host module, which is defined according to the rules of secure connection, performs security authentication, and can realize authentication in the form of x509 certificate, UserToken, and custom key

3.2.7.2 Implementation logic, according to the Endpoint's InInterceptor and OutInterceptor's callback defined by the API host module, to realize the authentication and processing of output and input

3.2.7.3 Illustration
clip_image014

3.3 Rule logic layer

3.3.1 Logic Control Management Module

3.3.1.1 Description, this module can maintain logic rules, add, delete, enable, disable logic rules layer, and obtain real-time information and logs of the operation status of logic rules host

3.3.1.2 Implement the logic, realize the control of the logic rules by configuring the entry of the logic rule host and each logic rule layer, and realize the reading of the status and log by calling the status monitoring module

3.3.2 Logic rule generation module

3.3.2.1 Description, can respond to the call of the logic control module, generate the specified control rules of the logic rule control module, and add the logic control host to realize the addition of logic rules

3.3.2.2 Implement logic, generate instances of rule classes according to program-defined interfaces and general classes, and add them to the logic control host

3.3.3 Logic rules control host module

3.3.3.1 Description, this module can provide a unique entry point for external calls, and call the logical rule layer in a loosely coupled form through the factory reflection mode. Each logical rule layer will be executed according to the program-defined interface and return.

3.3.3.2 Implement logic, implement integrated control through a unique entry point call, and use ClassLoader to instantiate the rule layer in the entry point execution environment and call to implement rule control

3.3.4 Logic Rule Status Monitoring Module

3.3.4.1 Description, this module controls the callback of the host module entry through logic rules to read the status, and records log information to achieve traceability of all operations

3.3.4.2 Implementation logic, this module defines the only non-blocking callback function for the host module entry point callback, obtains the current state and records and processes it through the callback information of the function

3.4 Data connection management module

3.4.1 Data connection management module

3.4.1.1 Description, this module can manage the mounting and unloading of data database instances, the addition of database drivers, and call the data connection module to suspend database operations

3.4.1.2 Implementation logic, by configuring the specified database instance information and switches for the connection module to call, to realize the control of connecting to the database

3.4.2 Data connection module

As described in 3.4.2.1, this module specifies a unique entry point for calling to implement database operations

3.4.2.2 Implement logic, judge the connection type of the database and dynamically load the connection driver through the management module configuration information and entry call information, and operate the database through the driver module

3.5 Client Connection

3.5.1 Connection mode, the client uses the soap protocol to call the API to access the database

3.5.2 Access security, the client encrypts the IP, MAC, and password information to the server through the private key (or certificate), and the server provides services after authentication. IP, MAC, password information, this is the realization of incoming and outgoing security verification

3.5.3 Through platformization, the client provides help class libraries in various languages ​​(.Net, java, VC) to assist the client to complete the access, and the client can completely ignore the implementation logic (of course, the client can also customize the access to think The soap protocol is generic)

4 Rough technical details definitions and conventions

4.1 Interface convention

4.1.1.1clip_image016

4.1.1.2 The implementation method is to specify the incoming parameters through the parameters of the API function. When the execution result is a data set, it returns DataTableResult, when the single-value return result is executed, it returns SingleResult, and when there is no return result, it returns VoidResult.

4.1.2 Incoming parameter control, the required atomic data type of incoming parameters of each function, int, string, etc.

4.1.3 Large data volume performance control, the maximum number of data elements returned by the system at a time is 5000 rows * 500 columns to avoid the program from forming resource locks

4.1.4 Exception control, peripheral exception control will be used in the system, so it will not cause the program to crash, and the program will print all exception information to the exception information record for review and debugging

4.1.5 For system stability, the maximum pressure to be tested is 3-5 times the actual business data volume of the enterprise. Data request pressure verification

4.2 Extensibility Conventions

4.2.1 Be able to carry out post-development within the scope of not changing the system logic framework, and reserve extensible interfaces and modules for post-development

5 Summary

5.1 The data bus system can effectively solve the problems of database access and data security caused by loose data management, data sharing, data security, system integration, cross-platform and cross-language applications, etc.

5.2 The data bus can be regarded as a proxy server for all databases, so that all IT applications of the enterprise conduct database operations through the data bus, which will reduce the performance upper limit of enterprise IT applications, and may also cause all IT applications to fail due to bus server errors. risk of inaccessibility

6 References

6.1 "Java Software Development" (US) Sartaj Sahni, Raj Kumar China Water Resources and Hydropower Press

6.2 "Advanced Java Programming: JDK5" (US) Richardson et al, Shen Wenyan Machinery Industry Press

6.3 Apache CXF http://cxf.apache.org/

6.4 WSS4J http://baike.baidu.com/view/3184209.htm http://ws.apache.org/wss4j/

 

/Files/Rolends/Databus Documentation.doc

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326358466&siteId=291194637