Interface configuration management method and device, computer equipment, readable storage medium and program product
By identifying the application running environment information and request information, finding and matching target interface packets, the shortcomings of API gateways in multi-environment management are solved, and more flexible and stable interface configuration management is achieved.
Patent Information
- Application Number
- CN202411772196.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-02-28
AI Technical Summary
The existing API gateways lack effective management of multiple environments, which leads to errors that occur during the environment switching process, affecting system stability and development efficiency.
By obtaining the service access request of the application backend service, identifying the application running environment information and request information corresponding to the request, finding the corresponding interface group, and matching the target interface based on the request information, realizing the routing of the service access request.
It improves the flexibility of interface configuration in multiple environments, ensures that service access requests can be correctly routed in different environments, and improves system stability and development efficiency.
Smart Images

Figure CN119536916A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an interface configuration management method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] Applications usually need to run in different environments, including but not limited to development environment, test environment, and production environment. Each environment may have different configuration requirements and resource constraints, which requires an API gateway that can flexibly manage and switch between different environments. Most existing API gateways lack effective management of multiple environments, which makes it easy to make errors during the environment switching process, affecting system stability and development efficiency.
[0003] In traditional technology, multi-environment management of interfaces is generally achieved by setting interface paths and environment isolation identifiers to route interface requests to components in the corresponding environment for processing. However, this method can only match the preset environment, resulting in a narrow scope of application and poor flexibility. Summary of the invention
[0004] Based on this, it is necessary to provide an interface configuration management method, apparatus, computer device, computer-readable storage medium and computer program product that can improve the flexibility of interface configuration in multiple environments in order to address the above technical problems.
[0005] In a first aspect, the present application provides an interface configuration management method, comprising:
[0006] Get service access requests for application backend services;
[0007] Identify application program operating environment information and request information corresponding to the service access request;
[0008] Find the interface group corresponding to the application program running environment information;
[0009] Matching a target interface in the interface grouping based on the request information;
[0010] The service access request is routed to the service address of the backend service requested by the service access request through the target interface.
[0011] In one embodiment, the method further comprises:
[0012] Get the interface publishing request;
[0013] Extracting the intermediate interface setting information and environment specifying information of the interface publishing request;
[0014] Based on the intermediate interface setting information, searching the configuration database for resource configuration information of the interface function module corresponding to the interface publishing request;
[0015] Based on the intermediate interface setting information and the resource configuration information, publish the API interface corresponding to the interface publishing request;
[0016] The API interface is bound to the interface group of the application program running environment information specified by the environment specifying information.
[0017] In one embodiment, searching the configuration database for resource configuration information of the interface function module corresponding to the interface publishing request based on the intermediate interface setting information includes:
[0018] Extracting the publishing environment information and the encoding information from the intermediate state interface setting information;
[0019] Based on the publishing environment information and the encoding information, the resource configuration information of the interface function module corresponding to the interface publishing request is searched in the configuration database.
[0020] In one embodiment, before searching the configuration database for resource configuration information of the interface function module corresponding to the interface publishing request based on the intermediate interface setting information, the method further includes:
[0021] Get the intermediate configuration information update request;
[0022] Searching the configuration database for target resource configuration information of the intermediate configuration information update request;
[0023] The target resource configuration information is updated based on the intermediate configuration information update request.
[0024] In one embodiment, searching for the interface group corresponding to the application program running environment information includes:
[0025] Extracting domain name information contained in the service access request;
[0026] The interface group corresponding to the application program running environment information is searched based on the domain name information.
[0027] In one embodiment, searching for the interface group corresponding to the application program running environment information includes:
[0028] Extracting the request header information contained in the service access request;
[0029] Identifying environment configuration information in the request header information;
[0030] The interface group corresponding to the application program running environment information is searched based on the environment configuration information.
[0031] In a second aspect, the present application further provides an interface configuration management device, the device comprising:
[0032] The request acquisition module is used to obtain service access requests for application backend services;
[0033] An information identification module, used to identify the application program running environment information and request information corresponding to the service access request;
[0034] A group search module, used to search for the interface group corresponding to the application program running environment information;
[0035] An interface matching module, used for matching a target interface in the interface group based on the request information;
[0036] The request routing module is used to route the service access request to the service address of the backend service requested by the service access request through the target interface.
[0037] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0038] Get service access requests for application backend services;
[0039] Identify application program operating environment information and request information corresponding to the service access request;
[0040] Find the interface group corresponding to the application program running environment information;
[0041] Matching a target interface in the interface grouping based on the request information;
[0042] The service access request is routed to the service address of the backend service requested by the service access request through the target interface.
[0043] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0044] Get service access requests for application backend services;
[0045] Identify application program operating environment information and request information corresponding to the service access request;
[0046] Find the interface group corresponding to the application program running environment information;
[0047] Matching a target interface in the interface grouping based on the request information;
[0048] The service access request is routed to the service address of the backend service requested by the service access request through the target interface.
[0049] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0050] Get service access requests for application backend services;
[0051] Identify application program operating environment information and request information corresponding to the service access request;
[0052] Find the interface group corresponding to the application program running environment information;
[0053] Matching a target interface in the interface grouping based on the request information;
[0054] The service access request is routed to the service address of the backend service requested by the service access request through the target interface.
[0055] The above-mentioned interface configuration management method, apparatus, computer equipment, computer-readable storage medium and computer program product obtain a service access request for an application backend service; identify the application operating environment information and request information corresponding to the service access request; find the interface grouping corresponding to the application operating environment information; match the target interface in the interface grouping based on the request information; and route the service access request to the service address of the backend service requested by the service access request through the target interface. After receiving a service access request, the present application identifies the application environment information corresponding to the access request, and then matches the target interface under the interface grouping of the application environment, and completes the routing processing of the service access request through the target interface. The user only needs to specify the corresponding access environment in the service access request to quickly send a request to the target environment, effectively improving the flexibility of interface configuration under multiple environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0057] FIG1 is an application environment diagram of an interface configuration management method in one embodiment;
[0058] FIG2 is a schematic diagram of a flow chart of an interface configuration management method in one embodiment;
[0059] FIG3 is a schematic diagram of the architecture of an application function model structure of an API gateway in one embodiment;
[0060] FIG4 is a schematic diagram of a library table design for application configuration sharing in one embodiment;
[0061] FIG5 is a schematic diagram of an intermediate state and a published state of an API in one embodiment;
[0062] FIG6 is a schematic diagram of the association between the API and modules such as groups and domain names in one embodiment;
[0063] FIG7 is a schematic diagram of a plug-in binding operation after an API is published in one embodiment;
[0064] FIG8 is a schematic diagram of a process of accessing an API by domain name in one embodiment;
[0065] FIG9 is a schematic diagram of a process of accessing an API through a request header in one embodiment;
[0066] FIG10 is a block diagram of an interface configuration management device according to an embodiment;
[0067] FIG. 11 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0069] The interface configuration management method provided in the embodiment of the present application can be applied in the application environment shown in Figure 1. Among them, the terminal 102 communicates with the API gateway server 104 through the network, and the API gateway server 104 communicates with the back-end server 106. The data storage system can store the data that the API gateway server 104 needs to process. The data storage system can be integrated on the API gateway server 104, or it can be placed on the cloud or other network servers. When the terminal 102 needs to implement related service processing, it can initiate a corresponding service access request through the application front end on the terminal 102. The service access request will first reach the API gateway server 104, and the API gateway server 104 obtains the service access request for the application back-end service; identifies the application operating environment information and request information corresponding to the service access request; finds the interface grouping corresponding to the application operating environment information; matches the target interface in the interface grouping based on the request information; and routes the service access request to the service address of the back-end server 106 requested by the service access request through the target interface. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The API gateway server 104 and the backend server 106 can be independent physical servers, or server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide cloud computing services.
[0070] In an exemplary embodiment, as shown in FIG2 , an interface configuration management method is provided, which is described by taking the method applied to the API gateway server 106 in FIG1 as an example, and includes the following steps 201 to 209. Among them:
[0071] Step 201: Obtain a service access request for an application backend service.
[0072] Step 203: Identify the application program running environment information and request information corresponding to the service access request.
[0073] Among them, the service access request refers to the request generated by the user at the terminal 102 for accessing the relevant backend service on the backend server 106. The service access request will first be sent from the terminal 102 to the API gateway server 104. API gateway is a tool for API management and service governance, which integrates functions such as configuration publishing, environment management, access authentication, user authentication, and access control. As the single entry point for requests, the API gateway is responsible for implementing request routing, API monitoring, and API security. Through the API gateway, services can be managed efficiently, securely, and at low cost, and all API traffic can be easily tracked and monitored in one location. This application specifically calls the corresponding API interface through the API gateway server, so that the service access request is routed to the specified backend service for processing. The application running environment information specifically refers to the development environment, test environment, and production environment, and the request information refers to the information about the specific content carried in the request, such as the domain name and request header.
[0074] Exemplarily, applications usually need to run in different environments, including but not limited to development environments, test environments, and production environments. Each environment may have different configuration requirements and resource constraints, which requires an API gateway that can flexibly manage and switch between different environments. The present application implements the switching and calling of API gateways in different environments on the API gateway server 106. When a user submits a service access request related to the application backend service through the terminal 102, the service access request will first be transmitted to the API gateway server 104, which will identify the application operating environment information specified by the service access request and extract the request information therein as the basic data for interface configuration management.
[0075] Step 205: Look up the interface group corresponding to the application program running environment information.
[0076] Step 207: Match the target interface in the interface group based on the request information.
[0077] Among them, for interface grouping, this application can configure different API interface groups for the backend services of the application in different application running environments. The groups of different environments are actually mapped to different resources in the API gateway. For example, it can be divided into development environment grouping, test environment grouping, and production environment grouping.
[0078] Exemplarily, after identifying the application runtime environment information corresponding to the service access request, the corresponding interface grouping can be matched based on the application runtime environment information, and then the corresponding target interface can be queried and matched under the interface grouping. That is, the service environment requested by the service access request is automatically identified, and the interface grouping under the corresponding environment is switched to perform subsequent routing processing. After determining the interface grouping, the desired target interface can be hit based on the request information and some matching conditions of the API itself.
[0079] Step 209: Routing the service access request to the service address of the backend service requested by the service access request through the target interface.
[0080] Exemplarily, after determining the target interface for routing the service access request, the service access request can be routed to the service address of the backend service requested by the service access request through the target interface, and the backend service performs corresponding service processing actions on the service access request.
[0081] In a specific embodiment, the present application accesses the backend service through the domain name. At this time, in the initial stage of the solution, it is necessary to create a backend service configuration and define different backend service addresses in different environments, namely test_srv corresponding to the test environment and prod_srv corresponding to the production environment. Create an interface group groupA, and create an API in the interface group, called demo. Reference the backend service during the creation. After the creation is completed, publish it to different environments. Bind the domain name to the API environment. Bind the domain name in the group, and associate the corresponding domain names for different environments, namely test.com and prod.com. When a user requests the API through a service access request, such as requesting through the domain name test.com:port / demo, the request will be routed and forwarded to the backend service test_srv of the test environment. Similarly, the domain name prod.com:port / demo will be forwarded to the backend service prod_srv.
[0082] The above-mentioned interface configuration management method obtains a service access request for an application backend service; identifies the application operating environment information and request information corresponding to the service access request; searches for the interface grouping corresponding to the application operating environment information; matches the target interface in the interface grouping based on the request information; and routes the service access request to the service address of the backend service requested by the service access request through the target interface. After receiving a service access request, this application identifies the application environment information corresponding to the access request, and then matches the target interface under the interface grouping of the application environment, and completes the routing processing of the service access request through the target interface. The user only needs to specify the corresponding access environment in the service access request to quickly send a request to the target environment, effectively improving the flexibility of interface configuration under multiple environments.
[0083] In an exemplary embodiment, the method also includes: obtaining an interface publishing request; extracting the intermediate interface setting information and environment specification information of the interface publishing request; based on the intermediate interface setting information, searching the configuration database for resource configuration information of the interface function module corresponding to the interface publishing request; based on the intermediate interface setting information and the resource configuration information, publishing the API interface corresponding to the interface publishing request; binding the API interface to the interface grouping of the application running environment information specified by the environment specification information.
[0084] Among them, the interface publishing request refers to the process of publishing the corresponding API interface to the specified environment. In the process of creating an API, the user can publish the API interface to the interface grouping of different environments through the interface publishing request after the interface is created, so as to facilitate the subsequent request process. The intermediate interface setting information is the setting information of the user in the process of creating the API interface, and the resource configuration information is the information related to the resource configuration content related to the API interface created by the user, including the configuration content of domain name management, plug-in management, application authorization and back-end service functions.
[0085] Exemplarily, the model of the API gateway in this application is distinguished by the intermediate state and the release state. The intermediate state is to extract the main functional models of the API gateway, which are stored and managed through the database, mainly including API, API grouping, domain name management, plug-in management, application authorization and back-end service functions; the release state is the configuration information that actually acts on the API gateway, which is written through the Admin interface of the gateway; the entire device is composed of a database-based configuration management module: used to manage and store intermediate state and release state information of different environments in the database, etc., to ensure the persistence and consistency of the configuration information. The application function model structure of the API gateway of this application is specifically shown in Figure 3, and the reading and writing of the API gateway are decoupled through the database; parallel processing and verification are achieved in development, testing, and online by publishing to different environments. Before writing the API, the functional module configurations associated with the API, such as back-end services, plug-in configurations, application authorization, etc., can be written to the core gateway (Gateway-Core) through the Admin API when creating / modifying, and stored in the database at the same time. As shown in Figure 4, the functional modules of the plug-in configuration are written to the core gateway. After the user writes the API interface, if the interface needs to be published to the specified environment, the API interface is transformed into the release state at this time. In the release state, based on the intermediate state interface setting information, search the configuration database for the resource configuration information of the interface function module corresponding to the interface release request; based on the intermediate state interface setting information and resource configuration information, release the API interface corresponding to the interface release request, such as matching the resource configuration information of various interface function modules, to achieve the application authorization, plug-in binding, online debugging and other operations as shown in Figure 5. Finally, bind the API interface to the interface group of the application running environment information specified by the environment specified information. During the release process, the API must be bound to a certain interface group, and all APIs in the group share the configuration of the current group, such as domain name, basePath, environment variables, etc. In this embodiment, the release management of interfaces in different environments is realized through the intermediate state and the release state. At the same time, by switching from the intermediate state to the release state, the user can not only customize different environments (a certain release state), but also simply and quickly create multi-environment configurations (intermediate state) under different interface function modules. When publishing a specified environment, the latest configuration information of each interface function module in the environment is automatically rendered to the API. When editing and updating the configuration, each function module can be dynamically applied to the API without modifying the API resources, effectively improving the performance of API-based access to backend services and the flexibility of interface management. Moreover, through the API release configuration management of multiple environments, the same set of API configurations can be used in parallel for development, testing, etc., reducing differences caused by external reasons such as different deployment environments.
[0086] Further, based on the intermediate state interface setting information, searching the configuration database for the resource configuration information of the interface function module corresponding to the interface release request includes: extracting the release environment information and coding information in the intermediate state interface setting information; based on the release environment information and coding information, searching the configuration database for the resource configuration information of the interface function module corresponding to the interface release request. The present application can specifically achieve the matching of resource information through coding information. When the user publishes the API interface to the specified environment through the interface release request, the corresponding resource configuration is found through the unique code of the associated module, and the associated configuration is rendered as a configuration object when the API is written to the core gateway, as shown in Figure 6, which shows the association of each functional object, and the matching search of the configuration information can be achieved through the uniquely coded coding information. In another embodiment, when the API is released to the specified environment, the unique code of the associated functional module, such as nativePluginCode, will be referenced, and the unique resource code of the api in the gateway-core will be formed in the format of apiCode_envName: write to the database when creating / updating the plug-in and call the Admin API to write the core gateway. It is a group of published API binding / unbinding plug-ins, and it is necessary to call the Admin API to write the core gateway. For details, please refer to the plug-in binding operation of the API after release as shown in Figure 7. In this embodiment, the search and matching process of resource configuration information is implemented by using coding information and publishing environment information, which can effectively ensure the efficiency and accuracy of the search.
[0087] In one embodiment, based on the intermediate interface setting information, before searching the configuration database for resource configuration information of the interface function module corresponding to the interface release request, it also includes: obtaining an intermediate configuration information update request; searching the configuration database for target resource configuration information of the intermediate configuration information update request; and updating the target resource configuration information based on the intermediate configuration information update request.
[0088] Exemplarily, the present application also includes an update process for resource configuration information. As the application is updated and iterated, the configuration information of various interface function modules also needs to be updated accordingly. At this time, the update process of the configuration information of the corresponding function module in the database can be completed through an intermediate configuration information update request. After receiving the intermediate configuration information update request, the interface function module specified by the intermediate configuration information update request can be first searched in the configuration database, and then its configuration information can be read as the target resource configuration information, and the target resource configuration information is updated based on the intermediate configuration information update request, and then the updated configuration information is saved to the database. In this embodiment, the update process of the resource configuration information is completed through an intermediate configuration information update request, thereby effectively ensuring that when the API is released to a specified environment, the latest configuration information of each function module in the environment is automatically rendered to the API, thereby ensuring the effect of the API interface.
[0089] In one embodiment, step 205 includes: extracting domain name information included in the service access request; searching for an interface group corresponding to the application program running environment information based on the domain name information.
[0090] Exemplarily, the present application can specifically associate the corresponding interface grouping through domain name information, and different environments of the API grouping are bound to different domain names: based on the way of group matching domain names, groups of different environments are actually mapped to different resources in the API gateway. Then, when groups of different environments are associated with domain names, the APIs of the current group in all corresponding environments must first match the domain name. By extracting the domain name information contained in the service access request; and searching for the interface grouping corresponding to the application running environment information based on the domain name information. Then directly hit the desired target API through some matching conditions of the API itself, so when associating domain names for different environments of the grouping here, it is necessary to ensure that the domain name associated with the current environment has uniqueness in the grouping, so we require that the domain names between the environments in the group cannot be cross-associated. The processing process of accessing the API by domain name can be shown in Figure 8. In this embodiment, the interface grouping corresponding to the application running environment information is searched by domain name, so that the API interface is called to execute routing, which can effectively improve the call processing efficiency.
[0091] In another embodiment, step 205 includes: extracting the request header information contained in the service access request; identifying the environment configuration information in the request header information; searching for the interface group corresponding to the application program running environment information based on the environment configuration information. The request header can also be used as a matching condition for the API. When the request header matching method is enabled, the interface group can be searched and the interface can be called through the request header information. For example, the calling environment can be specified through the parameter X-Ca-Stage in the request header, such as "X-Ca-Stage: PROD", which clearly tells the API gateway that the current API is an API in the PROD generation environment. At this time, the user can still associate the domain name in the group, and the domain name is no longer the only condition for environment matching, but is converted into an additional condition for API matching. The domain names associated with each environment in the group are no longer exclusive. The specific process of accessing the API through the request header can be shown in Figure 9. In this embodiment, the interface group corresponding to the application program running environment information is searched through the request header, so as to call the API interface to execute routing, which can effectively improve the call processing efficiency.
[0092] In a specific embodiment, the interface configuration management method of the present application specifically includes: obtaining an interface publishing request; extracting the intermediate interface setting information and environment specification information of the interface publishing request; extracting the publishing environment information and encoding information in the intermediate interface setting information; searching the configuration database for the resource configuration information of the interface function module corresponding to the interface publishing request based on the publishing environment information and encoding information; publishing the API interface corresponding to the interface publishing request based on the intermediate interface setting information and resource configuration information; binding the API interface to the interface grouping of the application running environment information specified by the environment specification information. Obtaining a service access request for an application backend service; identifying the application running environment information and request information corresponding to the service access request; extracting the domain name information contained in the service access request; searching for the interface grouping corresponding to the application running environment information based on the domain name information; matching the target interface in the interface grouping based on the request information; routing the service access request to the service address of the backend service requested by the service access request through the target interface.
[0093] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0094] Based on the same inventive concept, the embodiment of the present application also provides an interface configuration management device for implementing the interface configuration management method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more interface configuration management device embodiments provided below can refer to the limitations of the interface configuration management method above, and will not be repeated here.
[0095] In an exemplary embodiment, as shown in FIG10 , an interface configuration management device is provided, including:
[0096] The request acquisition module 1001 is used to acquire a service access request for an application backend service.
[0097] The information identification module 1003 is used to identify the application program running environment information and request information corresponding to the service access request.
[0098] The group search module 1005 is used to search for the interface group corresponding to the application program running environment information.
[0099] The interface matching module 1007 is used to match the target interface in the interface group based on the request information.
[0100] The request routing module 1009 is used to route the service access request to the service address of the backend service requested by the service access request through the target interface.
[0101] In one embodiment, it also includes an interface publishing module, which is used to: obtain an interface publishing request; extract the intermediate interface setting information and environment specification information of the interface publishing request; based on the intermediate interface setting information, search the configuration database for resource configuration information of the interface function module corresponding to the interface publishing request; based on the intermediate interface setting information and the resource configuration information, publish the API interface corresponding to the interface publishing request; bind the API interface to the interface grouping of the application running environment information specified by the environment specification information.
[0102] In one embodiment, the interface publishing module is specifically used to: extract publishing environment information and encoding information from the intermediate interface setting information; and search the configuration database for resource configuration information of the interface function module corresponding to the interface publishing request based on the publishing environment information and encoding information.
[0103] In one embodiment, it also includes a configuration update module, which is used to: obtain an intermediate configuration information update request; search the configuration database for the target resource configuration information of the intermediate configuration information update request; and update the target resource configuration information based on the intermediate configuration information update request.
[0104] In one embodiment, the group search module 1005 is specifically used to: extract domain name information included in the service access request; and search for the interface group corresponding to the application program running environment information based on the domain name information.
[0105] In one embodiment, the group search module 1005 is specifically used to: extract the request header information contained in the service access request; identify the environment configuration information in the request header information; and search for the interface group corresponding to the application program running environment information based on the environment configuration information.
[0106] Each module in the above interface configuration management device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0107] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG11. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store interface configuration management data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, an interface configuration management method is implemented.
[0108] Those skilled in the art will understand that the structure shown in FIG. 11 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0109] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0110] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0111] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.
[0112] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0113] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0114] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0115] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An interface configuration management method, characterized in that: The method comprises: Get service access requests for application backend services; Identify application program operating environment information and request information corresponding to the service access request; Find the interface group corresponding to the application program running environment information; Matching a target interface in the interface grouping based on the request information; The service access request is routed to the service address of the backend service requested by the service access request through the target interface.
2. The method according to claim 1, characterized in that The method further comprises: Get the interface publishing request; Extracting the intermediate interface setting information and environment specifying information of the interface publishing request; Based on the intermediate interface setting information, searching the configuration database for resource configuration information of the interface function module corresponding to the interface publishing request; Based on the intermediate interface setting information and the resource configuration information, publish the API interface corresponding to the interface publishing request; The API interface is bound to the interface group of the application program running environment information specified by the environment specifying information.
3. The method according to claim 2, characterized in that The searching, based on the intermediate interface setting information, in the configuration database for the resource configuration information of the interface function module corresponding to the interface publishing request comprises: Extracting the publishing environment information and the encoding information from the intermediate state interface setting information; Based on the publishing environment information and the encoding information, the resource configuration information of the interface function module corresponding to the interface publishing request is searched in the configuration database.
4. The method according to claim 2, characterized in that: The method further comprises: before searching the configuration database for resource configuration information of the interface function module corresponding to the interface publishing request based on the intermediate interface setting information; Get the intermediate configuration information update request; Searching the configuration database for target resource configuration information of the intermediate configuration information update request; The target resource configuration information is updated based on the intermediate configuration information update request.
5. The method according to any one of claims 1 to 4, characterized in that: The interface grouping corresponding to the application program running environment information includes: Extracting domain name information contained in the service access request; The interface group corresponding to the application program running environment information is searched based on the domain name information.
6. The method according to any one of claims 1 to 4, characterized in that: The interface grouping corresponding to the application program running environment information includes: Extracting the request header information contained in the service access request; Identifying environment configuration information in the request header information; The interface group corresponding to the application program running environment information is searched based on the environment configuration information.
7. An interface configuration management device, characterized in that: The device comprises: The request acquisition module is used to obtain service access requests for application backend services; An information identification module, used to identify the application program running environment information and request information corresponding to the service access request; A group search module, used to search for the interface group corresponding to the application program running environment information; An interface matching module, used for matching a target interface in the interface group based on the request information; The request routing module is used to route the service access request to the service address of the backend service requested by the service access request through the target interface.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.