Gateway interface calling method and device, multi-element gateway and storage medium

By determining the subscription gateway, publishing gateway and target API in the gateway interface call method, and obtaining and sending interface resource information when the gateway is an in-house gateway, the problem of low efficiency in gateway interface call in network isolation environment is solved, and fast and efficient API calls are achieved.

CN119996513AActive Publication Date: 2025-05-13SHENZHEN SMARTCITY TECH DEV GRP CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510451955.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-11
Publication Date
2025-05-13
Estimated Expiration
2045-04-11

AI Technical Summary

Technical Problem

In the isolated environment of different network segments, cross-service communication between gateways is difficult to implement, and the manual registration of API gateways is complicated, resulting in low efficiency in gateway interface calling.

Method used

A gateway interface calling method is proposed. By responding to the interface call request, the subscription gateway, publishing gateway and target API are determined. When the publishing gateway is a preset managed gateway, the interface resource information of the target API is obtained and sent to the subscription gateway.

Benefits of technology

It realizes the rapid completion of API calls without breaking network isolation, and improves the call efficiency of gateway interfaces in network isolation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119996513A_ABST
    Figure CN119996513A_ABST
Patent Text Reader

Abstract

The invention discloses a gateway interface calling method and device, a multi-element gateway and a storage medium, and relates to the technical field of interface calling, the gateway interface calling method comprises the following steps: in response to an interface calling request, determining a subscription gateway, a publishing gateway and a target application programming interface API matched with the publishing gateway; under the condition that the publishing gateway is a preset hosted gateway, interface resource information of the target API is acquired from the publishing gateway; the interface resource information is sent to the subscription gateway, and the interface resource information is used for API calling. According to the method and the device, the calling of the API is quickly completed through the multiple gateways on the premise of not breaking the network isolation, so that the calling efficiency of the gateway interface in the network isolation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] API (Application Programming Interface) allows communication and data exchange between different software systems, promoting modular design, functional expansion and cross-platform collaboration of software. Although the development of information technology, the emergence of API gateways and management tools have further simplified the use and monitoring of APIs, it has provided strong support for systems with high concurrency and dynamic routing requirements. When gateways in mutually isolated environments of different network segments want to communicate across services, they usually need to break through the network isolation and register the called API with the caller's service. However, network access between different isolated environments is difficult to break through, and the manual registration of API gateways is cumbersome, resulting in low efficiency in calling gateway interfaces in network isolation.

[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of the present application is to provide a gateway interface calling method, device, multiple gateway and storage medium, aiming to improve the calling efficiency of the gateway interface in network isolation.

[0005] To achieve the above purpose, the present application proposes a gateway interface calling method, the method comprising: In response to the interface call request, determining a subscription gateway, a publishing gateway, and a target application programming interface API matching the publishing gateway; In the case where the publishing gateway is a preset managed gateway, obtaining interface resource information of the target API from the publishing gateway; The interface resource information is sent to the subscription gateway, wherein the interface resource information is used for API calling.

[0006] In one embodiment, before the step of determining, in response to the interface call request, a subscription gateway, a publishing gateway, and a target application programming interface API matching the publishing gateway, the step further includes: In response to an authentication request of the gateway to be managed, determining a docking API of the gateway to be managed; In the case where the gateway to be managed is successfully accessed through the docking API, the gateway to be managed is determined as a managed gateway.

[0007] In one embodiment, before the step of determining the to-be-managed gateway as a managed gateway, the method further includes: Obtaining gateway data provided by the gateway to be managed through the docking API; Determining whether the gateway data meets a preset hierarchical distribution condition; In the case where the gateway data satisfies the hierarchical distribution condition, executing the step of determining the to-be-managed gateway as a managed gateway; When the gateway data does not satisfy the hierarchical distribution conditions, management exception information is output.

[0008] In one embodiment, after the step of determining the to-be-managed gateway as a managed gateway, the method further includes: The gateway resource information of the managed gateway is dynamically updated through the docking API.

[0009] In one embodiment, the step of determining, in response to the interface call request, a subscription gateway, a publishing gateway, and a target application programming interface API that matches the publishing gateway comprises: Parsing the interface call request to determine the subscription gateway, the publishing gateway and the target resource; Determine a target level corresponding to the target resource in the publishing gateway; A subordinate API of the target level is determined as the target API.

[0010] In one embodiment, before the step of obtaining the interface resource information of the target API from the publishing gateway, the method further includes: Determining whether the target API is an open resource according to the gateway resource information of the publishing gateway; In the case where the target API is the open resource, a step of acquiring interface resource information of the target API from the publishing gateway is performed.

[0011] In one embodiment, after the step of determining, in response to the interface call request, a subscription gateway, a publishing gateway, and a target application programming interface API matching the publishing gateway, the step further includes: Obtain the calling permission corresponding to the subscription gateway; Determining whether the subscription gateway has permission to call the target API according to the calling permission; In the case that the subscription gateway does not have the authority to call the target API, the interface call request is rejected.

[0012] In addition, to achieve the above purpose, the present application also proposes a gateway interface calling device, the gateway interface calling device comprising: A determination module, configured to determine, in response to an interface call request, a subscription gateway, a publishing gateway, and a target application programming interface API that matches the publishing gateway; An acquisition module, configured to acquire interface resource information of the target API from the publishing gateway when the publishing gateway is a preset managed gateway; A sending module is used to send the interface resource information to the subscription gateway, wherein the interface resource information is used for API calling.

[0013] In addition, to achieve the above objectives, the present application also proposes a multi-dimensional gateway, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the gateway interface calling method described above.

[0014] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the gateway interface calling method described above are implemented.

[0015] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the gateway interface calling method described above are implemented.

[0016] One or more technical solutions proposed in the present application have at least the following technical effects: by responding to an interface call request, it is possible to obtain information about a subscription gateway, a publishing gateway, and a target application programming interface API that matches the publishing gateway, thereby providing a clear target and path for subsequent calls to the target API; and then by confirming that the publishing gateway is a preset managed gateway, invalid calls to unauthorized gateways are avoided; and then after the confirmation is completed, the interface resource information of the target API is obtained from the publishing gateway, and the obtained interface resource information of the target API is sent to the subscription gateway, so that the subscription gateway can call the target API according to the interface resource information. By transmitting the resource information, it is possible to quickly complete the API call without breaking the network isolation, thereby improving the calling efficiency of the gateway interface in network isolation. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] 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.

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 A flowchart of the first embodiment of the gateway interface calling method of the present application is provided; Figure 2 A schematic diagram of multi-level data resources provided in Example 2 of the present application; Figure 3 A schematic diagram of the gateway management process provided in Example 2 of the present application; Figure 4 An interactive diagram of the gateway interface call provided in the third embodiment of the present application; Figure 5 This is a schematic diagram of the module structure of the gateway interface calling device according to an embodiment of the present application; Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the gateway interface calling method in the embodiment of the present application. DETAILED DESCRIPTION

[0020] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0021] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0022] In this embodiment, for the convenience of description, the following description is made with the multi-gateway as the execution entity.

[0023] In addition to breaking network isolation to call the gateway interface in network isolation, the conventional practice also includes forwarding traffic between two gateways through proxy services. However, the downstream gateway often needs to expose all service APIs to the proxy service, which increases security risks; and if only the service APIs for specific requirements are exposed, when other services need to be called again in the future, relevant personnel need to be re-integrated for communication and configuration. This model cannot solve the service call problem at one time, resulting in low efficiency of gateway interface calls.

[0024] The present application provides a solution. First, according to the authentication information of the publishing gateway obtained, the corresponding docking API is determined from the preset API library, and the publishing gateway is accessed through the docking API, so as to complete the authentication verification of the publishing gateway and ensure that the publishing gateway is truly accessible; after successful access, the open resources provided by the publishing gateway are further obtained, and the publishing gateway is determined as a managed gateway. Through the management operation, effective management and scheduling of gateway resources are realized, creating conditions for subsequent efficient calls. In the actual gateway interface calling process, the information of the subscription gateway, publishing gateway and target API can be obtained by parsing the received interface calling request, which provides a clear target and path for the subsequent target API calling; and then by confirming that the publishing gateway is the preset management gateway and the target API is the preset open resource, invalid calls to unauthorized gateways or non-open resources are avoided; and then after the confirmation is completed, the resource information of the target API is obtained from the publishing gateway, and the obtained resource information of the target API is sent to the subscription gateway, so that the subscription gateway can call the target API according to the resource information. Through the transmission of resource information, the API calling is completed quickly without breaking the network isolation, which effectively reduces the difficulty and complexity of calling between gateway interfaces in the grid isolation environment, thereby improving the calling efficiency of the gateway interface in the network isolation.

[0025] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a multi-gateway, a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes the multi-gateway as the execution subject as an example to illustrate this embodiment and the following embodiments.

[0026] It should be noted that the multi-gateway is used to achieve communication between mutually isolated networks, and is usually located on the public network segment of different isolated network segments. The setting of the multi-gateway can ensure the mutual isolation between the isolated network segments, reducing the risk of the gateway or system under the isolated network segment being cracked due to lateral attacks.

[0027] Based on this, the embodiment of the present application provides a gateway interface calling method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the gateway interface calling method of the present application.

[0028] In this embodiment, the gateway interface calling method includes steps S10 to S30: Step S10, in response to the interface call request, determining the subscription gateway, the publishing gateway, and the target application programming interface API that matches the publishing gateway; It should be noted that the subscription gateway refers to the gateway that requests the service interface of other gateways, while the publishing gateway refers to the gateway that exposes the interface capabilities of the backend service to external callers. It should be noted that the identities of the subscription gateway and the publishing gateway are related, and any gateway can be both a subscription gateway and a publishing gateway.

[0029] In addition, it should be noted that API (Application Programming Interface) refers to the interface for communication and interaction between different software applications, which defines a set of rules and protocols that specify how to exchange data between software components, the format of requests and responses, and how to trigger specific operations or services. Interface call requests can be configured by the user subscription gateway or generated by the subscription gateway according to actual needs.

[0030] Exemplarily, the system in the subscription gateway expects to call an API interface of the publishing gateway, and for this purpose generates an interface call request including the subscription gateway to which the current system belongs, the publishing gateway to which the API interface belongs, and the target API, and sends the interface call request to the multi-gateway; after receiving the interface call request, the multi-gateway performs format verification and field extraction on the interface call request, and extracts information such as the subscription gateway, publishing gateway and target API, which is used for subsequent API calls and routing decisions.

[0031] Step S20, when the publishing gateway is a preset managed gateway, obtaining the interface resource information of the target API from the publishing gateway; It should be noted that a managed gateway refers to a gateway that has been registered and authenticated in the current multi-gateway; interface resource information refers to various metadata and descriptive information related to the API interface, including detailed data such as the path, parameters, and return type of the target API.

[0032] Exemplarily, after parsing the interface call request, the multi-gateway needs to first determine whether the publishing gateway indicated by the interface call request is a preset managed gateway, that is, to confirm whether the multi-gateway contains the registration information of the publishing gateway to avoid sending API resource requests to illegal gateways; and then, after confirming that the publishing gateway is legal, the multi-gateway can obtain the resource information of the target API from the publishing gateway through resource requests.

[0033] Exemplarily, the publishing gateway may add an identifier or token to the resource information of the target API returned to the multi-gateway, thereby authenticating the caller of the target API, thereby reducing the risk of the API interface being illegally called.

[0034] It is understandable that directly obtaining the resource information of the target API of the publishing gateway through the multi-gateway skips the network isolation restrictions, improves the efficiency of API resource acquisition, and thus improves the efficiency of interface calls.

[0035] Step S30: sending interface resource information to a subscription gateway, wherein the interface resource information is used for API calling.

[0036] Exemplarily, the multi-gateway sends the interface resource information of the target API obtained above to the subscription gateway; after receiving the interface resource information of the target API, the subscription gateway determines the routing path or access path for calling the target API through the multi-gateway, the data format and return data type corresponding to the target API, etc. according to the interface resource information, so as to directly call the target API subsequently.

[0037] This embodiment provides a gateway interface calling method, which requests the interface resource information of the target API from the publishing gateway through the multi-gateway, and forwards it to the subscribing gateway without breaking the network isolation, thereby realizing direct calling and centralized management of API resources and improving the calling efficiency between gateway interfaces in network isolation.

[0038] In a feasible implementation manner, before step S10, the method further includes: Step S01, in response to an authentication request of the gateway to be managed, determining a docking API of the gateway to be managed; It should be noted that the authentication request refers to the request sent by the gateway to be managed for authentication and registration in the multi-gateway, which usually includes information such as gateway type, gateway version number, communication protocol, gateway address, authentication parameters, and whether remote access is required.

[0039] In addition, it should be noted that the docking API is used for direct communication between the multi-gateway and the gateway to be managed, and is usually integrated into the internal system of the multi-gateway and is not exposed to the outside.

[0040] Exemplarily, after receiving the authentication request, the multi-gateway determines the authentication information of the gateway to be managed, and the authentication information includes all the information of the authentication request; then the multi-gateway can determine the docking API that matches the authentication information based on the authentication information, and the docking API is only used to communicate and interact with the gateway to be managed.

[0041] Exemplarily, the multi-gateway can also determine a docking API that matches the gateway type and gateway version number from a preset API library based on partial content of the authentication request of the gateway to be managed, such as the gateway type and gateway version number. The docking API is suitable for communication with gateways of the same type and version number as the gateway to be managed.

[0042] In a feasible implementation manner, before step S01, the method further includes: configuring a service provider interface SPI mode for a preset API library.

[0043] It should be noted that the preset API library refers to a database or collection that stores various API interface information, each of which corresponds to a specific gateway or a specific gateway type and gateway version number. The specific corresponding elements are not specifically limited in this implementation. The SPI (Service Provider Interface) mode is a service discovery mechanism that allows dynamic loading and replacement of interface implementation classes at runtime. By defining interfaces and configuration files, developers can dynamically add or replace service implementations without modifying the main program.

[0044] Exemplarily, by configuring the SPI mode for the API library, the multi-gateway can provide an SPI interface specification; then the provider of each gateway to be managed can implement the SPI interface specification by using the docking API corresponding to the gateway to be managed, and integrate the specific implementation of the docking API of each gateway to be managed into the preset API library. When the multi-gateway needs to call the docking API corresponding to each gateway to be managed, it can directly call the SPI interface in the API library to achieve communication and interaction with each publishing gateway.

[0045] In this embodiment, by configuring the SPI mode, the main program of the multi-element gateway is decoupled from the docking API configuration, so that users can dynamically configure different docking APIs in the API library according to actual needs, thereby improving the flexibility of the multi-element gateway. Moreover, by directly calling the SPI interface, the process of searching and determining the docking API is reduced, so that the multi-element gateway can directly communicate with the gateway through the SPI interface, thereby improving the efficiency of the interface call.

[0046] Step S02: When the gateway to be managed is successfully accessed through the docking API, the gateway to be managed is determined as a managed gateway.

[0047] Exemplarily, the multi-gateway determines the docking API based on all the information in the obtained authentication request, and then initiates an access request to the gateway to be managed through the docking API. If a response message is received from the gateway to be managed, it means that the access is successful and the next step can be performed; if no response message is received, it means that the obtained authentication information is incorrect, and a prompt message can be returned to the provider of the authentication information.

[0048] Exemplarily, the multi-gateway can also determine from a preset API library a docking API suitable for a gateway with the same type and version number as the publishing gateway based on part of the authentication request of the gateway to be managed, such as the gateway type and gateway version number; further, the multi-gateway can construct a complete access request based on the communication protocol, gateway address, and authentication parameters in the authentication information, and broadcast the access request through the docking API until a response information is received from the gateway to be managed within a preset time range, thereby determining that the access is successful and determining the gateway to be managed as a managed gateway.

[0049] It is understandable that by accessing the publishing gateway, it is possible to ensure that the authentication information is correct, determine that the publishing gateway is authentic and valid, and avoid making interface calls to invalid publishing gateways.

[0050] In this implementation, through a standardized gateway management process, automatic registration and management of the gateway is achieved, reducing the workload of management personnel and facilitating users to manage and subscribe to the API resources provided by the gateway; when implementing interface calls, there is no need to manually register the interface, thereby improving the efficiency of interface calls.

[0051] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above description, and will not be repeated in the following. On this basis, in step S03, by docking with the API, obtaining the API data provided by the publishing gateway, determining the API data as an open resource, and determining the publishing gateway as a managed gateway, the steps include: Step A01, obtaining gateway data provided by the gateway to be managed through the docking API; It should be noted that gateway data refers to data organized in a hierarchical structure in the publishing gateway, and each level contains data of different types or granularities.

[0052] It can be understood that since the docking API is determined based on the authentication request of the gateway to be managed, it matches the data format, parameter type, etc. of the gateway to be managed. Therefore, the gateway data of the gateway to be managed can be directly obtained through the docking API without the need for format conversion and other operations, thereby improving the efficiency of the interface call.

[0053] Step A02, determining whether the gateway data meets the preset hierarchical distribution conditions; It should be noted that the preset hierarchical distribution conditions refer to a series of pre-defined hierarchical distribution rules or standards for determining whether gateway data is qualified, which may include information or rules on which levels the gateway data should contain and the order in which the levels should be arranged.

[0054] For example, please refer to Figure 2, the multi-gateway can communicate with gateway A and gateway B in a network isolated environment respectively. Gateway A and gateway B can provide resources that allow other gateways to call. Gateway A has 4 levels of data, from high to low, namely system, application, service, and API, among which system, application and service are all resource directory levels, and API is the actual resource level; the multi-gateway requests data resources of each level from the gateway to be managed through the API; then, after receiving the request, the gateway to be managed packages the data resources of each level into the response information according to the deployment method of each level in the gateway, and returns it to the multi-gateway; then, after receiving the response information, the multi-gateway parses it, extracts the gateway data from it, and determines whether the obtained gateway data meets the preset hierarchical distribution conditions according to the hierarchical distribution contained in the gateway data, and then takes corresponding processing measures.

[0055] Step A03, when the gateway data meets the hierarchical distribution condition, executing the step of determining the to-be-managed gateway as a managed gateway; Step A04: When the gateway data does not meet the hierarchical distribution conditions, output management exception information.

[0056] Exemplarily, gateway A contains four levels of gateway data, namely system, application, service and API; after obtaining the data resources of gateway A, the multi-level gateway extracts its hierarchical structure, and compares the extracted hierarchical structure with the preset hierarchical distribution conditions to determine whether the obtained gateway data contains all preset levels. For example, if the extracted hierarchical structure only contains system and application, it means that some data pulling has failed. The multi-level gateway can try to re-acquire the data resources by itself, or output management exception information; if the obtained gateway data contains all preset levels, gateway A is determined to be a managed gateway; after the management is completed, the user can call the API resources of gateway A through the multi-level gateway.

[0057] For example, please refer to Figure 3 , Figure 3A schematic flow diagram of gateway management is provided, specifically: the multi-gateway executes S201, determines the docking API of the gateway to be managed in response to the authentication request of the gateway to be managed; then executes S202 to determine whether the multi-gateway can successfully access the gateway to be managed through the docking API; in the case of unsuccessful access, the multi-gateway re-executes S201 to re-determine the docking API, and may also send a prompt message to the gateway to be managed to request it to resend the authentication request; in the case of successfully accessing the gateway to be managed through the docking API, executes S203 to obtain gateway data provided by the gateway to be managed through the docking API; then executes S204 to determine whether the obtained gateway data meets a preset hierarchical distribution condition; in the case that the gateway data does not meet the hierarchical distribution condition, executes S205 to prompt a management exception and output management exception information; in the case that the gateway data meets the hierarchical distribution condition, executes S206 to determine the gateway to be managed as a managed gateway, and determine that the gateway management is successful.

[0058] In this embodiment, by performing hierarchical detection on the acquired data resources, the integrity of the data resources can be ensured, thereby ensuring that the managed API resources can be accurately called in the subsequent calling process.

[0059] In a feasible implementation manner, step S10 includes: Step A11, parsing the interface call request, determining the subscription gateway, publishing gateway and target resource; It should be noted that, since the publishing gateway provides multi-level gateway data, the target resource to be called in the interface call request can be a resource directory or an underlying API resource.

[0060] Step A12, determining the target level corresponding to the target resource in the publishing gateway; It is understandable that by dividing the data into different levels, it is convenient for users to call and manage the API resources of the publishing gateway, especially when multiple API resources are called at one time.

[0061] Step A13, determining the subordinate API of the target level as the target API.

[0062] For example, after receiving the call application, the multi-gateway parses it and extracts information such as the subscription gateway, publishing gateway, and target resource; then, according to the description or identification of the target resource, it determines the target level to which the target resource belongs; then, according to the preset level setting, it searches for the subordinate API under the target level from the acquired data resources and determines it as the target API expected to be called in the call application. For example, please refer to Figure 2In the case where the target resource of the interface call request is application 1 of gateway A, all services under application 1 are determined as target services, and then the subordinate APIs of the target services are determined as target APIs.

[0063] In this implementation, through hierarchical resource management, it is possible to call a complete service by calling high-level data resources to improve the efficiency of interface calls; it is also possible to achieve fine management of interface calls by calling low-level data, thereby meeting the calling needs of different users.

[0064] Based on the first embodiment and / or the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those of the above-mentioned first and second embodiments can be referred to the above introduction, and will not be repeated later. On this basis, after step S10, it also includes: Step B11, obtaining the calling authority corresponding to the subscription gateway; It should be noted that calling permissions refer to the ability of a subscribed gateway to be authorized to call a specific API, which is usually stored in a multi-gateway or cloud environment in the form of permission identifiers, roles, or policies.

[0065] Step B12, determining whether the subscription gateway has the authority to call the target API according to the calling authority; Step B13: If the subscription gateway does not have the authority to call the target API, the interface call request is rejected.

[0066] Exemplarily, after parsing the interface call interface, the multi-gateway determines that the user expects to subscribe gateway A (subscribing gateway) to an API resource (target API) of gateway B (publishing gateway); then the multi-gateway reads the corresponding calling permissions of gateway A from the permission management system, and determines whether gateway A has the permission to call the target API; then, if gateway A does not have the permission to call the target API, the multi-gateway will reject the interface call request; and if gateway A has the permission to call the target API, the multi-gateway can normally obtain the interface resource information of the target API from gateway B through the docking API, and send it to gateway A, so that gateway A can call the target API based on the interface resource information.

[0067] In this implementation, by detecting the calling authority of the subscription gateway, illegal gateways are prevented from illegally calling the API resources of the publishing gateway, thereby reducing the risk of illegal attacks and data leakage on the publishing gateway.

[0068] Based on the first embodiment, the second embodiment and / or the third embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those of the above-mentioned first embodiment, second embodiment and third embodiment can refer to the above introduction, and will not be repeated later. On this basis, after step S02, it also includes: Step E03: Dynamically update the gateway resource information of the managed gateways through the docking API.

[0069] Exemplarily, after successfully managing a gateway, the multi-gateway can obtain the latest API data from the managed gateway by docking with the API at preset time intervals to achieve regular updates of gateway resource information and avoid invalid access to managed API resources.

[0070] Exemplarily, the multi-gateway can also obtain the latest API data through an event notification mechanism. For example, the multi-gateway listens to the API data of the managed gateway through a custom listener, and when the API data of the managed gateway is updated, it obtains the latest gateway resource information of the managed gateway.

[0071] In this embodiment, dynamic updates are used to ensure that the latest API data is maintained in the multi-gateway, which effectively reduces calls to invalid APIs and improves the real-time performance of the multi-gateway.

[0072] In a feasible implementation manner, before the step of obtaining the interface resource information of the target API from the publishing gateway in step S20, the method further includes: Step E11, determining whether the target API is an open resource according to the gateway resource information of the publishing gateway; It should be noted that open resources refer to API resources that are preset in the publishing gateway to allow external access or calls.

[0073] Step E12, when the target API is an open resource, execute the step of obtaining the interface resource information of the target API from the publishing gateway.

[0074] Exemplarily, after the multi-gateway determines that the publishing gateway in the interface call request is a managed gateway, it further determines whether the target API to be called is an open resource of the publishing gateway based on the gateway resource information provided by the publishing gateway, that is, determines whether the target API can be accessed or called by other gateways or systems; if the target API is an open resource, the interface resource information of the target API can be obtained from the publishing gateway; if the target API is not an open resource, a prompt message of resource acquisition exception is output.

[0075] In this implementation, invalid requests are effectively reduced by further confirming that the target API of the request belongs to an open resource.

[0076] For example, to help understand the implementation process of the gateway interface calling method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 4 , Figure 4 A schematic diagram of interaction based on a multi-gateway is provided, specifically: The user executes step S101 to send an interface call request to the multi-gateway, where the interface call request at least includes information such as a subscription gateway, a publishing gateway, and a target API.

[0077] After receiving the interface call request sent by the user, the multi-gateway parses it to obtain the above-mentioned subscription gateway, publishing gateway and target API information, and makes it clear that the user expects to subscribe a system resource (target resource) of gateway B (publishing gateway) for gateway A (subscription gateway); then the multi-gateway executes S102, performs an authority review on gateway A, obtains the calling authority of gateway A, and determines whether gateway A has the authority to call the system resource of gateway B; then, if gateway A has the authority to call the system resource of gateway B, the subordinate API of the system resource is determined as the target API, and S103 is executed to obtain the interface resource information of the target API from gateway B.

[0078] After receiving the acquisition request, gateway B executes S104 and provides the interface authentication information of the target API to the multi-gateway; the multi-gateway then executes S105, registers the target interface for accessing the target API based on the received interface authentication information, and executes S106 to provide the interface resource information of the target interface to gateway A; gateway A then executes S107, accesses the target interface of the multi-gateway based on the interface resource information, and calls the target API of gateway B.

[0079] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the gateway interface calling method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0080] The present application also provides a gateway interface calling device, please refer to Figure 5 , the gateway interface calling device comprises: A determination module 10, for determining, in response to an interface call request, a subscription gateway, a publishing gateway, and a target application programming interface API that matches the publishing gateway; The acquisition module 20 is used to acquire the interface resource information of the target API from the publishing gateway when the publishing gateway is a preset managed gateway; The sending module 30 is used to send the interface resource information to the subscription gateway, wherein the interface resource information is used for API calling.

[0081] The gateway interface calling device provided in the embodiment of the present application adopts the gateway interface calling method in the above embodiment, which can improve the calling efficiency of the gateway interface in network isolation. Compared with the prior art, the beneficial effects of the gateway interface calling device provided in the present application are the same as the beneficial effects of the gateway interface calling method provided in the above embodiment, and other technical features in the gateway interface calling device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0082] An embodiment of the present application provides a multi-dimensional gateway, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the gateway interface calling method in the above-mentioned embodiment one.

[0083] Reference below Figure 6 , which shows a schematic diagram of the structure of a multi-gateway suitable for implementing an embodiment of the present application. The multi-gateway in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions: tablet computers), PMPs (Portable Media Players: portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The multi-gateway shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0084] like Figure 6As shown, the multi-gateway may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the multi-gateway are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the multi-gateway to communicate with other devices wirelessly or wired to exchange data. Although the figure shows a multi-gateway with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0085] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0086] The multi-element gateway provided in the embodiment of the present application adopts the gateway interface calling method in the above embodiment, which can improve the calling efficiency of the gateway interface in network isolation. Compared with the prior art, the beneficial effects of the multi-element gateway provided in the present application are the same as the beneficial effects of the gateway interface calling method provided in the above embodiment, and the other technical features in the multi-element gateway are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0087] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0088] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0089] An embodiment of the present application provides a computer-readable storage medium having computer-readable program instructions (ie, a computer program) stored thereon, wherein the computer-readable program instructions are used to execute the gateway interface calling method in the above embodiment.

[0090] The computer-readable storage medium provided in the embodiment of the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0091] The computer-readable storage medium may be included in the multi-dimensional gateway; or may exist independently without being assembled into the multi-dimensional gateway.

[0092] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the multi-gateway, the multi-gateway: responds to the interface call request, determines the subscription gateway, the publishing gateway and the target application programming interface API matched by the publishing gateway; when the publishing gateway is a preset managed gateway, obtains the interface resource information of the target API from the publishing gateway; sends the interface resource information to the subscription gateway, wherein the interface resource information is used for API call.

[0093] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0094] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0095] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0096] The readable storage medium provided in the embodiment of the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned gateway interface calling method, and can improve the calling efficiency of the gateway interface in network isolation. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the gateway interface calling method provided in the above-mentioned embodiment, and will not be repeated here.

[0097] An embodiment of the present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned gateway interface calling method when executed by a processor.

[0098] The computer program product provided in the embodiment of the present application can improve the calling efficiency of the gateway interface in network isolation. Compared with the prior art, the beneficial effects of the computer program product provided in the present application are the same as the beneficial effects of the gateway interface calling method provided in the above embodiment, which will not be repeated here.

[0099] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A gateway interface calling method, characterized in that: The gateway interface calling method comprises: In response to the interface call request, determining a subscription gateway, a publishing gateway, and a target application programming interface API matching the publishing gateway; In the case where the publishing gateway is a preset managed gateway, obtaining interface resource information of the target API from the publishing gateway; The interface resource information is sent to the subscription gateway, wherein the interface resource information is used for API calling.

2. The gateway interface calling method according to claim 1, characterized in that: Before the step of determining, in response to the interface call request, a subscription gateway, a publishing gateway, and a target application programming interface API matching the publishing gateway, the step further includes: In response to an authentication request of the gateway to be managed, determining a docking API of the gateway to be managed; In the case where the gateway to be managed is successfully accessed through the docking API, the gateway to be managed is determined as a managed gateway.

3. The gateway interface calling method according to claim 2, characterized in that: Before the step of determining the to-be-managed gateway as a managed gateway, the method further includes: Obtaining gateway data provided by the gateway to be managed through the docking API; Determining whether the gateway data meets a preset hierarchical distribution condition; In the case where the gateway data satisfies the hierarchical distribution condition, executing the step of determining the to-be-managed gateway as a managed gateway; When the gateway data does not satisfy the hierarchical distribution conditions, management exception information is output.

4. The gateway interface calling method according to claim 2, characterized in that: After the step of determining the to-be-managed gateway as a managed gateway, the method further includes: The gateway resource information of the managed gateway is dynamically updated through the docking API.

5. The gateway interface calling method according to claim 1, characterized in that: The step of determining, in response to the interface call request, a subscription gateway, a publishing gateway, and a target application programming interface API that matches the publishing gateway comprises: Parsing the interface call request to determine the subscription gateway, the publishing gateway and the target resource; Determine a target level corresponding to the target resource in the publishing gateway; A subordinate API of the target level is determined as the target API.

6. The gateway interface calling method according to claim 1, characterized in that: Before the step of obtaining the interface resource information of the target API from the publishing gateway, the step further includes: Determining whether the target API is an open resource according to the gateway resource information of the publishing gateway; In the case where the target API is the open resource, a step of acquiring interface resource information of the target API from the publishing gateway is performed.

7. The gateway interface calling method according to claim 1, characterized in that: After the step of determining, in response to the interface call request, a subscription gateway, a publishing gateway, and a target application programming interface API matching the publishing gateway, the step further includes: Obtain the calling permission corresponding to the subscription gateway; Determining whether the subscription gateway has permission to call the target API according to the calling permission; In the case that the subscription gateway does not have the authority to call the target API, the interface call request is rejected.

8. A gateway interface calling device, characterized in that: The gateway interface calling device comprises: A determination module, configured to determine, in response to an interface call request, a subscription gateway, a publishing gateway, and a target application programming interface API that matches the publishing gateway; An acquisition module, configured to acquire interface resource information of the target API from the publishing gateway when the publishing gateway is a preset managed gateway; A sending module is used to send the interface resource information to the subscription gateway, wherein the interface resource information is used for API calling.

9. A multi-gateway, characterized in that: The multi-dimensional gateway comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the gateway interface calling method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the gateway interface calling method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Application programming interface service device and application programming interface service system

    CN108111629A

  • Method and device for calling application program interface

    CN111435924A

  • Cross-domain authorization processing method and cross-domain call processing method

    CN116034361A

  • API (Application Program Interface) calling management and control system and authentication method for different security protection levels in specific field

    CN119449446A

  • Rail transit system based on gateway cascade structure

    CN217116109U