CN114422358A - API gateway configuration updating method and equipment - Google Patents

API gateway configuration updating method and equipment Download PDF

Info

Publication number
CN114422358A
CN114422358A CN202210096591.1A CN202210096591A CN114422358A CN 114422358 A CN114422358 A CN 114422358A CN 202210096591 A CN202210096591 A CN 202210096591A CN 114422358 A CN114422358 A CN 114422358A
Authority
CN
China
Prior art keywords
api gateway
updating
configuration
information
gateway
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
CN202210096591.1A
Other languages
Chinese (zh)
Other versions
CN114422358B (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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202210096591.1A priority Critical patent/CN114422358B/en
Publication of CN114422358A publication Critical patent/CN114422358A/en
Application granted granted Critical
Publication of CN114422358B publication Critical patent/CN114422358B/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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a method and equipment for updating API gateway configuration, wherein the method comprises the following steps: when monitoring that the configuration platform updates the API gateway, the updating device acquires the updating information of the API gateway from the configuration platform, wherein the API gateway adopts a responsibility chain mode and is in a running state; when the updating information is used for changing the existing function configuration of the API gateway, the updating device updates the configuration information in the memory corresponding to the API gateway according to the updating information; and when the updating information is used for configuring the newly added function of the API gateway, the updating device acquires a component package corresponding to the newly added target function configuration from a preset component library according to the updating information, sends the component package to the API gateway, and updates the configuration information in the memory corresponding to the API gateway according to the updating information. According to the embodiment of the application, dynamic updating can be realized when the API gateway is in the running state, and the reliability and the availability of the API gateway are effectively improved.

Description

API gateway configuration updating method and equipment
Technical Field
The embodiment of the Application relates to the technical field of computer networks, in particular to a method and equipment for updating Application Programming Interface (API) gateway configuration.
Background
The network service generally comprises a client and a server, and the API gateway is a bridge between the client and the server. The API gateway is used as a unified entry for the client to access the backend service, and needs to have good reliability and high availability capability, and also have certain arranging and expanding capabilities.
The existing API gateway generally records routing information in a configuration file manner, and when the API gateway is started, the API gateway automatically loads the configuration file into a memory and implements related functions according to the configuration file in the memory. When the function of the API gateway needs to be updated, the dynamic update in the running state cannot be realized only by changing the configuration file of the API gateway and restarting the API gateway, and the requirements on the high reliability and high availability principle of the API gateway are met.
Disclosure of Invention
The embodiment of the application provides an API gateway configuration updating method and device, dynamic updating can be achieved when the API gateway is in a running state, and reliability and availability of the API gateway are effectively improved.
In a first aspect, an embodiment of the present application provides an API gateway configuration updating method, where the method includes:
when monitoring that the configuration platform updates the API gateway, the updating device acquires the updating information of the API gateway from the configuration platform, wherein the API gateway adopts a responsibility chain mode and is in a running state;
when the updating information is used for changing the existing function configuration of the API gateway, the updating device updates the configuration information in the memory corresponding to the API gateway according to the updating information;
and when the updating information is used for configuring the newly added function of the API gateway, the updating device acquires a component package corresponding to the newly added target function configuration from a preset component library according to the updating information, sends the component package to the API gateway, and updates the configuration information in the memory corresponding to the API gateway according to the updating information.
In a possible implementation manner, the updating, by the updating apparatus, updating the configuration information in the memory corresponding to the API gateway according to the update information includes:
and the updating device loads the updating information into a memory corresponding to the API gateway by using a class loader.
In a possible implementation manner, the updating, by the updating apparatus, updating the configuration information in the memory corresponding to the API gateway according to the update information includes:
the updating device determines updating content corresponding to the updating information, wherein the updating content comprises the starting and stopping state and the arranging sequence of the existing functions of the API gateway;
and the updating device updates the configuration information in the memory corresponding to the API gateway according to the updating content.
In a possible implementation manner, before the updating device updates the configuration information in the memory corresponding to the API gateway according to the update information, the method further includes:
the updating device checks the changed function configuration of the API gateway;
and when the changed function configuration of the API gateway meets a preset change rule, the updating device updates the configuration information in the memory corresponding to the API gateway according to the updating information.
In a possible embodiment, the method further comprises:
and when the changed function configuration of the API gateway does not accord with the change rule, generating a reminding message, wherein the reminding message is used for reminding a user that the updating of the API gateway fails.
In a possible implementation manner, before the updating apparatus obtains the component package corresponding to the newly added target function configuration from the preset component library according to the update information, the method further includes:
the updating device checks the newly added target function configuration of the API gateway;
and when the newly added target function configuration of the API gateway meets a preset newly added rule, the updating device acquires a component package corresponding to the newly added target function configuration from a preset component library according to the updating information.
In a possible embodiment, the method further comprises:
and when the newly added target function configuration of the API gateway does not conform to the newly added rule, generating a reminding message, wherein the reminding message is used for reminding a user that the API gateway fails to update.
In a second aspect, an embodiment of the present application provides an API gateway configuration updating apparatus, including:
the monitoring module is used for acquiring the updating information of the API gateway from the configuration platform when the configuration platform is monitored to update the API gateway, and the API gateway adopts a responsibility chain mode and is in a running state;
the updating module is used for updating the configuration information in the memory corresponding to the API gateway according to the updating information when the updating information is used for changing the existing function configuration of the API gateway; and when the updating information is used for configuring the newly added function of the API gateway, the updating device acquires a component package corresponding to the newly added target function configuration from a preset component library according to the updating information, sends the component package to the API gateway, and updates the configuration information in the memory corresponding to the API gateway according to the updating information.
In a third aspect, an embodiment of the present application provides an electronic terminal, including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the API gateway configuration update method as provided by the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer executing instruction is stored in the computer-readable storage medium, and when a processor executes the computer executing instruction, the API gateway configuration updating method provided in the first aspect is implemented.
According to the API gateway configuration updating method and equipment provided by the embodiment of the application, when the configuration platform is monitored to update the API gateway, the updating device acquires the updating information of the API gateway from the configuration platform, wherein the API gateway adopts a responsibility chain mode and is in a running state; when the updating information is used for changing the existing function configuration of the API gateway, the updating device updates the configuration information in the memory corresponding to the API gateway according to the updating information; and when the update information is used for configuring the newly added function of the API gateway, the updating device acquires a component package corresponding to the newly added target function configuration from a preset component library according to the update information, sends the component package to the API gateway, and updates the configuration information in the memory corresponding to the API gateway according to the update information. According to the embodiment of the application, the dynamic update of the API gateway can be realized in the operation process of the API gateway under the condition of no restart, and the reliability and the availability of the API gateway are effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments of the present application or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without inventive exercise.
Fig. 1 is a schematic architecture diagram of an API gateway configuration update system provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of an API gateway configuration updating method provided in an embodiment of the present application;
FIG. 3 is a flow chart of a thermal arrangement mechanism provided in an embodiment of the present application;
fig. 4 is a schematic flow chart of a dynamic expansion mechanism provided in an embodiment of the present application;
fig. 5 is a schematic program module diagram of an API gateway configuration updating apparatus provided in an embodiment of the present application;
fig. 6 is a schematic hardware structure diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. In addition, while the disclosure herein has been presented in terms of one or more exemplary examples, it should be appreciated that aspects of the disclosure may be implemented solely as a complete embodiment.
It should be noted that the brief descriptions of the terms in the present application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of the present application. These terms should be understood in their ordinary and customary meaning unless otherwise indicated.
The terms "first," "second," and the like in the description and claims of this application and in the above-described drawings are used for distinguishing between similar or analogous objects or entities and not necessarily for describing a particular sequential or chronological order, unless otherwise indicated. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein.
Furthermore, the terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or device that comprises a list of elements is not necessarily limited to those elements explicitly listed, but may include other elements not expressly listed or inherent to such product or device.
The term "module," as used herein, refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and/or software code that is capable of performing the functionality associated with that element.
With the rapid advancement of cloud and micro-service in enterprise services, the API gateway gradually becomes a key component for landing applications and forwarding, and serves as a key part in an enterprise network architecture, and besides the need to ensure high reliability and high availability of gateway services, the API gateway also needs to provide the capability of supporting hot arrangement of related functions without restarting, and meanwhile, the API gateway also needs to provide the capability of integrating user-defined gateway functional components in the face of diversified requirements of various projects on the gateway capability.
The API is some predefined interfaces (e.g. functions, HTTP interfaces) or a convention for linking different components of the software system. The API gateway is a central interface for accessing all APIs of a group of services, so that the request of a client can be distributed to a back-end service in a uniform mode and rule; in addition to route distribution, the API gateway may integrate important security and management tasks such as authentication, throttling, request and response translation, etc.
The API gateway is used as a unified entry for a user or a client to access a backend service, and is required to have good high reliability and high availability capability, and simultaneously have certain arranging and expanding capabilities, and the existing API gateway expanding device or method generally has the following disadvantages:
firstly, the custom expansion cost is high: the existing API gateway or network agent needs to be expanded based on languages such as C + +, Lua or Go, and the like, and has no unified standard and interface when performing custom development and function enhancement, so that developers need to deeply understand products of the API gateway or network agent, and the cost of custom expansion development is increased.
Secondly, recompiling and restarting the service after custom expansion: after the existing API gateway product performs custom expansion or function enhancement on the gateway, the whole project and a newly added module code need to be repackaged or compiled, dynamic expansion and arrangement in operation cannot be realized, and the requirements on the high reliability and high availability principle of the gateway are deviated. That is, a general API gateway implemented based on software needs to restart services when performing configuration update and function plug, and cannot provide dynamic extension of gateway functions without restarting services and repackaging and compiling, which deviates from the requirements of the gateway itself on reliability, availability and timeliness.
In view of the above technical problems, the present application provides an API Gateway orchestration and dynamic expansion method, which is implemented on the basis of an API Gateway implemented based on a Spring-Cloud-Gateway framework, and by means of a responsibility chain mode and a distributed configuration platform, implements dynamic expansion of a third-party functional component for hot orchestration and hot loading of Gateway functions, so as to support diversified requirements of an enterprise on the API Gateway, and improve high reliability and high availability of the Gateway. The following examples are given for illustrative purposes.
The following explains the related terms referred to in the embodiments of the present application:
Spring-Cloud-Gateway: the second generation gateway framework based on Spring-Cloud can help developers to conveniently realize functions of routing forwarding, protocol conversion, current limiting and the like.
A distributed configuration platform: the distributed configuration platform can manage the configurations of different environments and different clusters of the application and the service in a centralized manner, can realize real-time pushing to the server after configuration, has the characteristics of standard authority, flow management and the like, and is suitable for a micro-service configuration management scene.
Hot arrangement: the finger gateway can realize the starting and stopping of related functions under the condition of not restarting the service.
And (3) thermal loading: the method is characterized in that a gateway functional component which is developed by a third party in a self-defined manner is loaded and integrated in real time on the premise of not compiling the gateway engineering again and restarting the gateway service.
Chain of responsibility mode: the method belongs to a design mode in program development, a sender and a processor of a request are decoupled, the request is only sent to the processor by the requester, each processor in a chain contains the reference of the next processor, and if the current processor cannot request, the reference is transmitted to the next processor, so that the sender does not need to pay attention to the details of processing and request transmission.
The application provides an API gateway configuration updating method supporting the API gateway to perform function hot arrangement and custom development enhancement based on spring-bound-gateway.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an API gateway configuration update system provided in an embodiment of the present application.
The API gateway configuration updating system provided in the embodiment of the application is realized based on spring-closed-gateway, and comprises an API gateway developed by using a responsibility chain mode, a distributed configuration platform and an updating device.
In some embodiments, the API gateway portion is implemented on the basis of a spring-closed-gateway framework, and is accessed into a filter chain of the spring-closed-gateway through a preset filter, and a design mode of a responsibility chain is used to implement functions of routing forwarding, identity authentication, current limiting, and the like of the API gateway, and the design mode provides a basis for thermal arrangement and subsequent dynamic expansion of each function; the distributed configuration platform module provides a function of pushing and configuring services of different clusters in different environments; the updating device can interact with the distributed configuration platform, can monitor the change of the relevant configuration of the configuration platform, and can actively acquire the configuration from the configuration platform.
Referring to fig. 2, fig. 2 is a schematic flowchart of an API gateway configuration updating method provided in an embodiment of the present application, where in some embodiments, the method includes:
s201, when monitoring that the configuration platform updates the functions of the API gateway, the updating device acquires the updating information of the API gateway from the configuration platform, and the API gateway adopts a responsibility chain mode and is in a running state.
In some embodiments, a user can update the gateway configuration of a specified cluster in a specified environment according to a change requirement through a distributed configuration platform, the update content includes start-stop states of specified functions, an arrangement sequence, configuration of related functions and the like, and the updated gateway configuration is configured and issued through the distributed configuration platform.
And S202, when the updating information is used for changing the existing function configuration of the API gateway, the updating device updates the configuration information in the memory corresponding to the API gateway according to the updating information.
In the embodiment of the application, a user modifies the corresponding configuration according to the rule on the configuration platform, the modified updating device monitors the change of the configuration, and updates the relevant configuration in the API gateway service memory after actively pulling the new configuration for verification.
Optionally, the changing of the existing function configuration of the API gateway includes updating a start-stop state and an arrangement sequence of the existing functions of the API gateway, deleting the existing functions of the API gateway, and the like.
And S203, when the update information is used for newly adding function configuration for the API gateway, the updating device acquires a component package corresponding to the newly added target function configuration from a preset component library according to the update information, sends the component package to the API gateway, and updates the configuration information in the memory corresponding to the API gateway according to the update information.
In the embodiment of the application, after the third party develops the API gateway custom function according to the interface standard, the third party actively increases the related configuration on the distributed configuration platform, and the updating device dynamically loads the new function to the running API gateway service by using the class loader after receiving the configuration information, so that the new function takes effect.
The API gateway configuration updating method provided by the embodiment of the application has the following advantages:
the usability and maintainability of the spring closed Gateway are improved, and the hot arrangement of the functions can be carried out during the operation. For example, in the internet second killing scene, functions such as current limiting, ip blacklist and the like need to be added urgently, the open-source native spring closed Gateway needs to be restarted, hot effect cannot be achieved, efficiency is low, and continuity influence is caused on services. By adopting the updating device provided by the application and matching with the distributed configuration platform, the hot arrangement of the gateway function can be efficiently realized, various emergency scenes can be effectively dealt with, and the back-end system of an enterprise is protected.
And secondly, the expansion capability of the spring closed Gateway is improved, when the expansion function is added to the open-source native spring closed Gateway, the original code function must be added into the jar packet in a compiling mode, the dynamic loading expansion code capability is not provided, the expansion capability of the spring closed Gateway is reduced, meanwhile, the upgrading and the changing of the function code are expanded, the spring closed Gateway and the expansion code need to be recompiled, and the efficiency and the reliability are low. The updating device provided by the application can dynamically load the extended jar and the corresponding function, the code of the spring closed Gateway does not need to be compiled, the upgrading and the changing of the extended function code only need to be compiled independently, the corresponding extended jar can be replaced, and the maintainability and the extension efficiency of the system are enhanced.
In some embodiments, the updating apparatus uses a class loader to load the update information into a memory corresponding to the API gateway.
In some embodiments, the updating device is configured to determine update content corresponding to the update information, where the update content includes updating a start-stop state and a scheduling sequence of existing functions of the API gateway; and updating the configuration information in the memory corresponding to the API gateway according to the updating content.
In some embodiments, the updating apparatus further includes a checking module, configured to check the changed function configuration of the API gateway; when the changed function configuration of the API gateway meets a preset change rule, the updating device updates the configuration information in the memory corresponding to the API gateway according to the updating information; and when the changed function configuration of the API gateway does not accord with the change rule, generating a reminding message, wherein the reminding message is used for reminding a user that the updating of the API gateway fails.
In some embodiments, the verification module is further configured to:
checking the newly added target function configuration of the API gateway; when the newly added target function configuration of the API gateway meets a preset newly added rule, the updating device acquires a component package corresponding to the newly added target function configuration from a preset component library according to the updating information; and when the newly added target function configuration of the API gateway does not conform to the newly added rule, generating a reminding message, wherein the reminding message is used for reminding a user that the API gateway fails to update.
Referring to fig. 3, fig. 3 is a schematic flow chart of a thermal arrangement mechanism provided in an embodiment of the present application, and in a possible implementation manner of the present application, a flow for implementing thermal arrangement is as follows:
1. configuration updating and publishing: and updating the gateway configuration of the designated cluster in the designated environment by the user through the distributed configuration platform according to the change requirement, wherein the updating content comprises the start-stop state of the designated function, the arrangement sequence, the configuration of the related function and the like, and the updated gateway configuration is configured and issued by the distributed configuration platform.
2. Configuration acquisition and verification: after the configuration is released, a listener of the updating device monitors related information and actively pulls the updated configuration, the configuration is verified according to the agreed standard and rule after pulling, if the verification is passed, the current configuration in the gateway service memory during operation is modified, and the latest arrangement and configuration are used by default when a new request passes through the gateway after the modification is successful, so that the repackaging, the releasing and the restarting of the gateway service are not needed; if the verification fails, the user is reminded, and the current configuration is continuously used without updating.
3. The arrangement is effective: the API gateway is realized in a design mode of a responsibility chain, and is deployed in a mode of separating configuration from service, a configuration file is loaded to a memory when the service is started for the first time, and after the configuration updated by a user is verified by an updating device, relevant configuration parameters in the service memory of the gateway can be actively updated, so that the latest configuration can be immediately effective, and the hot arrangement of the gateway function and the configuration is realized.
In some embodiments, a set of dynamic extension mechanism is designed for loading of the API gateway supporting the third-party custom development function, a third-party user can develop the custom function by relying on a public interface, and meanwhile, the API gateway can dynamically load a newly added functional component in an integrated mode.
Referring to fig. 4, fig. 4 is a schematic flowchart of a dynamic expansion mechanism provided in an embodiment of the present application, and in a possible implementation manner of the present application, a flow for implementing dynamic expansion is as follows:
1. and (3) third-party custom development: the third-party user can inject request context information for the self-defined component and realize the self-defined enhancement function by relying on the open public interface and realizing the method in the interface.
2. Packaging the custom components: after the user-defined component is developed, a third party packs the components in a jar package mode and places the packages into a third party functional component library at a specified position;
3. releasing the configuration of the newly added functions: and a third-party user adds related configuration on the distributed configuration platform and issues the configuration in a way in the process description of the thermal arrangement mechanism, and the updating device carries out thermal loading on the verification machine functional components of the related configuration in real time.
4. And function dynamic loading: after the updating device loads the component package, the configuration and function arrangement sequence in the memory is updated, and the newly added responsibility chain node can execute the related new function after the new request enters the gateway, namely, the dynamic expansion under the condition of no restart is realized.
The API gateway configuration updating method provided by the embodiment of the application skillfully provides a foundation for plugging and unplugging functions through a mode of a responsibility chain, and simultaneously, a mode with separated application and configuration is used, related functions and parameters thereof are injected through configuration, so that a premise is provided for dynamic expansion and hot arrangement of the API gateway.
Furthermore, the method and the device reduce the difficulty and complexity of managing and enhancing the functions of the API gateway, and a user can fully utilize java language characteristics through a unified interface and specification to expand and enhance the openness of the gateway function to a certain extent; meanwhile, the method and the device can acquire the function start-stop state and the configuration parameters of the current gateway in real time, modify and arrange the function start-stop state and the configuration parameters in real time, and solve the problems that the gateway is complex to configure as a middleware, the threshold of entering the door is high and the like.
According to the method and the device, the distributed configuration platform is fully utilized by means of the responsibility chain and the configuration type arrangement mode, the requirements of hot arrangement, hot plug and dynamic loading of the API gateway function during operation on new functional components developed by self-definition are met, and operations deviating from the high reliability and high availability principle of the gateway, such as recompiling, packing, issuing and restarting service after the function is enhanced are avoided.
Based on the content described in the foregoing embodiments, an API gateway configuration updating apparatus is further provided in the embodiments of the present application. Referring to fig. 5, fig. 5 is a schematic diagram of program modules of an API gateway configuration updating apparatus provided in an embodiment of the present application, where the API gateway configuration updating apparatus includes:
the monitoring module 501 is configured to, when it is monitored that the configuration platform updates the API gateway, obtain update information of the API gateway from the configuration platform, where the API gateway adopts a responsibility chain mode and is in a running state.
An updating module 502, configured to, when the update information is used to change an existing function configuration of the API gateway, update configuration information in a memory corresponding to the API gateway by the updating apparatus according to the update information; and when the updating information is used for configuring the newly added function of the API gateway, the updating device acquires a component package corresponding to the newly added target function configuration from a preset component library according to the updating information, sends the component package to the API gateway, and updates the configuration information in the memory corresponding to the API gateway according to the updating information.
In some embodiments, the updating apparatus uses a class loader to load the update information into a memory corresponding to the API gateway.
In some embodiments, the updating module 502 is configured to determine an update content corresponding to the update information, where the update content includes updating a start-stop state and a scheduling sequence of an existing function of the API gateway; and updating the configuration information in the memory corresponding to the API gateway according to the updating content.
In some embodiments, the API gateway further comprises a verification module, configured to verify the changed functional configuration of the API gateway; when the changed function configuration of the API gateway meets a preset change rule, the updating device updates the configuration information in the memory corresponding to the API gateway according to the updating information; and when the changed function configuration of the API gateway does not accord with the change rule, generating a reminding message, wherein the reminding message is used for reminding a user that the updating of the API gateway fails.
In some embodiments, the verification module is further configured to:
checking the newly added target function configuration of the API gateway; when the newly added target function configuration of the API gateway meets a preset newly added rule, the updating device acquires a component package corresponding to the newly added target function configuration from a preset component library according to the updating information; and when the newly added target function configuration of the API gateway does not conform to the newly added rule, generating a reminding message, wherein the reminding message is used for reminding a user that the API gateway fails to update.
The API gateway configuration updating device provided by the application is based on a responsibility chain mode, and on the premise of separation of configuration and service, the function arrangement and configuration hot updating of the API gateway during operation in a full scene can be realized by means of a distributed configuration platform; meanwhile, the dynamic loading of third-party self-defined function components is supported, the maintainability and the expansion efficiency of the native gateway system are enhanced, the dynamic extension device is suitable for dynamic extension devices of various applications and systems of enterprises, which have requirements on the API gateway, and users can realize the arrangement and the expansion of the API gateway functions during operation by using the device only by realizing uniform and standard interfaces.
Further, based on the content described in the foregoing embodiments, an electronic device is also provided in the embodiments of the present application, where the electronic device includes at least one processor and a memory; wherein the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory to implement the steps of the credit data management method described in the above embodiments, which is not described herein again.
For better understanding of the embodiment of the present application, referring to fig. 6, fig. 6 is a schematic diagram of a hardware structure of an electronic device provided in the embodiment of the present application.
As shown in fig. 6, the electronic apparatus of the present embodiment includes: a processor 601 and a memory 602; wherein:
a memory 602 for storing computer-executable instructions;
the processor 601 is configured to execute a computer execution instruction stored in the memory to implement each step in the credit data management method described in the foregoing embodiments, which is not described herein again.
Alternatively, the memory 602 may be separate or integrated with the processor 601.
When the memory 602 is provided separately, the device further comprises a bus 603 for connecting said memory 602 and the processor 601.
Further, based on the content described in the foregoing embodiments, an embodiment of the present application further provides a computer-readable storage medium, where a computer-executable instruction is stored in the computer-readable storage medium, and when a processor executes the computer-executable instruction, the steps in the API gateway configuration updating method described in the foregoing embodiments are implemented, and details of this embodiment are not repeated herein.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules is only one logical division, and other divisions may be realized in practice, for example, a plurality of modules may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one unit. The module integrated unit can be realized in a hardware form, and can also be realized in a form of hardware and a software functional unit.
The integrated module implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application.
It should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in the incorporated application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
The memory may comprise a high-speed RAM memory, and may further comprise a non-volatile storage NVM, such as at least one disk memory, and may also be a usb disk, a removable hard disk, a read-only memory, a magnetic or optical disk, etc.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The storage medium may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the storage medium may reside as discrete components in an electronic device or host device.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. An API gateway configuration update method, the method comprising:
when monitoring that a configuration platform updates the functions of an API gateway, an updating device acquires the updating information of the API gateway from the configuration platform, wherein the API gateway adopts a responsibility chain mode and is in a running state;
when the updating information is used for changing the existing function configuration of the API gateway, the updating device updates the configuration information in the memory corresponding to the API gateway according to the updating information;
and when the updating information is used for configuring the newly added function of the API gateway, the updating device acquires a component package corresponding to the newly added target function configuration from a preset component library according to the updating information, sends the component package to the API gateway, and updates the configuration information in the memory corresponding to the API gateway according to the updating information.
2. The method according to claim 1, wherein the updating device updates the configuration information in the memory corresponding to the API gateway according to the update information, and includes:
and the updating device loads the updating information into a memory corresponding to the API gateway by using a class loader.
3. The method according to claim 1, wherein the updating device updates the configuration information in the memory corresponding to the API gateway according to the update information, and includes:
the updating device determines updating content corresponding to the updating information, wherein the updating content comprises the starting and stopping state and the arranging sequence of the existing functions of the API gateway;
and the updating device updates the configuration information in the memory corresponding to the API gateway according to the updating content.
4. The method according to any one of claims 1 to 3, wherein before the updating device updates the configuration information in the memory corresponding to the API gateway according to the update information, the method further comprises:
the updating device checks the changed function configuration of the API gateway;
and when the changed function configuration of the API gateway meets a preset change rule, the updating device updates the configuration information in the memory corresponding to the API gateway according to the updating information.
5. The method of claim 4, further comprising:
and when the changed function configuration of the API gateway does not accord with the change rule, generating a reminding message, wherein the reminding message is used for reminding a user that the updating of the API gateway fails.
6. The method according to claim 1, wherein before the updating apparatus obtains the component package corresponding to the newly added target function configuration from a preset component library according to the update information, the method further comprises:
the updating device checks the newly added target function configuration of the API gateway;
and when the newly added target function configuration of the API gateway meets a preset newly added rule, the updating device acquires a component package corresponding to the newly added target function configuration from a preset component library according to the updating information.
7. The method of claim 6, further comprising:
and when the newly added target function configuration of the API gateway does not conform to the newly added rule, generating a reminding message, wherein the reminding message is used for reminding a user that the API gateway fails to update.
8. An API gateway configuration update apparatus, comprising:
the monitoring module is used for acquiring the updating information of the API gateway from the configuration platform when the configuration platform is monitored to update the API gateway, and the API gateway adopts a responsibility chain mode and is in a running state;
the updating module is used for updating the configuration information in the memory corresponding to the API gateway according to the updating information when the updating information is used for changing the existing function configuration of the API gateway; and when the updating information is used for configuring the newly added function of the API gateway, the updating device acquires a component package corresponding to the newly added target function configuration from a preset component library according to the updating information, sends the component package to the API gateway, and updates the configuration information in the memory corresponding to the API gateway according to the updating information.
9. An electronic terminal, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the memory-stored computer-executable instructions cause the at least one processor to perform the API gateway configuration update method of any of claims 1 to 7.
10. A computer-readable storage medium having stored thereon computer-executable instructions which, when executed by a processor, implement the API gateway configuration update method of any one of claims 1 to 7.
CN202210096591.1A 2022-01-26 2022-01-26 API gateway configuration updating method and equipment Active CN114422358B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210096591.1A CN114422358B (en) 2022-01-26 2022-01-26 API gateway configuration updating method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210096591.1A CN114422358B (en) 2022-01-26 2022-01-26 API gateway configuration updating method and equipment

Publications (2)

Publication Number Publication Date
CN114422358A true CN114422358A (en) 2022-04-29
CN114422358B CN114422358B (en) 2024-01-30

Family

ID=81276434

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210096591.1A Active CN114422358B (en) 2022-01-26 2022-01-26 API gateway configuration updating method and equipment

Country Status (1)

Country Link
CN (1) CN114422358B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174342A (en) * 2022-06-15 2022-10-11 阿里巴巴(中国)有限公司 Gateway plug-in management method, device and equipment

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101771762A (en) * 2009-01-06 2010-07-07 北京邮电大学 Method and system for dynamically loading services in service system
CN106656622A (en) * 2016-12-29 2017-05-10 深圳Tcl新技术有限公司 Method and device for configuring interface call tasks
CN107533491A (en) * 2015-09-14 2018-01-02 松下电器(美国)知识产权公司 Gateway apparatus, firmware update and control program
CN108900329A (en) * 2018-06-21 2018-11-27 珠海宏桥高科技有限公司 Real-time dynamic forwarding method based on gateway infrastructure service
CN108965007A (en) * 2018-07-19 2018-12-07 北京车和家信息技术有限公司 API gateway interface configures update method and device
CN109842656A (en) * 2017-11-28 2019-06-04 厦门雅迅网络股份有限公司 Car networking method of servicing, the car networking gateway system of the compatible multi-protocols of intelligence
CN110493067A (en) * 2019-09-05 2019-11-22 中国银联股份有限公司 A kind of method and device that API gateway service updates
CN112260876A (en) * 2020-10-26 2021-01-22 欧冶云商股份有限公司 Dynamic gateway route configuration method, platform, computer equipment and storage medium
CN112636992A (en) * 2021-03-10 2021-04-09 腾讯科技(深圳)有限公司 Dynamic routing method, device, equipment and storage medium
CN112882738A (en) * 2021-03-22 2021-06-01 亿企赢网络科技有限公司 Configuration information updating method and device under micro-service architecture and electronic equipment
US11095506B1 (en) * 2020-07-22 2021-08-17 Servicenow, Inc. Discovery of resources associated with cloud operating system
CN113315710A (en) * 2021-05-29 2021-08-27 东方电子股份有限公司 Middle station API gateway management configuration and extension method based on asynchronous dynamic routing
CN113452617A (en) * 2021-06-24 2021-09-28 上海豹云网络信息服务有限公司 Dynamic gateway route management method, device and storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101771762A (en) * 2009-01-06 2010-07-07 北京邮电大学 Method and system for dynamically loading services in service system
CN107533491A (en) * 2015-09-14 2018-01-02 松下电器(美国)知识产权公司 Gateway apparatus, firmware update and control program
CN106656622A (en) * 2016-12-29 2017-05-10 深圳Tcl新技术有限公司 Method and device for configuring interface call tasks
CN109842656A (en) * 2017-11-28 2019-06-04 厦门雅迅网络股份有限公司 Car networking method of servicing, the car networking gateway system of the compatible multi-protocols of intelligence
CN108900329A (en) * 2018-06-21 2018-11-27 珠海宏桥高科技有限公司 Real-time dynamic forwarding method based on gateway infrastructure service
CN108965007A (en) * 2018-07-19 2018-12-07 北京车和家信息技术有限公司 API gateway interface configures update method and device
CN110493067A (en) * 2019-09-05 2019-11-22 中国银联股份有限公司 A kind of method and device that API gateway service updates
US11095506B1 (en) * 2020-07-22 2021-08-17 Servicenow, Inc. Discovery of resources associated with cloud operating system
CN112260876A (en) * 2020-10-26 2021-01-22 欧冶云商股份有限公司 Dynamic gateway route configuration method, platform, computer equipment and storage medium
CN112636992A (en) * 2021-03-10 2021-04-09 腾讯科技(深圳)有限公司 Dynamic routing method, device, equipment and storage medium
CN112882738A (en) * 2021-03-22 2021-06-01 亿企赢网络科技有限公司 Configuration information updating method and device under micro-service architecture and electronic equipment
CN113315710A (en) * 2021-05-29 2021-08-27 东方电子股份有限公司 Middle station API gateway management configuration and extension method based on asynchronous dynamic routing
CN113452617A (en) * 2021-06-24 2021-09-28 上海豹云网络信息服务有限公司 Dynamic gateway route management method, device and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174342A (en) * 2022-06-15 2022-10-11 阿里巴巴(中国)有限公司 Gateway plug-in management method, device and equipment
CN115174342B (en) * 2022-06-15 2024-03-08 阿里巴巴(中国)有限公司 Plug-in management method, device and equipment of gateway

Also Published As

Publication number Publication date
CN114422358B (en) 2024-01-30

Similar Documents

Publication Publication Date Title
CN111290865A (en) Service calling method and device, electronic equipment and storage medium
EP2696532A2 (en) Method, server and system for starting application
CN112486547B (en) Application program updating method and device under multi-tenant scene and electronic equipment
US8806475B2 (en) Techniques for conditional deployment of application artifacts
KR20060051932A (en) Updating software while it is running
CN111930521A (en) Method and device for deploying application, electronic equipment and readable storage medium
CN111090423B (en) Webhook framework system and method for realizing active calling and event triggering
CN109995523B (en) Activation code management method and device and activation code generation method and device
EP4033349A1 (en) Method and apparatus for generating mirror image file, and computer-readable storage medium
US20180246753A1 (en) Program execution without the use of bytecode modification or injection
CN113626133B (en) Virtual machine control method, device, equipment and computer readable storage medium
CN115378735B (en) Data processing method and device, storage medium and electronic equipment
CN108399331A (en) Application process trial method and system
CN111064626B (en) Configuration updating method, device, server and readable storage medium
CN113595927A (en) Method and device for processing mirror flow in bypass mode
CN114422358A (en) API gateway configuration updating method and equipment
CN109032685A (en) A kind of method and terminal accelerating Android system starting
CN113596151A (en) Plug-in management method and device, and data processing method and device
CN113268308B (en) Information processing method, device and storage medium
CN115617471A (en) Service calling method and device, storage medium and electronic equipment
CN115811481A (en) Interactive service testing method and device, computer equipment and storage medium
CN115185847A (en) Fault testing method and device, storage medium and electronic equipment
CN115760391A (en) Intelligent contract changing method and device in block chain, electronic equipment and storage medium
CN110286956B (en) Plug-in operation method and device and electronic equipment
CN112350856B (en) Distributed service sign-off method and equipment

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