CN111629029A - Service publishing method and system - Google Patents

Service publishing method and system Download PDF

Info

Publication number
CN111629029A
CN111629029A CN202010303999.2A CN202010303999A CN111629029A CN 111629029 A CN111629029 A CN 111629029A CN 202010303999 A CN202010303999 A CN 202010303999A CN 111629029 A CN111629029 A CN 111629029A
Authority
CN
China
Prior art keywords
control information
api gateway
service
gateway
target 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.)
Granted
Application number
CN202010303999.2A
Other languages
Chinese (zh)
Other versions
CN111629029B (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.)
Kingdee Software China Co Ltd
Original Assignee
Kingdee Software China 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 Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CN202010303999.2A priority Critical patent/CN111629029B/en
Publication of CN111629029A publication Critical patent/CN111629029A/en
Application granted granted Critical
Publication of CN111629029B publication Critical patent/CN111629029B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways

Abstract

The application relates to a service publishing method and system. When receiving first control information sent by a terminal, a gateway console forwards the first control information to at least two API gateway clusters; the first control information is generated according to a service publishing operation acting on the terminal; when the at least two API gateway clusters receive the first control information, the first control information is stored in the databases of the at least two API gateway clusters, and service release completion information is returned to the gateway console; and when receiving the service publishing completion information, the gateway console forwards the service publishing completion information to the terminal. The method can improve the service publishing efficiency.

Description

Service publishing method and system
Technical Field
The present application relates to the field of computer technologies, and in particular, to a service publishing method and system.
Background
The control console of traditional public cloud API gateway is generally deployed in API gateway cluster, the gateway generally adopts tight coupling framework, the gateway control console and load balancer LBS are put in same gateway cluster, expandability is poor, when the tenant publishes service on a plurality of public cloud multi-region gateway clusters, a plurality of corresponding control consoles and load balancing need to be deployed, there are a plurality of sets of management systems, the control information generated when the control console in each public cloud API gateway cluster publishes service to the user respectively sends to each API gateway node in the API gateway cluster, data can not be shared, the management difficulty is big, it is inconvenient to use. And when the console sends the control information to each API gateway node, the console needs to acquire the IP address of each API gateway node first, and then can send the control information to the API gateway node corresponding to each IP address. Therefore, under the traditional public cloud API gateway architecture, the user service release process of the multi-region multi-gateway cluster is complicated, and the service release efficiency is influenced.
Disclosure of Invention
Therefore, it is necessary to provide a service publishing method and system for solving the technical problem of low service publishing efficiency under the conventional gateway architecture.
A method of service publication, the method comprising:
when receiving first control information sent by a terminal, a gateway console forwards the first control information to at least two API gateway clusters; the first control information is generated according to a service publishing operation acting on the terminal;
when the at least two API gateway clusters receive the first control information, the first control information is stored in the databases of the at least two API gateway clusters, and service release completion information is returned to the gateway console;
and when receiving the service publishing completion information, the gateway console forwards the service publishing completion information to the terminal.
In one embodiment, the method further comprises:
and when receiving the first control information sent by the terminal, the gateway console stores the first control information into a local database of the gateway console.
In one embodiment, the method further comprises:
and when the first control information is stored in the database, the server corresponding to the database sends the first control information to the API gateway nodes in the at least two API gateway clusters for caching.
In one embodiment, the method further comprises:
and when the target API gateway cluster receives the service request sent by the terminal, the API gateway node in the target API gateway cluster forwards the service request to a service server according to the stored second control information.
In one embodiment, the method further comprises:
when a target API gateway cluster receives a service request sent by the terminal, a load balancer in the target API gateway cluster determines a target API gateway node and sends the service request to the target API gateway node; the target API gateway cluster belongs to the at least two API gateway clusters;
and when receiving the service request, the target API gateway node forwards the service request to a service server according to the stored second control information.
In one embodiment, before sending the service request to the target API gateway node, the method further comprises:
the target API gateway cluster acquires third control information stored in the database;
judging whether the saving time of the second control information is the same as the saving time of the third control information or not;
and if so, the load balancer in the target API gateway cluster executes the step of sending the service request to the target API gateway node.
In one embodiment, the method further comprises:
if the storage time of the second control information is different from the storage time of the third control information, the target API gateway cluster sends the third control information to the target API gateway node;
and caching the third control information when the target API gateway node receives the third control information.
In one embodiment, before the third control information includes the first control information, the method further includes, before the target API gateway cluster obtains the third control information stored in the database:
the target API gateway cluster judges whether the database stores the first control information or not;
if not, the target API gateway cluster sends a control information acquisition request to the gateway console;
when receiving the control information acquisition request, the gateway console reads the first control information from a local database of the gateway console and sends the first control information to the target API gateway cluster;
and when the target API gateway cluster receives the first control information, updating the first control information to the database.
A service publishing system, the system comprising:
the gateway control console is used for forwarding first control information to at least two API gateway clusters when the first control information sent by the terminal is received; the first control information is generated according to a service publishing operation acting on the terminal;
the at least two API gateway clusters are used for storing the first control information to databases of the at least two API gateway clusters when the first control information is received, and returning service release completion information to the gateway console;
and the gateway console is further configured to forward the service release completion information to the terminal when receiving the service release completion information.
In one embodiment, the gateway console is further configured to:
and when the first control information sent by the terminal is received, storing the first control information into a local database of the gateway console.
In one embodiment, the at least two API gateway clusters comprise a Redis server:
and the Redis server is used for sending the first control information to the API gateway nodes in the at least two API gateway clusters for caching when the first control information is stored in the Redis database.
In an embodiment, the gateway nodes in the at least two API gateway clusters are provided with buffers, and the buffers are used for storing the first control information sent by the server corresponding to the database.
In one embodiment, the at least two API gateway clusters further comprise a load balancer and an API gateway node:
the target API gateway cluster is used for determining a target API gateway node through a load balancer in the target API gateway cluster when receiving a service request sent by the terminal, and sending the service request to the target API gateway node; the target API gateway cluster belongs to the at least two API gateway clusters; the target API gateway node belongs to an API gateway node in the target API gateway cluster;
and the target API gateway node is used for forwarding the service request to a service server according to the stored second control information when receiving the service request.
In one embodiment, the target API gateway cluster is further configured to obtain third control information stored in the database; judging whether the saving time of the second control information is the same as the saving time of the third control information or not;
and the load balancer is further configured to execute the step of sending the service request to the target API gateway node if the saving time of the second control information is the same as the saving time of the third control information.
In an embodiment, the target API gateway cluster is further configured to send the third control information to the target API gateway node if the saving time of the second control information is different from the saving time of the third control information;
the target API gateway node is further configured to cache the third control information when receiving the third control information.
In one embodiment, the third control information includes the first control information,
the target API gateway cluster is also used for judging whether the database stores the first control information or not;
the target API gateway cluster is further used for sending a control information acquisition request to the gateway console if the database does not store the first control information,
the gateway console is further configured to read the first control information from a local database of the gateway console and send the first control information to the target API gateway cluster when receiving the control information acquisition request;
the target API gateway cluster is further configured to update the first control information to the database when receiving the first control information.
A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of any of the methods described above when executing the computer program.
According to the service publishing method and system, when receiving first control information sent by the terminal, the gateway console forwards the first control information to the at least two API gateway clusters, wherein the first control information is generated according to service publishing operation acting on the terminal; when receiving the first control information, the at least two API gateway clusters store the first control information to databases of the at least two API gateway clusters and return service release completion information to the gateway console; the gateway console forwards the service publishing completion information to the terminal when receiving the service publishing completion information, so that service publishing can be performed in a plurality of API gateway clusters through one gateway console without the gateway console acquiring the IP addresses of all API gateway nodes in all the API gateway clusters, and the service publishing efficiency is improved.
Drawings
FIG. 1 is a diagram of an application environment for a service publishing method in one embodiment;
FIG. 2 is a flow diagram that illustrates a method for service publishing in one embodiment;
FIG. 3 is a flow chart illustrating a service request forwarding step in one embodiment;
FIG. 4 is a flowchart illustrating the verifying step of the cached data in another embodiment;
FIG. 5 is a diagram of an API gateway architecture in one embodiment;
FIG. 6 is a timing diagram of a service publishing process in one embodiment;
FIG. 7 is a diagram illustrating a service request forwarding process in one embodiment;
FIG. 8 is a block diagram showing the construction of a service delivery apparatus according to one embodiment;
fig. 9 is a block diagram showing the construction of a service distribution apparatus in another embodiment;
FIG. 10 is a diagram showing an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The service publishing method provided by the application can be applied to the application environment shown in fig. 1. The application environment includes a terminal 102, a gateway console 104, at least two API gateway clusters 106, and a service server 108, where the terminal 102 communicates through the gateway console 104, the at least two API gateway clusters 106, and the service server 108. When receiving the first control information sent by the terminal 102, the gateway console 104 forwards the first control information to at least two API gateway clusters 106; the first control information is generated according to a service issuing operation that acts on the terminal 102; when receiving the first control information, the at least two API gateway clusters 106 store the first control information in the databases of the at least two API gateway clusters, and return service release completion information to the gateway console 104; the gateway console 104, upon receiving the service delivery completion information, forwards the service delivery completion information to the terminal 102. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, the gateway console 104 and the at least two API gateway clusters 106 may be deployed on the same server or on multiple servers, and the service server 108 may be implemented by an independent server or a server cluster formed by multiple servers.
In one embodiment, as shown in fig. 2, a service publishing method is provided, which is described by taking the application environment in fig. 1 as an example, and includes the following steps:
s202, when receiving first control information sent by a terminal, a gateway console forwards the first control information to at least two API gateway clusters; the first control information is generated according to a service delivery operation acting on the terminal.
The gateway console provides a uniform management interface for users through the terminal. The first control information is generated according to a service publishing operation acted on the terminal, and the service publishing operation can be related operations of setting and maintaining an interface, a component and system basic information, and specifically comprises operations of publishing the service and the interface, setting interface calling authority, generating an application and a key and the like performed on a gateway console management interface displayed on the terminal. The at least two API gateway clusters may be multiple API gateway clusters deployed in multiple clouds or multiple regions, and the at least two API gateway clusters are mainly responsible for receiving a service request of a terminal, and performing interface forwarding, authentication, current limiting, fusing, quota and black-and-white list limiting according to the received service request.
In one embodiment, a user performs a service publishing operation through a management interface of a gateway console displayed on a terminal, the terminal generates first control information according to the detected service publishing operation when detecting the service publishing operation of the user and sends the first control information to the gateway console, and the gateway console forwards the first control information to at least two API gateway clusters corresponding to the gateway console after receiving the first control information. Specifically, after receiving the first control information, the terminal acquires domain names of at least two corresponding API gateway clusters, and sends the first control information to the API gateway cluster corresponding to each domain name.
In one embodiment, after receiving the first control information, the gateway control platform further stores the first control information in a local database of the gateway control platform, where the database of the gateway control platform stores a plurality of pieces of control information, the plurality of pieces of control information are pieces of control information sent to the gateway control platform by the terminal each time the user performs a service distribution operation, and the pieces of control information are also generated according to the service distribution operation acting on the terminal.
And S204, when the at least two API gateway clusters receive the first control information, storing the first control information into the databases of the at least two API gateway clusters, and returning service release completion information to the gateway console.
The database may be a Redis database, where the Redis database is used to store the first control information received by the corresponding API gateway cluster, other control information sent by the console, and state information of each API gateway node in the API gateway cluster, so as to coordinate the state of each API gateway node in each API gateway cluster. The API gateway nodes are used for forwarding the service requests received by the API gateway cluster to the service server, and in order to ensure the reliability of each API gateway cluster, a load balancer and a plurality of API gateway nodes are deployed in each API gateway cluster in the application, so that when the service requests received by the API gateway cluster are large in quantity, each service request is shared to each API gateway node through the load balancer to be forwarded.
The service publishing completion information is information for indicating completion of service publishing, specifically may include a service publishing completion identifier, and may be a corresponding code for indicating completion of service publishing.
In one embodiment, when receiving first control information sent by a gateway console, at least two API gateway clusters store the first control information in the Redis databases of the at least two API gateway clusters, and return service publishing completion information to the gateway console.
In one embodiment, after the at least two API gateway clusters store the first control information in the Redis databases of the at least two API gateway clusters, the Redis server corresponding to the Redis database sends the first control information to the API gateway nodes in the at least two API gateway clusters, and the API gateway nodes cache the first control information after receiving the first control information. Wherein the API gateway node may also cache other control information sent by the Redis database.
S206, when receiving the service distribution completion information, the gateway console forwards the service distribution completion information to the terminal.
In one embodiment, the gateway console forwards the service distribution completion information to the terminal when receiving the received service distribution completion information returned by the at least two API gateway clusters, and the terminal generates a service distribution completion prompt according to the service distribution completion information after receiving the service distribution completion information and displays the service distribution completion prompt on a gateway console management interface on the terminal to prompt the user that service distribution is completed.
In the above embodiment, when receiving first control information sent by a terminal, a gateway console forwards the first control information to at least two API gateway clusters, where the first control information is generated according to a service publishing operation acting on the terminal; when receiving the first control information, the at least two API gateway clusters store the first control information to databases of the at least two API gateway clusters and return service release completion information to the gateway console; the gateway console forwards the service publishing completion information to the terminal when receiving the service publishing completion information, so that service publishing can be performed in a plurality of API gateway clusters through one gateway console without the gateway console acquiring the IP addresses of all API gateway nodes in all the API gateway clusters, and the service publishing efficiency is improved.
In one embodiment, when the target API gateway cluster receives the service request sent by the terminal, the API gateway node in the target API gateway cluster forwards the service request to the service server according to the stored second control information. The target API gateway cluster corresponds to the service server requested to be accessed by the service request; the target API gateway cluster belongs to at least two API gateway clusters, and the target API gateway node belongs to an API gateway node in the target API gateway cluster; the second control information is control information stored on the API gateway node, and specifically includes a forwarding rule.
In one embodiment, as shown in fig. 3, the service publishing method further includes the following steps:
s302, when the target API gateway cluster receives a service request sent by the terminal, a load balancer in the target API gateway cluster determines a target API gateway node and sends the service request to the target API gateway node.
In one embodiment, after the service release is completed, a user operates an application on a terminal, the terminal generates a corresponding service request according to the user operation and sends the service request to a target API gateway cluster, and when the target API gateway cluster receives the service request sent by the terminal, a load balancer in the target API gateway cluster determines a target API gateway node and sends the service request to the target API gateway node.
And S304, when the target API gateway node receives the service request, forwarding the service request to the service server according to the stored second control information.
In one embodiment, the target API gateway node, upon receiving the service request, forwards the service request to the service server according to the second control information stored on the target API gateway node. The service request is forwarded to the service server according to the second control information stored in the target API gateway node, specifically, the forwarding rule stored in the target API gateway node is matched according to the received service request, and the service request is forwarded to the service server based on the matched forwarding rule.
In one embodiment, after receiving a service request forwarded by a target gateway cluster, a service server calls a relevant interface according to the service request, processes the service request to obtain a service processing result, and returns the service processing result to the target API gateway cluster, and after receiving the processing result returned by the service server, the target API gateway cluster returns the service processing result to a terminal.
In the above embodiment, when the target API gateway cluster receives a service request sent by the terminal, the load balancer in the target API gateway cluster determines a target API gateway node, and sends the service request to the target API gateway node, and when the target API gateway node receives the service request, the service request is forwarded to the service server according to the stored second control information, so that when the service request volume is large, each service request can be distributed to different API gateway nodes for forwarding through load balancing in time, and further, the processing efficiency of the service request is improved.
In an embodiment, as shown in fig. 4, before the target API gateway cluster sends the service request to the target API gateway node, the service publishing method further includes the following steps:
s402, the target API gateway cluster acquires third control information stored in the database.
The third control information is each control information stored in a Redis database of the target API gateway cluster, and each control information is control information sent by the gateway console and received by each service release, and specifically includes the first control information.
In an embodiment, before S402, the service publishing method further includes the following steps: the target API gateway cluster judges whether the Redis database stores first control information or not; if not, the target API gateway cluster sends a control information acquisition request to the gateway console, the gateway console reads the first control information from a local database of the gateway console when receiving the control information acquisition request, and sends the first control information to the target API gateway cluster, and the target API gateway cluster updates the first control information to a Redis database when receiving the first control information.
In an embodiment, before S402, the service publishing method further includes the following steps: the target API gateway cluster judges whether the database stores first control information or not; if yes, go to S402.
S404 determines whether the time when the second control information is stored is the same as the time when the third control information is stored.
And S406, if yes, the load balancer in the target API gateway cluster executes the step of sending the service request to the target API gateway node.
In one embodiment, if the saving time of the second control information is the same as the saving time of the third control information, the second control information is considered to contain the third control information, and the load balancer in the target API gateway cluster performs the step of sending the service request to the target API gateway node.
In one embodiment, if the saving time of the second control information is different from the saving time of the third control information, the target API gateway cluster sends the third control information to the target API gateway node; and when the target API gateway node receives the third control information, caching the third control information so as to obtain second control information containing the third control information.
In one embodiment, the second control information stored in the Redis database is updated or notified of the age using an atom, thereby ensuring that the second control information stored in the Redis database is consistent with the control information in the local database of the gateway console.
In the above embodiment, the API gateway cluster updates the second control information stored in the database and the third control information of the target API gateway node, so that the target API gateway node timely stores the control information for forwarding the service request, and the target API gateway node can forward the service request timely, thereby improving the processing efficiency of the service request.
Fig. 5 is an architecture diagram of a gateway console and at least two API gateway clusters, fig. 6 is a timing diagram corresponding to a service publishing process in the service publishing method, fig. 7 is a flowchart corresponding to a service request forwarding process in the service publishing method, the service publishing process in the embodiment is described below with reference to fig. 5 and 6, and the service request forwarding process in the embodiment is described below with reference to fig. 5 and 7.
Referring to fig. 5 and 6, after a user performs a service publishing operation on a gateway console operation interface displayed by a terminal, the terminal generates first control information according to the service publishing operation and sends the first control information to the gateway console; the gateway console sends the received first control information to each API gateway cluster, and stores the received first control information into mysql; after receiving the first control information, each API gateway cluster stores the first control information into a corresponding Redis database and returns service release completion information to the gateway console; a Redis server corresponding to the Redis database sends the first control information to each API gateway node in the API gateway cluster for caching; and after receiving the service publishing completion information, the gateway console forwards the service publishing completion information to the terminal.
Referring to fig. 5 and 7, after the service release is completed, the user operates the application running on the terminal, the terminal generates a corresponding service request according to the user operation and sends the service request to the target API gateway cluster, and when the target API gateway cluster receives the service request sent by the terminal, the target API gateway node is determined by a load balancer in the target API gateway cluster; then judging whether the Redis database stores first control information or not, if not, sending a control information acquisition request to a gateway console by a target API gateway cluster, reading first control information from a local database of the gateway console when the gateway console receives the control information acquisition request, sending the first control information to the target API gateway cluster, and updating the first control information to the Redis database when the target API gateway cluster receives the first control information; then the target API gateway cluster acquires second control information of the Redis database, and when the storage time of third control information stored by the target API gateway node is different from the storage time of the second control information of the Redis database, the target API gateway cluster sends the third control information to the target API gateway node; when the target API gateway node receives the third control information, caching the third control information so as to obtain second control information containing the third control information; when the storage time of third control information stored by the target API gateway node is the same as the storage time of second control information of the Redis database, the target API gateway cluster sends the service request to the target API gateway node, and when the target API gateway node receives the service request, the target API gateway node forwards the service request to the service server according to the stored second control information and receives a forwarding result returned by the service server when the forwarding is successful.
It should be understood that although the various steps in the flow charts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 8, there is provided a service publishing system comprising: a gateway console 802, at least two API gateway clusters 804, wherein:
the gateway console 802 is configured to forward first control information to at least two API gateway clusters when the first control information sent by the terminal is received; the first control information is generated according to a service issuing operation acting on the terminal;
the at least two API gateway clusters 804 are used for storing the first control information to Redis databases of the at least two API gateway clusters when the first control information is received, and returning service release completion information to the gateway console;
the gateway console 802 is further configured to forward the service distribution completion information to the terminal when receiving the service distribution completion information.
In one embodiment, the gateway console 802 is further configured to:
and when first control information sent by the terminal is received, storing the first control information into a local database of the gateway console.
In one embodiment, as shown in FIG. 9, at least two API gateway clusters 804 include a Redis server 804 a:
the Redis server 804a is configured to send the first control information to the API gateway nodes in the at least two API gateway clusters for caching when the first control information is stored in the Redis database.
In the above embodiment, when receiving first control information sent by a terminal, a gateway console forwards the first control information to at least two API gateway clusters, where the first control information is generated according to a service publishing operation acting on the terminal; when the at least two API gateway clusters receive the first control information, the first control information is stored in Redis databases of the at least two API gateway clusters, and service release completion information is returned to the gateway console; the gateway console forwards the service publishing completion information to the terminal when receiving the service publishing completion information, so that service publishing can be performed in a plurality of API gateway clusters through one gateway console without the gateway console acquiring the IP addresses of all API gateway nodes in all the API gateway clusters, and the service publishing efficiency is improved.
In one embodiment, as shown in fig. 9, the at least two API gateway clusters 804 further include a load balancer 804b and an API gateway node 804 c:
the target API gateway cluster is used for determining a target API gateway node through a load balancer in the target API gateway cluster when receiving a service request sent by the terminal and sending the service request to the target API gateway node; the target API gateway cluster belongs to at least two API gateway clusters; the target API gateway node belongs to an API gateway node in the target API gateway cluster;
and the target API gateway node is used for forwarding the service request to the service server according to the stored second control information when receiving the service request.
In one embodiment, the target API gateway cluster is further configured to obtain third control information stored in the Redis database; judging whether the storage time of the second control information is the same as the storage time of the third control information or not;
and the load balancer 804b is further configured to execute the step of sending the service request to the target API gateway node if the saving time of the second control information is the same as the saving time of the third control information.
In the above embodiment, when the target API gateway cluster receives a service request sent by the terminal, the load balancer in the target API gateway cluster determines a target API gateway node, and sends the service request to the target API gateway node, and when the target API gateway node receives the service request, the service request is forwarded to the service server according to the stored second control information, so that when the service request volume is large, each service request can be distributed to different API gateway nodes for forwarding through load balancing in time, and further, the processing efficiency of the service request is improved.
In an embodiment, the target API gateway cluster is further configured to send the third control information to the target API gateway node if the saving time of the second control information is different from the saving time of the third control information;
and the target API gateway node is also used for caching the third control information when receiving the third control information.
In one embodiment, the third control information includes the first control information,
the target API gateway cluster is also used for judging whether the Redis database stores first control information or not;
the target API gateway cluster is also used for sending a control information acquisition request to the gateway console if the Redis database does not store the first control information,
the gateway console 802 is further configured to, when receiving the control information acquisition request, read first control information from a local database of the gateway console, and send the first control information to the target API gateway cluster;
and the target API gateway cluster is also used for updating the first control information to a Redis database when the first control information is received.
In the above embodiment, the API gateway cluster updates the second control information stored in the Redis database and the third control information of the target API gateway node, so that the target API gateway node timely stores the control information for forwarding the service request, and the target API gateway node can forward the service request timely, thereby improving the processing efficiency of the service request.
For specific limitations of the service delivery system, reference may be made to the above limitations of the service delivery method, which are not described herein again. The modules in the service issuing apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be the same server deployed by a gateway console and at least two API gateway clusters, and its internal structure diagram may be as shown in fig. 10. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing control information. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a service publishing method.
Those skilled in the art will appreciate that the architecture shown in fig. 10 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of: when receiving first control information sent by a terminal, a gateway console forwards the first control information to at least two API gateway clusters; the first control information is generated according to a service issuing operation acting on the terminal; when the at least two API gateway clusters receive the first control information, the first control information is stored in Redis databases of the at least two API gateway clusters, and service release completion information is returned to the gateway console; and when receiving the service publishing completion information, the gateway console forwards the service publishing completion information to the terminal.
In one embodiment, the computer program, when executed by the processor, causes the processor to further perform the steps of: and when receiving the first control information sent by the terminal, the gateway console stores the first control information into a local database of the gateway console.
In one embodiment, the computer program, when executed by the processor, causes the processor to further perform the steps of: when the first control information is stored in the Redis database, the Redis server corresponding to the Redis database sends the first control information to the API gateway nodes in the at least two API gateway clusters for caching.
In one embodiment, the computer program, when executed by the processor, causes the processor to further perform the steps of: and when the target API gateway cluster receives the service request sent by the terminal, the API gateway node in the target API gateway cluster forwards the service request to the service server according to the stored second control information.
In one embodiment, the computer program, when executed by the processor, causes the processor to further perform the steps of: when a target API gateway cluster receives a service request sent by a terminal, a load balancer in the target API gateway cluster determines a target API gateway node and sends the service request to the target API gateway node; the target API gateway cluster belongs to at least two API gateway clusters; and when receiving the service request, the target API gateway node forwards the service request to the service server according to the stored second control information.
In one embodiment, the computer program, when executed by the processor, causes the processor to further perform the steps of: the target API gateway cluster acquires third control information stored in a Redis database; judging whether the storage time of the second control information is the same as the storage time of the third control information or not; and if so, the load balancer in the target API gateway cluster executes the step of sending the service request to the target API gateway node.
In one embodiment, the computer program, when executed by the processor, causes the processor to further perform the steps of: if the storage time of the second control information is different from the storage time of the third control information, the target API gateway cluster sends the third control information to the target API gateway node; and when receiving the third control information, the target API gateway node caches the third control information.
In an embodiment, the third control information comprises the first control information, the computer program, when executed by the processor, causes the processor to further perform the steps of: the target API gateway cluster judges whether the Redis database stores first control information or not; if not, the target API gateway cluster sends a control information acquisition request to the gateway console; when receiving a control information acquisition request, the gateway console reads first control information from a local database of the gateway console and sends the first control information to a target API gateway cluster; and when receiving the first control information, the target API gateway cluster updates the first control information to the Redis database.
In one embodiment, a computer readable storage medium is provided, storing a computer program that, when executed by a processor, causes the processor to perform the steps of: when receiving first control information sent by a terminal, a gateway console forwards the first control information to at least two API gateway clusters; the first control information is generated according to a service issuing operation acting on the terminal; when the at least two API gateway clusters receive the first control information, the first control information is stored in Redis databases of the at least two API gateway clusters, and service release completion information is returned to the gateway console; and when receiving the service publishing completion information, the gateway console forwards the service publishing completion information to the terminal.
In one embodiment, the computer program, when executed by the processor, causes the processor to further perform the steps of: and when receiving the first control information sent by the terminal, the gateway console stores the first control information into a local database of the gateway console.
In one embodiment, the computer program, when executed by the processor, causes the processor to further perform the steps of: when the first control information is stored in the Redis database, the Redis server corresponding to the Redis database sends the first control information to the API gateway nodes in the at least two API gateway clusters for caching.
In one embodiment, the computer program, when executed by the processor, causes the processor to further perform the steps of: and when the target API gateway cluster receives the service request sent by the terminal, the API gateway node in the target API gateway cluster forwards the service request to the service server according to the stored second control information.
In one embodiment, the computer program, when executed by the processor, causes the processor to further perform the steps of: when a target API gateway cluster receives a service request sent by a terminal, a load balancer in the target API gateway cluster determines a target API gateway node and sends the service request to the target API gateway node; the target API gateway cluster belongs to at least two API gateway clusters; and when receiving the service request, the target API gateway node forwards the service request to the service server according to the stored second control information.
In one embodiment, the computer program, when executed by the processor, causes the processor to further perform the steps of: the target API gateway cluster acquires third control information stored in a Redis database; judging whether the storage time of the second control information is the same as the storage time of the third control information or not; and if so, the load balancer in the target API gateway cluster executes the step of sending the service request to the target API gateway node.
In one embodiment, the computer program, when executed by the processor, causes the processor to further perform the steps of: if the storage time of the second control information is different from the storage time of the third control information, the target API gateway cluster sends the third control information to the target API gateway node; and when receiving the third control information, the target API gateway node caches the third control information.
In an embodiment, the third control information comprises the first control information, the computer program, when executed by the processor, causes the processor to further perform the steps of: the target API gateway cluster judges whether the Redis database stores first control information or not; if not, the target API gateway cluster sends a control information acquisition request to the gateway console; when receiving a control information acquisition request, the gateway console reads first control information from a local database of the gateway console and sends the first control information to a target API gateway cluster; and when receiving the first control information, the target API gateway cluster updates the first control information to the Redis database.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (11)

1. A method of service publication, the method comprising:
when receiving first control information sent by a terminal, a gateway console forwards the first control information to at least two API gateway clusters; the first control information is generated according to a service publishing operation acting on the terminal;
when the at least two API gateway clusters receive the first control information, the first control information is stored in databases corresponding to the at least two API gateway clusters, and service release completion information is returned to the gateway console;
and when receiving the service publishing completion information, the gateway console forwards the service publishing completion information to the terminal.
2. The method of claim 1, further comprising:
and when receiving the first control information sent by the terminal, the gateway console stores the first control information into a local database of the gateway console.
3. The method of claim 1, further comprising:
and when the first control information is stored in the database, the server corresponding to the database sends the first control information to the API gateway nodes in the at least two API gateway clusters for caching.
4. The method of claim 1, further comprising:
and when the target API gateway cluster receives the service request sent by the terminal, the API gateway node in the target API gateway cluster forwards the service request to a service server according to the stored second control information.
5. The method of claim 4, wherein when a target API gateway cluster receives a service request sent by the terminal, an API gateway node in the target API gateway cluster forwards the service request to a service server according to the stored second control information, and the method comprises:
when a target API gateway cluster receives a service request sent by the terminal, a load balancer in the target API gateway cluster determines a target API gateway node and sends the service request to the target API gateway node; the target API gateway cluster belongs to the at least two API gateway clusters;
and when receiving the service request, the target API gateway node forwards the service request to a service server according to the stored second control information.
6. The method of claim 5, wherein prior to sending the service request to the target API gateway node, the method further comprises:
the target API gateway cluster acquires third control information stored in the database;
judging whether the saving time of the second control information is the same as the saving time of the third control information or not;
and if so, the load balancer in the target API gateway cluster executes the step of sending the service request to the target API gateway node.
7. The method of claim 6, further comprising:
if the storage time of the second control information is different from the storage time of the third control information, the target API gateway cluster sends the third control information to the target API gateway node;
and caching the third control information when the target API gateway node receives the third control information.
8. The method of claim 6, wherein the third control information comprises the first control information, and wherein before the target API gateway cluster obtains the third control information stored in the database, the method further comprises:
the target API gateway cluster judges whether the database stores the first control information or not;
if not, the target API gateway cluster sends a control information acquisition request to the gateway console;
when receiving the control information acquisition request, the gateway console reads the first control information from a local database of the gateway console and sends the first control information to the target API gateway cluster;
and when the target API gateway cluster receives the first control information, updating the first control information to the database.
9. A service distribution system, the system comprising:
the gateway control console is used for forwarding first control information to at least two API gateway clusters when the first control information sent by the terminal is received; the first control information is generated according to a service publishing operation acting on the terminal;
the at least two API gateway clusters are used for storing the first control information to databases of the at least two API gateway clusters when the first control information is received, and returning service release completion information to the gateway console;
and the gateway console is further configured to forward the service release completion information to the terminal when receiving the service release completion information.
10. The system according to claim 9, wherein the gateway nodes in the at least two API gateway clusters are provided with a buffer, and the buffer is configured to store the first control information sent by the server corresponding to the database.
11. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of the method of any one of claims 1 to 8.
CN202010303999.2A 2020-04-17 2020-04-17 Service release method and system Active CN111629029B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010303999.2A CN111629029B (en) 2020-04-17 2020-04-17 Service release method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010303999.2A CN111629029B (en) 2020-04-17 2020-04-17 Service release method and system

Publications (2)

Publication Number Publication Date
CN111629029A true CN111629029A (en) 2020-09-04
CN111629029B CN111629029B (en) 2023-06-20

Family

ID=72260585

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010303999.2A Active CN111629029B (en) 2020-04-17 2020-04-17 Service release method and system

Country Status (1)

Country Link
CN (1) CN111629029B (en)

Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030229779A1 (en) * 2002-06-10 2003-12-11 Morais Dinarte R. Security gateway for online console-based gaming
US20040193686A1 (en) * 2003-03-27 2004-09-30 Blagsvedt Sean O. Controlling publication of presence information
US20110047294A1 (en) * 2005-06-29 2011-02-24 Visa U.S.A., Inc. Adaptive gateway for switching transactions and data on unreliable networks using context-based rules
CN102457816A (en) * 2010-10-21 2012-05-16 中兴通讯股份有限公司 Method for managing cluster information, cluster access gateway and corresponding cluster system
CN103748548A (en) * 2011-06-30 2014-04-23 亚马逊科技公司 Storage gateway activation process
US20150161235A1 (en) * 2013-12-10 2015-06-11 Zahi Libfeld Database content publisher
CN105703940A (en) * 2015-12-10 2016-06-22 中国电力科学研究院 Multistage dispatching distributed parallel computing-oriented monitoring system and monitoring method
CN105827446A (en) * 2016-03-31 2016-08-03 深圳市金溢科技股份有限公司 Intelligent traffic API gateway and intelligent traffic service system
CN107645508A (en) * 2017-10-16 2018-01-30 深圳市买买提乐购金融服务有限公司 A kind of data handling system, method, client and server
CN109104473A (en) * 2018-07-27 2018-12-28 深圳绿米联创科技有限公司 A kind of control method, control device, control system and gateway
CN109684873A (en) * 2018-12-29 2019-04-26 金蝶软件(中国)有限公司 Data access control method, device, computer equipment and storage medium
CN109960516A (en) * 2019-02-28 2019-07-02 珠海市横琴新区芯云平台科技有限公司 A kind of concentrating type Internet of Things application development system and its method
CN110022226A (en) * 2019-01-04 2019-07-16 国网浙江省电力有限公司 A kind of data collection system and acquisition method based on object-oriented
CN110120970A (en) * 2019-04-15 2019-08-13 钛马信息网络技术有限公司 Data processing method, device and gateway system based on car networking
CN110175753A (en) * 2019-04-30 2019-08-27 西安培华学院 A kind of production religion converged services management platform and management method
CN110213163A (en) * 2019-05-24 2019-09-06 深圳壹账通智能科技有限公司 A kind of routing conversion and device based on nginx and zuul
CN110300056A (en) * 2019-06-28 2019-10-01 四川长虹电器股份有限公司 A kind of real-time response formula API gateway and its request processing method
CN110336753A (en) * 2019-06-19 2019-10-15 腾讯科技(深圳)有限公司 A kind of service calling method, device, equipment and the storage medium in across a network region

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030229779A1 (en) * 2002-06-10 2003-12-11 Morais Dinarte R. Security gateway for online console-based gaming
US20040193686A1 (en) * 2003-03-27 2004-09-30 Blagsvedt Sean O. Controlling publication of presence information
US20110047294A1 (en) * 2005-06-29 2011-02-24 Visa U.S.A., Inc. Adaptive gateway for switching transactions and data on unreliable networks using context-based rules
CN102457816A (en) * 2010-10-21 2012-05-16 中兴通讯股份有限公司 Method for managing cluster information, cluster access gateway and corresponding cluster system
CN103748548A (en) * 2011-06-30 2014-04-23 亚马逊科技公司 Storage gateway activation process
US20150161235A1 (en) * 2013-12-10 2015-06-11 Zahi Libfeld Database content publisher
CN105703940A (en) * 2015-12-10 2016-06-22 中国电力科学研究院 Multistage dispatching distributed parallel computing-oriented monitoring system and monitoring method
CN105827446A (en) * 2016-03-31 2016-08-03 深圳市金溢科技股份有限公司 Intelligent traffic API gateway and intelligent traffic service system
CN107645508A (en) * 2017-10-16 2018-01-30 深圳市买买提乐购金融服务有限公司 A kind of data handling system, method, client and server
CN109104473A (en) * 2018-07-27 2018-12-28 深圳绿米联创科技有限公司 A kind of control method, control device, control system and gateway
CN109684873A (en) * 2018-12-29 2019-04-26 金蝶软件(中国)有限公司 Data access control method, device, computer equipment and storage medium
CN110022226A (en) * 2019-01-04 2019-07-16 国网浙江省电力有限公司 A kind of data collection system and acquisition method based on object-oriented
CN109960516A (en) * 2019-02-28 2019-07-02 珠海市横琴新区芯云平台科技有限公司 A kind of concentrating type Internet of Things application development system and its method
CN110120970A (en) * 2019-04-15 2019-08-13 钛马信息网络技术有限公司 Data processing method, device and gateway system based on car networking
CN110175753A (en) * 2019-04-30 2019-08-27 西安培华学院 A kind of production religion converged services management platform and management method
CN110213163A (en) * 2019-05-24 2019-09-06 深圳壹账通智能科技有限公司 A kind of routing conversion and device based on nginx and zuul
CN110336753A (en) * 2019-06-19 2019-10-15 腾讯科技(深圳)有限公司 A kind of service calling method, device, equipment and the storage medium in across a network region
CN110300056A (en) * 2019-06-28 2019-10-01 四川长虹电器股份有限公司 A kind of real-time response formula API gateway and its request processing method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
MINGYU LI ET.AL.: "ConHA: An SOA-based API gateway for consolidating heterogeneous HA clusters", 《2013 IEEE INTERNATIONAL CONFERENCE ON CLUSTER COMPUTING (CLUSTER)》 *
王易川;李文钧;: "基于ZigBee、WiFi和云服务器集群的智能家居系统设计", 物联网技术 *
秦景辉: "基于OpenStack的虚拟课室无缝接入系统的设计与实现", 《中国优秀硕士学位论文全文数据库 (信息科技辑) 》 *

Also Published As

Publication number Publication date
CN111629029B (en) 2023-06-20

Similar Documents

Publication Publication Date Title
CN109995881B (en) Load balancing method and device of cache server
US9940020B2 (en) Memory management method, apparatus, and system
CN110825479A (en) Page processing method and device, terminal equipment, server and storage medium
CN111885216B (en) DNS query method, device, equipment and storage medium
CN108683668A (en) Resource checksum method, apparatus, storage medium and equipment in content distributing network
CN110737857A (en) back-end paging acceleration method, system, terminal and storage medium
CN109873839B (en) Data access method, server and distributed system
WO2022222438A1 (en) Profile state synchronization method and apparatus, terminal, server, and storage medium
CN108512948B (en) Address book updating method and device, computer equipment and storage medium
CN111597213A (en) Caching method, software server and storage medium
CN113010224A (en) Front-end micro-service method, device, computer equipment and storage medium
US8707318B2 (en) Partitioning system including a generic partitioning manager for partitioning resources
CN111694639A (en) Method and device for updating address of process container and electronic equipment
US20220103500A1 (en) Method and device for managing group member, and method for processing group message
US8266634B2 (en) Resource assignment system with recovery notification
CN114281263A (en) Storage resource processing method, system and equipment of container cluster management system
US10467143B1 (en) Event-driven cache
CN112380563A (en) Node access method, device, equipment and storage medium
CN111629029A (en) Service publishing method and system
CN116488986A (en) Event-driven message touch method, system and device and storage medium
CN111104376B (en) Resource file query method and device
CN109088913B (en) Method for requesting data and load balancing server
CN113438331A (en) Short domain name management method, system, electronic device and storage medium
CN115373831A (en) Data processing method, device and computer readable storage medium
CN110944037A (en) Method, computer device and storage medium for client cache change configuration

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