CN112434069A - Multi-source heterogeneous database access adaptation method and adapter - Google Patents
Multi-source heterogeneous database access adaptation method and adapter Download PDFInfo
- Publication number
- CN112434069A CN112434069A CN202011378384.2A CN202011378384A CN112434069A CN 112434069 A CN112434069 A CN 112434069A CN 202011378384 A CN202011378384 A CN 202011378384A CN 112434069 A CN112434069 A CN 112434069A
- Authority
- CN
- China
- Prior art keywords
- database
- type
- query
- execution unit
- persistent
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 230000006978 adaptation Effects 0.000 title claims abstract description 15
- 230000002085 persistent effect Effects 0.000 claims abstract description 31
- 238000004806 packaging method and process Methods 0.000 claims description 3
- 230000002688 persistence Effects 0.000 abstract description 14
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000008092 positive effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24553—Query execution of query operations
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a multi-source heterogeneous database access adaptation method and an adapter, wherein the adaptation method comprises the following steps: configuring a data execution unit in the persistent framework layer, wherein the data execution unit in the persistent framework layer judges the type of the query database when interacting with the database, and executes different actuators according to different database types. The invention adds a persistent layer data execution unit in the original open source persistent layer frame, when the persistent layer data execution unit receives an execution query instruction, the persistent layer data execution unit firstly judges the execution type of a session and selects a corresponding actuator according to the execution type; firstly, the method is suitable for different types of databases, and secondly, a data execution unit of the persistence layer is arranged in the persistence layer and does not invade the original persistence layer framework code.
Description
Technical Field
The invention relates to the field of electronic information technology software, in particular to a multi-source heterogeneous database access adaptation method and an adapter.
Background
The types of databases are various, the traditional relational database adopts SQL to query and process data, and the storage structure of emerging databases such as XDM is different from that of the traditional database, does not support SQL query, and queries in a unique mode. Only the traditional relational database and the main-stream database are supported in an open-source persistent layer framework, and other databases such as emerging XDM and the like are not supported.
Disclosure of Invention
In view of the above, the present invention provides a multi-source heterogeneous database access adaptation method and an adapter, so as to solve the problems in the prior art.
In order to solve the technical problems, the invention adopts the technical scheme that: a multi-source heterogeneous database access adaptation method is characterized by comprising the following steps: the adaptation method comprises the following steps: configuring a data execution unit in the persistent framework layer, wherein the data execution unit in the persistent framework layer judges the type of the query database when interacting with the database, and executes different actuators according to different database types.
Preferably, the type of the query database is judged, and if the database type is the relational data, the SQL query is adopted.
Preferably, the type of the query database is judged, and if the type of the database is non-relational data, an actuator matched with the type of the database is newly built.
Preferably, the step of creating an actuator matching the database type comprises:
acquiring an execution statement;
analyzing the statement to obtain a query library name and a query condition;
and calling the packaged XDM querier, and packaging the query result.
A multi-source heterogeneous database access adapter is arranged in a persistent layer frame and comprises a persistent layer data execution unit, wherein the persistent layer data execution unit comprises a judgment unit and an execution unit, and the judgment unit is used for judging the execution type of a session; the execution unit executes different inquiry processes according to the judgment result of the judgment unit.
Preferably, the determining unit determines the execution type of the session, and when the execution type is the relational data, the executing unit executes the SQL query procedure, and when the execution type is the XDM type, the executing unit creates the new XDM executor.
Preferably, the system further comprises an XDM executor query module, wherein the XDM executor query module comprises a parsing module and a calling module.
The invention has the advantages and positive effects that: the invention adds a persistent layer data execution unit in the original open source persistent layer frame, when the persistent layer data execution unit receives an execution query instruction, the persistent layer data execution unit firstly judges the execution type of a session and selects a corresponding actuator according to the execution type; firstly, the method is suitable for different types of databases, and secondly, a data execution unit of the persistence layer is arranged in the persistence layer and does not invade the original persistence layer framework code.
Drawings
FIG. 1 is a prior art procedure in a persistence tier framework for querying a relational database;
FIG. 2 is a process of the present invention after system initialization logic is modified in the original persistence tier framework;
FIG. 3 is a flow chart of the multi-source heterogeneous database access adaptation method of the present invention.
Detailed Description
For a better understanding of the present invention, reference is made to the following detailed description and accompanying drawings that illustrate the invention.
The invention provides a multi-source heterogeneous database access adaptation method, which comprises the following steps: and configuring a data execution module of a persistence layer in the persistence framework layer, wherein the data execution module of the persistence layer judges the type of the query database when interacting with the database, and executes different actuators according to different database types.
The database comprises a traditional relational database and an emerging non-relational database, and particularly, the storage modes of the relational database and the non-relational database are different essentially, the relational database is in a table format naturally, so that the relational database is stored in rows and columns of a table, and data tables can be stored in a mutual correlation manner; non-relational databases are not suitable for storage in rows and columns of a data table, but rather are grouped together in large blocks, typically stored in a data set, like a document, key value, or graph structure.
Based on the above difference, the query modes of the relational database and the non-relational database are different, the relational database generally adopts SQL query, and the non-relational database has a different storage structure from the conventional relational database, does not support SQL query, and queries in a unique manner.
In the prior art, a relational database is generally queried in MyBatis, which is an excellent persistent layer framework supporting custom SQL, storage process and advanced mapping; the query process is to query the rows and columns of the relational database table according to a specific query rule.
The invention adds a persistent layer data execution module in the original open source persistent layer frame, when the persistent layer data execution unit receives an execution query instruction, the persistent layer data execution unit firstly judges the execution type of a session and selects a corresponding actuator according to the execution type; firstly, the method is suitable for different types of databases, and secondly, a data execution unit of the persistence layer is arranged in the persistence layer and does not invade the original persistence layer framework code.
Specifically, the non-relational database takes XDM as an example, and a program in a persistent layer frame for querying a relational database in the prior art is shown in fig. 1, the present invention modifies a system initialization logic in an original persistent layer frame, determines that an XDM executor is created if an execution type is XDM, specifically, as shown in fig. 2, adds a determination statement, determines an execution type of a session, executes an SQL query process when the execution type is relational data, and creates an XDM executor when the execution type is XDM.
Further, the process of newly building the XDM executor comprises the following steps:
acquiring an execution statement;
analyzing the statement to obtain a query library name and a query condition;
and calling the packaged XDM querier, and packaging the query result.
In this embodiment, the non-relational data multiplexes query elements of the relational database, and in the SQL conversion phase, the query is converted into an XDM query statement.
Specifically, in a specific query process, the relational data query statement is: selecting FROM BT WHERE IDNAME $ { idmame }, that is, querying a BT table in a relational database, wherein a value corresponding to an idmame column in the table is $ { idmame }; when the XDM is inquired, BT corresponds to the name of a data set of the XDM, IDNAME behind where is used as a key value name, and $ { IDNAME } is used as a condition for matching key value content, and an inquiry method of an XDM database is called (the inquiry method is provided by an XDM database supplier)
The invention provides a multi-source heterogeneous database access adapter which is arranged in a persistent layer frame and comprises a persistent layer data execution unit, wherein the persistent layer data execution unit comprises a judgment unit and an execution unit, and the judgment unit is used for judging the execution type of a session; the execution unit executes different inquiry processes according to the judgment result of the judgment unit.
In the invention, the judging unit is used for judging the execution type of the session, when the execution type is relational data, the execution unit executes SQL query process, and when the execution type is XDM type, the execution unit newly builds an XDM executor.
The system also comprises an XDM executor inquiry module which comprises an analysis module and a calling module.
The analysis module is used for analyzing the query statement, and specifically comprises the steps of obtaining key query elements from the query statement, such as which table is queried; the key query element is transmitted to a calling module, and the calling module queries the XDM in a preset mode.
The XDM executor inquiry module creates an XDM inquirer when a system is initialized to load a data configuration file, binds the XDM inquirer to a corresponding data configuration file, and can directly call the XDM inquirer in the inquiry process.
The embodiments of the present invention have been described in detail, but the description is only for the preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. All equivalent changes and modifications made within the scope of the present invention should be covered by the present patent.
Claims (7)
1. A multi-source heterogeneous database access adaptation method is characterized by comprising the following steps: the adaptation method comprises the following steps: configuring a data execution unit in the persistent framework layer, wherein the data execution unit in the persistent framework layer judges the type of the query database when interacting with the database, and executes different actuators according to different database types.
2. The multi-source heterogeneous database access adaptation method according to claim 1, wherein: judging the type of the query database, and if the type of the database is relational data, adopting SQL for query.
3. The multi-source heterogeneous database access adaptation method according to claim 1 or 2, wherein: judging the type of the query database, and if the type of the database is non-relational data, newly building an actuator matched with the type of the database.
4. The multi-source heterogeneous database access adaptation method of claim 3, wherein: the step of newly building an actuator matched with the database type comprises the following steps:
acquiring an execution statement;
analyzing the statement to obtain a query library name and a query condition;
and calling the packaged XDM querier, and packaging the query result.
5. A multi-source heterogeneous database access adapter, characterized by: the adapter is arranged in the persistent layer frame and comprises a persistent layer data execution unit, the persistent layer data execution unit comprises a judgment unit and an execution unit, and the judgment unit is used for judging the execution type of the session; the execution unit executes different inquiry processes according to the judgment result of the judgment unit.
6. The multi-source heterogeneous database access adapter of claim 5, wherein: the judging unit judges the execution type of the session, when the execution type is relational data, the execution unit executes an SQL query process, and when the execution type is an XDM type, the execution unit creates an XDM executor.
7. The multi-source heterogeneous database access adapter of claim 5 or 6, wherein: the system also comprises an XDM executor inquiry module which comprises an analysis module and a calling module.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011378384.2A CN112434069A (en) | 2020-12-01 | 2020-12-01 | Multi-source heterogeneous database access adaptation method and adapter |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011378384.2A CN112434069A (en) | 2020-12-01 | 2020-12-01 | Multi-source heterogeneous database access adaptation method and adapter |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112434069A true CN112434069A (en) | 2021-03-02 |
Family
ID=74698703
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011378384.2A Pending CN112434069A (en) | 2020-12-01 | 2020-12-01 | Multi-source heterogeneous database access adaptation method and adapter |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112434069A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113918634A (en) * | 2021-10-15 | 2022-01-11 | 国家电网有限公司大数据中心 | Data adaptation method, adapter and storage medium for data interaction |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1448867A (en) * | 2002-03-30 | 2003-10-15 | 深圳市中兴通讯股份有限公司 | Method for accessing database system uniformly |
CN1815468A (en) * | 2005-01-31 | 2006-08-09 | 微软公司 | Integration of a non-relational query language with a relational data store |
US20070208721A1 (en) * | 2003-12-01 | 2007-09-06 | Zaman Kazi A | Modeling multidimensional data sources |
CN101158975A (en) * | 2007-11-21 | 2008-04-09 | 金蝶软件(中国)有限公司 | Method and system for accessing distinct type data-base |
CN103955370A (en) * | 2014-04-28 | 2014-07-30 | 华为软件技术有限公司 | Persistence device and method of domain object model |
CN105868411A (en) * | 2016-04-27 | 2016-08-17 | 国网上海市电力公司 | Non-relation type database and relation type database integrated data query method and system |
CN106383850A (en) * | 2016-08-31 | 2017-02-08 | 东软集团股份有限公司 | Data processing method and apparatus |
CN106407302A (en) * | 2016-08-30 | 2017-02-15 | 东华大学 | Method for supporting function of calling specific functions of middleware database through simple SQL |
CN106897322A (en) * | 2015-12-21 | 2017-06-27 | ***通信集团山西有限公司 | The access method and device of a kind of database and file system |
US20180349463A1 (en) * | 2017-05-31 | 2018-12-06 | HarperDB, Inc. | Systems, methods, and apparatus for hierarchical database |
CN110032604A (en) * | 2019-02-02 | 2019-07-19 | 阿里巴巴集团控股有限公司 | Data storage device, transfer device and data bank access method |
CN110633292A (en) * | 2019-09-19 | 2019-12-31 | 上海依图网络科技有限公司 | Query method, device, medium, equipment and system for heterogeneous database |
US10628394B1 (en) * | 2017-02-27 | 2020-04-21 | Amazon Technologies, Inc. | Database analysis service |
CN111309785A (en) * | 2020-02-14 | 2020-06-19 | 广州极晟网络技术有限公司 | Spring framework-based database access method and device, computer equipment and medium |
-
2020
- 2020-12-01 CN CN202011378384.2A patent/CN112434069A/en active Pending
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1448867A (en) * | 2002-03-30 | 2003-10-15 | 深圳市中兴通讯股份有限公司 | Method for accessing database system uniformly |
US20070208721A1 (en) * | 2003-12-01 | 2007-09-06 | Zaman Kazi A | Modeling multidimensional data sources |
CN1815468A (en) * | 2005-01-31 | 2006-08-09 | 微软公司 | Integration of a non-relational query language with a relational data store |
CN101158975A (en) * | 2007-11-21 | 2008-04-09 | 金蝶软件(中国)有限公司 | Method and system for accessing distinct type data-base |
CN103955370A (en) * | 2014-04-28 | 2014-07-30 | 华为软件技术有限公司 | Persistence device and method of domain object model |
CN106897322A (en) * | 2015-12-21 | 2017-06-27 | ***通信集团山西有限公司 | The access method and device of a kind of database and file system |
CN105868411A (en) * | 2016-04-27 | 2016-08-17 | 国网上海市电力公司 | Non-relation type database and relation type database integrated data query method and system |
CN106407302A (en) * | 2016-08-30 | 2017-02-15 | 东华大学 | Method for supporting function of calling specific functions of middleware database through simple SQL |
CN106383850A (en) * | 2016-08-31 | 2017-02-08 | 东软集团股份有限公司 | Data processing method and apparatus |
US10628394B1 (en) * | 2017-02-27 | 2020-04-21 | Amazon Technologies, Inc. | Database analysis service |
US20180349463A1 (en) * | 2017-05-31 | 2018-12-06 | HarperDB, Inc. | Systems, methods, and apparatus for hierarchical database |
CN110032604A (en) * | 2019-02-02 | 2019-07-19 | 阿里巴巴集团控股有限公司 | Data storage device, transfer device and data bank access method |
CN110633292A (en) * | 2019-09-19 | 2019-12-31 | 上海依图网络科技有限公司 | Query method, device, medium, equipment and system for heterogeneous database |
CN111309785A (en) * | 2020-02-14 | 2020-06-19 | 广州极晟网络技术有限公司 | Spring framework-based database access method and device, computer equipment and medium |
Non-Patent Citations (3)
Title |
---|
傅荣蓉: "面向电网异构大数据的存储适配***设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
汪雪飞: "基于PostgreSQL的大规模分布式异构数据库统一访问研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
王循: "Java_Web快速开发框架中部分关键技术初步研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113918634A (en) * | 2021-10-15 | 2022-01-11 | 国家电网有限公司大数据中心 | Data adaptation method, adapter and storage medium for data interaction |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107491561B (en) | Ontology-based urban traffic heterogeneous data integration system and method | |
CA2588922C (en) | Computer readable medium, method and apparatus for preserving filtering conditions to query multilingual data sources at various locales when regenerating a report | |
US7912845B2 (en) | Methods and systems for data integration | |
CN104899295B (en) | A kind of heterogeneous data source data relation analysis method | |
US20050278286A1 (en) | Dynamic graphical database query and data mining interface | |
CN1122233C (en) | Method and apparatus for supporting dynamic run-time object definition in a relational detabase management system | |
US9824128B1 (en) | System for performing single query searches of heterogeneous and dispersed databases | |
CN1761962A (en) | Real-time aggregation of unstructured data into structured data for SQL processing by a relational database engine | |
US20190188302A1 (en) | Group-by-time operations with returned time context | |
CN101110030A (en) | Developing method for data base persistence layer based on JAVA | |
US11797557B2 (en) | Data management platform, intelligent defect analysis system, intelligent defect analysis method, computer-program product, and method for defect analysis | |
US20030208479A1 (en) | Flexible access of data stored in a database | |
CN112434069A (en) | Multi-source heterogeneous database access adaptation method and adapter | |
CN101916208A (en) | System and method for calling driver module in multithreading | |
CN1228728C (en) | System and process for developing customized business report forms in the WEB applications | |
CN100440803C (en) | Gridding information model system and method for modeling processing gridding information | |
US20030191727A1 (en) | Managing multiple data mining scoring results | |
CN113515564A (en) | Data access method, device, equipment and storage medium based on J2EE | |
US20050114404A1 (en) | Database table version upload | |
US20220019597A1 (en) | Data management device and data management method | |
CN107622070B (en) | Database management method and device | |
JP2022018435A5 (en) | ||
KR940001879B1 (en) | Apparatus for database access | |
CN102385599A (en) | Inquiring and updating method of distributed data source | |
CN117711560B (en) | Automatic generation method and device for group study data analysis report and computer equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210302 |
|
RJ01 | Rejection of invention patent application after publication |