CN109710223A - API gateway hot plug system based on distributed KV storage system - Google Patents

API gateway hot plug system based on distributed KV storage system Download PDF

Info

Publication number
CN109710223A
CN109710223A CN201811633587.4A CN201811633587A CN109710223A CN 109710223 A CN109710223 A CN 109710223A CN 201811633587 A CN201811633587 A CN 201811633587A CN 109710223 A CN109710223 A CN 109710223A
Authority
CN
China
Prior art keywords
api
module
heat
data
distributed
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
Application number
CN201811633587.4A
Other languages
Chinese (zh)
Other versions
CN109710223B (en
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.)
Beijing University of Posts and Telecommunications
Original Assignee
Beijing University of Posts and Telecommunications
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 Beijing University of Posts and Telecommunications filed Critical Beijing University of Posts and Telecommunications
Priority to CN201811633587.4A priority Critical patent/CN109710223B/en
Publication of CN109710223A publication Critical patent/CN109710223A/en
Application granted granted Critical
Publication of CN109710223B publication Critical patent/CN109710223B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a kind of API gateway hot plug systems based on distributed KV storage system, hot plug system realizes that distributed dynamic accesses micro services by distributed deployment, it include: that API heat inserts module and API hot drawing module, it includes online submodule and registration submodule that API heat, which inserts module, online submodule is used to handle the online issuing function of API, and accesses after API success is online;Registration submodule includes web form registration submodule and file registration submodule;API hot drawing module includes downline module and cancellation module, and downline module is used for offline API, and forbids accessing after API is offline, to modify or nullify API;Cancellation module is for removing API from hot plug system.And it is flexible to carry out horizontal dynamic to hot plug system by way of docker container.The system has strong consistency, High Availabitity, high-performance, high extended attribute, and has fault-tolerant ability.

Description

API gateway hot plug system based on distributed KV storage system
Technical field
The present invention relates to information technology and data service technical fields, in particular to a kind of to be based on distribution KV (Key- Value, key assignments) storage system API (Application Programming Interface, application programming interface) Gateway hot plug system.
Background technique
In micro services framework style, one big application is split into order to which multiple small service systems provide, this A little small systems they can establish one's own system, that is to say, that these mini systems can possess the database of oneself, frame even language Speech etc., these mini systems are usually come with providing the interface of Rest Api style by H5, Android, IOS and third-party application journey Sequence is called, for example, checking a commodity details page in an electric business system, this commodity details page includes the title of commodity, Price, inventory, comment etc., these data may be among different micro services systems, so not doing for rear end The application of image of Buddha conventional monomer is equally inquired by the join of database to obtain final result.This when, it is desirable to one Unified entrance is managed service access, therefore API gateway is also born.And manager of the gateway as service, it first has to It solves the problems, such as to be how dynamic access service.
The API gateway scheme of comparative maturity has springcloudzuul at present, it is based on eureka as in service registration The heart.Kong, a High Availabitity write based on Nginx_Lua module easily extend the API Gateway to be increased income by Mashape company Project, it is based on Apache Cassandra/PostgreSQL storage service data.
However, at present eureka registration service be difficult to the formal operations service of flight data recorder, need have to service it is certain Invasion.The service for only meeting its specific specifications just can be carried out registration access, this is difficult to operate.The installation of Kong need additionally into The troublesome operations such as row installing DB configuration, it is not friendly enough to user.Meanwhile horizontal extension ability is also that gateway influences gateway The more important of energy.Existing system does not have more effective scheme in horizontal extension ability.
Summary of the invention
The present invention is to be made based on inventor to the understanding of following problems and discovery:
Many Web applications all store data into RDBMS, and application server therefrom reads data and shows in a browser Show.But the concentration of increase, access with data volume just will appear the burden of RDBMS, database response deteriorates, website The significant impacts such as display delay.
For API gateway, performance issue is more prominent, and due to the presence of gateway, pervious request is from being dispersed into The aggregation that row becomes present carries out.Gateway is responsible for handling service access request, acts on behalf of and route service, API gateway obviously become The bottleneck point of system.If gateway architecture design is improper, can systematic entirety be declined.Therefore, how framework sets Meter becomes key point.
The present invention is directed to solve at least some of the technical problems in related technologies.
For this purpose, it is an object of the invention to propose a kind of API gateway hot plug system based on distributed KV storage system, The system has strong consistency, High Availabitity, high-performance, high extended attribute, and has fault-tolerant ability, and the storage of API uses should System is realized can be very convenient, efficient.
In order to achieve the above objectives, the embodiment of the present invention proposes a kind of API gateway heat based on distributed KV storage system Plug-in system, the hot plug system realize that distributed dynamic accesses micro services by distributed deployment, comprising: API heat inserts mould Block and API hot drawing module, wherein it includes online submodule and registration submodule that the API heat, which inserts module, wherein described online Submodule is used to handle the online issuing function of API, and accesses after API success is online;The registration submodule Submodule is registered including web form and file registers submodule, wherein the web form registration submodule is used for by pre- If web form pass through predetermined manner guide user carry out list registration;The file registration submodule is used for by filling in JSON/YML file carries out file registration;The API hot drawing module includes downline module and cancellation module, wherein described offline Module is used for the offline API, and forbids accessing after the API is offline, to modify or nullify the API;The cancellation Module is for removing the API from the hot plug system.
The API gateway hot plug system based on distributed KV storage system of the embodiment of the present invention, is deposited by distributed KV The technology that storage system effectively solves the significant impacts such as the burden of RDBMS, database response deterioration, website display delay is asked It inscribes, by the way that using unique device ID as key, the mode that information on services JSON turns to value solves dynamic and modifies API information, additions and deletions API word The problem of section, in the form of docker container, dynamic retractility dilatation is carried out to API gateway, solves the problems, such as horizontal extension. So that system has strong consistency, High Availabitity, high-performance, high extended attribute, and has fault-tolerant ability, the storage of API is used The system is realized can be very convenient, efficient.
In addition, the API gateway hot plug system according to the above embodiment of the present invention based on distributed KV storage system is also It can have following additional technical characteristic:
Further, in one embodiment of the invention, when the API heat inserts module and be in single node heat slotting mode, The online submodule is further used for: creation API is clicked, with typing API data;Typing API key message, wherein described API key message includes address, port and path of API;The API data is deposited in JSON format In HttpRequestBody, and it is submitted to backstage gateway server;The API key message is extracted, and is inserted into upper offline mark Know symbol, the API key message is deposited in background data base, and generates unique mark of API according to API Name and uuid Know.
Further, in one embodiment of the invention, when the API heat inserts module and be in single node heat slotting mode, The registration submodule is further used for: clicking and uploads yaml file;Fill in the yaml file, wherein the yaml file Address, the API parameter declaration, the response explanation of API, offer of service are provided including the corresponding title of API, the label of API, API One of the port of service, the corresponding request path of API, the requesting method of API and the affiliated type of API are a variety of;In click Pass the yaml file, Yaml data transmission to background server;The background server carries out normalizing to the Yaml data Change is handled, and offline identifier in insertion is deposited in the Yaml data in background data base, and according to API Name and uuid Generate the unique identification of API.
Further, in one embodiment of the invention, further includes: package module, for the list registration and/ Or the file registration is normalized later by data check, to be packaged into unified data.
Further, in one embodiment of the invention, when the API heat inserts module and be in multinode heat slotting mode, The API heat inserts module and is also used to the submission of log, specifically includes: when an API heat insert request reach preset it is non- The API heat is inserted request and is forwarded to Leader node by LeaderServer node, and the Leader node is according to the API Heat inserts the journal entries that request generates the operation, and then, the Leader node sends daily record reproduction request to follower, with Synchronize the journal entries;After the Leader node has sent journal entries duplicate requests, the feedback of follower is waited, After receiving the response of partial node of predetermined number, the journal entries are modified.
Further, in one embodiment of the invention, when the API heat inserts module and be in multinode heat slotting mode, The API heat inserts the submission that module is also used to data, specifically includes: after the Leader node modifies the journal entries The submission of data is carried out, and sends the journal entries and information is submitted to receive institute to each follower, each follower After stating information, the modification of respective data is carried out.
Further, in one embodiment of the invention, single node hot drawing mode is in the API hot drawing module When, the downline module is further used for: typing needs the ID of offline API, wherein the ID is by APINAME and uuid group It closes;After the ID for obtaining the API, corresponding API whether there is according to ID inquiry, if it is present it is corresponding to carry out API The update of data, otherwise terminates process.
Further, in one embodiment of the invention, single node hot drawing mode is in the API hot drawing module When, the cancellation module is further used for: typing needs the ID of offline API, wherein the ID is by APINAME and uuid group It closes;After the ID for obtaining the API, corresponding API whether there is according to ID inquiry, if it does, carrying out API corresponds to number According to elimination, otherwise terminate process.
Further, in one embodiment of the invention, multinode hot drawing mode is in the API hot drawing module When, the API hot drawing module is also used to the submission of log, specifically include: when API hot drawing request reach preset it is non- API hot drawing request is forwarded to Leader node by LeaderServer node, and the Leader node is according to the API Heat inserts the journal entries that request generates the operation, and then, the Leader node sends daily record reproduction request to follower, with Synchronize the journal entries;After the Leader node has sent journal entries duplicate requests, the feedback of follower is waited, After receiving the response of partial node of predetermined number, the journal entries are modified.
Further, in one embodiment of the invention, multinode hot drawing mode is in the API hot drawing module When, the API hot drawing module also with the submission for being also used to data, specifically includes: modifying the log in the Leader node The submission of data is carried out after entry, and is sent the journal entries and submitted information to each follower, each follower After receiving the information, the modification of respective data is carried out.
The additional aspect of the present invention and advantage will be set forth in part in the description, and will partially become from the following description Obviously, or practice through the invention is recognized.
Detailed description of the invention
Above-mentioned and/or additional aspect and advantage of the invention will become from the following description of the accompanying drawings of embodiments Obviously and it is readily appreciated that, in which:
Fig. 1 is the API gateway hot plug system based on distributed KV storage system according to one embodiment of the invention Structural schematic diagram;
Fig. 2 is to insert flow chart according to the heat of one embodiment of the invention;
Fig. 3 is to fill in form interface schematic diagram according to the webpage of one embodiment of the invention;
Fig. 4 is to register detailed process schematic diagram according to the web form of one embodiment of the invention;
Fig. 5 is the file register interface schematic diagram according to one embodiment of the invention;
Fig. 6 is to register workflow schematic diagram according to the file of one embodiment of the invention;
Fig. 7 is the online publication schematic diagram of API according to one embodiment of the invention;
Fig. 8 is to insert flow chart according to the multinode heat of one embodiment of the invention;
Fig. 9 is the daily record reproduction schematic diagram under being inserted according to the multinode heat of one embodiment of the invention;
Figure 10 is that the journal entries under being inserted according to the multinode heat of one embodiment of the invention submit modification schematic diagram;
Figure 11 is the synchronous schematic diagram of data under being inserted according to the multinode heat of one embodiment of the invention;
Figure 12 is the single node hot drawing flow chart according to one embodiment of the invention;
Figure 13 is the hot drawing flow chart according to the multinode of one embodiment of the invention;
Figure 14 is according to the daily record reproduction schematic diagram under the hot drawing of the multinode of one embodiment of the invention;
Figure 15 is to submit schematic diagram according to the log modification under the hot drawing of the multinode of one embodiment of the invention;
Figure 16 is according to the synchronous schematic diagram of data under the hot drawing of the multinode of one embodiment of the invention.
Specific embodiment
The embodiment of the present invention is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached The embodiment of figure description is exemplary, it is intended to is used to explain the present invention, and is not considered as limiting the invention.
The API gateway heat based on distributed KV storage system proposed according to embodiments of the present invention is described with reference to the accompanying drawings Plug-in system.
Fig. 1 is the structure of the API gateway hot plug system based on distributed KV storage system of one embodiment of the invention Schematic diagram.
As shown in Figure 1, the API gateway hot plug system 10 based on distributed KV storage system of being somebody's turn to do, hot plug system 10 is logical It crosses distributed deployment and realizes distributed dynamic access micro services, comprising: API heat inserts module 100 and API hot drawing module 200.
Wherein, it includes online submodule 110 and registration submodule 120 that API heat, which inserts module 100, wherein online submodule 110 access for handling the online issuing function of API, and after API success is online;Registering submodule 120 includes webpage List registers submodule 121 and file registers submodule 122, wherein web form is registered submodule 121 and is used for by preset Web form guides user to carry out list registration by predetermined manner;File is registered submodule 122 and is used for by filling in JSON/ YML file carries out file registration.API hot drawing module 200 includes downline module 210 and cancellation module 220, wherein downline module 210 are used for offline API, and forbid accessing after API is offline, to modify or nullify API;Cancellation module 220 is used to insert from heat It pulls out and removes API in system.The system 10 of the embodiment of the present invention has strong consistency, High Availabitity, high-performance, high extended attribute, and And there is fault-tolerant ability, the storage of API is realized using the system can be very convenient, efficient.
It is understood that the API gateway hot plug side based on distributed KV storage system that the embodiment of the present invention proposes Case intends to solve that the above flow definition is complicated, invasive big problem.It includes online submodule 110 that API heat, which inserts module 100: processing The online issuing function of API could formally access after only API success is online;It registers submodule 120: including two Submodule, i.e. web form register submodule 121: guiding user to register step by step by web form with open arms.Text Part registers submodule 122: being registered by filling in JSON/YML file.API hot drawing module 200, comprising: downline module 210: Offline API forbids accessing, to modify or to nullify.Cancellation module 220: the API is formally removed in system 10.
Above-mentioned functional module provides not only support functionally to hot plug, meanwhile, hot plug system passes through distribution Deployment, also provides powerful support to the robustness of system.Often there is "bottleneck" in one-of-a-kind system, in face of low discharge, Of short duration access often shows unsatisfactory without too big problem under high concurrent, in the event of Single Point of Faliure, meeting Lead to that systematic entirety can be damaged or even system directly can not externally provide work.The present invention, which passes through, carries out distributed heat plug, So that system has reliability, high fault tolerance, a server, which obtains delay machine, will not influence other servers.Simultaneity factor is flexible It extends very convenient, dynamic capacity-expanding can be reached, convert machine quantity according to actual needs.Distributed Computer System can be with There is the computing capability of multiple stage computers, so that having faster processing speed than other systems, better performance can be obtained.
The embodiment of the present invention mainly illustrates that through distributed KV storage system, the technology for implementing API hot plug is realized Details is broadly divided into 2 parts, the realization of heat slotting module 100 and hot drawing module 200.Wherein each module mainly includes single node reality Realization in existing (mainly for realization functionally), multinode (mainly for the synchronization of more piece point data).
The API gateway hot plug system 10 based on distributed KV storage system is carried out in detail below in conjunction with specific embodiment It is thin to illustrate.
Module 100 to be inserted to API heat first to be described in detail, it includes the slotting mode of single node heat that API heat, which inserts module 100, and Multinode heat inserts mode, wherein single node only needs the business function in view of core, does not have to be concerned about data consistency.For The heat of one API is inserted, and online and two functional modules of registration are mainly contained.The slotting process of heat is as shown in Figure 2.
Further, in one embodiment of the invention, when API heat inserts module 100 and be in single node heat slotting mode, on Line submodule 110 is further used for: creation API is clicked, with typing API data;Typing API key message, wherein API is crucial Information includes address, port and path of API;API data is deposited in HttpRequestBody with JSON format, and It is submitted to backstage gateway server;API key message is extracted, and is inserted into upper offline identifier, API key message is deposited in In background data base, and according to the unique identification of API Name and uuid generation API.
Specifically, as shown in figure 3, by filling in web form, by a friendly operation interface guide user into Row registration, is easily understood.As shown in figure 4, detailed operation process:
A) user clicks creation API, into the API data typing stage.
B) typing key message includes the address of API, port, path.Three completes API Access address jointly Definition, this is the key message of API routing.
C) API data is deposited in HttpRequestBody with JSON format.It is submitted to backstage gateway server.
D) gateway server normalization data extracts API key message in b), and is inserted into upper offline mark Symbol, it is deposited in background data base jointly with additional information, and unique mark of API is generated according to the additional uuid of API Name Know.
Further, in one embodiment of the invention, API heat insert module be in single node heat insert mode when, register Submodule is further used for: clicking and uploads yaml file;Fill in yaml file, wherein yaml file includes the corresponding name of API Title, the label of API, API provide address, API parameter declaration, the response explanation of API, the port of offer service, API pairs of service One of the requesting method of the request path, API answered and the affiliated type of API are a variety of;It clicks and uploads yaml file, Yaml number According to being sent to background server;Yaml data are normalized in background server, offline identifier in insertion, by Yaml Data are deposited in background data base, and the unique identification of API is generated according to API Name and uuid.
Specifically, by filling in JSON/YML file, the system of submitting to is registered.File template is as shown in Figure 5.Such as Shown in Fig. 6, specifically include:
A) user, which clicks, uploads yaml file.
B) yaml file is filled in, specific data are as shown in table 1.
C) transmitting file in user's click.Yaml data can be sent to backstage.
D) it after background server obtains data, is normalized, offline identifier in insertion, by itself and additional information It deposits in background data base jointly, and generates the unique identification of API according to the additional uuid of API Name.Wherein, table 1 is API phase It closes term and nodal community explains table.
Table 1
Title Description
Name The corresponding title of API
Tags The label of the API
Address The API provides the address of service
Argument The API parameter declaration
Response The response explanation of the API
Port The port of service is provided
Path The corresponding request path of API
Method The requesting method of API
Apitype The affiliated type of API
Further, in one embodiment of the invention, the system 10 of the embodiment of the present invention further include: package module 300 (not being specifically identified in figure).Wherein, package module 300 be used for list registration and/or file registration by data check it After be normalized, to be packaged into unified data.
Specifically, either file registration or list registration, after data check, can all be normalized processing. It is encapsulated into unified data.The data are defined as follows:
Data eventually arrive at destination node by encapsulation, it will generate the identifier of an apiname+uuid as API Unique identification, as key, the data after encapsulation are stored as value into data warehouse.By using additional Custom data is converted to JSON format string by content field, and without being concerned about specific content, it can dynamic Ground increases any field, can even is that the customized object of user, it is only necessary to meet JSON format.It can be serialized and deposit Storage is read.
It is illustrated in fig. 7 shown below, after succeeding in registration, API, which enters, will become creation state.API in creation state not can be carried out visit Ask, need it is online just can be carried out use, first typing APIID, by inquiry, if finding the API, carry out corresponding online behaviour Make, if not finding, terminates process.The operation is uniformly carried out by web interface.
Concrete implementation is: the state of API generates " on " marker by system and is identified, and online operation is It is the operation to the marker.By registration, it is online.One API can normally have accessed.
Above-described embodiment is that API heat inserts situation of the module 100 under single-unit dot pattern, and API heat is inserted module below and is in The case where when multinode heat inserts mode, is illustrated, and the processing on multinode is uniquely a difference in that consistency between node Guarantee.Because data are eventually fallen in as the business operation in single node with single node business operation is.Its overall flow figure It is similar with single node, as shown in Figure 8.
Further, in one embodiment of the invention, when API heat inserts module and be in multinode heat and insert mode, API is warm Slotting module is also used to the submission of log, specifically includes: request arrival, which is inserted, when an API heat presets non-Leader Server node, API heat to be inserted into request and is forwarded to Leader node, Leader node inserts the journal entries that request generates the operation according to API heat, Then, Leader node sends daily record reproduction request to follower, with synchronization log entry;Day has been sent in Leader node After the request of will replicate entries, the feedback of follower is waited, after receiving the response of partial node of predetermined number, by log item Mesh is modified.
In one embodiment of the invention, when API heat inserts module and be in multinode heat and insert mode, the slotting module of API heat is also It for the submission of data, specifically includes: carrying out the submission of data after Leader node modifies journal entries, and send log Entry submits information to each follower, after each follower receives information, carries out the modification of respective data.
Specifically, until data normalization and single node processing are all consistent, because data are not yet on multinode Reach registration center's cluster.But just difference due to using the deployment of multinode, has used load here below For equalization server as entrance, the load-balanced server realization used here is Nginx.Nginx is finally according to load balancing The suitable registration center's server of policy selection, forwarding request.The consistency of registration center's server is based on raft, in cluster only There is a leader.Remaining is follower.Data synchronize as follows:
1, the submission of log
It is illustrated in fig. 9 shown below, inserts request when an API heat and reach some non-Leader Server node, request will be turned It is dealt into Leader, Leader node will not increase corresponding API entry newly immediately, but can generate the journal entries of the operation first (LogEntry), such as ADDkey1API1.Then, Leader is sent to its follower " logreplication " request.It should Log is synchronized.
As shown in Figure 10, after Leader has sent daily record reproduction request, the feedback of follower is waited, when receiving major part After the response of node, actual modification will be carried out.
2, the submission of data
As shown in figure 11, after Leader modification, then follower, logentry can be notified submitted again.Respectively After a follower receives request, the modification of respective data is carried out.
Further, above-described embodiment is that API heat inserts module 100 in the slotting mode of single node heat and the slotting mode of multinode heat Elaborate.The feelings that single node hot drawing mode will be in API hot drawing module 200 and when in multinode hot drawing mode below Condition is described in detail.As shown in figure 12, the hot drawing in single node is inserted similar with heat, mainly includes nullifying and offline two Functional module.
Further, in one embodiment of the invention, when API hot drawing module is in single node hot drawing mode, under Wire module is further used for: typing needs the ID of offline API, wherein ID is combined by APINAME and uuid;Obtaining API's After ID, corresponding API whether there is according to ID inquiry, if it is present carrying out the update of API corresponding data, otherwise terminate to flow Journey.
Specifically, as shown in figure 12, offline process principle is that typing obtains needing offline API_ID, by APINAME+uuid combination, ensure that global uniqueness.After obtaining the id, the corresponding API inquiry of the id is carried out first, if finding , then the update of API corresponding data is carried out, process is otherwise terminated.
Further, in one embodiment of the invention, when API hot drawing module is in single node hot drawing mode, note Pin module is further used for: typing needs the ID of offline API, wherein ID is combined by APINAME and uuid;Obtaining API's After ID, corresponding API whether there is according to ID inquiry, if it does, carrying out the elimination of API corresponding data, otherwise terminate process.
Specifically, as shown in figure 12, the principle of logout flow path is that typing obtains needing offline API_ID, by APINAME+uuid combination, ensure that global uniqueness.After obtaining the id, the corresponding API inquiry of the id is carried out first, if finding , then the elimination of API corresponding data is carried out, process is otherwise terminated.
Further, in one embodiment of the invention, when API hot drawing module is in multinode hot drawing mode, API Hot drawing module is also used to the submission of log, specifically includes: presetting non-Leader Server section when an API hot drawing request reaches API hot drawing request is forwarded to Leader node by point, and Leader node inserts the log item that request generates the operation according to API heat Mesh, then, Leader node send daily record reproduction request to follower, with synchronization log entry;It is sent in Leader node After complete journal entries duplicate requests, the feedback of follower is waited, after receiving the response of partial node of predetermined number, by day Will entry is modified.
In one embodiment of the invention, when API hot drawing module is in multinode hot drawing mode, API hot drawing module It also with the submission for being also used to data, specifically includes: carrying out the submission of data after Leader node modifies journal entries, concurrently It send journal entries to submit information to each follower, after each follower receives information, carries out repairing for respective data Change.
Specifically, the hot drawing of multinode is equally inserted similar with multinode heat, need to guarantee the consistency of each operation.Its Flow chart is illustrated in fig. 13 shown below, followed by analysis.It the hot drawing of multinode and is also required to a load-balanced server and will ask It asks and is distributed to multi-node cluster.Data flowing when API data to be treated comes multinode is as follows:
1, the submission of log
As shown in figure 14, when an API hot drawing request reaches some non-Leader Server node, request will be turned It is dealt into Leader, Leader node will not modify corresponding API entry immediately, but can generate the journal entries of the operation first (Log Entry), such as delkey1.Then, Leader is sent to its follower " log replication " request, by this Log is synchronized.
As shown in figure 15, after Leader has sent daily record reproduction request, the feedback of follower is waited, when receiving major part After the response of node, actual modification will be carried out.
2, the submission modified
As shown in figure 16, after Leader modification, then follower, logentry can be notified submitted again.Respectively After a follower receives request, actual modification is carried out.
It should be noted that the hot plug system of the embodiment of the present invention can reach distributed dynamic access micro services, and Function and performance issue are solved simultaneously, and the service field stored can be in the case where not modifying table structure, flexible earthquake State expands;Flexible simultaneously, polymorphic type registration scenarios.
The API gateway hot plug system based on distributed KV storage system proposed according to embodiments of the present invention, using base In the K/V storage form storage service of consul, zero invasion is belonged to for service.The popular technology of industry at present, such as Eureka, service registration are not transparent.Need to enter a small number of modifications of the internal progress of service even to service also particular requirement (for example service need to add@EnableDiscoveryClient note).And based on K/V by globally unique key service pair It should get up, it can be with the information of dynamic memory service in v.Immediately change, comes into force immediately.Concern specific service is not required to realize.It realizes Mechanism is understandable, and practical operation gets up not needing multi-configuration.Other than eureka, there are also a lot of other Related products, Such as kong, it is based on nginx.It needs skilled operation to Service-side tools such as nginx, has one for user's use Set threshold.And the K/V form that this programme is taken, operation complexity is greatly reduced, user only needs to fill in API basic information, Remaining information is by system automatically generated.A unified entrance API is finally generated to access for user.And for API net For closing hot plug system, the support to distributed deployment is extraordinary, internal component such as service register center, then outside The entire API gateway hot plug system in portion can carry out horizontal dynamic extension according to demand, easy-to-use.
In addition, term " first ", " second " are used for descriptive purposes only and cannot be understood as indicating or suggesting relative importance Or implicitly indicate the quantity of indicated technical characteristic.Define " first " as a result, the feature of " second " can be expressed or Implicitly include at least one this feature.In the description of the present invention, the meaning of " plurality " is at least two, such as two, three It is a etc., unless otherwise specifically defined.
In the present invention unless specifically defined or limited otherwise, fisrt feature in the second feature " on " or " down " can be with It is that the first and second features directly contact or the first and second features pass through intermediary mediate contact.Moreover, fisrt feature exists Second feature " on ", " top " and " above " but fisrt feature be directly above or diagonally above the second feature, or be merely representative of First feature horizontal height is higher than second feature.Fisrt feature can be under the second feature " below ", " below " and " below " One feature is directly under or diagonally below the second feature, or is merely representative of first feature horizontal height less than second feature.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office It can be combined in any suitable manner in one or more embodiment or examples.In addition, without conflicting with each other, the skill of this field Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples It closes and combines.
Although the embodiments of the present invention has been shown and described above, it is to be understood that above-described embodiment is example Property, it is not considered as limiting the invention, those skilled in the art within the scope of the invention can be to above-mentioned Embodiment is changed, modifies, replacement and variant.

Claims (10)

1. a kind of API gateway hot plug system based on distributed KV storage system, which is characterized in that the hot plug system is logical It crosses distributed deployment and realizes distributed dynamic access micro services, comprising: API heat inserts module and API hot drawing module, wherein
It includes online submodule and registration submodule that the API heat, which inserts module, wherein the online submodule is for handling API Online issuing function, and the API success it is online after access;The registration submodule includes web form registration Module and file register submodule, wherein
The web form registration submodule is used to guide user to carry out list by predetermined manner by preset web form Registration;The file registration submodule is used to carry out file registration by filling in JSON/YML file;
The API hot drawing module includes downline module and cancellation module, wherein and the downline module is used for the offline API, and Forbid accessing after the API is offline, to modify or nullify the API;The cancellation module is used for from the hot plug system The API is removed in system.
2. the API gateway hot plug system according to claim 1 based on distributed KV storage system, which is characterized in that When the API heat inserts module and be in single node heat slotting mode, the online submodule is further used for:
Creation API is clicked, with typing API data;
Typing API key message, wherein the API key message includes address, port and path of API;
The API data is deposited in HttpRequestBody with JSON format, and is submitted to backstage gateway server;
The API key message is extracted, and is inserted into upper offline identifier, the API key message is deposited in into back-end data In library, and according to the unique identification of API Name and uuid generation API.
3. the API gateway hot plug system according to claim 2 based on distributed KV storage system, which is characterized in that When the API heat inserts module and be in single node heat slotting mode, the registration submodule is further used for:
It clicks and uploads yaml file;
Fill in the yaml file, wherein the yaml file includes the corresponding title of API, the label of API, API offer service Address, API parameter declaration, API response explanation, provide service port, the corresponding request path of API, API requesting party One of method and the affiliated type of API are a variety of;
It clicks and uploads the yaml file, Yaml data transmission to background server;
The Yaml data are normalized in the background server, offline identifier in insertion, by the Yaml number According to depositing in background data base, and generate according to API Name and uuid the unique identification of API.
4. the API gateway hot plug system according to claim 1 based on distributed KV storage system, which is characterized in that Further include:
Package module, for place to be normalized after list registration and/or file registration are by data check Reason, to be packaged into unified data.
5. the API gateway hot plug system according to claim 1 based on distributed KV storage system, which is characterized in that When the API heat inserts module and be in multinode heat and insert mode, the slotting module of the API heat is also used to the submission of log, specifically includes:
Request arrival is inserted when an API heat and presets non-Leader Server node, and the API heat is inserted into request and is forwarded to Leader node, the Leader node inserts the journal entries that request generates the operation according to the API heat, then, described Leader node sends daily record reproduction request to follower, to synchronize the journal entries;
After the Leader node has sent journal entries duplicate requests, the feedback of follower is waited, it is default a when receiving After the response of several partial nodes, the journal entries are modified.
6. the API gateway hot plug system according to claim 5 based on distributed KV storage system, which is characterized in that When the API heat inserts module and be in multinode heat and insert mode, the slotting module of the API heat is also used to the submission of data, specifically includes:
The submission of data is carried out after the Leader node modifies the journal entries, and is sent the journal entries and submitted Information after each follower receives the information, carries out the modification of respective data to each follower.
7. the API gateway hot plug system according to claim 1 based on distributed KV storage system, which is characterized in that When the API hot drawing module is in single node hot drawing mode, the downline module is further used for:
Typing needs the ID of offline API, wherein the ID is combined by APINAME and uuid;
After the ID for obtaining the API, corresponding API whether there is according to ID inquiry, if it is present carrying out API pairs The update for answering data, otherwise terminates process.
8. the API gateway hot plug system according to claim 7 based on distributed KV storage system, which is characterized in that When the API hot drawing module is in single node hot drawing mode, the cancellation module is further used for:
Typing needs the ID of offline API, wherein the ID is combined by APINAME and uuid;
After the ID for obtaining the API, corresponding API whether there is according to ID inquiry, if it does, it is corresponding to carry out API The elimination of data, otherwise terminates process.
9. the API gateway hot plug system according to claim 1 based on distributed KV storage system, which is characterized in that When the API hot drawing module is in multinode hot drawing mode, the API hot drawing module is also used to the submission of log, specific to wrap It includes:
Non- Leader Server node is preset when an API hot drawing request reaches, API hot drawing request is forwarded to Leader node, the Leader node inserts the journal entries that request generates the operation according to the API heat, then, described Leader node sends daily record reproduction request to follower, to synchronize the journal entries;
After the Leader node has sent journal entries duplicate requests, the feedback of follower is waited, it is default a when receiving After the response of several partial nodes, the journal entries are modified.
10. the API gateway hot plug system according to claim 9 based on distributed KV storage system, which is characterized in that When the API hot drawing module is in multinode hot drawing mode, the API hot drawing module is also with the submission for being also used to data, tool Body includes:
The submission of data is carried out after the Leader node modifies the journal entries, and is sent the journal entries and submitted Information after each follower receives the information, carries out the modification of respective data to each follower.
CN201811633587.4A 2018-12-29 2018-12-29 API gateway hot plug system based on distributed KV storage system Active CN109710223B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811633587.4A CN109710223B (en) 2018-12-29 2018-12-29 API gateway hot plug system based on distributed KV storage system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811633587.4A CN109710223B (en) 2018-12-29 2018-12-29 API gateway hot plug system based on distributed KV storage system

Publications (2)

Publication Number Publication Date
CN109710223A true CN109710223A (en) 2019-05-03
CN109710223B CN109710223B (en) 2021-03-12

Family

ID=66259460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811633587.4A Active CN109710223B (en) 2018-12-29 2018-12-29 API gateway hot plug system based on distributed KV storage system

Country Status (1)

Country Link
CN (1) CN109710223B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083338A (en) * 2019-05-27 2019-08-02 广东金赋科技股份有限公司 Service system based on intelligent gateway
CN110971472A (en) * 2019-12-31 2020-04-07 浪潮云信息技术有限公司 AWS style API secondary route forwarding method based on Kong
CN111431999A (en) * 2020-03-23 2020-07-17 杭州趣维科技有限公司 Cloud function distributed system based on Paxos algorithm

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740408A (en) * 2016-01-28 2016-07-06 东软集团股份有限公司 Hadoop cluster calling method and device
CN106453288A (en) * 2016-09-29 2017-02-22 上海和付信息技术有限公司 Asynchronous mode supporting distributed micro service framework system and implementation method thereof
CN106533944A (en) * 2016-12-29 2017-03-22 金蝶软件(中国)有限公司 Distributed API gateway, management method and management system
CN107807859A (en) * 2017-10-24 2018-03-16 郑州云海信息技术有限公司 A kind of FaaS frameworks and its method of work, the system of exploitation O&M FaaS frameworks
US20180107526A1 (en) * 2016-06-13 2018-04-19 1Qb Information Technologies Inc. Methods and systems for quantum ready and quantum enabled computations
CN108234653A (en) * 2018-01-03 2018-06-29 马上消费金融股份有限公司 A kind of method and device of processing business request
CN108965007A (en) * 2018-07-19 2018-12-07 北京车和家信息技术有限公司 API gateway interface configures update method and device
US20180357114A1 (en) * 2017-03-17 2018-12-13 Accenture Global Solutions Limited Extensible single point orchestration system for application program interfaces
CN109067862A (en) * 2018-07-23 2018-12-21 北京邮电大学 The method and apparatus of API Gateway automatic telescopic

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740408A (en) * 2016-01-28 2016-07-06 东软集团股份有限公司 Hadoop cluster calling method and device
US20180107526A1 (en) * 2016-06-13 2018-04-19 1Qb Information Technologies Inc. Methods and systems for quantum ready and quantum enabled computations
CN106453288A (en) * 2016-09-29 2017-02-22 上海和付信息技术有限公司 Asynchronous mode supporting distributed micro service framework system and implementation method thereof
CN106533944A (en) * 2016-12-29 2017-03-22 金蝶软件(中国)有限公司 Distributed API gateway, management method and management system
US20180357114A1 (en) * 2017-03-17 2018-12-13 Accenture Global Solutions Limited Extensible single point orchestration system for application program interfaces
CN107807859A (en) * 2017-10-24 2018-03-16 郑州云海信息技术有限公司 A kind of FaaS frameworks and its method of work, the system of exploitation O&M FaaS frameworks
CN108234653A (en) * 2018-01-03 2018-06-29 马上消费金融股份有限公司 A kind of method and device of processing business request
CN108965007A (en) * 2018-07-19 2018-12-07 北京车和家信息技术有限公司 API gateway interface configures update method and device
CN109067862A (en) * 2018-07-23 2018-12-21 北京邮电大学 The method and apparatus of API Gateway automatic telescopic

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
(西)维克托•法西克: "《微服务运维实战》", 30 June 2016, 华中科技大学出版社 *
大坨-童鞋: ""如何架构一个合适的企业API网关"", 《HTTPS://BLOG.CSDN.NET/ZHENGPEITAO/ARTICLE/DETAILS/72722301》 *
李国莉: "基于JAVA的可插拔网管平台的框架研究", 《计算机工程与应用》 *
黄红元主编: "《上海证券交易所联合研究报告 2013 证券信息前沿技术专集》", 31 December 2014, 上海人民出版社 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083338A (en) * 2019-05-27 2019-08-02 广东金赋科技股份有限公司 Service system based on intelligent gateway
CN110083338B (en) * 2019-05-27 2023-12-22 广东金赋科技股份有限公司 Service system based on intelligent gateway
CN110971472A (en) * 2019-12-31 2020-04-07 浪潮云信息技术有限公司 AWS style API secondary route forwarding method based on Kong
CN110971472B (en) * 2019-12-31 2022-10-11 浪潮云信息技术股份公司 AWS style API secondary route forwarding method based on Kong
CN111431999A (en) * 2020-03-23 2020-07-17 杭州趣维科技有限公司 Cloud function distributed system based on Paxos algorithm
CN111431999B (en) * 2020-03-23 2022-11-25 杭州小影创新科技股份有限公司 Cloud function distributed system based on Paxos algorithm

Also Published As

Publication number Publication date
CN109710223B (en) 2021-03-12

Similar Documents

Publication Publication Date Title
US11711420B2 (en) Automated management of resource attributes across network-based services
CN103390041B (en) A kind of method and system that data, services is provided based on middleware
CN102640151B (en) Transformed data recording method and system
US7493518B2 (en) System and method of managing events on multiple problem ticketing system
US10733172B2 (en) Method and computing device for minimizing accesses to data storage in conjunction with maintaining a B-tree
CN109710223A (en) API gateway hot plug system based on distributed KV storage system
US20220051187A1 (en) System and method for anomaly detection and deduplication of electronic data feeds
US10387387B2 (en) Enabling multi-tenant access to respective isolated data sets organized using different application schemas
WO2017113962A1 (en) Method of accessing distributed database and device providing distributed data service
CN113381866A (en) Service calling method, device, equipment and storage medium based on gateway
CN109359281A (en) Dynamic list generation method and device
US7908243B2 (en) Considering transient data also in reports generated based on data eventually stored in a data-warehouse
CN108388623A (en) ER relationships generation method, device, computer equipment and storage medium
CN102355499A (en) Cloud computing system
US9747339B2 (en) Server-based management for querying eventually-consistent database
CN108139927A (en) The routing based on action of affairs in online transaction processing system
CN104239412B (en) The data mapping to thesaurus and correlation technique, system and computer-readable medium are applied in data repository
US11048547B2 (en) Method and system for routing and executing transactions
CN106341402B (en) Treating method and apparatus based on multi rack structure distributed caching
CN107895044A (en) A kind of database data processing method, device and system
CN108958933A (en) Configuration parameter update method, device and the equipment of task performer
US20100228749A1 (en) Open types for distributed systems
EP2479675A1 (en) Database management device using key-value store with attributes, and key-value-store structure caching-device therefor
CN113450224B (en) Transaction processing method, device, equipment and storage medium based on UTXO model
CN110347654A (en) A kind of method and apparatus of online cluster features

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