CN112948666A - Method for realizing database table data release as API service - Google Patents

Method for realizing database table data release as API service Download PDF

Info

Publication number
CN112948666A
CN112948666A CN202110118224.2A CN202110118224A CN112948666A CN 112948666 A CN112948666 A CN 112948666A CN 202110118224 A CN202110118224 A CN 202110118224A CN 112948666 A CN112948666 A CN 112948666A
Authority
CN
China
Prior art keywords
api service
user
data
service
api
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
Application number
CN202110118224.2A
Other languages
Chinese (zh)
Inventor
申大雪
张明哲
张滨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Cloud Information Technology Co Ltd
Original Assignee
Inspur Cloud Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Inspur Cloud Information Technology Co Ltd filed Critical Inspur Cloud Information Technology Co Ltd
Priority to CN202110118224.2A priority Critical patent/CN112948666A/en
Publication of CN112948666A publication Critical patent/CN112948666A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24564Applying rules; Deductive queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Abstract

The invention relates to the technical field of web application, and particularly provides a method for realizing the release of database table data into API service, which comprises the following steps: s1, introducing Redis as a cache server based on a Spring MVC framework; s2, developing a front-end configuration page; s3, selecting API service; s4, setting data query conditions by a user; s5, setting desensitization rules; s6, testing the API service on line by the user; s7, judging whether the API service configuration is correct; s8, the user saves the configuration information and sample data of the API service; s9, reading an access path configured by a user, and generating an API service for providing access to the outside; and S10, storing the API service into a MySQL database for persistence, and simultaneously storing into a Redis server. Compared with the prior art, the method and the system can rapidly release the database table data into the API service, and meet the requirements of different platforms and different applications on data opening and data sharing.

Description

Method for realizing database table data release as API service
Technical Field
The invention relates to the technical field of web application, and particularly provides a method for realizing the release of database table data into API service.
Background
With the development of internet information and the advancement of computer storage capacity, the amount of data is increasing exponentially. Data from networks, smart phones, sensors, cameras, payment systems, and other approaches form an asset, creating tremendous value for use. Data is now a core asset driving innovation, creating competitive advantage, and will certainly become a new driver for socioeconomic development.
With the continued development of open data movement, more and more data can be acquired and utilized. How to make full use of the potential value of data to realize data sharing has become a hot spot concerned by various big data manufacturers.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a method for realizing the release of the database table data into the API service with strong practicability.
The technical scheme adopted by the invention for solving the technical problems is as follows:
an implementation method for publishing database table data as API service comprises the following steps:
s1, introducing Redis as a cache server based on a Spring MVC framework;
s2, developing a front-end configuration page;
s3, selecting API service;
s4, setting data query conditions by a user;
s5, setting desensitization rules;
s6, testing the API service on line by the user;
s7, judging whether the API service configuration is correct;
s8, the user saves the configuration information and sample data of the API service;
s9, reading an access path configured by a user, and generating an API service for providing access to the outside;
and S10, storing the API service into a MySQL database for persistence, and simultaneously storing into a Redis server.
Further, in step S2, in the development front-end configuration page, the basic information is configured as a service name, a service tag, and an access path.
Further, in step S3, database information and data table information corresponding to the API service are selected, the multi-table association and complex query functions are supported, and the MySQL, Oracle, SQL Server, and greenplus databases are supported.
Further, in step S4, the user sets the filtering condition and the associated condition of the data query, and supports setting the custom request parameter.
Further, in step S6, after the user has configured the API service, the user performs an online test to check the API service request information and the service return data.
Further, in step S7, the user determines whether the API service configuration is correct according to the information returned in step S6, and if the information returned is abnormal, the user modifies the API service according to the prompt information until correct sample data is obtained.
Further, in step S9, the service request path format is: the method comprises the following steps of/open-API/{ resPath }, wherein { resPath } is an access path configured by a user, and response parameters and return data provided by an API service adopt a RESTFUL style.
Further, in step S10, when the user accesses the API service, the API information stored in the Redis server is read first, and if the acquisition fails, the information stored in the MySQL database is read, and is synchronized to the Redis server again.
Compared with the prior art, the implementation method for releasing the database table data into the API service has the following outstanding beneficial effects:
(1) the invention can rapidly release the database table data into the API service, and meets the requirements of different platforms and different applications on data opening and data sharing.
(2) The guided configuration is used for helping the user to release the API service, so that the development work of the user is reduced; the Redis cache is used as a container for storing API service, so that the physical storage pressure of a system server can be relieved, the response speed of the service is improved, and the method and the system support various relational databases and non-relational databases.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow diagram of an implementation method for publishing database table data as an API service.
Detailed Description
The present invention will be described in further detail with reference to specific embodiments in order to better understand the technical solutions of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
A preferred embodiment is given below:
as shown in fig. 1, an implementation method for publishing database table data as an API service in this embodiment includes the following steps:
s1, developing by adopting a Java Web project, and introducing Redis as a cache server based on a Spring MVC framework.
And S2, developing a front-end configuration page, and configuring basic information into a service name, a service label and an access path.
S3, selecting database information and data table information corresponding to the API service, supporting multi-table association and complex query functions, and supporting MySQL, Oracle, SQL Server and GreenPlum databases.
S4, the user sets the filtering condition and the association condition of the data query, supports the setting of the user-defined request parameter, and meets the individual query requirement of the user.
S5, supporting desensitization processing of data, and supporting replacement desensitization, simulation desensitization, random desensitization and encryption desensitization rules. Besides the built-in common desensitization rule, the method also supports the user to set the desensitization rule in a self-defined manner, and realizes the protection of data information.
And S6, after the API service is configured by the user, carrying out online test, and checking API service request information and service return data.
And S7, judging whether the API service configuration is correct or not by the user according to the information returned in the step S6, and if the returned information is abnormal, modifying the API service by the user according to the prompt information until correct sample data is obtained.
S8, the user saves the configuration information and sample data of the API service, and the sample data can help the user of the API service to quickly judge whether the API service is normally accessed.
S9, reading the access path configured by the user, and generating an API service providing access to the outside, wherein the service request path format is as follows: the method comprises the following steps of/open-api/{ resPath }, wherein { resPath } is an access path configured by a user. The request parameters and the return data provided by the API service adopt an RESTFUL style, are simple and light, have uniform format, and are convenient for users to carry out secondary development.
And S10, storing the API service into a MySQL database for persistence, and simultaneously storing into a Redis server.
When a user accesses the API service, firstly, reading API information stored in the Redis server, if the acquisition fails, reading information stored in the MySQL database, and synchronizing to the Redis server again. So as to ensure the reliability and high efficiency of data reading.
The above embodiments are only specific cases of the present invention, and the scope of the present invention includes but is not limited to the above embodiments, and any suitable changes or substitutions that are consistent with the claims of the method for publishing library table data as API service and are made by those skilled in the art shall fall within the scope of the present invention.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (8)

1. An implementation method for publishing database table data as API service is characterized by comprising the following steps:
s1, introducing Redis as a cache server based on a Spring MVC framework;
s2, developing a front-end configuration page;
s3, selecting API service;
s4, setting data query conditions by a user;
s5, setting desensitization rules;
s6, testing the API service on line by the user;
s7, judging whether the API service configuration is correct;
s8, the user saves the configuration information and sample data of the API service;
s9, reading an access path configured by a user, and generating an API service for providing access to the outside;
and S10, storing the API service into a MySQL database for persistence, and simultaneously storing into a Redis server.
2. The method of claim 1, wherein in step S2, the basic information in the development front-end configuration page is configured as service name, service label and access path.
3. The method for realizing the release of the database table data as the API service according to claim 1, wherein in step S3, the database information and the data table information corresponding to the API service are selected, the multi-table association and complex query functions are supported, and the MySQL, Oracle, SQL Server and GreenPlum databases are supported.
4. The method of claim 1, wherein in step S4, the user sets the filter condition and association condition of the data query, and supports setting the custom request parameter.
5. The method of claim 1, wherein in step S6, after the user has configured the API service, the user performs an online test to view API service request information and service return data.
6. The method of claim 1, wherein in step S7, the user determines whether the API service configuration is correct according to the information returned in step S6, and if the information returned is abnormal, the user modifies the API service according to the prompt information until the correct sample data is obtained.
7. The method of claim 1, wherein in step S9, the service request path format is: the method comprises the following steps of/open-API/{ resPath }, wherein { resPath } is an access path configured by a user, and response parameters and return data provided by an API service adopt a RESTFUL style.
8. The method of claim 1, wherein in step S10, when the user accesses the API service, the API information stored in the Redis server is read first, and if the obtaining fails, the information stored in the MySQL database is read, and the information is synchronized to the Redis server again.
CN202110118224.2A 2021-01-28 2021-01-28 Method for realizing database table data release as API service Pending CN112948666A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110118224.2A CN112948666A (en) 2021-01-28 2021-01-28 Method for realizing database table data release as API service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110118224.2A CN112948666A (en) 2021-01-28 2021-01-28 Method for realizing database table data release as API service

Publications (1)

Publication Number Publication Date
CN112948666A true CN112948666A (en) 2021-06-11

Family

ID=76238607

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110118224.2A Pending CN112948666A (en) 2021-01-28 2021-01-28 Method for realizing database table data release as API service

Country Status (1)

Country Link
CN (1) CN112948666A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016011883A1 (en) * 2014-07-24 2016-01-28 阿里巴巴集团控股有限公司 Data resource acquisition method, device and system
CN106254423A (en) * 2016-07-20 2016-12-21 普元信息技术股份有限公司 The method realizing Restful service release quickly based on micro services framework
CN108681563A (en) * 2018-04-28 2018-10-19 新疆熙菱信息技术股份有限公司 Service publication based on a-table-multi-purpose family and access system
CN109063511A (en) * 2018-08-16 2018-12-21 深圳云安宝科技有限公司 Data access control method, device, proxy server and medium based on Web API
CN110515599A (en) * 2019-08-30 2019-11-29 北京浪潮数据技术有限公司 A kind of data open interface method and system based on configuration
CN110569299A (en) * 2018-01-29 2019-12-13 北京数聚鑫云信息技术有限公司 management system and management method based on API
CN111930780A (en) * 2020-10-12 2020-11-13 上海冰鉴信息科技有限公司 Data query method and system
CN112235405A (en) * 2020-10-14 2021-01-15 深圳前海微众银行股份有限公司 Distributed storage system and data delivery method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016011883A1 (en) * 2014-07-24 2016-01-28 阿里巴巴集团控股有限公司 Data resource acquisition method, device and system
CN106254423A (en) * 2016-07-20 2016-12-21 普元信息技术股份有限公司 The method realizing Restful service release quickly based on micro services framework
CN110569299A (en) * 2018-01-29 2019-12-13 北京数聚鑫云信息技术有限公司 management system and management method based on API
CN108681563A (en) * 2018-04-28 2018-10-19 新疆熙菱信息技术股份有限公司 Service publication based on a-table-multi-purpose family and access system
CN109063511A (en) * 2018-08-16 2018-12-21 深圳云安宝科技有限公司 Data access control method, device, proxy server and medium based on Web API
CN110515599A (en) * 2019-08-30 2019-11-29 北京浪潮数据技术有限公司 A kind of data open interface method and system based on configuration
CN111930780A (en) * 2020-10-12 2020-11-13 上海冰鉴信息科技有限公司 Data query method and system
CN112235405A (en) * 2020-10-14 2021-01-15 深圳前海微众银行股份有限公司 Distributed storage system and data delivery method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ITFLY8: "API快速开发平台设计思考", 《CSDN》 *

Similar Documents

Publication Publication Date Title
CN110020542B (en) Data reading and writing method and device and electronic equipment
WO2020023733A1 (en) Blockchain-based cross-chain data access method and apparatus
CN110032598B (en) Method and device for updating field and electronic equipment
CN107491487A (en) A kind of full-text database framework and bitmap index establishment, data query method, server and medium
EP3158480A2 (en) Data query method and apparatus
CN106557486A (en) A kind of storage method and device of data
CN106897342B (en) Data verification method and equipment
CN111930848B (en) Data partition storage method, device and system
CN109918678B (en) Method and device for identifying field meaning
WO2020108345A1 (en) Database index and database query processing method, apparatus, and device
CN110837471B (en) Test method, test device, server and storage medium
CN114297204A (en) Data storage and retrieval method and device for heterogeneous data source
CN107622090B (en) Object acquisition method, device and system
CN112948666A (en) Method for realizing database table data release as API service
CN116414935A (en) Method for distributed Search space vector data based on Elastic Search
CN110362569A (en) The method of calibration and device of tables of data, electronic equipment, storage medium
CN111651466B (en) Data sampling method and device
CN109388685A (en) The method and apparatus that will plan that the spatial data that industry uses is put in storage
CN112395292A (en) Data feature extraction and matching method and device
CN113377804B (en) Data processing method and device, storage medium and electronic equipment
CN117149755A (en) Method, system, equipment and storage medium for detecting data quality
CN114996600B (en) Multi-temporal image management database data writing and reading method and device
CN108763363B (en) Method and device for checking record to be written
CN108256096B (en) Data processing method and device
CN116821143A (en) Data updating method and device

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210611