Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Cross-database access method and abstract data access method based on dynamic proxy

A technology of dynamic proxy and access method, applied in electronic digital data processing, special data processing applications, instruments, etc., can solve the problem that cannot be separated, the same SQL statement is difficult to access different types of databases in a unified way, and the SQL statement cannot unification etc.

Inactive Publication Date: 2018-12-07
南京汇银迅信息技术有限公司
View PDF5 Cites 8 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] 1. The program is hard-coded, and the different data sources used in program development must be together with the specific code and cannot be separated
[0005] 2. It cannot dynamically switch data sources when it is running, and is not suitable for specific business scenarios that require dynamic switching of data sources
[0006] 3. Heterogeneous databases cannot be supported uniformly. For the same business service to access different types of databases, SQL statements cannot be unified. It is difficult for the same SQL statement to uniformly access different types of databases.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Cross-database access method and abstract data access method based on dynamic proxy
  • Cross-database access method and abstract data access method based on dynamic proxy

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0042] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0043] Such as figure 1 As shown, the present invention proposes a WEB system cross-database access method based on dynamic proxy. The dynamic proxy technology used in the present invention adopts the characteristics of object-oriented development programs, including inheritance, polymorphism and encapsulation, and functions are distributed to different objects. In the process, the data source is defined using the method of responsibility assignment. Reduced code complexity and made classes reusable.

[0044] Extract aspects in the process of database connection, and cut into the connection step or closing stage in the process of database connection processing. Before calling the business database code, the dynamic proxy will dynamically add database access control codes through aspects to prepare data resources, start Transactions,...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a cross-database access method and an abstract data access method based on a dynamic proxy. The cross-database access method based on the dynamic proxy includes: defining and configuring a plurality of data sources to form an abstract data source, and configuring the plurality of data sources through the abstract data source proxy; in the service that needs to access the database, annotating the alias of the database that the service needs to access before the service class name by the service annotation; when executing data access, the dynamic proxy intercepting the service method of accessing the database, obtaining the database alias injected into the object in the service annotation mode, and obtaining the database connection parameter from the configuration information according to the database alias; generating an instance of a database access object corresponding to the data source; obtaining the database access connection and passing the connection to a subsequent invocation method. In the method of the invention, the program does not need hard-coded database connection, and the parameters of the service component are connected with the database and decoupled by the recessive transmission parameter.

Description

technical field [0001] The invention relates to a database access method, in particular to a dynamic agent-based cross-database access method and an abstract data access method. Background technique [0002] In the process of software development, there will be more than one physical database for large-scale and complex projects, especially for real-time Internet services, the database is often divided vertically by business to improve the performance and throughput of the entire system, which must require The WEB platform can achieve effective, convenient and high-performance cross-database access for the same business service function; [0003] Different from the common single data instance solution, cross-database access requires the program to dynamically decide which database instance to store data in and which database to extract data from according to the current request and system status at runtime. Currently, the most commonly used The main scheme is: configure mul...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F17/30
Inventor 史晋
Owner 南京汇银迅信息技术有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products