A method of cross gateway invocation interface

By calling interface methods across gateways, the problem of network access for different departments was solved, automated interface calls and management were achieved, data silos were broken down, and convenient information exchange was provided.

CN119094606BActive Publication Date: 2026-01-23SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411238785.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2026-01-23
Estimated Expiration
2044-09-05

AI Technical Summary

Technical Problem

Network access between different management departments and organizations is difficult to achieve or connect, data silos are a serious problem, multi-layered authorization information makes it difficult for callers to use, and manual registration on one's own interface gateway is cumbersome, insecure and impossible to count and manage.

Method used

By calling interface methods across gateways, users apply for interface I on gateway G1. After gateways G1 and G2 approve the application, they register proxy interface I2 and establish a mapping relationship between the two. The authorization information is recorded and appended to the request to achieve automated interface calls.

Benefits of technology

It achieves highly automated interface calls, avoids manual registration, supports statistics and management between gateways, breaks down data silos, and facilitates information exchange between different departments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094606B_ABST
    Figure CN119094606B_ABST
Patent Text Reader

Abstract

The application particularly relates to a method for cross-gateway calling of an interface. The method for cross-gateway calling of the interface, a user U is a user of a gateway G1, an interface I is an interface of a gateway G2, the user U views and applies for calling the interface I in the gateway G1; after the interface application is audited, the interface I is registered in the gateway G1, and a proxy interface I2 is generated; the gateway G1 and the gateway G2 authorize the interface I to the user U, and record the authorization information of the user U in the gateway G2 in the authorization information in the gateway G1; the user U calls the proxy interface I2, the gateway G1 acquires the authorization information of the user U in the gateway G2, splices the authorization information into request information, and then calls the gateway G2. The method for cross-gateway calling of the interface has high automation degree, does not need to manually register other gateway interfaces, the called gateway can also count and manage the calling party, meanwhile, the network limitation problem can be avoided, the data island is broken, and great convenience is provided for information interaction between different departments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of service communication and information security technology, and in particular to a method for cross-gateway API invocation. Background Technology

[0002] With the development and popularization of electronic information technology, various management departments and organizations have more and more service platforms and interfaces. Each platform provides interface calls to internal and external parties through independent interface gateways. However, network access between different management departments and organizations is difficult to achieve or connect, the problem of data silos is becoming more and more serious, and multi-layered authorization information makes it difficult for callers to use the service. Manually registering with one's own interface gateway is cumbersome, insecure, and impossible to count and manage.

[0003] To address the aforementioned challenges, this invention proposes a method for cross-gateway API calls. Summary of the Invention

[0004] To overcome the shortcomings of existing technologies, this invention provides a simple and efficient method for cross-gateway API calls.

[0005] This invention is achieved through the following technical solution:

[0006] A method for cross-gateway interface invocation, where user U is a user of gateway G1 and interface I is an interface of gateway G2, the steps for user U to invoke interface I are as follows:

[0007] Step S1: User U views and requests to call interface I of gateway G2 on gateway G1;

[0008] Step S2: After the interface application is approved by both gateway G1 and gateway G2, interface I is registered in gateway G1 to generate proxy interface I2.

[0009] Step S3: Authorize interface I to user U in gateway G1 and gateway G2 respectively, and record user U's authorization information in gateway G2 in the authorization information in gateway G1;

[0010] In step S4, user U calls the proxy interface I2 of gateway G1. After gateway G1 confirms the authorization information, it obtains the authorization information of user U in gateway G2, concatenates the authorization information into the request information, and then calls gateway G2 again.

[0011] The specific implementation steps of step S1 are as follows:

[0012] Step S1.1: Set up an interface list on gateway G1. The interface list is used to display all interface information of the current gateway and other network management platforms that have been connected. The interface information includes interface name, function description, request method and request parameters.

[0013] Step S1.2: User U views the interface I displayed through interface connection on the interface list page of gateway G1, and submits application information to gateway G1. The application information includes user ID, interface ID, application validity period, number of applications and application reason.

[0014] Step S1.3: After receiving the application information, the gateway G1 records the application information and performs preliminary approval. The preliminary approval includes verifying the user's identity and checking whether the user meets the conditions for calling interface I.

[0015] After the initial approval, gateway G1 will push the application information to gateway G2 via an interface call;

[0016] Step S1.4: After receiving the application information pushed by gateway G1, gateway G2 performs a second approval. The second approval includes verifying the validity of the interface and checking whether the user meets the conditions for calling the interface.

[0017] After the second approval is passed, gateway G2 will return the confirmation information to gateway G1.

[0018] In step S2, the proxy interface I2 is responsible for forwarding the user's request to interface I and processing the returned result;

[0019] Gateway G1 establishes a mapping relationship between proxy interface I2 and interface I to ensure the correct forwarding of requests and the correct return of results.

[0020] In step S3, gateway G1 records the authorization information of user U to proxy interface I2, and gateway G2 records the authorization information of user U to interface I; the authorization information includes user ID, interface ID, authorization time, number of authorizations, and authorization validity period;

[0021] The authorization information of user U to interface I in gateway G2 is returned to gateway G1. Gateway G1 records the returned authorization information and associates the authorization information with the authorization of user U to interface I through related fields (such as user ID, interface ID, etc.).

[0022] The associated field is used to query authorization information when making an interface call and assemble it into the call parameters.

[0023] In step S4, the authorization information of user U on gateway G2 interface I is queried according to the associated field, and then the authorization information is concatenated into the request information through the authorization method specified by gateway G2 to request the call to interface I;

[0024] After receiving the request, gateway G2 matches the authorization information to user U's authorization, records the call log, and returns the result to gateway G1. Gateway G1 then records its own call log and returns the result to user U.

[0025] The specific implementation steps of step S4 are as follows:

[0026] In step S4.1, user U calls proxy interface I2. Gateway G1 first verifies the user's authorization information. The verification process includes checking whether the user ID, interface ID, authorization time, and authorization validity period match the authorization data. If the match is successful, the user is allowed to make the interface call; otherwise, the call request is rejected.

[0027] Step S4.2: Gateway G1 queries the authorization information of user U on interface I of gateway G2 based on the associated fields of the authorization information, and concatenates the queried information into the request information. Gateway G1 then forwards the request information to interface I.

[0028] Step S4.3: After receiving the request information, gateway G2 verifies the user's identity and permissions based on the authorization information; after successful verification, gateway G2 processes the request and returns the result to gateway G1; at the same time, gateway G2 records the call log for subsequent monitoring and analysis.

[0029] In step S4, after receiving the return result from gateway G2, gateway G1 parses and converts the format, and returns the final result to user U; at the same time, gateway G1 records its own call log for subsequent monitoring and analysis.

[0030] Because the authorization information carried when ultimately requesting gateway G2 belongs to user U, gateway G2 manages user U, including but not limited to IP restrictions, traffic restrictions, canary releases, and log recording.

[0031] A system for cross-gateway interface invocation includes at least two gateways, user U is a user of gateway G1, and interface I is an interface of gateway G2; it also includes an interface application module, an interface proxy module, an interface authorization module, and an interface invocation module.

[0032] The interface request module is responsible for viewing interface I of the gateway G2 to be called and sending a request message, which is then reviewed by gateways G1 and G2.

[0033] The interface proxy module is responsible for registering interface I to gateway G1 and generating proxy interface I2;

[0034] The interface authorization module is responsible for authorizing interface I to user U in gateway G1 and gateway G2 respectively, and recording user U's authorization information in gateway G2 in the authorization information in gateway G1;

[0035] When user U calls the proxy interface I2 of gateway G1, gateway G1 confirms the authorization information and obtains the authorization information of user U in gateway G2. The interface calling module is responsible for first concatenating the authorization information into the request information and then calling gateway G2.

[0036] A device for cross-gateway calling interface, characterized in that it includes a memory and a processor; the memory is used to store a computer program, and the processor is used to execute the computer program to implement the above-described method steps.

[0037] A readable storage medium, characterized in that: a computer program is stored on the readable storage medium, and the computer program, when executed by a processor, implements the above-described method steps.

[0038] The beneficial effects of this invention are: the method of cross-gateway calling interface is highly automated, does not require manual registration of other gateway interfaces, the called gateway can also perform statistics and management on the caller, and can also avoid network restriction problems, break down data silos, and provide great convenience for information exchange between different departments. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Appendix Figure 1 This is a schematic diagram of the method for cross-gateway API calls according to the present invention.

[0041] Appendix Figure 2 This is a schematic diagram of the interface application process for this invention.

[0042] Appendix Figure 3 This is a schematic diagram of the interface proxy process of the present invention.

[0043] Appendix Figure 4 This is a schematic diagram of the interface authorization process of this invention.

[0044] Appendix Figure 5 This is a schematic diagram of the interface call process of the present invention. Detailed Implementation

[0045] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions in the embodiments of this invention will be clearly and completely described below in conjunction with the embodiments of this invention. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.

[0046] In this cross-gateway API call method, user U is a user of gateway G1, and interface I is an interface of gateway G2. The steps for user U to call interface I are as follows:

[0047] Step S1: User U views and requests to call interface I of gateway G2 on gateway G1;

[0048] The specific implementation steps of step S1 are as follows:

[0049] Step S1.1: Set up an interface list on gateway G1. The interface list is used to display all interface information of the current gateway and other network management platforms that have been connected. The interface information includes interface name, function description, request method and request parameters.

[0050] Step S1.2: User U views the interface I displayed through interface connection on the interface list page of gateway G1, and submits application information to gateway G1. The application information includes user ID, interface ID, application validity period, number of applications and application reason.

[0051] Step S1.3: After receiving the application information, the gateway G1 records the application information and performs preliminary approval. The preliminary approval includes verifying the user's identity and checking whether the user meets the conditions for calling interface I.

[0052] After the initial approval, gateway G1 will push the application information to gateway G2 via an interface call;

[0053] Step S1.4: After receiving the application information pushed by gateway G1, gateway G2 performs a second approval. The second approval includes verifying the validity of the interface and checking whether the user meets the conditions for calling the interface.

[0054] After the second approval is passed, gateway G2 will return the confirmation information to gateway G1.

[0055] Step S2: After the interface application is approved by both gateway G1 and gateway G2, interface I is registered in gateway G1 to generate proxy interface I2.

[0056] In step S2, the proxy interface I2 is responsible for forwarding the user's request to interface I and processing the returned result;

[0057] Gateway G1 establishes a mapping relationship between proxy interface I2 and interface I to ensure the correct forwarding of requests and the correct return of results.

[0058] Step S3: Authorize interface I to user U in gateway G1 and gateway G2 respectively, and record user U's authorization information in gateway G2 in the authorization information in gateway G1;

[0059] In step S3, gateway G1 records the authorization information of user U to proxy interface I2, and gateway G2 records the authorization information of user U to interface I; the authorization information includes user ID, interface ID, authorization time, number of authorizations, and authorization validity period;

[0060] The authorization information of user U to interface I in gateway G2 is returned to gateway G1. Gateway G1 records the returned authorization information and associates the authorization information with the authorization of user U to interface I through related fields (such as user ID, interface ID, etc.).

[0061] The associated field is used to query authorization information when making an interface call and assemble it into the call parameters.

[0062] In step S4, user U calls the proxy interface I2 of gateway G1. After gateway G1 confirms the authorization information, it obtains the authorization information of user U in gateway G2, concatenates the authorization information into the request information, and then calls gateway G2 again.

[0063] In step S4, the authorization information of user U on gateway G2 interface I is queried according to the associated field, and then the authorization information is concatenated into the request information through the authorization method specified by gateway G2 to request the call to interface I;

[0064] After receiving the request, gateway G2 matches the authorization information to user U's authorization, records the call log, and returns the result to gateway G1. Gateway G1 then records its own call log and returns the result to user U.

[0065] The specific implementation steps of step S4 are as follows:

[0066] In step S4.1, user U calls proxy interface I2. Gateway G1 first verifies the user's authorization information. The verification process includes checking whether the user ID, interface ID, authorization time, and authorization validity period match the authorization data. If the match is successful, the user is allowed to make the interface call; otherwise, the call request is rejected.

[0067] Step S4.2: Gateway G1 queries the authorization information of user U on interface I of gateway G2 based on the associated fields of the authorization information, and concatenates the queried information into the request information. Gateway G1 then forwards the request information to interface I.

[0068] Step S4.3: After receiving the request information, gateway G2 verifies the user's identity and permissions based on the authorization information; after successful verification, gateway G2 processes the request and returns the result to gateway G1; at the same time, gateway G2 records the call log for subsequent monitoring and analysis.

[0069] In step S4, after receiving the return result from gateway G2, gateway G1 parses and converts the format, and returns the final result to user U; at the same time, gateway G1 records its own call log for subsequent monitoring and analysis.

[0070] Because the authorization information carried when ultimately requesting gateway G2 belongs to user U, gateway G2 manages user U, including but not limited to IP restrictions, traffic restrictions, canary releases, and log recording.

[0071] Furthermore, after gateway G1 retrieves the IP address from user U's request information, it implements the blacklist / whitelist IP management function. Correspondingly, when gateway G1 requests gateway G2, it carries user U's IP address along with it, so gateway G2 can also accurately implement the blacklist / whitelist IP function.

[0072] Gateways G1 and G2 record interface call logs, including detailed information such as request information, response results, and call times. These logs can be used to monitor interface usage, troubleshoot faults, and resolve other issues.

[0073] The system for cross-gateway call interfaces includes at least two gateways, where user U is a user of gateway G1 and interface I is an interface of gateway G2; it also includes an interface application module, an interface proxy module, an interface authorization module, and an interface call module.

[0074] The interface request module is responsible for viewing interface I of the gateway G2 to be called and sending a request message, which is then reviewed by gateways G1 and G2.

[0075] The interface proxy module is responsible for registering interface I to gateway G1 and generating proxy interface I2;

[0076] The interface authorization module is responsible for authorizing interface I to user U in gateway G1 and gateway G2 respectively, and recording user U's authorization information in gateway G2 in the authorization information in gateway G1;

[0077] When user U calls the proxy interface I2 of gateway G1, gateway G1 confirms the authorization information and obtains the authorization information of user U in gateway G2. The interface calling module is responsible for first concatenating the authorization information into the request information and then calling gateway G2.

[0078] The device for the cross-gateway call interface includes a memory and a processor; the memory is used to store a computer program, and the processor is used to implement the above-described method steps when executing the computer program.

[0079] The readable storage medium stores a computer program that, when executed by a processor, implements the above-described method steps.

[0080] Compared with existing technologies, this method of cross-gateway API call has the following characteristics:

[0081] First, compared to the traditional method, this method eliminates the hassle of manually registering other gateway interfaces. Users only need to click to apply, and the gateways can automatically proxy and authorize interfaces according to the agreed format.

[0082] Secondly, when making API calls, compared to traditional methods, the backend gateway can perceive and read the real caller, and can perform targeted management, such as rate limiting, IP restriction, and auditing.

[0083] Third, this method can bypass network restriction issues, allowing only network connectivity between gateways to be opened, without considering network connectivity between users and interfaces, or between users and other gateways.

[0084] The embodiments described above are merely one specific implementation of the present invention. Ordinary changes and substitutions made by those skilled in the art within the scope of the technical solution of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for cross-gateway API invocation, characterized in that: User U is a user of gateway G1, and interface I is an interface of gateway G2. The steps for user U to call interface I are as follows: Step S1: User U views and requests to call interface I of gateway G2 on gateway G1; Step S2: After the interface application is approved by both gateway G1 and gateway G2, interface I is registered in gateway G1 to generate proxy interface I2. Step S3: Authorize interface I to user U in gateway G1 and gateway G2 respectively, and record user U's authorization information in gateway G2 in the authorization information in gateway G1; In step S4, user U calls the proxy interface I2 of gateway G1. After gateway G1 confirms the authorization information, it obtains the authorization information of user U in gateway G2, concatenates the authorization information into the request information, and then calls gateway G2 again.

2. The method for cross-gateway API call according to claim 1, characterized in that: The specific implementation steps of step S1 are as follows: Step S1.1: Set up an interface list on gateway G1. The interface list is used to display all interface information of the current gateway and other network management platforms that have been connected. The interface information includes interface name, function description, request method and request parameters. Step S1.2: User U views the interface I displayed through interface connection on the interface list page of gateway G1, and submits application information to gateway G1. The application information includes user ID, interface ID, application validity period, number of applications and application reason. Step S1.3: After receiving the application information, the gateway G1 records the application information and performs preliminary approval. The preliminary approval includes verifying the user's identity and checking whether the user meets the conditions for calling interface I. After the initial approval, gateway G1 will push the application information to gateway G2 via an interface call; Step S1.4: After receiving the application information pushed by gateway G1, gateway G2 performs a second approval. The second approval includes verifying the validity of the interface and checking whether the user meets the conditions for calling the interface. After the second approval is passed, gateway G2 will return the confirmation information to gateway G1.

3. The method for cross-gateway API call according to claim 1, characterized in that: In step S2, the proxy interface I2 is responsible for forwarding the user's request to interface I and processing the returned result; Gateway G1 establishes a mapping relationship between proxy interface I2 and interface I to ensure the correct forwarding of requests and the correct return of results.

4. The method for cross-gateway interface invocation according to claim 3, characterized in that: In step S3, gateway G1 records the authorization information of user U to proxy interface I2, and gateway G2 records the authorization information of user U to interface I. The authorization information includes user ID, interface ID, authorization time, number of authorizations, and authorization validity period; The authorization information of user U to interface I in gateway G2 is returned to gateway G1. Gateway G1 records the returned authorization information and associates the authorization information with the authorization of user U to interface I through the association field. The associated field is used to query authorization information when making an interface call and assemble it into the call parameters.

5. The method for cross-gateway interface invocation according to claim 4, characterized in that: In step S4, the authorization information of user U on gateway G2 interface I is queried according to the associated field, and then the authorization information is concatenated into the request information through the authorization method specified by gateway G2 to request the call to interface I; After receiving the request, gateway G2 matches the authorization information to user U's authorization, records the call log, and returns the result to gateway G1. Gateway G1 then records its own call log and returns the result to user U.

6. The method for cross-gateway interface invocation according to claim 5, characterized in that: The specific implementation steps of step S4 are as follows: In step S4.1, user U calls proxy interface I2. Gateway G1 first verifies the user's authorization information. The verification process includes checking whether the user ID, interface ID, authorization time, and authorization validity period match the authorization data. If the match is successful, the user is allowed to make the interface call. Otherwise, the request is rejected; Step S4.2: Gateway G1 queries the authorization information of user U on interface I of gateway G2 based on the associated fields of the authorization information, and concatenates the queried information into the request information. Gateway G1 then forwards the request information to interface I. Step S4.3: After receiving the request information, gateway G2 verifies the user's identity and permissions based on the authorization information; After successful verification, gateway G2 processes the request and returns the result to gateway G1; at the same time, gateway G2 records the call log for subsequent monitoring and analysis. In step S4, after receiving the return result from gateway G2, gateway G1 parses and converts the format, and returns the final result to user U; at the same time, gateway G1 records its own call log for subsequent monitoring and analysis.

7. The method for cross-gateway interface invocation according to claim 4, characterized in that: Gateway G2 manages user U, including but not limited to IP restrictions, traffic restrictions, canary releases, and logging.

8. A system for cross-gateway API calls, characterized in that: It includes at least two gateways, with user U being the user of gateway G1 and interface I being the interface of gateway G2; it also includes an interface application module, an interface proxy module, an interface authorization module, and an interface invocation module. The interface request module is responsible for viewing interface I of the gateway G2 to be called and sending a request message, which is then reviewed by gateways G1 and G2. The interface proxy module is responsible for registering interface I to gateway G1 and generating proxy interface I2; The interface authorization module is responsible for authorizing interface I to user U in gateway G1 and gateway G2 respectively, and recording user U's authorization information in gateway G2 in the authorization information in gateway G1; When user U calls the proxy interface I2 of gateway G1, gateway G1 confirms the authorization information and obtains the authorization information of user U in gateway G2. The interface calling module is responsible for first concatenating the authorization information into the request information and then calling gateway G2.

9. A device for cross-gateway API calls, characterized in that: It includes a memory and a processor; the memory is used to store a computer program, and the processor is used to execute the computer program to implement the method as described in any one of claims 1 to 7.

10. A readable storage medium, characterized in that: The readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Government affair system API interface access gateway and method, electronic equipment and storage medium

    CN111416837A

  • Interface unified management system and platform interface management system

    CN114417278A