CN111629029B - Service release method and system - Google Patents
Service release method and system Download PDFInfo
- Publication number
- CN111629029B CN111629029B CN202010303999.2A CN202010303999A CN111629029B CN 111629029 B CN111629029 B CN 111629029B CN 202010303999 A CN202010303999 A CN 202010303999A CN 111629029 B CN111629029 B CN 111629029B
- Authority
- CN
- China
- Prior art keywords
- control information
- api gateway
- gateway
- service
- console
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/66—Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Computer And Data Communications (AREA)
Abstract
The application relates to a service release method and a service release system. When receiving first control information sent by a terminal, a gateway control console forwards the first control information to at least two API gateway clusters; the first control information is generated according to a service release 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 of the at least two API gateway clusters, and service release completion information is returned to the gateway console; and the gateway console forwards the service release completion information to the terminal when receiving the service release completion information. By adopting the method, the service release efficiency can be improved.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a service publishing method and system.
Background
The control console of the traditional public cloud API gateway is usually deployed in an API gateway cluster, the gateway is generally in a tight coupling architecture, the gateway control console and the load balancer LBS are placed in the same gateway cluster, the expandability is poor, when a tenant needs to release services on a plurality of public cloud multi-area gateway clusters, a plurality of corresponding control consoles and load balancing are required to be deployed, a multi-sleeve management system exists, the control information generated when a user releases the services is respectively sent to each API gateway node in each public cloud API gateway cluster by the control console in each public cloud API gateway cluster, the data cannot be shared, the management difficulty is high, and the use is inconvenient. When the control console sends the control information to each API gateway node, the control console needs to acquire the IP address of each API gateway node, and then sends 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 affected.
Disclosure of Invention
Based on this, it is necessary to provide a service publishing method and system for solving the technical problem of low service publishing efficiency in the conventional gateway architecture.
A service distribution method, the method comprising:
when receiving first control information sent by a terminal, a gateway control console forwards the first control information to at least two API gateway clusters; the first control information is generated according to a service release 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 of the at least two API gateway clusters, and service release completion information is returned to the gateway console;
and the gateway console forwards the service release completion information to the terminal when receiving the service release completion information.
In one embodiment, the method further comprises:
and when the gateway console receives 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:
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:
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 the target API gateway node receives the service request, forwarding the service request to a service server according to the stored second control information.
In one embodiment, before the 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 storage time of the second control information is the same as the storage time of the third control information;
And 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, 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 the target API gateway node caches the third control information when receiving the third control information.
In one embodiment, the third control information includes the first control information, and before the target API gateway cluster obtains the third control information stored in the database, the method further includes:
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 the gateway control console receives the control information acquisition request, the gateway control console reads the first control information from a local database of the gateway control console and sends the first control information to the target API gateway cluster;
And the target API gateway cluster updates the first control information to the database when receiving the first control information.
A service distribution system, the system comprising:
the gateway control console is used for forwarding the first control information to at least two API gateway clusters when receiving the first control information sent by the terminal; the first control information is generated according to a service release operation acting on the terminal;
the at least two API gateway clusters are used for storing the first control information into 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 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 include 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 one embodiment, the gateway nodes in the at least two API gateway clusters are provided with a buffer, where the buffer is used to store 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 equalizer 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 the service request is received.
In one embodiment, the target API gateway cluster is further configured to obtain third control information stored in the database; judging whether the storage time of the second control information is the same as the storage time of the third control information;
and the load balancer is further configured to execute the step of sending the service request to the target API gateway node if the save time of the second control information is the same as the save 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 save time of the second control information is different from the save time of the third control information;
and the target API gateway node is further 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 further used for judging whether the database stores the first control information;
the target API gateway cluster is further configured to send 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, when receiving the control information acquisition request, 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;
the target API gateway cluster is further used for updating the first control information to the database when the first control information is received.
A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of any of the methods described above when executing the computer program.
According to the service release method and system, when the gateway control console receives the first control information sent by the terminal, the first control information is forwarded to at least two API gateway clusters, wherein the first control information is generated according to the service release 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 of the at least two API gateway clusters, and service release completion information is returned to the gateway console; when receiving the service release completion information, the gateway console forwards the service release completion information to the terminal, so that service release can be performed in a plurality of API gateway clusters through one gateway console without acquiring the IP addresses of the API gateway nodes in each API gateway cluster by the gateway console, and the service release efficiency is improved.
Drawings
FIG. 1 is an application environment diagram of a service distribution method in one embodiment;
FIG. 2 is a flow chart of a method of distributing services in one embodiment;
FIG. 3 is a flow chart of a service request forwarding step in one embodiment;
FIG. 4 is a flowchart illustrating a cache data verification step according to 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 schematic diagram of a service request forwarding process in one embodiment;
FIG. 8 is a block diagram of a service distribution apparatus in one embodiment;
FIG. 9 is a block diagram showing a construction of a service issuing apparatus according to another embodiment;
fig. 10 is an internal structural view of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The service release method provided by the application can be applied to an 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. The gateway console 104, when receiving the first control information sent by the terminal 102, 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 acting on the terminal 102; when the at least two API gateway clusters 106 receive the first control information, the first control information is stored in databases of the at least two API gateway clusters, and service release completion information is returned to the gateway console 104; upon receiving the service release completion information, the gateway console 104 forwards the service release completion information to the terminal 102. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, the gateway console 104 and 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 composed of multiple servers.
In one embodiment, as shown in fig. 2, a service publishing method is provided, and an application environment of the method in fig. 1 is taken as an example for explanation, and the method includes the following steps:
s202, when receiving first control information sent by a terminal, a gateway control 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.
The gateway console provides a unified management interface for the user through the terminal. The first control information is generated according to a service release operation acting on the terminal, wherein the service release operation can be related operations of setting and maintaining of interfaces, components and system basic information, and specifically comprises operations of releasing services and interfaces, setting interface calling authority, generating applications and secret keys and the like which are 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 areas, where the at least two API gateway clusters are mainly responsible for receiving a service request of a terminal, forwarding an interface according to the received service request, and performing authentication, current limiting, fusing, quota, black-and-white list restriction, and the like.
In one embodiment, a user performs service release operation through a management interface of a gateway console displayed on a terminal, and when the terminal detects the service release operation of the user, the terminal generates first control information according to the detected service release operation and sends the first control information to the gateway console, and after receiving the first control information, the gateway console forwards the first control information to at least two API gateway clusters corresponding to the gateway console. Specifically, after receiving the first control information, the terminal obtains 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 control information, where the plurality of control information is control information sent by the terminal to the gateway control platform each time the user performs a service release operation, and each control information is also generated according to the service release operation acting on the terminal.
S204, when the at least two API gateway clusters receive the first control information, the first control information is stored in databases of the at least two API gateway clusters, and service release completion information is returned to the gateway console.
The database may be a Redis database, where the Redis database is configured to store first control information received by the corresponding API gateway cluster, other control information sent by the console, and status information of each API gateway node in the API gateway cluster, so as to coordinate a status of each API gateway node in each API gateway cluster. The API gateway nodes are used for forwarding service requests received by the API gateway clusters to the service server, and in order to ensure the reliability of each API gateway cluster, a load equalizer and a plurality of API gateway nodes are deployed in each API gateway cluster in the application, so that when the service request quantity received by the API gateway cluster is large, each service request is shared to each API gateway node through the load equalizer for forwarding.
The service release completion information is information for indicating that the service release is completed, and specifically may contain a service release completion identification, and may be a corresponding code for indicating that the service release is completed.
In one embodiment, when receiving the first control information sent by the gateway console, the at least two API gateway clusters store the first control information to the dis databases of the at least two API gateway clusters, and return service release completion information to the gateway console.
In one embodiment, after storing first control information in Redis databases of at least two API gateway clusters, the Redis server corresponding to the Redis databases sends the first control information to 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, the gateway console forwards the service release completion information to the terminal when receiving the service release completion information.
In one embodiment, when receiving service release completion information returned by at least two API gateway clusters, the gateway console forwards the service release completion information to the terminal, and after receiving the service release completion information, the terminal generates a service release completion prompt according to the service release completion information, and displays the service release completion prompt on a gateway console management interface on the terminal to prompt the user that service release is completed.
In the above embodiment, when receiving the first control information sent by the terminal, the 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 databases of the at least two API gateway clusters, and service release completion information is returned to the gateway console; when receiving the service release completion information, the gateway console forwards the service release completion information to the terminal, so that service release can be performed in a plurality of API gateway clusters through one gateway console without acquiring the IP addresses of the API gateway nodes in each API gateway cluster by the gateway console, and the service release 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 a service server which is 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 forwarding rules.
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 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.
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 operation of the user 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.
S304, the target API gateway node forwards 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 node, upon receiving the service request, forwards the service request to the service server in accordance with the second control information stored on the target API gateway node. And forwarding the service request to the service server according to the second control information stored on the target API gateway node, specifically, matching the forwarding rule stored on the target API gateway node according to the received service request, and forwarding the service request 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 related interface according to the service request, processes the service request to obtain a service processing result, returns the service processing result to the target API gateway cluster, and returns the service processing result to the terminal after receiving the processing result returned by the service server.
In the above embodiment, when the target API gateway cluster receives the service request sent by the terminal, the load balancer in the target API gateway cluster determines the 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 target API gateway node forwards the service request to the service server according to the stored second control information, so that when the service request is large, each service request can be distributed to different API gateway nodes for forwarding in time through load balancing, and further the processing efficiency of the service request is improved.
In one 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 control information stored in a Redis database of the target API gateway cluster, and each control information is control information sent by the received gateway console for each service release, and specifically comprises the first control information.
In one 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, when the gateway console receives the 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 the target API gateway cluster, and when the target API gateway cluster receives the first control information, the target API gateway cluster updates the first control information to the Redis database.
In one 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, S402 is executed.
S404, judging whether the storage time of the second control information is the same as the storage time of the third control information.
And S406, if yes, 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 time of saving the second control information is the same as the time of saving the third control information, the second control information is considered to include 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 save time of the second control information is different from the save 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 atomically or notification aged, 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 stores the control information for forwarding the service request in time, so that the target API gateway node can forward the service request in time, and further, the processing efficiency of the service request is improved.
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, and 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 release operation on a gateway console operation interface displayed by a terminal, the terminal generates first control information according to the service release operation and transmits the first control information to the gateway console; the gateway control 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 a gateway console; the 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 the gateway console forwards the service release completion information to the terminal after receiving the service release completion information.
Referring to fig. 5 and 7, after service release is completed, a user operates an application running on a terminal, the terminal generates a corresponding service request according to the operation of the user 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 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, if not, the target API gateway cluster sends a control information acquisition request to the gateway console, when the gateway console receives 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, the target API gateway cluster updates the first control information to the Redis database; then the target API gateway cluster acquires second control information of the Redis database, and when the storage time of the 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 the third control information stored by the target API gateway node is the same as the storage time of the 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 when forwarding is successful, a forwarding result returned by the service server is received.
It should be understood that, although the steps in the flowcharts of fig. 2-4 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2-4 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in fig. 8, there is provided a service distribution system including: gateway console 802, at least two API gateway clusters 804, wherein:
the gateway console 802 is configured to forward, when receiving first control information sent by the terminal, 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;
At least two API gateway clusters 804, configured to store, when receiving the first control information, the first control information to a dis database of the at least two API gateway clusters, and return service release completion information to the gateway console;
the gateway console 802 is further configured to forward the service release completion information to the terminal when receiving the service release completion information.
In one embodiment, gateway console 802 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, as shown in fig. 9, at least two API gateway clusters 804 include a Redis server 804a:
redis server 804a is configured to send, when the first control information is stored in the Redis database, the first control information to the API gateway nodes in the at least two API gateway clusters for buffering.
In the above embodiment, when receiving the first control information sent by the terminal, the 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; when receiving the service release completion information, the gateway console forwards the service release completion information to the terminal, so that service release can be performed in a plurality of API gateway clusters through one gateway console without acquiring the IP addresses of the API gateway nodes in each API gateway cluster by the gateway console, and the service release efficiency is improved.
In one embodiment, as shown in fig. 9, at least two API gateway clusters 804 further include a load balancer 804b and an API gateway node 804c:
the target API gateway cluster is used for determining a target API gateway node through a load equalizer 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 the 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 the service request is received.
In one embodiment, the target API gateway cluster is further configured to obtain third control information stored in the Redis database; judging whether the preservation time of the second control information is the same as the preservation time of the third control information;
the load balancer 804b is further configured to perform a step of sending the service request to the target API gateway node if the save time of the second control information is the same as the save time of the third control information.
In the above embodiment, when the target API gateway cluster receives the service request sent by the terminal, the load balancer in the target API gateway cluster determines the 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 target API gateway node forwards the service request to the service server according to the stored second control information, so that when the service request is large, each service request can be distributed to different API gateway nodes for forwarding in time through load balancing, 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 save time of the second control information is different from the save time of the third control information;
and the target API gateway node is further used for caching the third control information when the third control information is received.
In one embodiment, the third control information includes first control information,
the target API gateway cluster is also used for judging whether the Redis database stores the first control information;
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 a 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;
the target API gateway cluster is further used for updating the first control information to the 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 stores the control information for forwarding the service request in time, so that the target API gateway node can forward the service request in time, and further, the processing efficiency of the service request is improved.
For specific limitations on the service delivery system, reference may be made to the above limitations on the service delivery method, and no further description is given here. The respective modules in the service issuing apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above 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, the internal structure of which 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 includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used to store 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 distribution method.
It will be appreciated by those skilled in the art that the structure shown in fig. 10 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided 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 control 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 the gateway console forwards the service release completion information to the terminal when receiving the service release completion information.
In one embodiment, the computer program, when executed by the processor, causes the processor to further perform the steps of: and when the gateway console receives 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 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: 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 the target API gateway cluster receives a service request sent by a terminal, a load equalizer 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 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 computer program, when executed by the processor, causes the processor to further perform the steps of: the target API gateway cluster obtains third control information stored in the Redis database; judging whether the preservation time of the second control information is the same as the preservation time of the third control information; if yes, 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, 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 the target API gateway node caches the third control information when receiving the third control information.
In one embodiment, the third control information comprises the first control information, which 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 the target API gateway cluster receives the first control information, the first control information is updated to the Redis database.
In one embodiment, a computer readable storage medium is provided, storing a computer program which, when executed by a processor, causes the processor to perform the steps of: when receiving first control information sent by a terminal, a gateway control 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 the gateway console forwards the service release completion information to the terminal when receiving the service release completion information.
In one embodiment, the computer program, when executed by the processor, causes the processor to further perform the steps of: and when the gateway console receives 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 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: 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 the target API gateway cluster receives a service request sent by a terminal, a load equalizer 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 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 computer program, when executed by the processor, causes the processor to further perform the steps of: the target API gateway cluster obtains third control information stored in the Redis database; judging whether the preservation time of the second control information is the same as the preservation time of the third control information; if yes, 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, 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 the target API gateway node caches the third control information when receiving the third control information.
In one embodiment, the third control information comprises the first control information, which 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 the target API gateway cluster receives the first control information, the first control information is updated to the Redis database.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.
Claims (11)
1. A service distribution method, the method comprising:
when receiving first control information sent by a terminal, a gateway control console forwards the first control information to at least two API gateway clusters; the first control information is generated according to a service release operation acting on a management interface of the terminal; the management interface is an interface provided by the gateway console;
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 the gateway console forwards the service release completion information to the terminal when receiving the service release completion information.
2. The method according to claim 1, wherein the method further comprises:
and when the gateway console receives 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 according to claim 1, wherein the method further comprises:
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 according to claim 1, wherein the method further comprises:
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 according to claim 4, wherein 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, including:
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 the target API gateway node receives the service request, forwarding the service request to a service server according to the stored second control information.
6. The method of claim 5, wherein prior to said sending said service request to said target API gateway node, said method further comprises:
the target API gateway cluster acquires third control information stored in the database;
judging whether the storage time of the second control information is the same as the storage time of the third control information;
And 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.
7. The method of claim 6, wherein 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 the target API gateway node caches the third control information when receiving 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, further comprising:
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 the gateway control console receives the control information acquisition request, the gateway control console reads the first control information from a local database of the gateway control console and sends the first control information to the target API gateway cluster;
And the target API gateway cluster updates the first control information to the database when receiving the first control information.
9. A service distribution system, the system comprising:
the gateway control console is used for forwarding the first control information to at least two API gateway clusters when receiving the first control information sent by the terminal; the first control information is generated according to a service release operation acting on a management interface of the terminal; the management interface is an interface provided by the gateway console;
the at least two API gateway clusters are used for storing the first control information into 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 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 gateway nodes in the at least two API gateway clusters are provided with a buffer for storing the first control information sent by the server to which the database corresponds.
11. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 8 when executing the computer program.
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 CN111629029A (en) | 2020-09-04 |
CN111629029B true 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 (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107645508A (en) * | 2017-10-16 | 2018-01-30 | 深圳市买买提乐购金融服务有限公司 | A kind of data handling system, method, client and server |
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 |
Family Cites Families (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7370194B2 (en) * | 2002-06-10 | 2008-05-06 | Microsoft Corporation | Security gateway for online console-based gaming |
US7216147B2 (en) * | 2003-03-27 | 2007-05-08 | Microsoft Corporation | Controlling publication of presence information |
US7774402B2 (en) * | 2005-06-29 | 2010-08-10 | Visa U.S.A. | Adaptive gateway for switching transactions and data on unreliable networks using context-based rules |
CN102457816B (en) * | 2010-10-21 | 2016-05-11 | 中兴通讯股份有限公司 | Method, cluster access gateway and the corresponding group system of cluster information management |
US8806588B2 (en) * | 2011-06-30 | 2014-08-12 | Amazon Technologies, Inc. | Storage gateway activation process |
US9747353B2 (en) * | 2013-12-10 | 2017-08-29 | Sap Se | Database content publisher |
CN105703940B (en) * | 2015-12-10 | 2021-08-20 | 中国电力科学研究院有限公司 | Monitoring system and monitoring method for multi-level scheduling distributed parallel computation |
CN105827446B (en) * | 2016-03-31 | 2019-04-30 | 深圳市金溢科技股份有限公司 | A kind of intelligent transportation API gateway and intelligent transportation operation system |
CN109104473B (en) * | 2018-07-27 | 2022-11-08 | 深圳绿米联创科技有限公司 | Control method, control device, control system and gateway |
CN109684873B (en) * | 2018-12-29 | 2020-12-29 | 金蝶软件(中国)有限公司 | Data access control method and device, computer equipment and storage medium |
CN110022226B (en) * | 2019-01-04 | 2023-04-04 | 国网浙江省电力有限公司 | Object-oriented data acquisition system and acquisition method |
CN109960516B (en) * | 2019-02-28 | 2022-08-12 | 珠海市横琴新区芯云平台科技有限公司 | Cluster-type Internet of things application development system and method thereof |
CN110120970B (en) * | 2019-04-15 | 2022-04-05 | 钛马信息网络技术有限公司 | Data processing method and device based on Internet of vehicles and gateway system |
CN110336753B (en) * | 2019-06-19 | 2021-10-22 | 腾讯科技(深圳)有限公司 | Cross-network-area service calling method, device, equipment and storage medium |
CN110300056B (en) * | 2019-06-28 | 2021-06-29 | 四川长虹电器股份有限公司 | Real-time response type API gateway and request processing method thereof |
-
2020
- 2020-04-17 CN CN202010303999.2A patent/CN111629029B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107645508A (en) * | 2017-10-16 | 2018-01-30 | 深圳市买买提乐购金融服务有限公司 | A kind of data handling system, method, client and server |
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 |
Non-Patent Citations (1)
Title |
---|
基于ZigBee、WiFi和云服务器集群的智能家居系统设计;王易川;李文钧;;物联网技术(01);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN111629029A (en) | 2020-09-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9405574B2 (en) | System and method for transmitting complex structures based on a shared memory queue | |
US10235047B2 (en) | Memory management method, apparatus, and system | |
CN108683668B (en) | Resource checking method, device, storage medium and equipment in content distribution network | |
CN106503058B (en) | A kind of data load method, terminal and computing cluster | |
CN103312624B (en) | A kind of Message Queuing Services system and method | |
CN111460458B (en) | Data processing method, related device and computer storage medium | |
CN109873839B (en) | Data access method, server and distributed system | |
KR102398076B1 (en) | Apparatus and method for distributing and storing data | |
CN103607428A (en) | Method of accessing shared memory and apparatus thereof | |
US20100332532A1 (en) | Distributed directory environment using clustered ldap servers | |
US8930518B2 (en) | Processing of write requests in application server clusters | |
US8707318B2 (en) | Partitioning system including a generic partitioning manager for partitioning resources | |
CN115470156A (en) | RDMA-based memory use method, system, electronic device and storage medium | |
US20220107752A1 (en) | Data access method and apparatus | |
US20220103500A1 (en) | Method and device for managing group member, and method for processing group message | |
US10467143B1 (en) | Event-driven cache | |
CN111629029B (en) | Service release method and system | |
CN113067824A (en) | Data scheduling method, system, virtual host and computer readable storage medium | |
WO2019242279A1 (en) | Message processing method and device | |
CN107203339B (en) | Data storage method and device | |
CN112130747A (en) | Distributed object storage system and data read-write method | |
CN112001800B (en) | Method and device for processing business in block chain system | |
US9184996B2 (en) | Thin client system, management server, client environment management method and program | |
CN114116889A (en) | Method and device for synchronizing material data, computer equipment and storage medium | |
US8412817B1 (en) | Load balancing voicemail server system |
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 |