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

Dynamic switching method and device based on multiple databases

A database and dynamic technology, applied in the database field, can solve problems such as inability to realize dynamic database switching, destroying computer application system structure, and inability to realize method-level database switching, etc.

Active Publication Date: 2014-01-22
BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF4 Cites 15 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In order to realize the switch between multiple databases of the computer application system, it is necessary to completely separate the read operation method and the write operation method into different program codes, which not only destroys the structure of the computer application system, but also hinders the development of the computer application system. Increase the cost; moreover, the existing technology can only realize the database switch of the object level (that is, for the class), and cannot realize the database switch of the method level; at the same time, because the corresponding database identification is set for each type of method in advance, after the computer application system starts All the classes that need to read and write the database have been initialized, so the dynamic switching of the database cannot be realized when the computer application system is running

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
  • Dynamic switching method and device based on multiple databases
  • Dynamic switching method and device based on multiple databases
  • Dynamic switching method and device based on multiple databases

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0036] In this embodiment, a multi-database-based dynamic switching device is pre-set in the computer application system. Such as image 3 It is an implementation flowchart of Embodiment 1 of the present invention, including:

[0037] Step 301: When the computer application system is started, the multi-database-based dynamic switching device reads related configuration files, and the configuration files appear in the form of key-value pairs, wherein the key is configured as the identifier of the database, and the value is configured as the one that needs to be accessed. The database method name.

[0038] The configuration file is stored in the computer application system, which is an existing file in the prior art. The configuration file is a collection of settings and files that the software system loads the required environment for the user when the user logs in to the computer or uses the software. It includes all user-specific configuration settings.

[0039] Step 302: ...

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 dynamic switching method and device based on multiple databases. The dynamic switching method based on the multiple databases comprises the steps that a relevant configuration file is read when a computer application system is started, wherein the configuration file comprises more than one key-value pair, each key is a database identification, and each value is a method name for accessing of a corresponding database; the database identifications in the configuration file are set in a thread pool of the computer application system; the method is intercepted when the method of the computer application system is called, a database identification corresponding to the method is obtained in the thread pool, and the intercepted method is released; the method is executed by means of the obtained database identification. The dynamic switching method and device based on the multiple databases have the advantages that read-write separation based on configuration can be achieved, and method-level database switching is achieved.

Description

technical field [0001] The invention relates to the technical field of databases, in particular to a dynamic switching method and device based on multiple databases. Background technique [0002] When the database includes a master database and more than one slave database, the slave database synchronizes the data stored in the master database according to a fixed cycle. Computer application systems can write to the master database (including operations that change data content, such as adding, inserting, and deleting), and read from the slave database. A read operation or write operation performed by the computer application system on the master database or from the database is called a method; multiple methods form a class, and in a class of methods, all methods perform the same operation on the same database (that is, read operation or write operation). [0003] In the prior art, a corresponding database identifier (that is, a data source) is added to each database-read...

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
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
CPCG06F16/25
Inventor 崔振
Owner BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD
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