Self-adaptive switching gateway configuration system for multi-modal serviceTechnical Field
The invention relates to the technical field of gateway configuration, in particular to a self-adaptive switching gateway configuration system for multi-modal service.
Background
The traditional API gateway can only support one or two or three background services (HTTP, Webscolet and the like), and for newly added services, the traditional API gateway cannot be adapted quickly and flexibly, but if an adaptation module is developed for each newly added service, the development amount is large, and the development and deployment cost is greatly increased.
Disclosure of Invention
The invention aims to provide a self-adaptive transit gateway configuration system of multi-modal service, which is used for solving the problem that an API (application programming interface) network in the prior art cannot adapt to newly-added service quickly and flexibly.
The invention solves the problems through the following technical scheme:
a self-adaptive switching gateway configuration system of multi-modal services comprises a multi-modal service gateway, a multi-modal service gateway background management and a database, wherein the multi-modal service gateway comprises a current limiting module, an authentication module, a routing module, a service quality and fusing module and a multi-modal service providing module; the multimodal service gateway background management comprises a basic management module and a gateway routing configuration module, wherein:
a basic management module: configured to provide user management, rights management, log queries, and access statistics;
a gateway route configuration module: a service configured to provide a configuration route, a custom service component, and an import of a service component;
the current limiting module is configured to acquire whether the route starts current limiting and execute corresponding actions according to the route configuration basic data of the gateway route configuration module;
an authentication module configured to authenticate a client user request;
an authentication module configured to check whether a user authenticated by the client user request has an authority to access the route;
the routing module is configured to position downstream services and an exception handling mechanism according to the client request routing and routing configuration basic data of the gateway routing configuration module, the positioned downstream services provide data support for the multi-modal service providing module, and the exception handling mechanism provides data support for the service quality and fusing module;
the service quality and fusing module is configured to stop forwarding the request to the downstream service through a maintenance strategy of the gateway routing configuration module when the downstream service fails, reduce the burden of the downstream server and the API gateway and ensure that the API gateway and other downstream services can normally run;
and the multi-modal service providing module is configured to determine the type of the service according to the downstream service basic data provided by the routing module, establish a communication channel with the corresponding service and return a processing result of the service to the terminal.
The attributes of the configured route in the gateway route configuration module comprise an upstream service route, a downstream service route, service aggregation, configured service authentication, current limiting configuration, cache configuration, service quality and fusing, and header information forwarding.
Compared with the prior art, the invention has the following advantages and beneficial effects:
(1) the invention is independently deployed on the network, builds a communication pipeline between the application and the multi-mode Service, automatically adapts various modal services (HTTP/HTTPS Service, web Service, webscolet Service, RPC Service, message queue Service, Internet of things Service and the like) for the application, provides an interface or abstract class for expanding the user-defined Service, and can flexibly realize the interface or inherit the abstract class to realize the quick butt joint of the user-defined Service.
(2) The invention avoids the workload of developing and adapting the multi-mode service for each application, realizes the self-adaptive switching by connecting the multi-mode gateway, realizes that the client application can communicate with the multi-mode service only through HTTP, and greatly reduces the development and deployment cost.
Drawings
FIG. 1 is a schematic block diagram of the system of the present invention.
Detailed Description
The present invention will be described in further detail with reference to examples, but the embodiments of the present invention are not limited thereto.
Example (b):
with reference to fig. 1, a system for configuring an adaptive transit gateway for multimodal services includes a multimodal service gateway and a multimodal service gateway background management, where the multimodal service gateway includes a current limiting module, an authentication module, a routing module, a service quality and fusing module, and a multimodal service providing module; the multimodal service gateway background management comprises a basic management module and a gateway routing configuration module. Wherein:
the basic management module comprises a user management module, an authority management module, an access amount counting module and a log query module, provides basic user and authority management, and provides log query and access amount counting for terminal access;
a gateway route configuration module: providing a service for configuring a route, the route comprising the following attributes: the multi-mode service gateway comprises an upstream service route, a downstream service route, service aggregation, configuration service authentication, current limiting configuration, cache configuration, service quality and fusing, header information forwarding and the like, if the multi-mode service gateway fails to provide certain reset, a service component can be defined by a user and is led in through the module.
A current limiting module: aiming at the configuration of basic data in a gateway routing configuration module, whether the routing starts the current limiting or not is obtained, if the current limiting is not needed, the verification is skipped, if the current limiting is needed, the current limiting is carried out according to corresponding strategies (the client can retry after a plurality of seconds, the maximum request number allowed in a statistical time period, an access white list and the like), the current limiting of the request is realized, and the crash of a downstream server due to access overload is prevented;
an authentication module: the authentication of the user request of the client is realized, and the service provided by the multi-modal service gateway is not allowed to be used when the user authentication is not carried out; the authentication module supports the authentication modes of JWT and Identity Server;
an authentication module: checking the authenticated user for permission to access the route;
a routing module: positioning downstream services and an exception handling mechanism through request routing of a client and routing configuration basic data provided by a gateway routing configuration module, wherein the positioned downstream services provide data support for a multi-modal service providing module, and the exception handling mechanism provides data support for service quality and a fusing module;
quality of service and fuse module: when the downstream service has a fault, the request is stopped to be forwarded to the downstream service through a policy (how many abnormal requests are allowed, the fusing time is short, and if the processing time of the downstream request exceeds how much, the request is freely set to be overtime) maintained by a gateway routing configuration module, so that the burden of a downstream server and an API gateway is relieved, and the normal operation of the API gateway and other downstream services is ensured;
a multimodal service providing module: and determining the type of the service according to the downstream service basic data provided by the routing module, establishing a communication channel corresponding to the service, and returning the processing result of the service to the terminal.
The invention can avoid the workload of developing and adapting the multi-mode service for each application, realizes that the client application can communicate with the multi-mode service only through HTTP by connecting the multi-mode gateway, and solves the problems that the traditional API gateway can only support one or two or three background services (HTTP, Webscolet and the like), and the traditional API gateway can not adapt rapidly and flexibly for newly added services, thereby greatly increasing the development and deployment cost.
Although the present invention has been described herein with reference to the illustrated embodiments thereof, which are intended to be preferred embodiments of the present invention, it is to be understood that the invention is not limited thereto, and that numerous other modifications and embodiments can be devised by those skilled in the art that will fall within the spirit and scope of the principles of this disclosure.