CN110309365A - A kind of openstack data query method and apparatus realized based on Mybatis - Google Patents
A kind of openstack data query method and apparatus realized based on Mybatis Download PDFInfo
- Publication number
- CN110309365A CN110309365A CN201910281996.0A CN201910281996A CN110309365A CN 110309365 A CN110309365 A CN 110309365A CN 201910281996 A CN201910281996 A CN 201910281996A CN 110309365 A CN110309365 A CN 110309365A
- Authority
- CN
- China
- Prior art keywords
- mybatis
- openstack
- sql
- database
- data
- 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.)
- Granted
Links
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/80—Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
- G06F16/81—Indexing, e.g. XML tags; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/80—Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
- G06F16/83—Querying
- G06F16/835—Query processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/80—Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
- G06F16/83—Querying
- G06F16/838—Presentation of query results
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Abstract
The invention discloses a kind of openstack data query method and apparatus realized based on Mybatis, method includes the following steps: 1) recording and storing the database link address and user name password of openstack in the form of configuration file or database data when disposing openstack;2) Mybatis is quoted, configures database link address, the username and password of Mybatis, and configure Connecting quantity;3) request for receiving user query data, writes SQL statement for the openstack data for needing to inquire in request and is saved in xml format;4) Mybatis is connected according to the database linkage information of configuration and the Database of openstack;5) Mybatis finds the XML file of storage SQL by interface, and is parsed the SQL that will be write to XML and be converted into executable SQL;6) executable SQL executes SQL data query in the database of openstack, and query result is returned to user by interface.The method of the present invention can effectively solve the problem too long as computer virtualized soft authentication performance and efficiency too low caused access time due to openstack.
Description
Technical field
The present invention relates to cloud computing technology more particularly to a kind of data query sides openstack realized based on Mybatis
Method and device.
Background technique
With use openstack management coordination server virtualization resource cloud management system in, Certificate Authority is must
Indispensable process is authenticated in openstack using keystone component, the request of all access openstack
The certification for all passing through keystone, by the way that corresponding data or resource could be obtained after certification.But this process is by assembly property
Or network etc. influences performance and efficiency is all very low, leads to each spent overlong time of request, user experience decline.Therefore how
It promotes authentication performance and efficiency is to use openstack as computer virtualized software problem in urgent need to solve.
Summary of the invention
The technical problem to be solved in the present invention is that for the defects in the prior art, providing a kind of real based on Mybatis
Existing openstack data query method and apparatus.
The technical solution adopted by the present invention to solve the technical problems is: a kind of openstack realized based on Mybatis
Data query method, comprising the following steps:
1) number of openstack is recorded and stored in the form of configuration file or database data when disposing openstack
According to library link address and user name password;
2) Mybatis is quoted, according to the database link address of the information configuration Mybatis of step 1), user name and close
Code, and configures Connecting quantity, and the Connecting quantity includes: the Mapper file road that database connection pool parameter, Mybatis are used
Diameter, Mybatis scanner configuration parameter;
3) request for receiving user query data, writes SQL statement for the openstack data for needing to inquire in request
And it is saved in xml format;
4) query interface of Mybatis is called, Mybatis is according to the database linkage information of configuration and openstack
Database connection;
5) Mybatis finds the XML file of storage SQL by interface, and is parsed to XML and turn the SQL write
The parameter for turning to executable SQL, and being passed to according to interface is by corresponding parameter setting into SQL;
6) executable SQL executes SQL data query in the database of openstack, and query result is passed through interface
Return to user.
A kind of openstack data query device realized based on Mybatis, comprising:
Data memory module, for being recorded and being deposited in the form of configuration file or database data when disposing openstack
Store up the database link address and user name password of openstack;
Configuration module, for quoting Mybatis, according to the database link address of the information configuration Mybatis of step 1),
Username and password, and configure Connecting quantity, the Connecting quantity include: that database connection pool parameter, Mybatis are used
Mapper file path, Mybatis scanner configuration parameter;
File generating module is inquired, for receiving the request of user query data, for need to inquire in request
Openstack data are write SQL statement and are saved in xml format;
Data inquiry module executes SQL data query for the database in openstack, and query result is passed through
Interface returns to user;Detailed process is as follows:
The query interface of Mybatis is called, Mybatis is according to the database linkage information of configuration and the number of openstack
Connection is established according to library;
Mybatis finds the XML file of storage SQL by interface, and is parsed to XML and convert the SQL write
For executable SQL, and the parameter being passed to according to interface by corresponding parameter setting into SQL;
Database of the executable SQL in openstack executes SQL data query, and query result is returned by interface
Back to user.
The beneficial effect comprise that: it can bypass keystone verification the present invention provides one kind and obtain
The method of openstack data or resource, can effectively solve due to openstack as computer virtualized soft authentication performance and
The too long problem of access time caused by efficiency is too low.
Detailed description of the invention
Present invention will be further explained below with reference to the attached drawings and examples, in attached drawing:
Fig. 1 is the method flow diagram of the embodiment of the present invention.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to embodiments, to the present invention
It is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, is not used to limit
The fixed present invention.
As shown in Figure 1, a kind of openstack data query method realized based on Mybatis, comprising the following steps:
1) database of openstack is recorded in the form of configuration file or database data when disposing openstack
Link address and user name password;
2) Mybatis is quoted in Java, according to the database link address of the information configuration Mybatis of step 1), user
Name and password, and configure Connecting quantity, and the Connecting quantity includes: the Mapper that database connection pool parameter, Mybatis are used
File path, the configuration of Mybatis scanner;
3) request of user query data, the openstack inquired for needs are received using the system that this method is inquired
Data are write SQL statement and are saved in xml format;
4) call the query interface of Mybatis using Java, Mybatis according to the database linkage information of configuration with
The Database of openstack connects;
5) Mybatis finds the XML file of storage SQL by interface, and is parsed to XML and turn the SQL write
The parameter for turning to executable SQL, and being passed to according to interface (join by the corresponding various querying conditions of data needed for predominantly inquiring
Number) by corresponding parameter setting into SQL;
6) executable SQL executes SQL data query in the database of openstack, and query result is passed through interface
Return to Java.
According to above method, we are easy to obtain a kind of openstack data realized based on Mybatis by programming and looked into
Ask device, comprising:
Data memory module, for being recorded and being deposited in the form of configuration file or database data when disposing openstack
Store up the database link address and user name password of openstack;
Configuration module, for quoting Mybatis, according to the database link address of the information configuration Mybatis of step 1),
Username and password, and configure Connecting quantity, the Connecting quantity include: that database connection pool parameter, Mybatis are used
Mapper file path, the configuration of Mybatis scanner;
File generating module is inquired, for receiving the request of user query data, for need to inquire in request
Openstack data are write SQL statement and are saved in xml format;
Data inquiry module executes SQL data query for the database in openstack, and query result is passed through
Interface returns to user;Detailed process is as follows:
The query interface of Mybatis is called, Mybatis is according to the database linkage information of configuration and the number of openstack
Connection is established according to library;
Mybatis finds the XML file of storage SQL by interface, and is parsed to XML and convert the SQL write
For executable SQL, and the parameter being passed to according to interface by corresponding parameter setting into SQL;
Database of the executable SQL in openstack executes SQL data query, and query result is returned by interface
Back to user.
It should be understood that for those of ordinary skills, it can be modified or changed according to the above description,
And all these modifications and variations should all belong to the protection domain of appended claims of the present invention.
Claims (2)
1. a kind of openstack data query method realized based on Mybatis, which comprises the following steps:
1) database of openstack is recorded and stored in the form of configuration file or database data when disposing openstack
Link address and user name password;
2) Mybatis is quoted, according to the database link address of the information configuration Mybatis of step 1), username and password, and
Configure Connecting quantity, the Connecting quantity include: the Mapper file path that database connection pool parameter, Mybatis are used and
Mybatis scanner configuration parameter;
3) receive user query data request, for the openstack data for needing to inquire in request write SQL statement and with
XML format is saved;
4) query interface of Mybatis is called, Mybatis is according to the database linkage information of configuration and the data of openstack
Connection is established in library;
5) Mybatis finds the XML file of storage SQL by interface, and is parsed the SQL that will be write to XML and be converted into
Executable SQL, and according to interface be passed to parameter by corresponding parameter setting into SQL;
6) executable SQL executes SQL data query in the database of openstack, and query result is returned by interface
To user.
2. a kind of openstack data query device realized based on Mybatis characterized by comprising
Data memory module, for being recorded and stored in the form of configuration file or database data when disposing openstack
The database link address and user name password of openstack;
Configuration module, for quoting Mybatis, according to the database link address of the information configuration Mybatis of step 1), user
Name and password, and configure Connecting quantity, and the Connecting quantity includes: the Mapper that database connection pool parameter, Mybatis are used
File path, Mybatis scanner configuration parameter;
File generating module is inquired, for receiving the request of user query data, for the openstack for needing to inquire in request
Data are write SQL statement and are saved in xml format;
Data inquiry module executes SQL data query for the database in openstack, and query result is passed through interface
Return to user;Detailed process is as follows:
The query interface of Mybatis is called, Mybatis is according to the database linkage information of configuration and the database of openstack
Establish connection;
Mybatis finds the XML file of storage SQL by interface, and being parsed that the SQL that will be write is converted into XML can
The SQL of execution, and according to interface be passed to parameter by corresponding parameter setting into SQL;
Database of the executable SQL in openstack executes SQL data query, and query result is returned to by interface
User.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910281996.0A CN110309365B (en) | 2019-04-09 | 2019-04-09 | Openstack data query method and device based on Mybatis |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910281996.0A CN110309365B (en) | 2019-04-09 | 2019-04-09 | Openstack data query method and device based on Mybatis |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110309365A true CN110309365A (en) | 2019-10-08 |
CN110309365B CN110309365B (en) | 2023-07-25 |
Family
ID=68074419
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910281996.0A Active CN110309365B (en) | 2019-04-09 | 2019-04-09 | Openstack data query method and device based on Mybatis |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110309365B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111158646A (en) * | 2019-12-17 | 2020-05-15 | 广西交通设计集团有限公司 | SQL lightweight persistent layer framework and configuration method |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102110110A (en) * | 2009-12-28 | 2011-06-29 | 中国移动通信集团公司 | Method and device for data access based on SOA (Service-Oriented Architecture) |
CN108121542A (en) * | 2017-11-17 | 2018-06-05 | 广东睿江云计算股份有限公司 | A kind of collocation method of the SQL statement based on MyBatis, system |
-
2019
- 2019-04-09 CN CN201910281996.0A patent/CN110309365B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102110110A (en) * | 2009-12-28 | 2011-06-29 | 中国移动通信集团公司 | Method and device for data access based on SOA (Service-Oriented Architecture) |
CN108121542A (en) * | 2017-11-17 | 2018-06-05 | 广东睿江云计算股份有限公司 | A kind of collocation method of the SQL statement based on MyBatis, system |
Non-Patent Citations (2)
Title |
---|
LV T , YOU X , ZHANG J: "The Design and Implementation of Cloud Disk System Based on OpenStack", 《INTERNATIONAL CORE JOURNAL OF ENGINEERING 》 * |
邹红霆: "基于 SSM 框架的 Web 系统研究与应用", 《湖南理工学院学报(自然科学版)》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111158646A (en) * | 2019-12-17 | 2020-05-15 | 广西交通设计集团有限公司 | SQL lightweight persistent layer framework and configuration method |
Also Published As
Publication number | Publication date |
---|---|
CN110309365B (en) | 2023-07-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107370786B (en) | General information management system based on micro-service architecture | |
CN110096857B (en) | Authority management method, device, equipment and medium for block chain system | |
US20190141144A1 (en) | Consolidating cloud-provisioning data into configuration items | |
CN109670297B (en) | Method and device for opening service permission, storage medium and electronic equipment | |
CN109656686A (en) | The upper deployment container cloud method of OpenStack, storage medium, electronic equipment and system | |
US10089371B2 (en) | Extensible extract, transform and load (ETL) framework | |
US10891569B1 (en) | Dynamic task discovery for workflow tasks | |
WO2017041649A1 (en) | Application deployment method and device | |
CN111327613B (en) | Distributed service authority control method and device and computer readable storage medium | |
CN104731943A (en) | Server and data processing method | |
CN106649164B (en) | Hardware interface management method | |
US11444785B2 (en) | Establishment of trusted communication with container-based services | |
WO2021061419A1 (en) | Template-based onboarding of internet-connectible devices | |
CN103118073A (en) | Virtual machine data persistence storage system and method in cloud environment | |
US11960870B2 (en) | Container image management | |
CN113722114A (en) | Data service processing method and device, computing equipment and storage medium | |
CN111444216A (en) | Data block deleting method based on centralized block chain type account book | |
CN111582824A (en) | Cloud resource synchronization method, device, equipment and storage medium | |
CN110309365A (en) | A kind of openstack data query method and apparatus realized based on Mybatis | |
US7865880B2 (en) | System and/or method for implementing efficient techniques for testing common information model providers | |
CN104283852A (en) | Mobile application single-sign-on authentication method, system, client side and server side | |
US20100030805A1 (en) | Propagating information from a trust chain processing | |
CN111638939A (en) | Management system and method for application life cycle of Kubernetes container platform | |
CN115469807A (en) | Disk function configuration method, device, equipment and storage medium | |
US11570182B1 (en) | Compute-less authorization |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |