API gateway interface calling method and device and storage medium

By obtaining the interface call information of the application system in the API gateway, determining the assembly interface, and associating it with multiple atomic interfaces, defining the response parameter format, and realizing parallel call and text combination, it solves the problem of low interface call efficiency and improves the response parameters flexibility and stability.

CN119094614AActive Publication Date: 2024-12-06CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411215544.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-06
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

The existing API interface gateway is inefficient when calling the interface, which makes it difficult to read the aggregate response parameters and cannot meet the needs of diverse users.

Method used

By obtaining the interface call information of the application system, determining the assembly interface to be called, and associated with multiple atomic interfaces, defining the response parameter format, implementing parallel calls, text combination response parameters, and feedback to the application system to ensure the response parameters and format structure. Integrity and independence.

Benefits of technology

It improves interface call efficiency, supports fast cloning and replication of orchestration APIs of the same type, enhances the flexibility and stability of response parameters, and avoids the impact of atomic interface call exceptions on response parameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094614A_ABST
    Figure CN119094614A_ABST
Patent Text Reader

Abstract

The invention provides an interface calling method and device of an API gateway and a storage medium, and relates to the technical field of networks. The method comprises the steps that interface calling information of an application system is obtained, a to-be-called assembly interface is determined according to the interface calling 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; calling each atomic interface associated with the assembly interface in parallel, and obtaining a response parameter of each atomic interface; and performing text combination on the response parameters of all the atomic interfaces associated with the assembly interface and the response parameters of the assembly interface, and feeding back to the application system. According to the method provided by the invention, the technical effect of improving the calling efficiency of the API gateway interface is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network technology, and in particular to an interface calling method, device and storage medium of an API gateway. Background Art

[0002] As the standardization process of data interface services accelerates, how to flexibly arrange and combine interfaces based on atomic API interfaces to quickly respond to and meet diverse user needs has become a key challenge that needs to be solved urgently.

[0003] In the prior art, the interface aggregation method based on the API interface gateway, when the application system initiates a call request to the aggregated interface, the routing information matching the aggregated interface calls the atomic API interfaces in sequence, processes the response data to construct the aggregated response information and returns it to the application system.

[0004] Since the response parameters of the orchestrated atomic APIs are different, the aggregated response parameters may not be readable, so the prior art has the technical problem of low interface calling efficiency. Summary of the invention

[0005] The present application provides an interface calling method, device and storage medium of an API gateway, which are used to solve the technical problem of low interface calling efficiency in the prior art.

[0006] In a first aspect, the present application provides an interface calling method of an API gateway, the method comprising:

[0007] Obtaining interface call information of the application system, determining the assembly interface to be called according to the interface call information, the assembly interface is associated with at least two atomic interfaces, and defining the response parameter format of each atomic interface through the assembly interface;

[0008] Call each atomic interface associated with the assembly interface 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 textually 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 according to the interface calling information, the method further includes:

[0011] Obtain atomic call information and atomic parameter information. The atomic call information includes 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.

[0012] Create an atomic interface according to the atomic call information and atomic parameter information;

[0013] Based on the call parameter information passed into 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, call information for calling the atomic interface is allocated to the application system.

[0015] Optionally, before determining the assembly interface to be called according to the interface calling 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 an assembly interface based on the unique identifier, assembly interface call information, call permissions, and response parameter format;

[0018] De-duplicate all atomic interfaces associated with the assembly interface.

[0019] Optionally, after deduplication of all atomic interfaces associated with the assembly interface, the following steps are further included:

[0020] Get the cloned response parameter text;

[0021] According to the response parameter text, match the interface identifier of the atomic interface from the API gateway;

[0022] Verify the format of the response parameters of the atomic interface identified by the configuration interface.

[0023] If the verification passes, the response parameters of the atomic interface are 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 comprises:

[0025] Identify the response parameter text and obtain the visualized hierarchical node structure and target atomic interface;

[0026] Parse the call parameter and response parameter format of the target atomic interface;

[0027] The target atomic interface's calling parameter and response parameter formats are used to create the target atomic interface's calling parameters on the new assembly interface using union logic to obtain the cloned assembly interface.

[0028] Optionally, the method further comprises:

[0029] Configure the visualization hierarchical node structure. The visualization hierarchical node structure includes child nodes and parallel nodes. Child nodes support object types and array types, and parallel nodes support object types and other data types.

[0030] Optionally, obtain the response parameters of each atomic interface, including:

[0031] Get the data exchange format object path pre-assigned on the response parameter for 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 given to the application system, it also includes:

[0034] Get multiple single indicators and multiple trend indicators;

[0035] Obtaining single indicator analysis information of each single indicator and trend indicator analysis information of each trend indicator;

[0036] According to the analysis information of each single indicator and each trend indicator, the calling status of the assembly interface is obtained.

[0037] In a second aspect of the present application, an interface calling device of an API gateway is provided, including:

[0038] 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;

[0039] A calling module is used to call various atomic interfaces associated with the assembly interface in parallel to obtain response parameters of each atomic interface;

[0040] The second processing module is used to textually combine the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface, and feed back the result to the application system.

[0041] Optionally, the first processing module is further used for:

[0042] Obtain atomic call information and atomic parameter information. The atomic call information includes 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.

[0043] Create an atomic interface according to the atomic call information and atomic parameter information;

[0044] Based on the call parameter information passed into 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, call information for calling the atomic interface is allocated to the application system.

[0046] Optionally, the first processing module is further used for:

[0047] Obtain assembly interface call information, call permissions, custom response parameter format, and unique identifier assigned by the API gateway;

[0048] Construct an assembly interface based on the unique identifier, assembly interface call information, call permissions, and response parameter format;

[0049] De-duplicate all atomic interfaces associated with the assembly interface.

[0050] Optionally, the first processing module is further used for:

[0051] Get the cloned response parameter text;

[0052] According to the response parameter text, match the interface identifier of the atomic interface from the API gateway;

[0053] Verify the format of the response parameters of the atomic interface identified by the configuration interface.

[0054] If the verification passes, the response parameters of the atomic interface are 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 further used for:

[0056] Identify the response parameter text and obtain the visualized hierarchical node structure and target atomic interface;

[0057] Parse the call parameter and response parameter format of the target atomic interface;

[0058] The target atomic interface's calling parameter and response parameter formats are used to create the target atomic interface's calling parameters on the new assembly interface using union logic to obtain the cloned assembly interface.

[0059] Optionally, the first processing module is further used for:

[0060] Configure the visualization hierarchical node structure. The visualization hierarchical node structure includes child nodes and parallel nodes. Child nodes support object types and array types, and parallel nodes support object types and other data types.

[0061] Optionally, the calling module is also used to:

[0062] Get the data exchange format object path pre-assigned on the response parameter for 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 further used for:

[0065] Get multiple single indicators and multiple trend indicators;

[0066] Obtaining single indicator analysis information of each single indicator and trend indicator analysis information of each trend indicator;

[0067] According to the analysis information of each single indicator and each trend indicator, the calling status of the assembly interface is obtained.

[0068] In a third aspect, the present application provides an interface calling device of an API gateway, comprising: a processor, and a memory connected to the processor in communication, comprising:

[0069] Memory stores computer-executable instructions;

[0070] The processor executes the computer execution instructions stored in the memory to implement the interface calling method of the API gateway of the first aspect.

[0071] In a fourth aspect, a computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the interface calling method of the API gateway of the first aspect.

[0072] In a fifth aspect, a computer program product includes a computer program, which, when executed by a processor, implements the interface calling method of the API gateway of the first aspect.

[0073] The present application provides an interface calling method, device and storage medium of an API gateway, which obtains interface calling information of an application system, determines an assembly interface to be called according to the interface calling information, and associates the assembly interface with at least two atomic interfaces, and defines the response parameter format of each atomic interface through the assembly interface; calls each atomic interface associated with the assembly interface in parallel to obtain the response parameters of each atomic interface; combines the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface in text form, and feeds back to the application system, thereby realizing the ability to synchronously retrieve response parameters in parallel when calling the atomic interface through the interface orchestration technology that returns the determined response parameters and format structure, and the response parameters and format structure are not affected by the abnormal calls of one or more atomic interfaces, and based on the characteristics that the response parameters have been determined, can quickly clone and copy the same type of orchestration API, and support the inverse deduction of the orchestration API configuration through the response parameters, thereby improving the technical effect of improving the efficiency of interface calling. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0075] Figure 1 The process of the API gateway interface calling method provided in the embodiment of the present application Figure 1 ;

[0076] Figure 2 The process of the API gateway interface calling method provided in the embodiment of the present application Figure 2 ;

[0077] Figure 3 The process of the API gateway interface calling method provided in the embodiment of the present application Figure 3 ;

[0078] Figure 4 A schematic diagram of the structure of an API gateway interface calling device provided in an embodiment of the present application;

[0079] Figure 5 A hardware structure diagram of the interface calling device of the API gateway provided in an embodiment of the present application.

[0080] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0081] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0082] Within the framework of the prior art, when an interface aggregation strategy based on an API interface gateway is adopted, if the application system initiates a call request to the aggregated interface, the system will match the routing information of the aggregated interface and call each atomic API interface in sequence. Subsequently, the system will process the response data of these atomic APIs, construct the aggregated response information, and then return it to the application system. However, due to the differences in the response parameters of the arranged atomic API interfaces, this may make the aggregated response parameters difficult to read, which in turn makes the prior art insufficient in terms of interface call efficiency.

[0083] The present application provides an interface calling method, device and storage medium of an API gateway, which obtains interface calling information of an application system, determines an assembly interface to be called according to the interface calling information, and associates the assembly interface with at least two atomic interfaces, and defines the response parameter format of each atomic interface through the assembly interface; calls each atomic interface associated with the assembly interface in parallel to obtain the response parameters of each atomic interface; combines the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface in text form, and feeds back to the application system, thereby realizing the ability to synchronously retrieve response parameters in parallel when calling the atomic interface through the interface orchestration technology that returns the determined response parameters and format structure, and the response parameters and format structure are not affected by the abnormal calls of one or more atomic interfaces, and based on the characteristics that the response parameters have been determined, can quickly clone and copy the same type of orchestration API, and support the inverse deduction of the orchestration API configuration through the response parameters, thereby improving the technical effect of improving the efficiency of interface calling.

[0084] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0085] Figure 1 The API gateway interface calling method flow provided in the embodiment of the present application Figure 1 .like Figure 1 As shown, the API gateway interface calling method provided in this embodiment includes:

[0086] S101, obtaining interface call information of the application system, determining an assembly interface to be called according to the interface call information, wherein the assembly interface is associated with at least two atomic interfaces, and a 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 multiple APIs and provides a unified interface to the client. It can filter, convert and sort data from different data sources or APIs to meet the needs of the client. The client only needs to call an aggregation interface to obtain the required data without worrying about the implementation method of the underlying data source or API; the corresponding assembly interface to be called can be determined according to the interface call information, wherein 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, calling each atomic interface associated with the assembly interface in parallel to obtain a response parameter of each atomic interface;

[0089] In this embodiment, the API gateway calls multiple atomic interfaces in the assembly interface in parallel.

[0090] Among them, these atomic interfaces each execute independent business logic and return response parameters after execution. The assembly interface will receive the responses of these atomic interfaces at the same time and obtain the response parameters of each atomic interface from them. This method helps to improve the scalability and maintainability of the system. Each atomic interface completes a single task, and the assembly interface is responsible for integrating the results of these tasks. At the same time, parallel calls can also improve the processing efficiency of the system and reduce the overall response time.

[0091] S103, text-combining the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface, and feeding back the result 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 assembled interface. The combination process involves formatting, sorting, filtering or merging the data to ensure that the final data set meets the needs of the application system. After the combination is completed, the generated complete response data will be passed to the application system as feedback. In this way, the application system can receive a unified response that integrates the processing results of multiple atomic interfaces, thereby supporting its further business logic processing or user interface display.

[0093] The present application provides an interface calling method of an API gateway, which obtains the interface calling information of the application system, determines the assembly interface to be called according to the interface calling 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; further calling each atomic interface associated with the assembly interface in parallel, obtaining the response parameters of each atomic interface, the API gateway combines the response parameters returned by each atomic interface with the response parameters of the assembly interface, and the combination process involves formatting, sorting, filtering or merging the data to ensure that the final data set meets the requirements of the application system. After the combination is completed, the generated complete response data will be passed to the application system as feedback. Thus, the response parameters are synchronously obtained in a parallel manner to ensure that even when some or all of the atomic interface calls encounter exceptions, the acquisition of the response parameters and their format structure can maintain integrity and independence. Thereby significantly improving the efficiency and flexibility of interface calls.

[0094] Figure 2 The API gateway interface calling method flow provided in the embodiment of the present application Figure 2 This embodiment is in Figure 1Based on the embodiment, the interface calling method of the API gateway is described in detail, wherein the creation of the atomic interface is implemented through steps S201-S202, the addition of the assembly interface is implemented through step S203, the atomic interface is determined, the response parameter customization can be implemented according to steps S204-S205, and the result is fed back to the application system through steps S206-S207. Figure 2 As shown, the API gateway interface calling method provided in this embodiment includes:

[0095] S201, obtaining atomic call information and atomic parameter information; creating an atomic interface according to the atomic call information and the atomic parameter information; performing call verification on the atomic interface based on the call parameter information passed into 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, allocating the call information for calling the atomic interface to the application system;

[0096] In this embodiment, before creating an atomic interface, it is necessary to configure the provider management in the API gateway. The interface provider manages the network protocol, IP and port provided for the atomic interface to call, and manages the business attributes, technical attributes and management attributes of the provider; the atomic call information includes but is not limited to the URL path, interface access type and interface request header, and the 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, passes the call parameter information to the atomic interface, performs a call test, verifies whether the response parameters match the expectations, configures the application system permissions after the test is completed, allocates the key information of the application system call interface, and sets the permission whitelist and traffic restrictions.

[0097] S202, obtaining assembly interface call information, call permissions, a custom response parameter format, and a unique identifier assigned by the API gateway; constructing an assembly interface according to the unique identifier, assembly interface call information, call permissions, and response parameter format; and deduplicating all atomic interfaces associated with the assembly interface;

[0098] In this embodiment, the calling 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 calling information of the assembly interface should include the calling information of all atomic interfaces in the assembly interface. After the assembly interface is constructed according to the unique identifier, assembly interface calling information, calling permissions and response parameter format, the atomic interface is parsed according to the unique identifier of the atomic interface, and the duplicate atomic interfaces are merged.

[0099] S203, obtaining the interface call information of the application system, determining the assembly interface to be called according to the interface call information, and obtaining the cloned response parameter text; matching the interface identifier of the atomic interface from the API gateway according to the response parameter text; verifying the format of the response parameter of the atomic interface configured with the interface identifier, and if the verification passes, echoing the response parameter of the atomic interface to the visual hierarchical node structure through the API gateway, and the visual hierarchical node structure is used to customize the format of the response parameter;

[0100] In this embodiment, a visual hierarchical node structure is provided, which includes child nodes and parallel nodes. The child nodes support object types and array types, and the parallel nodes support object types and other data types, wherein the other data types include but are not limited to strings and numbers. By reading the cloned response parameter text, the atomic interface matching the response text is determined according to the response parameter text, 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 arranged atomic interface are pre-identified and aggregated according to clear response parameter combinations to avoid the risk of response parameter conflicts.

[0101] S204, calling each atomic interface associated with the assembly interface in parallel, obtaining a data exchange format object path pre-assigned on a response parameter of each atomic interface; and reading and obtaining a response parameter of each atomic interface based on the data exchange format object path;

[0102] In this embodiment, the response parameter format includes the Json object returned by the atomic interface in addition to the custom structure. For each atomic interface, the data format of its response is parsed to identify the specific location of all response parameters in the data exchange format. After the node selects the atomic interface, the node type option of the custom structure is invalid. The node input interface object path of the atomic interface is filled in according to the standard format, and the path end value and Json object path are supported. This application can reduce the impact of the long link of the serial interface on the performance of the interface service by merging the atomic interfaces that are repeatedly called on the API gateway and calling the atomic interfaces in parallel.

[0103] In one possible implementation, the response parameter text can be identified to obtain a visual hierarchical node structure and a target atomic interface; the calling parameters and response parameter format of the target atomic interface can be parsed; the calling parameters and response parameter format of the target atomic interface can be used to create the target atomic interface calling parameters on a new assembly interface using union logic to obtain a cloned assembly interface.

[0104] S205, combining the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface, and feeding back the result to the application system;

[0105] In this embodiment, before textually 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 new 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 at the same time, perform atomic interface call verification, and ensure that the atomic interface parameters are not missed when the assembly interface is called; use the built-in call test permission of the API gateway, pass the call information to the assembly interface, the call operation is the same as the atomic interface test, and execute the call test to verify whether the response parameters match the expectations. After completing the test, configure the application system permissions, assign the key information of the application system call interface, set the permission whitelist and traffic restrictions.

[0106] S206, obtaining multiple single indicators and multiple trend indicators; obtaining single indicator analysis information of each single indicator and trend indicator analysis information of each trend indicator; obtaining the calling status of the assembly interface according to each single indicator analysis information and each trend indicator analysis information.

[0107] In this embodiment, after the response parameters of all atomic interfaces associated with the assembly interface are textually combined with the response parameters of the assembly interface, the application system formally calls the service assembly interface to synchronously record the service logs of the assembly interface and the atomic interface. 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 calls are carried out, and single indicators include but are not limited to the total number of application systems, the number of assembly interfaces, today's call volume, the number of call statuses, the call success power, the average call time, the number of provider services, the number of application system calls and the number of interface calls; trend indicators include but are not limited to interface call trends, call success rate trends, call time trends, provider call rankings, application system call rankings and interface call rankings. Each single indicator and each trend indicator are analyzed to obtain multiple single indicator analysis information and multiple trend indicator analysis information, each single indicator analysis information and each trend indicator analysis information, to obtain the call status of the assembly interface.

[0108] Figure 3 The API gateway interface calling method flow provided in the embodiment of the present application Figure 3 .like Figure 3 As shown, the API gateway interface calling method provided in this embodiment includes:

[0109] S301, managing by configuring provider in API gateway;

[0110] S302. Create an atomic interface based on the atomic call information and atomic parameter information; set call test permissions in the API gateway, pass call parameter information to the atomic interface, perform call test to verify whether the response parameters match the expected parameters, and if the response parameters of the atomic interface match the expected parameters, configure application system permissions, allocate key information for the application system call interface, and set permission whitelists and traffic restrictions;

[0111] S303, obtain assembly interface call information, call permissions, custom response parameter format and unique identifier assigned by API gateway, build assembly interface according to unique identifier, assembly interface call information, call permissions and response parameter format; provide visual hierarchical node structure preview, match the interface identifier of atomic interface from API gateway according to response parameter text; verify the format of response parameter of atomic interface of configured interface identifier,

[0112] S304, if the verification passes, the response parameters of the atomic interface are echoed to the visual hierarchical node structure through the API gateway, and the visual hierarchical node structure is used to customize the format of the response parameters;

[0113] S305, configuring a visual hierarchical node structure, the visual hierarchical node structure includes child nodes and parallel nodes, the child nodes support object types and array types, and the parallel nodes support object types and other data types;

[0114] S306, calling each atomic interface associated with the assembly interface in parallel, obtaining a data exchange format object path pre-assigned on a response parameter of each atomic interface; based on the data exchange format object path, reading and obtaining a response parameter of each atomic interface;

[0115] S307, expanding the atomic interface call test information in the response parameters of the service assembly, performing atomic interface call verification, and ensuring that the atomic interface parameters are not omitted when assembling the interface call;

[0116] S308. Use the built-in call test permission of the API gateway to pass the call information to the assembly interface. The call operation is the same as the atomic interface test. Perform the call test to verify whether the response parameters match the expectations. After the test is completed, configure the application system permissions, allocate the key information of the application system call interface, set the permission whitelist and traffic limit;

[0117] S309, the application system formally calls the service assembly interface and synchronously records the service logs of the assembly interface and the atomic interface;

[0118] S310. At the API gateway level, multiple single indicators and multiple trend indicators are obtained; single indicator analysis information of each single indicator and trend indicator analysis information of each trend indicator are obtained; and based on each single indicator analysis information and each trend indicator analysis information, the calling status of the assembly interface is obtained.

[0119] The present application provides an interface calling method for an API gateway, which obtains atomic calling information and atomic parameter information; creates an atomic interface according to the atomic calling information and atomic parameter information; verifies the call of the atomic interface based on the calling 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, allocates the calling information for calling the atomic interface to the application system; obtains assembly interface calling information, calling permissions, a customized response parameter format, and a unique identifier assigned by the API gateway; constructs an assembly interface according to the unique identifier, assembly interface calling information, calling permissions, and response parameter format; deduplicates all atomic interfaces associated with the assembly interface; obtains the interface calling information of the application system, determines the assembly interface to be called according to the interface calling information, and obtains the cloned response parameter text; matches the interface identifier of the atomic interface from the API gateway according to the response parameter text; verifies the format of the response parameters of the atomic interface configured with the interface identifier, and if the verification passes , the response parameters of the atomic interface are echoed to the visual hierarchical node structure through the API gateway, and the visual hierarchical node structure is used to customize the format of the response parameters; call each atomic interface associated with the assembly interface in parallel, and obtain the data exchange format object path pre-assigned on the response parameters of each atomic interface; read the response parameters of each atomic interface based on the data exchange format object path; thus, the response parameters of all atomic interfaces associated with the assembly interface are combined with the response parameters of the assembly interface in text, and fed back to the application system; obtain multiple single indicators and multiple trend indicators; obtain the single indicator analysis information of each single indicator and the trend indicator analysis information of each trend indicator; obtain the call status of the assembly interface based on the analysis information of each single indicator and each trend indicator analysis information, so as to realize the parallel call of the atomic interface and reduce the impact of the long link of the serial interface on the interface service performance; at the same time, ensure that even when some or all atomic interface calls encounter exceptions, the acquisition of response parameters and their format structure can maintain integrity and independence. This significantly improves the efficiency and flexibility of interface calls.

[0120] Figure 4 A schematic diagram of the structure of an API gateway interface calling device provided in an embodiment of the present application. Figure 4 As shown, an API gateway interface calling device 400 provided in an embodiment of the present application 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 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] A calling module 402 is used to call each atomic interface associated with the assembly interface in parallel to obtain a response parameter of each atomic interface;

[0123] The second processing module 403 is used to textually combine the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface, and feed back the result to the application system.

[0124] In a possible implementation, the first processing module 401 is further configured to:

[0125] Obtain atomic call information and atomic parameter information. The atomic call information includes 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.

[0126] Create an atomic interface according to the atomic call information and atomic parameter information;

[0127] Based on the call parameter information passed into 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, call information for calling the atomic interface is allocated to the application system.

[0129] In a 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 an assembly interface based on the unique identifier, assembly interface call information, call permissions, and response parameter format;

[0132] De-duplicate all atomic interfaces associated with the assembly interface.

[0133] In a possible implementation, the first processing module 401 is further configured to:

[0134] Get the cloned response parameter text;

[0135] According to the response parameter text, match the interface identifier of the atomic interface from the API gateway;

[0136] Verify the format of the response parameters of the atomic interface identified by the configuration interface.

[0137] If the verification passes, the response parameters of the atomic interface are 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 a possible implementation, the first processing module 401 is further configured to:

[0139] Identify the response parameter text and obtain the visualized hierarchical node structure and target atomic interface;

[0140] Parse the call parameter and response parameter format of the target atomic interface;

[0141] The target atomic interface's calling parameter and response parameter formats are used to create the target atomic interface's calling parameters on the new assembly interface using union logic to obtain the cloned assembly interface.

[0142] In a possible implementation, the first processing module 401 is further configured to:

[0143] Configure the visualization hierarchical node structure. The visualization hierarchical node structure includes child nodes and parallel nodes. Child nodes support object types and array types, and parallel nodes support object types and other data types.

[0144] In a possible implementation, the calling module 402 is further used to:

[0145] Get the data exchange format object path pre-assigned on the response parameter for each atomic interface;

[0146] Based on the data exchange format object path, the response parameters of each atomic interface are read.

[0147] In a possible implementation, the second processing module 403 is further configured to:

[0148] Get multiple single indicators and multiple trend indicators;

[0149] Obtaining single indicator analysis information of each single indicator and trend indicator analysis information of each trend indicator;

[0150] According to the analysis information of each single indicator and each trend indicator, the calling status of the assembly interface is obtained.

[0151] The present application provides an interface calling device for an API gateway, which obtains atomic calling information and atomic parameter information; creates an atomic interface according to the atomic calling information and atomic parameter information; verifies the call of the atomic interface based on the calling 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, allocates the calling information for calling the atomic interface to the application system; obtains assembly interface calling information, calling permissions, a customized response parameter format, and a unique identifier assigned by the API gateway; constructs an assembly interface according to the unique identifier, assembly interface calling information, calling permissions, and response parameter format; deduplicates all atomic interfaces associated with the assembly interface; obtains the interface calling information of the application system, determines the assembly interface to be called according to the interface calling information, and obtains the cloned response parameter text; matches the interface identifier of the atomic interface from the API gateway according to the response parameter text; verifies the format of the response parameters of the atomic interface configured with the interface identifier, and if the verification passes , the response parameters of the atomic interface are echoed to the visual hierarchical node structure through the API gateway, and the visual hierarchical node structure is used to customize the format of the response parameters; call each atomic interface associated with the assembly interface in parallel, and obtain the data exchange format object path pre-assigned on the response parameters of each atomic interface; read the response parameters of each atomic interface based on the data exchange format object path; thus, the response parameters of all atomic interfaces associated with the assembly interface are combined with the response parameters of the assembly interface in text, and fed back to the application system; obtain multiple single indicators and multiple trend indicators; obtain the single indicator analysis information of each single indicator and the trend indicator analysis information of each trend indicator; obtain the call status of the assembly interface based on the analysis information of each single indicator and each trend indicator analysis information, so as to realize the parallel call of the atomic interface and reduce the impact of the long link of the serial interface on the interface service performance; at the same time, ensure that even when some or all atomic interface calls encounter exceptions, the acquisition of response parameters and their format structure can maintain integrity and independence. This significantly improves the efficiency and flexibility of interface calls.

[0152] Figure 5 This is a hardware diagram of the API gateway interface calling device provided in this application. Figure 5 As shown, the interface calling device 500 of the API gateway provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the device 50 also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus 504.

[0153] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above method.

[0154] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0155] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0156] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0157] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0158] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0159] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0160] The above-mentioned 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 memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0161] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium 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 be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0162] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

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

[0164] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0165] If the function is implemented in the form of 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 the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0166] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0167] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. An API gateway interface calling method, characterized in that: include: Acquire 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; Calling each atomic interface associated with the assembly interface in parallel to obtain a response parameter of each atomic interface; The response parameters of all atomic interfaces associated with the assembly interface are combined with the response parameters of the assembly interface in text form and fed back to the application system.

2. The method according to claim 1, characterized in that Before determining the assembly interface to be called according to the interface calling information, the method further includes: Acquire atomic call information and atomic parameter information, wherein the atomic call information includes a URL path, an interface access type, and an interface request header, and the atomic parameter information includes a path parameter, a query parameter, a header parameter, a body parameter, a response parameter, and a status parameter; Creating the atomic interface according to the atomic call information and the atomic parameter information; Based on the call parameter information passed into 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, calling information for calling the atomic interface is allocated to the application system.

3. The method according to claim 1, characterized in that Before determining the assembly interface to be called according to the interface calling information, the method further includes: Obtain assembly interface call information, call permissions, custom response parameter format, and a unique identifier assigned by the API gateway; Constructing an assembly interface according to the unique identifier, assembly interface call information, call authority and response parameter format; All atomic interfaces associated with the assembly interface are deduplicated.

4. The method according to claim 3, characterized in that After deduplication of all atomic interfaces associated with the assembly interface, the method further includes: Get the cloned response parameter text; According to the response parameter text, matching the interface identifier of the atomic interface from the API gateway; Verifying the format of the response parameter of the atomic interface configured with the interface identifier, If the verification passes, the response parameters of the atomic interface are echoed to the visual hierarchical node structure through the API gateway, and the visual hierarchical node structure is used to customize the format of the response parameters.

5. The method according to claim 4, characterized in that The method further comprises: Identify the response parameter text to obtain the visualization hierarchical node structure and the target atomic interface; Parsing the call parameter and response parameter format of the target atomic interface; The calling parameters and response parameter formats of the target atomic interface are used to create the target atomic interface calling parameters on the new assembly interface using union logic to obtain the cloned assembly interface.

6. The method according to claim 4, characterized in that The method further comprises: The visualization hierarchical node structure is configured, the visualization hierarchical node structure 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.

7. The method according to claim 1, characterized in that The step of obtaining the response parameters of each atomic interface includes: Get the data exchange format object path pre-assigned on the response parameter for each atomic interface; Based on the data exchange format object path, the response parameters of each atomic interface are read and obtained.

8. The method according to claim 1, characterized in that After the feedback is given to the application system, the method further includes: Get multiple single indicators and multiple trend indicators; Obtaining single indicator analysis information of each single indicator and trend indicator analysis information of each trend indicator; According to each single indicator analysis information and each trend indicator analysis information, the calling status of the assembly interface is obtained.

9. An API gateway interface calling device, characterized in that: include: A first processing module is used to obtain 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; A calling module, used for calling each atomic interface associated with the assembly interface in parallel to obtain a response parameter of each atomic interface; The second processing module is used to text-combine the response parameters of all atomic interfaces associated with the assembly interface with the response parameters of the assembly interface, and feed back the text to the application system.

10. An interface calling device of an API gateway, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement an interface calling method of an API gateway as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Program front-end and back-end interface calling method and device, computer equipment and storage medium

    CN111736930A

  • Data flow interface dynamic arrangement method and device, equipment, medium and program product

    CN114115841A

  • Request generation method, request generation device, electronic equipment and storage medium

    CN115421941A

  • API interface access method and device, API interface conversion method and device, equipment and storage medium

    CN115509647A

  • Interface calling method and device, electronic equipment and readable storage medium

    CN116048749A