IP Library Granted Patent US 11,272,036
Granted Patent B2
US 11,272,036 · App. 16/831,314 · Granted Mar 8, 2022

API hybrid multi-tenant routing method and system, and API gateway

Inventor: Linfeng Li (Nanjing, CN)
Assignee: Huawei Technologies Co., Ltd.
H04L67/327G06F9/541H04L67/1002H04L41/5022H04L41/5096
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,272,036
App. No.
16/831,314
Granted
Mar 8, 2022
Kind
B2
Abstract

Embodiments of this application provide an API hybrid multi-tenant routing method and system, as well as an API gateway. The method includes: after receiving an API request message sent by an API caller, obtaining an APP key carried in the message; obtaining, based on a multi-tenant routing policy table, an API running instance URL list corresponding to the APP key; determining an API running instance URL in the API running instance URL list; and returning the API running instance URL to the API caller. The APP key is used to identify the API caller. The multi-tenant routing policy table stores a mapping relationship between the APP key and the API running instance URL list. The API hybrid multi-tenant routing system is a functional module in the API gateway.

Claims (22)

1. An application programming interface (API) hybrid multi-tenant routing method, comprising:

receiving, by an API gateway, an API request message sent by an API caller, wherein the API request message carries an application key (APP key), and the APP key is used to identify the API caller;

obtaining, based on the APP key and a multi-tenant routing policy table, an API running instance URL list corresponding to the APP key, wherein the multi-tenant routing policy table is used to store a mapping relationship between the APP key and the API running instance URL list, the API caller belongs to an API tenant, and an API running instance corresponding to an API running instance URL of the API running instance URL list is configured by the API gateway based on information about the API tenant, wherein if a tenant type of the API tenant is a physical tenant, the API running instance corresponding to the API running instance URL list is an API running instance private to the API tenant, or if a tenant type of the API tenant is a logical tenant, the API running instance corresponding to the API running instance URL list is a shared API running allocated to the API tenant;

determining, in the API running instance URL list based on a preconfigured API load balancing policy, an API running instance URL corresponding to the API request message; and

returning the API running instance URL to the API caller,

wherein before the receiving, by the API gateway, the API request message sent by the API caller, the method further comprises:

generating the APP key based on information about the API caller, and returning the APP key to the API caller; and

generating the multi-tenant routing policy table by: obtaining a tenant ID of the API tenant based on the APP key, and generating a first mapping table between the APP key and the tenant ID; obtaining the API running instance URL list based on the tenant ID, and generating a second mapping table between the tenant ID and the API running instance URL list and generating the multi-tenant routing policy table based on the first mapping table and the second mapping table;

wherein the obtaining the tenant ID of the API tenant based on the APP key comprises: obtaining the information about the corresponding API caller from an identity and access management (IAM) module based on the APP key; and determining, based on the information about the API caller, the API tenant to which the API caller belongs, and obtaining the tenant ID of the API tenant.

2. A non-transitory computer readable storage medium, comprising an instruction, wherein when the instruction is run on a computer, the computer performs the method according to claim 1 .

3. An API gateway, comprising a memory, a receiver, a transmitter, and a processor, wherein:

the receiver is configured to receive an API request message sent by an API caller, wherein the API request message carries an APP key, and the APP key is used to identify the API caller;

the processor is configured to execute code stored in the memory to:

obtain, based on the APP key and a multi-tenant routing policy table, an API running instance URL list corresponding to the APP key, wherein the multi-tenant routing policy table is stored in the memory, and is used to store a mapping relationship between the APP key and the API running instance URL list, the API caller belongs to an API tenant, and an API running instance corresponding to an API running instance URL of the API running instance URL list is configured by the API gateway based on information about the API tenant, wherein if a tenant type of the API tenant is a physical tenant, the API running instance corresponding to the API running instance URL list is an API running instance private to the API tenant, or if a tenant type of the API tenant is a logical tenant, the API running instance corresponding to the API running instance URL list is a shared API running allocated to the API tenant; and

determine, in the API running instance URL list based on a preconfigured API load balancing policy, an API running instance URL corresponding to the API request message; and

the transmitter is configured to return the API running instance URL to the API caller,

wherein before the receiver is configured to receive the API request message, the processor is further configured to:

generate the APP key based on information about the API caller, and return the APP key to the API caller; and

generate the multi-tenant routing policy table and store the multi-tenant routing policy table in the memory, wherein the generating the multi-tenant routing policy table comprises: obtaining a tenant ID of the API tenant based on the APP key, and generating a first mapping table between the APP key and the tenant ID; obtaining the API running instance URL list based on the tenant ID, and generating a second mapping table between the tenant ID and the API running instance URL list and generating the multi-tenant routing policy table based on the first mapping table and the second mapping table,

wherein the processor is specifically configured to:

obtain the information about the corresponding API caller from an identity and access management (IAM) module based on the APP key; and

determine, based on the information about the API caller, the API tenant to which the API caller belongs, and obtain the tenant ID of the API tenant.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 8, 2020
From: LI, LINFENG
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 052868/0951 →
Continuity (2)
Continuation PCTCN2018099362 · Aug 8, 2018
Related Publication 20200228629A1 · Jul 16, 2020
Cited By (1)
US 12,289,362