API gateway interface calling methods, devices, and storage media
By invoking the assembly interface and multiple atomic interfaces in parallel within the API gateway, and obtaining and combining response parameters, the problem of low interface call efficiency in existing technologies is solved, achieving efficient and flexible interface calls.
Patent Information
- Application Number
- CN202411215544.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-08-30
AI Technical Summary
In existing technologies, API calls are inefficient, mainly because aggregated response parameters are difficult to read, resulting in insufficient efficiency.
By obtaining the interface call information of the application system, the assembly interface to be called is determined and associated with at least two atomic interfaces. The response parameter format of each atomic interface is defined, the assembly interface is called in parallel, the response parameters of each atomic interface are obtained, and the assembly interface and the response parameters of the assembly interface are combined into a text and fed back to the application system.
It enables synchronous retrieval of response parameters in parallel during API calls, improving API call efficiency, ensuring that response parameters and format structure are not affected by exceptions, and supporting rapid cloning and copying of similar orchestration APIs, thereby enhancing API call efficiency and flexibility.
Smart Images

Figure CN119094614B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network technology, and in particular to an API gateway interface calling method, device and storage medium. Background Technology
[0002] With the standardization of data interface services accelerating, the key challenge that urgently needs to be addressed is how to flexibly orchestrate and combine interfaces to quickly respond to and meet diverse user needs, based on atomic API interfaces.
[0003] In existing technologies, the method of interface aggregation based on API interface gateways involves matching the routing information of the aggregated interface with the routing information of the aggregated interface to call the atomic API interfaces in sequence, processing the response data to construct aggregated response information and returning it to the application system.
[0004] Because the response parameters of the orchestrated atomic APIs are different, the aggregated response parameters may not be readable, resulting in low API call efficiency in existing technologies. Summary of the Invention
[0005] This application provides an API gateway interface calling method, device, and storage medium to solve the technical problem of low interface calling efficiency in the prior art.
[0006] Firstly, this application provides an API gateway interface invocation method, the method comprising:
[0007] Obtain the interface call information of the application system, determine the assembly interface to be called based on the interface call information, the assembly interface is associated with at least two atomic interfaces, and the response parameter format of each atomic interface is defined through the assembly interface;
[0008] The assembly interface is invoked in parallel to obtain the response parameters of each atomic interface.
[0009] The response parameters of all atomic interfaces associated with the assembly interface are combined with the response parameters of the assembly interface and fed back to the application system.
[0010] Optionally, before determining the assembly interface to be called based on the interface call information, the method further includes:
[0011] Obtain atomic call information and atomic parameter information. Atomic call information includes URL path, interface access type and interface request header. Atomic parameter information includes path parameters, query parameters, header parameters, body parameters, response parameters and status parameters.
[0012] Create an atomic interface based on the atomic call information and atomic parameter information;
[0013] Based on the call parameter information passed to the atomic interface, the atomic interface is called and verified to determine whether the response parameters of the atomic interface match the expected parameters.
[0014] If the response parameters of the atomic interface match the expected parameters, then the call information for invoking the atomic interface is allocated to the application system.
[0015] Optionally, before determining the assembly interface to be called based on the interface call information, the method further includes:
[0016] Obtain assembly interface call information, call permissions, custom response parameter format, and unique identifier assigned by the API gateway;
[0017] Construct the assembly interface based on the unique identifier, assembly interface call information, call permissions, and response parameter format;
[0018] Remove duplicates from all atomic interfaces associated with the assembly interface.
[0019] Optionally, after deduplicating all atomic interfaces associated with the assembly interface, the following is also included:
[0020] Retrieve the text of the response parameters obtained from the clone;
[0021] Based on the response parameter text, match the interface identifier of the atomic interface from the API gateway;
[0022] Validate the format of the response parameters of the atomic interfaces that are configured with interface identifiers.
[0023] If the verification passes, the response parameters of the atomic interface will be echoed to the visual hierarchical node structure through the API gateway. The visual hierarchical node structure is used to customize the format of the response parameters.
[0024] Optionally, the method further includes:
[0025] Recognize the response parameter text to obtain the visualized hierarchical node structure and target atomic interface;
[0026] Parse the call parameters and response parameters of the target atomic interface;
[0027] The call parameters and response parameters of the target atomic interface are used to create a new assembled interface using union logic, resulting in a cloned assembled interface.
[0028] Optionally, the method further includes:
[0029] Configure a visual hierarchical node structure, which includes child nodes and parallel nodes. Child nodes support object and array types, while parallel nodes support object types and other data types.
[0030] Optionally, obtain the response parameters for each atomic interface, including:
[0031] Obtain the path to the pre-assigned data exchange format object on the response parameters of each atomic interface;
[0032] Based on the data exchange format object path, the response parameters of each atomic interface are read.
[0033] Optionally, after the feedback is sent to the application system, it also includes:
[0034] Obtain multiple individual indicators and multiple trend indicators;
[0035] Obtain individual indicator analysis information for each individual indicator and trend indicator analysis information for each trend indicator;
[0036] Based on the analysis information of each individual indicator and each trend indicator, the call status of the assembly interface is obtained.
[0037] A second aspect of this application provides an API gateway interface calling device, comprising:
[0038] The first processing module is used to obtain the interface call information of the application system, determine the assembly interface to be called based on the interface call information, the assembly interface is associated with at least two atomic interfaces, and the response parameter format of each atomic interface is defined through the assembly interface;
[0039] The calling module is used to call the atomic interfaces associated with the assembly interface in parallel and obtain the response parameters of each atomic interface;
[0040] The second processing module is used to combine the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface into a text format and feed it back to the application system.
[0041] Optionally, the first processing module is also used for:
[0042] Obtain atomic call information and atomic parameter information. Atomic call information includes URL path, interface access type and interface request header. Atomic parameter information includes path parameters, query parameters, header parameters, body parameters, response parameters and status parameters.
[0043] Create an atomic interface based on the atomic call information and atomic parameter information;
[0044] Based on the call parameter information passed to the atomic interface, the atomic interface is called and verified to determine whether the response parameters of the atomic interface match the expected parameters.
[0045] If the response parameters of the atomic interface match the expected parameters, then the call information for invoking the atomic interface is allocated to the application system.
[0046] Optionally, the first processing module is also used for:
[0047] Obtain assembly interface call information, call permissions, custom response parameter format, and unique identifier assigned by the API gateway;
[0048] Construct the assembly interface based on the unique identifier, assembly interface call information, call permissions, and response parameter format;
[0049] Remove duplicates from all atomic interfaces associated with the assembly interface.
[0050] Optionally, the first processing module is also used for:
[0051] Retrieve the text of the response parameters obtained from the clone;
[0052] Based on the response parameter text, match the interface identifier of the atomic interface from the API gateway;
[0053] Validate the format of the response parameters of the atomic interfaces that are configured with interface identifiers.
[0054] If the verification passes, the response parameters of the atomic interface will be echoed to the visual hierarchical node structure through the API gateway. The visual hierarchical node structure is used to customize the format of the response parameters.
[0055] Optionally, the first processing module is also used for:
[0056] Recognize the response parameter text to obtain the visualized hierarchical node structure and target atomic interface;
[0057] Parse the call parameters and response parameters of the target atomic interface;
[0058] The call parameters and response parameters of the target atomic interface are used to create a new assembled interface using union logic, resulting in a cloned assembled interface.
[0059] Optionally, the first processing module is also used for:
[0060] Configure a visual hierarchical node structure, which includes child nodes and parallel nodes. Child nodes support object and array types, while parallel nodes support object types and other data types.
[0061] Optionally, the calling module is also used for:
[0062] Obtain the path to the pre-assigned data exchange format object on the response parameters of each atomic interface;
[0063] Based on the data exchange format object path, the response parameters of each atomic interface are read.
[0064] Optionally, the second processing module is also used for:
[0065] Obtain multiple individual indicators and multiple trend indicators;
[0066] Obtain individual indicator analysis information for each individual indicator and trend indicator analysis information for each trend indicator;
[0067] Based on the analysis information of each individual indicator and each trend indicator, the call status of the assembly interface is obtained.
[0068] Thirdly, this application provides an API gateway interface calling device, including: a processor, and a memory communicatively connected to the processor, comprising:
[0069] The memory stores the instructions that the computer executes;
[0070] The processor executes computer-executable instructions stored in memory to implement the API gateway's interface invocation method in the first aspect.
[0071] Fourthly, a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the interface invocation method of the API gateway of the first aspect.
[0072] Fifthly, a computer program product includes a computer program that, when executed by a processor, implements the interface invocation method of the API gateway of the first aspect.
[0073] This application provides an API gateway interface invocation method, device, and storage medium. It obtains interface invocation information from the application system, determines the assembly interface to be invoked based on the information, and associates the assembly interface with at least two atomic interfaces. The assembly interface defines the response parameter format for each atomic interface. It then invokes each atomic interface associated with the assembly interface in parallel, obtaining the response parameters for each atomic interface. Finally, it combines the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface into a text format and feeds it back to the application system. This interface orchestration technology, by returning predetermined response parameters and format structures, enables the synchronous parallel retrieval of response parameters when invoking atomic interfaces. Furthermore, the response parameters and format structure are unaffected by any anomalies in the invocation of one or more atomic interfaces. Based on the predetermined response parameters, it allows for the rapid cloning and replication of similar orchestration APIs and supports the reverse inference of orchestration API configurations from response parameters, thereby improving interface invocation efficiency. Attached Figure Description
[0074] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0075] Figure 1 The flow of the API gateway interface calling method provided in the embodiments of this application Figure 1 ;
[0076] Figure 2 The flow of the API gateway interface calling method provided in the embodiments of this application Figure 2 ;
[0077] Figure 3 The flow of the API gateway interface calling method provided in the embodiments of this application Figure 3 ;
[0078] Figure 4 This is a schematic diagram of the structure of the API gateway interface calling device provided in the embodiments of this application;
[0079] Figure 5 This is a hardware structure diagram of the API gateway interface calling device provided in the embodiments of this application.
[0080] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0081] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0082] Within the existing technological framework, when employing an API gateway-based interface aggregation strategy, if an application system initiates a call request to an aggregated interface, the system matches the routing information of that aggregated interface and sequentially calls each atomic API interface. Subsequently, the system processes the response data of these atomic APIs, constructs aggregated response information, and returns it to the application system. However, due to the differences in the response parameters of the orchestrated atomic API interfaces, the aggregated response parameters may be difficult to read, resulting in insufficient efficiency in interface calls with the existing technology.
[0083] This application provides an API gateway interface invocation method, device, and storage medium. It obtains interface invocation information from the application system, determines the assembly interface to be invoked based on the information, and associates the assembly interface with at least two atomic interfaces. The assembly interface defines the response parameter format for each atomic interface. It then invokes each atomic interface associated with the assembly interface in parallel, obtaining the response parameters for each atomic interface. Finally, it combines the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface into a text format and feeds it back to the application system. This interface orchestration technology, by returning predetermined response parameters and format structures, enables the synchronous parallel retrieval of response parameters when invoking atomic interfaces. Furthermore, the response parameters and format structure are unaffected by any anomalies in the invocation of one or more atomic interfaces. Based on the predetermined response parameters, it allows for the rapid cloning and replication of similar orchestration APIs and supports the reverse inference of orchestration API configurations from response parameters, thereby improving interface invocation efficiency.
[0084] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0085] Figure 1 API gateway interface calling method flow provided in the embodiments of this application Figure 1 .like Figure 1 As shown, the API gateway interface call method provided in this embodiment includes:
[0086] S101. Obtain the interface call information of the application system, determine the assembly interface to be called based on the interface call information, the assembly interface is associated with at least two atomic interfaces, and the response parameter format of each atomic interface is defined through the assembly interface.
[0087] In this embodiment, the assembly interface is a technology that integrates data from multiple data sources or APIs and provides a unified interface to the client. It can filter, transform, and sort data from different data sources or APIs to meet the client's needs. The client only needs to call one aggregation interface to obtain the required data, without needing to know the underlying data source or API implementation. The corresponding assembly interface to be called can be determined based on the interface call information. The assembly interface includes at least two atomic interfaces, and the response parameter format of each atomic interface is defined through the assembly interface.
[0088] S102. In parallel, call each atomic interface associated with the assembly interface and obtain the response parameters of each atomic interface;
[0089] In this embodiment, the API gateway assembles multiple atomic interfaces in the interface through parallel calls.
[0090] In this approach, each atomic interface executes independent business logic and returns response parameters upon completion. The assembly interface simultaneously receives the responses from these atomic interfaces and extracts the response parameters from each. This method helps improve the system's scalability and maintainability, as each atomic interface completes a single task, while the assembly interface is responsible for integrating the results of these tasks. Furthermore, parallel invocation can improve system processing efficiency and reduce overall response time.
[0091] S103. Combine the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface into a text format and send it back to the application system.
[0092] In this embodiment, the API gateway combines the response parameters returned by each atomic interface with the response parameters of the assembly interface into a textual representation. This combination process involves formatting, sorting, filtering, or merging the data to ensure that the final dataset meets the application system's requirements. After combination, the generated complete response data is passed to the application system as feedback. This allows the application system to receive a unified response integrating the processing results of multiple atomic interfaces, thereby supporting further business logic processing or user interface display.
[0093] This application provides an API gateway interface invocation method. It obtains interface invocation information from an application system, determines the assembly interface to be invoked based on this information, and associates the assembly interface with at least two atomic interfaces. The assembly interface defines the response parameter format for each atomic interface. Furthermore, it invocations the associated atomic interfaces in parallel, obtaining the response parameters for each atomic interface. The API gateway combines the response parameters returned by each atomic interface with the response parameters of the assembly interface itself. This combination process involves formatting, sorting, filtering, or merging the data to ensure the final dataset meets the application system's requirements. After combination, the generated complete response data is passed to the application system as feedback. This parallel, synchronous acquisition of response parameters ensures that even if some or all atomic interface calls encounter exceptions, the acquisition and format structure of the response parameters remain intact and independent. This significantly improves the efficiency and flexibility of interface invocation.
[0094] Figure 2 API gateway interface calling method flow provided in the embodiments of this application Figure 2 This embodiment is... Figure 1Based on the embodiments, the API gateway interface calling method is described in detail. Creating an atomic interface is achieved through steps S201-S202; adding and assembling an interface is achieved through step S203; determining the atomic interface and customizing response parameters can be achieved according to steps S204-S205; and feeding the results back to the application system is achieved through steps S206-S207. Figure 2 As shown, the API gateway interface call method provided in this embodiment includes:
[0095] S201. Obtain atomic call information and atomic parameter information; create an atomic interface based on the atomic call information and atomic parameter information; verify the atomic interface based on the call parameter information passed to the atomic interface to determine whether the response parameters of the atomic interface match the expected parameters; if the response parameters of the atomic interface match the expected parameters, allocate call information for calling the atomic interface to the application system.
[0096] In this embodiment, before creating an atomic interface, the API gateway needs to be configured with provider management. The provider management manages the network protocol, IP address, and port for the atomic interface call, and manages the provider's business attributes, technical attributes, and management attributes. Atomic call information includes, but is not limited to, URL path, interface access type, and interface request header. Atomic parameter information includes, but is not limited to, path parameters, query parameters, header parameters, body parameters, response parameters, and status parameters. The API gateway has built-in call test permissions. The call parameter information is passed to the atomic interface to execute the call test, verify whether the response parameters match the expectations, and after the test is completed, the application system permissions are configured, the key information for the application system to call the interface is allocated, and permission whitelists and traffic limits are set.
[0097] S202. Obtain the assembly interface call information, call permissions, custom response parameter format, and unique identifier assigned by the API gateway; construct the assembly interface based on the unique identifier, assembly interface call information, call permissions, and response parameter format; deduplicate all atomic interfaces associated with the assembly interface;
[0098] In this embodiment, the call information of the assembly interface includes, but is not limited to, the basic information of the interface, request information, request header, request body, security requirements and response information. The call information of the assembly interface should include the call information of all atomic interfaces in the assembly interface. After the assembly interface is constructed according to the unique identifier, assembly interface call information, call permissions and response parameter format, the atomic interfaces are parsed according to the unique identifier of the atomic interfaces, and duplicate atomic interfaces are merged.
[0099] S203. Obtain the interface call information of the application system, determine the assembly interface to be called based on the interface call information, and obtain the cloned response parameter text; based on the response parameter text, match the interface identifier of the atomic interface from the API gateway; verify the format of the response parameters of the atomic interface with the configured interface identifier, and if the verification passes, echo the response parameters of the atomic interface to the visual hierarchical node structure through the API gateway. The visual hierarchical node structure is used to customize the format of the response parameters.
[0100] In this embodiment, a visual hierarchical node structure is provided, which includes child nodes and parallel nodes. Child nodes support object types and array types, while parallel nodes support object types and other data types, including but not limited to strings and numbers. By reading the cloned response parameter text, the atomic interface matching the response text is determined, the format of the response parameters of the atomic interface is verified, and the verified response parameters are displayed in the visual hierarchical node structure. The response parameters of the orchestrated atomic interfaces are pre-identified and aggregated according to a clear combination of response parameters to avoid the risk of response parameter conflicts.
[0101] S204. Parallel call the atomic interfaces associated with the assembly interface to obtain the data exchange format object path pre-allocated in the response parameters of each atomic interface; based on the data exchange format object path, read the response parameters of each atomic interface.
[0102] In this embodiment, the response parameter format includes not only a custom structure but also a JSON object returned by the atomic interface. For each atomic interface, its response data format is parsed to identify the specific location of all response parameters in the data exchange format. After selecting an atomic interface, the node type option for the custom structure becomes invalid. The node input for the atomic interface is the interface object path, filled in according to the standard format, supporting both path end values and JSON object paths. This application reduces the impact of long links in orchestrating serial interfaces on interface service performance by merging repeatedly called atomic interfaces on the API gateway and simultaneously calling atomic interfaces in parallel.
[0103] In one possible implementation, the response parameter text can be identified to obtain the visual hierarchical node structure and the target atomic interface; the call parameters and response parameter formats of the target atomic interface can be parsed; the call parameters and response parameter formats of the target atomic interface can be used in a union logic to create a new assembled interface, resulting in a cloned assembled interface.
[0104] S205. Combine the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface into a text format and send it back to the application system.
[0105] In this embodiment, before combining the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface, it is necessary to obtain the call parameters for each atomic interface associated with the assembly interface, add call parameters to the assembly interface according to the union logic, and expand the atomic interface call test information in the response parameters of the assembly interface to verify the atomic interface call and ensure that no atomic interface parameters are missed when the assembly interface is called. Using the built-in call test permission of the API gateway, call information is passed to the assembly interface, and the call operation is the same as that of the atomic interface test. The call test is executed to verify whether the response parameters match the expectations. After the test is completed, the application system permissions are configured, the key information for the application system to call the interface is allocated, and the permission whitelist and traffic limit are set.
[0106] S206. Obtain multiple individual indicators and multiple trend indicators; obtain individual indicator analysis information for each individual indicator and trend indicator analysis information for each trend indicator; based on the individual indicator analysis information and trend indicator analysis information, obtain the call status of the assembly interface.
[0107] In this embodiment, after combining the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface, the application system formally calls the service assembly interface and synchronously records the service logs of the assembly interface and atomic interfaces. The service logs include, but are not limited to, the application system name, interface provider, interface name, call time, call status, interface access time, access IP, and routing address. At the API gateway level, operation and maintenance monitoring and statistics of service assembly call status are carried out. Individual indicators include, but are not limited to, the total number of application systems, the number of assembly interfaces, the number of calls today, the number of call statuses, the call success rate, the average call time, the number of times the provider provides services, the number of times the application system calls, and the number of times the interface calls. Trend indicators include, but are not limited to, the interface call trend, the call success rate trend, the call time trend, the provider call ranking, the application system call ranking, and the interface call ranking. Each individual indicator and each trend indicator is analyzed to obtain multiple individual indicator analysis information and multiple trend indicator analysis information. The call status of the assembly interface is obtained from the individual indicator analysis information and the trend indicator analysis information.
[0108] Figure 3 API gateway interface calling method flow provided in the embodiments of this application Figure 3 .like Figure 3 As shown, the API gateway interface call method provided in this embodiment includes:
[0109] S301, Manage the API provider through configuration in the API gateway;
[0110] S302. Based on the atomic call information and atomic parameter information, create an atomic interface; in the API gateway, build a call test permission, pass the call parameter information to the atomic interface, execute the call test to verify whether the response parameters match the expectations. If the response parameters of the atomic interface match the expected parameters, configure application system permissions, allocate key information for the application system to call the interface, and set permission whitelist and traffic limits.
[0111] S303: Obtain the assembly interface call information, call permissions, custom response parameter format, and unique identifier assigned by the API gateway. Based on the unique identifier, assembly interface call information, call permissions, and response parameter format, construct the assembly interface. Provide a visual preview of the hierarchical node structure. Match the interface identifier of the atomic interface from the API gateway based on the response parameter text. Validate the format of the response parameters of the atomic interfaces with configured interface identifiers.
[0112] S304. If the verification passes, the response parameters of the atomic interface will be echoed to the visual hierarchical node structure through the API gateway. The visual hierarchical node structure is used to customize the format of the response parameters.
[0113] S305. Configure a visual hierarchical node structure. The visual hierarchical node structure includes child nodes and parallel nodes. Child nodes support object type and array type, and parallel nodes support object type and other data types.
[0114] S306. Parallel call the atomic interfaces associated with the assembly interface to obtain the data exchange format object path pre-allocated in the response parameters of each atomic interface; based on the data exchange format object path, read the response parameters of each atomic interface.
[0115] S307. Expand the atomic interface call test information in the service assembly response parameters, perform atomic interface call verification, and ensure that no atomic interface parameters are omitted when assembling the interface call.
[0116] S308. Using the API gateway's built-in call test permissions, pass the call information to the assembly interface. The call operation is the same as the atomic interface test. Execute the call test to verify whether the response parameters match the expectations. After completing the test, configure application system permissions, assign key information for the application system's call interface, and set permission whitelists and traffic limits.
[0117] S309. When the application system formally calls the service assembly interface, the service logs of the assembly interface and the atomic interface are recorded synchronously.
[0118] S310. At the API gateway level, obtain multiple individual indicators and multiple trend indicators; obtain individual indicator analysis information for each individual indicator and trend indicator analysis information for each trend indicator; and obtain the call status of the assembly interface based on the individual indicator analysis information and the trend indicator analysis information.
[0119] This application provides an API gateway interface invocation method, which involves: obtaining atomic call information and atomic parameter information; creating atomic interfaces based on the atomic call information and atomic parameter information; verifying the atomic interfaces based on the call parameter information passed to them to determine whether the response parameters of the atomic interfaces match the expected parameters; if the response parameters of the atomic interfaces match the expected parameters, allocating call information for invoking the atomic interfaces to the application system; obtaining assembly interface call information, call permissions, custom response parameter formats, and a unique identifier assigned by the API gateway; constructing an assembly interface based on the unique identifier, assembly interface call information, call permissions, and response parameter formats; deduplicating all atomic interfaces associated with the assembly interface; obtaining the interface call information of the application system, determining the assembly interface to be called based on the interface call information, and obtaining the cloned response parameter text; matching the interface identifier of the atomic interfaces from the API gateway based on the response parameter text; validating the format of the response parameters of the atomic interfaces configured with interface identifiers, and if the validation passes... The response parameters of the atomic interfaces are then echoed to the visual hierarchical node structure via the API gateway. This structure allows for customization of the response parameter format. Parallel calls are made to each atomic interface associated with the assembly interface, obtaining the pre-allocated data exchange format object path for each atomic interface's response parameters. Based on the data exchange format object path, the response parameters of each atomic interface are read. The response parameters of all atomic interfaces associated with the assembly interface are then combined with the assembly interface's response parameters and fed back to the application system. Multiple individual metrics and multiple trend metrics are obtained. Individual metric analysis information and trend metric analysis information are obtained for each individual metric and each trend metric. Based on these analysis information, the call status of the assembly interface is determined, enabling parallel calls to atomic interfaces and reducing the impact of long-chain orchestration of serial interfaces on interface service performance. Simultaneously, it ensures that even if some or all atomic interface calls encounter exceptions, the acquisition and format structure of the response parameters remain intact and independent. This significantly improves the efficiency and flexibility of interface calls.
[0120] Figure 4 This is a schematic diagram of the structure of an API gateway interface calling device provided in an embodiment of this application. Figure 4 As shown in the embodiment of this application, an API gateway interface calling device 400 is provided. The device includes: a first processing module 401, a calling module 402, and a second processing module 403.
[0121] The first processing module 401 is used to obtain the interface call information of the application system, determine the assembly interface to be called according to the interface call information, the assembly interface is associated with at least two atomic interfaces, and the response parameter format of each atomic interface is defined through the assembly interface.
[0122] Module 402 is called in parallel to call the atomic interfaces associated with the assembly interface and obtain the response parameters of each atomic interface.
[0123] The second processing module 403 is used to combine the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface in text form and feed them back to the application system.
[0124] In one possible implementation, the first processing module 401 is further configured to:
[0125] Obtain atomic call information and atomic parameter information. Atomic call information includes URL path, interface access type and interface request header. Atomic parameter information includes path parameters, query parameters, header parameters, body parameters, response parameters and status parameters.
[0126] Create an atomic interface based on the atomic call information and atomic parameter information;
[0127] Based on the call parameter information passed to the atomic interface, the atomic interface is called and verified to determine whether the response parameters of the atomic interface match the expected parameters.
[0128] If the response parameters of the atomic interface match the expected parameters, then the call information for invoking the atomic interface is allocated to the application system.
[0129] In one possible implementation, the first processing module 401 is further configured to:
[0130] Obtain assembly interface call information, call permissions, custom response parameter format, and unique identifier assigned by the API gateway;
[0131] Construct the assembly interface based on the unique identifier, assembly interface call information, call permissions, and response parameter format;
[0132] Remove duplicates from all atomic interfaces associated with the assembly interface.
[0133] In one possible implementation, the first processing module 401 is further configured to:
[0134] Retrieve the text of the response parameters obtained from the clone;
[0135] Based on the response parameter text, match the interface identifier of the atomic interface from the API gateway;
[0136] Validate the format of the response parameters of the atomic interfaces that are configured with interface identifiers.
[0137] If the verification passes, the response parameters of the atomic interface will be echoed to the visual hierarchical node structure through the API gateway. The visual hierarchical node structure is used to customize the format of the response parameters.
[0138] In one possible implementation, the first processing module 401 is further configured to:
[0139] Recognize the response parameter text to obtain the visualized hierarchical node structure and target atomic interface;
[0140] Parse the call parameters and response parameters of the target atomic interface;
[0141] The call parameters and response parameters of the target atomic interface are used to create a new assembled interface using union logic, resulting in a cloned assembled interface.
[0142] In one possible implementation, the first processing module 401 is further configured to:
[0143] Configure a visual hierarchical node structure, which includes child nodes and parallel nodes. Child nodes support object and array types, while parallel nodes support object types and other data types.
[0144] In one possible implementation, module 402 is also used for:
[0145] Obtain the path to the pre-assigned data exchange format object on the response parameters of each atomic interface;
[0146] Based on the data exchange format object path, the response parameters of each atomic interface are read.
[0147] In one possible implementation, the second processing module 403 is further used for:
[0148] Obtain multiple individual indicators and multiple trend indicators;
[0149] Obtain individual indicator analysis information for each individual indicator and trend indicator analysis information for each trend indicator;
[0150] Based on the analysis information of each individual indicator and each trend indicator, the call status of the assembly interface is obtained.
[0151] This application provides an API gateway interface invocation device, which obtains atomic invocation information and atomic parameter information; creates atomic interfaces based on the atomic invocation information and atomic parameter information; verifies the atomic interfaces based on the invocation parameter information passed to the atomic interfaces to determine whether the response parameters of the atomic interfaces match the expected parameters; if the response parameters of the atomic interfaces match the expected parameters, it allocates invocation information for invoking the atomic interfaces to the application system; obtains assembly interface invocation information, invocation permissions, custom response parameter formats, and a unique identifier assigned by the API gateway; constructs an assembly interface based on the unique identifier, assembly interface invocation information, invocation permissions, and response parameter formats; deduplicates all atomic interfaces associated with the assembly interface; obtains the interface invocation information of the application system, determines the assembly interface to be invoked based on the interface invocation information, and obtains the cloned response parameter text; matches the interface identifier of the atomic interfaces from the API gateway based on the response parameter text; and verifies the format of the response parameters of the atomic interfaces configured with interface identifiers. If the verification passes... The response parameters of the atomic interfaces are then echoed to the visual hierarchical node structure via the API gateway. This structure allows for customization of the response parameter format. Parallel calls are made to each atomic interface associated with the assembly interface, obtaining the pre-allocated data exchange format object path for each atomic interface's response parameters. Based on the data exchange format object path, the response parameters of each atomic interface are read. The response parameters of all atomic interfaces associated with the assembly interface are then combined with the assembly interface's response parameters and fed back to the application system. Multiple individual metrics and multiple trend metrics are obtained. Individual metric analysis information and trend metric analysis information are obtained for each individual metric and each trend metric. Based on these analysis information, the call status of the assembly interface is determined, enabling parallel calls to atomic interfaces and reducing the impact of long-chain orchestration of serial interfaces on interface service performance. Simultaneously, it ensures that even if some or all atomic interface calls encounter exceptions, the acquisition and format structure of the response parameters remain intact and independent. This significantly improves the efficiency and flexibility of interface calls.
[0152] Figure 5 This is a hardware diagram of the interface calling device for the API gateway provided in this application. Figure 5 As shown, the API gateway interface calling device 500 provided in this embodiment includes at least one processor 501 and a memory 502. Optionally, the device 500 also includes a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus 504.
[0153] In a specific implementation, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to perform the above-described method.
[0154] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0155] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0156] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0157] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0158] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0159] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0160] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0161] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0162] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0163] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0164] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0165] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0166] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0167] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A method for invoking an API gateway interface, characterized in that, include: Obtain the interface call information of the application system, determine the assembly interface to be called based on the interface call information, the assembly interface is associated with at least two atomic interfaces, and the response parameter format of each atomic interface is defined through the assembly interface; The assembly interface is invoked in parallel to each atomic interface associated with it, and the response parameters of each atomic interface are obtained. The response parameters of all atomic interfaces associated with the assembly interface are combined with the response parameters of the assembly interface in text format and fed back to the application system. Before determining the assembly interface to be called based on the interface call information, the method further includes: Obtain assembly interface call information, call permissions, custom response parameter format, and the unique identifier assigned by the API gateway; Construct the assembly interface based on the unique identifier, assembly interface call information, call permissions, and response parameter format; Deduplicat all atomic interfaces associated with the assembly interface; Retrieve the text of the response parameters obtained from the clone; Based on the response parameter text, match the interface identifier of the atomic interface from the API gateway; The format of the response parameters of the atomic interface configured with the interface identifier is validated. If the verification passes, the response parameters of the atomic interface are echoed back to the visual hierarchical node structure through the API gateway. The visual hierarchical node structure is used to customize the format of the response parameters.
2. The method according to claim 1, characterized in that, Before determining the assembly interface to be called based on the interface call information, the method further includes: Obtain atomic call information and atomic parameter information. The atomic call information includes the URL path, interface access type, and interface request header. The atomic parameter information includes path parameters, query parameters, header parameters, body parameters, response parameters, and status parameters. The atomic interface is created based on the atomic call information and atomic parameter information; Based on the call parameter information passed to the atomic interface, the atomic interface is called and verified to determine whether the response parameters of the atomic interface match the expected parameters. If the response parameters of the atomic interface match the expected parameters, then the call information for invoking the atomic interface is allocated to the application system.
3. The method according to claim 1, characterized in that, The method further includes: The response parameter text is identified to obtain the visualized hierarchical node structure and target atomic interface; Parse the call parameters and response parameters of the target atomic interface; The call parameters and response parameters of the target atomic interface are used to create a new assembled interface using union logic, thereby obtaining the cloned assembled interface.
4. The method according to claim 1, characterized in that, The method further includes: Configure the visualization hierarchy node structure, which includes child nodes and parallel nodes. The child nodes support object types and array types, and the parallel nodes support the object types and other data types.
5. The method according to claim 1, characterized in that, The process of obtaining the response parameters for each atomic interface includes: Obtain the path to the pre-assigned data exchange format object on the response parameters of each atomic interface; Based on the data exchange format object path, the response parameters of each atomic interface are read.
6. The method according to claim 1, characterized in that, After the feedback is sent to the application system, it also includes: Obtain multiple individual indicators and multiple trend indicators; Obtain individual indicator analysis information for each individual indicator and trend indicator analysis information for each trend indicator; Based on the analysis information of each individual indicator and the analysis information of each trend indicator, the call status of the assembly interface is obtained.
7. An API gateway interface calling device, characterized in that, include: The first processing module is used to obtain the interface call information of the application system, determine the assembly interface to be called according to the interface call information, the assembly interface is associated with at least two atomic interfaces, and the response parameter format of each atomic interface is defined through the assembly interface; The calling module is used to call the atomic interfaces associated with the assembly interface in parallel and obtain the response parameters of each atomic interface; The second processing module is used to combine the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface in text form and feed them back to the application system. The first processing module is also used for: Obtain assembly interface call information, call permissions, custom response parameter format, and the unique identifier assigned by the API gateway; Construct the assembly interface based on the unique identifier, assembly interface call information, call permissions, and response parameter format; Deduplicat all atomic interfaces associated with the assembly interface; Retrieve the text of the response parameters obtained from the clone; Based on the response parameter text, match the interface identifier of the atomic interface from the API gateway; The format of the response parameters of the atomic interface configured with the interface identifier is validated. If the verification passes, the response parameters of the atomic interface are echoed back to the visual hierarchical node structure through the API gateway. The visual hierarchical node structure is used to customize the format of the response parameters.
8. An API gateway interface calling device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement an API gateway interface invocation method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Data flow interface dynamic arrangement method and device, equipment, medium and program product
CN114115841A
Defining application programming interfaces (APIS) using object schemas
US9753744B1