API gateway configuration method, program product, electronic equipment and storage medium

By replacing the placeholder in the API gateway configuration file template with the microservice application ID and generating a configuration file, the automatic creation and binding of API gateway objects is realized, which solves the problem of low configuration efficiency in APISIX, improves configuration efficiency and reduces costs. Administrative costs.

CN118784464APending Publication Date: 2024-10-15JIANWEI DIGITAL TECH (CHONGQING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410969171.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-10-15

Smart Images

  • Figure CN118784464A_ABST
    Figure CN118784464A_ABST
Patent Text Reader

Abstract

The invention provides an API gateway configuration method, a program product, electronic equipment and a storage medium, the method comprises the following steps: reading a configuration file template corresponding to a configuration object in an API gateway, the configuration file template comprising a replacement placeholder of an ID of a micro-service application; for a current micro-service application needing to be configured in the API gateway, replacing the replacement placeholder in the configuration file template with an ID of the current micro-service application, and generating a configuration file corresponding to the configuration object; and creating the configuration object according to the configuration file by executing an instruction of the API gateway. According to the invention, the configuration efficiency of the API gateway can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer networks, and more specifically, to a configuration method, program product, electronic device, and storage medium for an API gateway. Background Art

[0002] APISIX Cloud Native Gateway is a high-performance API management platform and gateway designed for cloud native environments. APISIX provides routing management capabilities, which ensures that requests are correctly routed to backend services by matching routing paths. APISIX also provides upstream management capabilities for managing upstream nodes of backend services, including load balancing, health checks, and other functions. APISIX also provides consumer management capabilities, where users can set different authentication and authorization policies for different consumers to ensure access security.

[0003] Currently, the creation of routing, upstream, consumer and other objects in APISIX is mainly done manually after logging into the APISIX dashboard management interface, which is inefficient. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a configuration method, program product, electronic device and storage medium of an API gateway to improve the configuration efficiency of the API gateway.

[0005] In a first aspect, the present application provides a configuration method for an API gateway, comprising: reading a configuration file template corresponding to a configuration object in the API gateway, the configuration file template including a replacement placeholder for the ID of a microservice application; for a current microservice application that needs to be configured in the API gateway, replacing the replacement placeholder in the configuration file template with the ID of the current microservice application, and generating a configuration file corresponding to the configuration object; and creating the configuration object according to the configuration file by executing instructions of the API gateway.

[0006] In the above scheme, a template of the configuration file is pre-created for the object to be configured in the API gateway. By replacing the replacement placeholder in the configuration file template with the ID of the current microservice application, a configuration file adapted to the current microservice application is formed. Based on such a configuration file, a configuration object adapted to the current microservice application can be quickly created, saving the time of manually adding repeated configuration information, thereby greatly improving the configuration efficiency of the API gateway and saving human management costs.

[0007] As an optional method, the configuration object includes at least one of a route, an upstream, and a consumer. In the above scheme, the creation of routes, upstreams, and consumers in the API gateway can be automatically completed, which improves efficiency, and the configuration object is flexible and has strong configuration capabilities.

[0008] As an optional method, if the data format of the configuration file template is JSON, then replacing the replacement placeholder in the configuration file template with the ID of the current microservice application includes: using the command line processing tool jq to replace the replacement placeholder in the configuration file template with the ID of the current microservice application. In the above scheme, how to use the JSON tool to replace the ID of the microservice application when processing and exchanging data in JSON format is given, which is simple to operate, highly versatile, and can also avoid the line breaks that the script interpreter cannot parse.

[0009] As an optional manner, the configuration object includes a first configuration object and a second configuration object, the configuration file corresponding to the first configuration object is a first configuration file, and the configuration file corresponding to the second configuration object is a second configuration file. After the configuration object is created according to the configuration file by executing the instructions of the API gateway, it also includes: querying the first ID of the first configuration object and the second ID of the second configuration object from the API gateway according to the ID of the current microservice application; updating the second ID to the first configuration file to obtain a first updated configuration file; or updating the first ID to the second configuration file to obtain a second updated configuration file; and binding the first configuration object to the second configuration object according to the first updated configuration file or the second updated configuration file by executing the instructions of the API gateway.

[0010] In the above solution, after the configuration object is created and published, for multiple related configuration objects serving the same microservice application, the ID of the same microservice application can be used for querying to achieve automatic binding of the configuration objects, further improving the efficiency of API gateway configuration.

[0011] As an optional manner, the first configuration object is a route, the first configuration file is a route configuration file, and the second configuration object is an upstream; querying the first ID of the first configuration object and the second ID of the second configuration object from the API gateway according to the ID of the current microservice application includes: querying the route ID of the route and the upstream ID of the upstream from the API gateway according to the ID of the current microservice application; updating the second ID to the first configuration file to obtain a first updated configuration file includes: updating the upstream ID to the route configuration file to obtain a route update configuration file; binding the first configuration object and the second configuration object according to the first updated configuration file by executing the instructions of the API gateway includes: binding the route and the upstream according to the route update configuration file by executing the instructions of the API gateway.

[0012] In the above solution, when the configuration objects are routing and upstream respectively and both serve the same microservice application, the upstream ID is found through the ID of the microservice application, and then the upstream ID is updated to the routing configuration file, so that the routing and upstream can be automatically bound.

[0013] As an optional manner, the first configuration object is a route, the second configuration object is a consumer, and the second configuration file is a consumer configuration file; querying the first ID of the first configuration object and the second ID of the second configuration object from the API gateway according to the ID of the current microservice application includes: querying the route ID of the route and the consumer ID of the consumer from the API gateway according to the ID of the current microservice application; updating the first ID to the second configuration file to obtain a second updated configuration file includes: updating the route ID to the consumer configuration file to obtain a consumer updated configuration file; binding the first configuration object and the second configuration object according to the second updated configuration file by executing the instructions of the API gateway includes: binding the route and the consumer according to the consumer updated configuration file by executing the instructions of the API gateway.

[0014] In the above solution, when the configuration objects are routing and consumers and both serve the same microservice application, the routing ID is found through the ID of the microservice application, and then the routing ID is updated to the consumer configuration file, so that the routing and consumer can be automatically bound.

[0015] As an optional way, the method further includes: logging into the control plane of the API gateway to obtain an authentication token; the instruction executed by the API gateway carries the authentication token, and the authentication token is used for permission authentication. In the above scheme, the authentication token enhances the security of the system.

[0016] In a second aspect, the present application provides a computer program product, comprising computer program instructions, wherein when the computer program instructions are read and executed by a processor, the method described in the first aspect is executed.

[0017] In a third aspect, the present application provides an electronic device comprising: a processor, a memory and a bus, wherein the processor and the memory communicate with each other through the bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the method described in the first aspect above.

[0018] In a fourth aspect, the present application provides a computer-readable storage medium, comprising: the computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the method described in the first aspect above.

[0019] Other features and advantages of the present application will be described in the subsequent description, and in part will become apparent from the description, or will be understood by implementing the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 A flowchart of a method for configuring an API gateway provided in an embodiment of the present application;

[0022] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The following embodiments of the technical solution of the present application are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.

[0024] It should be noted that all technical and scientific terms used in this document have the same meanings as those generally understood by technicians in the technical field to which this application belongs; the terms used in this document are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.

[0025] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.

[0026] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0027] Please refer to Figure 1 , Figure 1 A flowchart of a method for configuring an API gateway provided in an embodiment of the present application, the method comprising the following steps:

[0028] Step S10: Read the configuration file template corresponding to the configuration object in the API gateway, where the configuration file template includes a replacement placeholder for the ID of the microservice application.

[0029] The embodiment of the present application does not specifically limit the type of API gateway, and those skilled in the art may make adjustments according to actual conditions. For example, the API gateway includes but is not limited to the APISIX gateway.

[0030] Configuration objects are objects in the API gateway that support the communication, request processing, and business logic implementation of microservice applications. In actual applications, configuration objects can be created, modified, and deleted through specific management tools or interfaces. These tools or interfaces provide user-friendly interfaces that enable network administrators to complete configuration tasks. At the same time, configuration objects also support automated configuration and management through scripts or command line interfaces. The configuration file template is a text file that defines the properties of the configuration object and stores the configuration object parameter information.

[0031] In some embodiments, the configuration object includes at least one of a route, an upstream, and a consumer. In a microservice architecture, a route refers to the rules used by the API gateway to determine how to process and forward requests. When the API gateway receives a request, it directs the request to the corresponding microservice according to the predefined routing rules; an upstream refers to a microservice application or server that receives client requests and provides corresponding services; a consumer refers to a client application or microservice that initiates a request.

[0032] Microservice applications refer to a series of small, autonomous services that are connected, managed, and communicated through an API gateway. Microservice applications are an integral part of the microservice architecture, where each microservice focuses on completing a specific business function and interacts with other services through lightweight communication protocols.

[0033] For the configuration objects in the API gateway, different configuration objects have their own configuration file templates. A configuration file template is specifically applicable to a configuration object. Various configuration file templates are created and stored in advance for ready call. The configuration file template includes the common configuration information of the corresponding configuration objects, and the microservice application ID that needs to be adjusted according to the actual situation is replaced by a replacement placeholder.

[0034] The replacement placeholder in the configuration file template is a special marker that reserves a position in the file so that it can be replaced with an actual value as needed in subsequent operations. For example, the replacement placeholder can be some special characters or strings.

[0035] Step S20: For the current microservice application that needs to be configured in the API gateway, the replacement placeholder in the configuration file template is replaced with the ID of the current microservice application, and a configuration file corresponding to the configuration object is generated.

[0036] For the current microservice application that needs to be configured in the API gateway, when creating a configuration object for the current microservice application, replace the replacement placeholder in the configuration file template with the ID of the current microservice application, generate the configuration file corresponding to the configuration object, and save it.

[0037] Step S30: Create a configuration object according to the configuration file by executing the instructions of the API gateway.

[0038] By executing the instructions of the API gateway, the configuration file is submitted to the control plane of the API management end to complete the creation of the configuration object. This application does not specifically limit the communication protocol used by the instructions of the API gateway, and those skilled in the art can adjust it according to actual conditions. As an implementation method, the POST request method of the HTTP protocol can be used to send the configuration file data to the API gateway.

[0039] In the above scheme, a template of the configuration file is pre-created for the object to be configured in the API gateway. By replacing the replacement placeholder in the configuration file template with the ID of the current microservice application, a configuration file adapted to the current microservice application is formed. Based on such a configuration file, a configuration object adapted to the current microservice application can be quickly created, thereby saving the time of manually adding repeated configuration information, thereby greatly improving the configuration efficiency of the API gateway and saving human management costs.

[0040] The present application does not specifically limit the configuration file templates corresponding to the routing, upstream, and consumer, including configuration information and data formats. Those skilled in the art may adjust them according to actual conditions. For example, the data format may be JSON or XML as an implementation method, and the configuration file template corresponding to the routing may be in JSON format, for example:

[0041]

[0042] Taking the microservice application ID as dgmes-pl as an example, replace the replacement placeholder in the routing configuration file template with dgmes-pl and save it as route.json to avoid the line that the script interpreter cannot parse. Then use curl "!route!" -H "Authorization:!token!" -X POST-d@route.json to synchronously create routes in APISIX.

[0043] As an implementation method, the configuration file template corresponding to the upstream may be:

[0044]

[0045] Taking the microservice application ID as dgmes-pl as an example, replace the replacement placeholder in the upstream configuration file template with dgmes-pl and save it as upstream.json to avoid the line that the script interpreter cannot parse. Then use curl "!upstream!" -H "Authorization:!token!" -X POST-d@upstream.json to synchronously create the upstream in APISIX.

[0046] As an implementation method, the configuration file template corresponding to the consumer may be:

[0047]

[0048] Taking the microservice application ID dgmes-pl as an example, replace the replacement placeholder in the consumer configuration file template with dgmes-pl and save consumer.json to avoid the line that the script interpreter cannot parse. Then use curl "!consumer!" -H "Authorization:!token!" -X POST-d@consumer.json to synchronously create a consumer in APISIX.

[0049] In the above solution, the creation of any one or more objects in the routing, upstream, and consumer in the API gateway can be automatically completed, which improves efficiency, and has flexible configuration and strong configuration capabilities.

[0050] In some embodiments, if the data format of the configuration file template is JSON, then replacing the replacement placeholder in the configuration file template with the ID of the current microservice application in step S20 includes:

[0051] Use the command line processing tool jq to replace the replacement placeholder in the configuration file template with the ID of the current microservice application.

[0052] jq is a lightweight command-line JSON processing tool used to parse, filter, modify, and manipulate JSON data. If the data format of the configuration file template is JSON, you can use jq to replace the replacement placeholder in the configuration file template with the ID of the current microservice application.

[0053] In the above solution, it is given how to use JSON tools to replace the ID of the microservice application when processing and exchanging data in JSON format. The operation is simple and versatile, and it can also avoid the branch lines that the script interpreter cannot parse.

[0054] In some embodiments, the configuration object includes a first configuration object and a second configuration object, the configuration file corresponding to the first configuration object is a first configuration file, and the configuration file corresponding to the second configuration object is a second configuration file. After step S30, the method further includes:

[0055] S40: Query the first ID of the first configuration object and the second ID of the second configuration object from the API gateway according to the ID of the current microservice application.

[0056] After the configuration object is created, the ID of the configuration object is automatically generated. The ID of the first configuration object is the first ID, and the ID of the second configuration object is the second ID. Since the replacement placeholders in the first configuration file and the second configuration file are replaced with the ID of the current microservice application at the beginning of the creation of the first configuration object and the second configuration object, the first configuration object and the second configuration object are associated with the ID of the current microservice application, so that the first ID and the second ID can be queried from the API gateway through the ID of the microservice application.

[0057] S50: updating the second ID into the first configuration file to obtain a first updated configuration file; or updating the first ID into the second configuration file to obtain a second updated configuration file.

[0058] S60: Bind the first configuration object and the second configuration object according to the first update configuration file or the second update configuration file by executing the instruction of the API gateway.

[0059] In step S50, if the execution is to update the second ID to the first configuration file to obtain the first updated configuration file, then in step S60, the first configuration object and the second configuration object are bound according to the first updated configuration file; in step S50, if the execution is to update the first ID to the second configuration file to obtain the second updated configuration file, then in step S60, the first configuration object and the second configuration object are bound according to the second updated configuration file.

[0060] The updated configuration file needs to be submitted to the control plane of the API gateway management end again to complete the binding of the first configuration object and the second configuration object. The control plane of the API gateway management end is an important part of the API gateway architecture. It is mainly responsible for the full life cycle management of the API and the distribution of configurations.

[0061] In the above solution, after the configuration object is created and published, for multiple related configuration objects serving the same microservice application, the ID of the same microservice application can be used for querying to achieve automatic binding of the configuration objects, further improving the efficiency of API gateway configuration.

[0062] In some embodiments, the first configuration object is a route, the first configuration file is a route configuration file, and the second configuration object is an upstream, then step S40 corresponds to:

[0063] Query the route ID of the route and the upstream ID of the upstream from the API gateway according to the ID of the current microservice application.

[0064] In step S50, the second ID is updated to the first configuration file to obtain a first updated configuration file, which corresponds to:

[0065] Update the upstream ID to the routing configuration file to obtain the routing update configuration file.

[0066] In step S60, the first configuration object and the second configuration object are bound according to the first update configuration file by executing the instruction of the API gateway, which corresponds to:

[0067] By executing the instructions of the API gateway, the route is bound to the upstream according to the route update configuration file.

[0068] After adding the upstream ID to the routing configuration file, you need to submit the routing update configuration file with the upstream ID added to the control plane of the API management end to complete the binding. As an implementation method, taking the ID of the current microservice application as dgmes_pl as an example, query the route_id of the route through dgmes_pl, query the upstream_id of the upstream through dgmes_pl, update the upstream_id and value to route.json, and then use the instruction curl "%route% / !route_id!" -H "Authorization:!token!" -X PUT-d@route.json in APISIX to complete the binding. After completing the binding of the route and the upstream, the current microservice application has the ability to provide external services.

[0069] In the above solution, when the configuration objects are routing and upstream respectively and both serve the same microservice application, the upstream ID is found through the ID of the microservice application, and then the upstream ID is updated to the routing configuration file, so that the routing and upstream can be automatically bound.

[0070] In some embodiments, the first configuration object is a route, the second configuration object is a consumer, and the second configuration file is a consumer configuration file, then step S40 corresponds to:

[0071] According to the ID of the current microservice application, query the route ID of the route and the consumer ID of the consumer from the API gateway.

[0072] In step S50, the first ID is updated to the second configuration file to obtain a second updated configuration file, which corresponds to:

[0073] Update the routing ID into the consumer configuration file to obtain the consumer update configuration file.

[0074] In step S60, the first configuration object and the second configuration object are bound according to the second update configuration file by executing the instruction of the API gateway, which corresponds to:

[0075] By executing the instructions of the API gateway, the routes are bound to the consumers according to the updated configuration files of the consumers.

[0076] After adding the route ID to the consumer configuration file, you need to submit the consumer update configuration file with the route ID added to the control plane of the API management end to complete the binding. As an implementation method, taking the ID of the current microservice application as dgmes_pl as an example, query the route_id of the route through dgmes_pl, query the consumer_id of the consumer through dgmes_pl, update the route_id and value to the consumer-restriction of consumer.json, and then use the instruction curl "%consumer% / !consumer_id!" -H "Authorization:!token!" -X PUT-d@consumer.json in APISIX to complete the binding. After completing the binding of the route and the consumer, the current microservice application has the ability to restrict consumption.

[0077] In the above solution, when the configuration objects are routing and consumers and both serve the same microservice application, the routing ID is found through the ID of the microservice application, and then the routing ID is updated to the consumer configuration file, so that the routing and consumer can be automatically bound.

[0078] In some embodiments, the method further comprises:

[0079] Log in to the control plane of the API gateway and obtain an authentication token. The instructions executed by the API gateway carry the authentication token, which is used for permission authentication.

[0080] For example, you can use the curl command to log in to the control plane of an API gateway environment cluster with a username and password, obtain information such as an authentication token, and save the authentication token obtained by logging in for authentication when you subsequently request the control plane interface of the API gateway. In the API gateway instructions in the above embodiment, token is the authentication token, and the instructions executed by the API gateway need to carry the authentication token.

[0081] The authentication token in the gateway is a mechanism for identity authentication and permission control, which is used to verify the identity and permissions of the requester and ensure that only legitimate users or services can access the backend microservices.

[0082] In the above scheme, the authentication token enhances the security of the system.

[0083] In some embodiments, for multiple microservice applications that need to create configuration objects, the IDs of all microservice applications can be sorted out, and then a loop is used to traverse the ID of each microservice application, and steps S20 and S30 (possibly S40, S50, S60) in the configuration method of the API gateway provided in the embodiment of the present application are repeated, so that batch creation and binding of configuration objects under multiple microservice applications can be achieved, which can greatly shorten the time of gateway configuration, save labor costs, and improve management efficiency. For example, the IDs of microservice applications that need to create configuration objects are sorted out to obtain an ID list of: dgmes-pldgmes-qt dgmes-tl dgmes-de dgmes-sm dgmes-sr dgmes-lg dgmes-st dgmes-itdgmes-ct dgmes-cm dgmes-pt, and all microservice application IDs in the list are traversed in a loop, and the replacement placeholder in the configuration file template is replaced with the ID of the current microservice application, and a configuration file corresponding to the configuration object is generated, and the configuration object is created according to the configuration file by executing the instructions of the API gateway. Optionally, binding between configuration objects can also be completed during the traversal process.

[0084] In some embodiments, for API gateway clusters existing in multiple environments, configuration synchronization of API gateways in different environments can be achieved by repeatedly executing the API gateway configuration method in the embodiments of the present application in the API gateway clusters in different environments.

[0085] An embodiment of the present application also provides a computer program product, including computer program instructions, which, when read and executed by a processor, execute the methods provided by the above-mentioned method embodiments.

[0086] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the electronic device includes a processor 201, a memory 202 and a bus 203, wherein the processor 201 and the memory 202 communicate with each other through the bus 203. The processor 201 calls the program instructions in the memory 202 to execute the methods provided by the above method embodiments.

[0087] The processor 201 can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 201 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. It can implement or execute various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0088] The memory 202 may include but is not limited to random access memory (RAM), read only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.

[0089] This embodiment provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the methods provided by the above-mentioned method embodiments.

[0090] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0091] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0092] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0093] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A configuration method for an API gateway, characterized in that: include: Read the configuration file template corresponding to the configuration object in the API gateway, where the configuration file template includes a replacement placeholder for the ID of the microservice application; For the current microservice application that needs to be configured in the API gateway, the replacement placeholder in the configuration file template is replaced with the ID of the current microservice application, and a configuration file corresponding to the configuration object is generated; By executing the instructions of the API gateway, the configuration object is created according to the configuration file.

2. The method according to claim 1, characterized in that The configuration object includes at least one of a route, an upstream, and a consumer.

3. The method according to claim 1, characterized in that: If the data format of the configuration file template is JSON, then replacing the replacement placeholder in the configuration file template with the ID of the current microservice application includes: The replacement placeholder in the configuration file template is replaced with the ID of the current microservice application using the command line processing tool jq.

4. The method according to any one of claims 1 to 3, characterized in that: The configuration object includes a first configuration object and a second configuration object, the configuration file corresponding to the first configuration object is a first configuration file, and the configuration file corresponding to the second configuration object is a second configuration file; After the configuration object is created according to the configuration file by executing the instruction of the API gateway, the method further includes: Querying the first ID of the first configuration object and the second ID of the second configuration object from the API gateway according to the ID of the current microservice application; updating the second ID into the first configuration file to obtain a first updated configuration file; or updating the first ID into the second configuration file to obtain a second updated configuration file; By executing the instruction of the API gateway, the first configuration object and the second configuration object are bound according to the first update configuration file or the second update configuration file.

5. The method according to claim 4, characterized in that The first configuration object is a route, the first configuration file is a route configuration file, and the second configuration object is an upstream; The querying the first ID of the first configuration object and the second ID of the second configuration object from the API gateway according to the ID of the current microservice application includes: Query the route ID of the route and the upstream ID of the upstream from the API gateway according to the ID of the current microservice application; The step of updating the second ID into the first configuration file to obtain a first updated configuration file includes: Update the upstream ID into the routing configuration file to obtain a routing update configuration file; Binding the first configuration object and the second configuration object according to the first update configuration file by executing the instruction of the API gateway includes: By executing the instructions of the API gateway, the route is bound to the upstream according to the route update configuration file.

6. The method according to claim 4, characterized in that The first configuration object is a route, the second configuration object is a consumer, and the second configuration file is a consumer configuration file; The querying the first ID of the first configuration object and the second ID of the second configuration object from the API gateway according to the ID of the current microservice application includes: Query the route ID of the route and the consumer ID of the consumer from the API gateway according to the ID of the current microservice application; The updating the first ID into the second configuration file to obtain a second updated configuration file includes: Update the routing ID into the consumer configuration file to obtain a consumer update configuration file; Binding the first configuration object and the second configuration object according to the second update configuration file by executing the instruction of the API gateway includes: By executing the instructions of the API gateway, the route is bound to the consumer according to the consumer update configuration file.

7. The method according to claim 1, characterized in that The method further comprises: Log in to the control plane of the API gateway and obtain an authentication token; The instructions executed by the API gateway carry an authentication token, which is used for permission authentication.

8. A computer program product, characterized in that The method comprises computer program instructions, and when the computer program instructions are read and executed by a processor, the method according to any one of claims 1 to 7 is executed.

9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the processor and the memory communicate with each other via the bus; The memory stores program instructions executable by the processor, and the processor can execute the method according to any one of claims 1 to 7 by calling the program instructions.

10. A computer-readable storage medium, characterized in that: include: The computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the method according to any one of claims 1 to 7.