WO2019095862A1 - 多租户请求的处理方法及装置 - Google Patents

多租户请求的处理方法及装置 Download PDF

Info

Publication number
WO2019095862A1
WO2019095862A1 PCT/CN2018/107539 CN2018107539W WO2019095862A1 WO 2019095862 A1 WO2019095862 A1 WO 2019095862A1 CN 2018107539 W CN2018107539 W CN 2018107539W WO 2019095862 A1 WO2019095862 A1 WO 2019095862A1
Authority
WO
WIPO (PCT)
Prior art keywords
identifier
application
field
request
type
Prior art date
Application number
PCT/CN2018/107539
Other languages
English (en)
French (fr)
Inventor
贾新禹
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Priority to SG11202000422SA priority Critical patent/SG11202000422SA/en
Priority to EP18878116.5A priority patent/EP3637735B1/en
Publication of WO2019095862A1 publication Critical patent/WO2019095862A1/zh
Priority to US16/796,679 priority patent/US11115376B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • H04L67/306User profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4552Lookup mechanisms between a plurality of directories; Synchronisation of directories, e.g. metadirectories
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/457Network directories; Name-to-address mapping containing identifiers of data entities on a computer, e.g. file names
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/2871Implementation details of single intermediate entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping

Definitions

  • One or more embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a method and an apparatus for processing a multi-tenant request.
  • Shared applications are typically implemented through multi-tenancy technology.
  • the idea of multi-tenant technology is to let multiple tenants share one application. Therefore, how to quickly and accurately share applications with multiple tenants becomes a problem to be solved.
  • One or more embodiments of the present specification describe a method and apparatus for processing a multi-tenant request that can quickly and accurately share an application among a plurality of tenants.
  • a method for processing a multi-tenant request including:
  • a new request is determined and sent according to the second identification.
  • a processing apparatus for a multi-tenant request including:
  • a receiving unit configured to receive a request for a user to access an application, where the request includes a user identifier and request data of the user;
  • a determining unit configured to determine tenant information corresponding to the user identifier according to a correspondence between the user and the tenant
  • the determining unit is further configured to determine, according to the request data, a type of the application
  • An extracting unit configured to extract, according to the type determined by the determining unit, a first identifier of the application from the request data
  • a modifying unit configured to modify the first identifier extracted by the extracting unit to a second identifier according to the tenant information determined by the determining unit;
  • the determining unit is further configured to determine a new request according to the second identifier modified by the modifying unit;
  • a sending unit configured to send the new request.
  • the method and device for processing a multi-tenant request receives a request for a user to access an application, and searches for a tenant information corresponding to the user from a correspondence between the user and the tenant. Determine the type of application to be accessed based on the request data in the request. The unique identifier of the application is extracted from the request data according to the type of the application. Modify the extracted unique identifier based on the tenant information to get the modified request. Forward the modified request to the above application. As a result, applications can be shared between multiple tenants quickly and accurately.
  • FIG. 1 is a schematic diagram of an application scenario of a method for processing a multi-tenant request according to an embodiment of the present disclosure
  • FIG. 2 is a flowchart of a method for processing a multi-tenant request according to an embodiment of the present disclosure
  • FIG. 3 is an information interaction diagram of a processing method of a multi-tenant request according to another embodiment of the present disclosure.
  • FIG. 4 is a schematic diagram of a processing apparatus for a multi-tenant request according to an embodiment of the present disclosure.
  • the processing method of the multi-tenant request can be applied to the scenario shown in FIG. 1.
  • one user can be uniquely attributed to one tenant, and one tenant can correspond to multiple users.
  • the gateway (also referred to as a middleman) is configured to receive a request for accessing the application sent by the user, and forward the request to the corresponding application; and further, receive the response message returned by the application, and forward the response message to the user. It should be noted that, in this specification, the gateway may modify the received request or the returned response message, and the specific modification method is subsequently described.
  • the application one (or application two) in FIG. 1 may be, for example, a database (database) or ElasticSearch (a search server).
  • gateway in FIG. 1 may appear in an independent form or in the form of an application plug-in.
  • FIG. 2 is a flowchart of a method for processing a multi-tenant request according to an embodiment of the present disclosure.
  • the execution body of the method may be a device having processing capabilities: a server or a system or device, such as the gateway in FIG. As shown in FIG. 2, the method may specifically include:
  • Step 210 Receive a request for a user to access an application.
  • the request may include the user identification and request data of the user, and the request data may include information such as a protocol type.
  • Step 220 Determine tenant information corresponding to the user identifier according to the correspondence between the user and the tenant.
  • the correspondence between the user and the tenant can be stored in the two-dimensional relation table.
  • the above tenant information may refer to a tenant's unique identifier and the like.
  • the tenant information is the unique identifier of the tenant.
  • the correspondence between the user and the tenant can be as shown in Table 1.
  • Step 230 Determine the type of the application according to the request data.
  • the type of application can be determined by analyzing the type of protocol in the request data.
  • the type of application can also be determined by other means.
  • the type of the application is determined by determining whether the request data includes a preset character or a character string corresponding to a specific type of application. This specification will not be repeated here.
  • Step 240 Extract the first identifier of the application from the request data according to the type.
  • the first identifier herein may refer to any identifier that uniquely identifies an application.
  • step 240 may include the following steps:
  • Step A Determine an identifier field corresponding to the application of the type according to the correspondence between the type of the application and the identifier field.
  • the identification field may refer to a field representing a unique key in the application, and the field value of the identification field may uniquely identify an application.
  • the correspondence between the type of the application and the identification field may be stored in the two-dimensional relational table; or it may be stored in a storage system of a key value (KV) structure. When stored in a KV-structured storage system, K can be the type of application. In the present specification, the above correspondence may be preset by an artificial person.
  • the corresponding identification fields are generally inconsistent for different types of applications.
  • the corresponding identifier field may be “DataBase”; and when the application is “ElasticSearch”, the corresponding identifier field may be “Index”.
  • the above description is only for the purpose of facilitating the understanding of the present embodiment, and is not intended to limit the embodiments given in the specification. In practical applications, the identification field corresponding to "DB” or "ElasticSearch” may also be other.
  • Step B Extract the field value of the identifier field from the request data according to the identifier field.
  • the field value of the extracted identifier field is: “indexName”. ".
  • step C the field value is taken as the first identifier.
  • the first identifier is: "indexName”.
  • step 240 may also include the following steps:
  • Step a Determine a method for extracting the field value of the identifier field of the application according to the correspondence between the type of the application and the extraction method of the field value of the identifier field.
  • the correspondence between the type of the application and the extraction method of the field value of the identifier field may be stored in the two-dimensional relation table; or may be stored in a storage system of a key value (KV) structure.
  • K can be the type of application.
  • the above correspondence may be preset by an artificial person.
  • the storage system of the two-dimensional relation table or the KV structure may further include other content, such as an identifier field, which is not limited in this specification.
  • the extraction methods of the field values of the corresponding identification fields are inconsistent for different types of applications.
  • the foregoing extraction method may refer to a regular rule.
  • the extraction method may include: taking the first bit of the path in the Uniform Resource Locator (URL) or taking the content of the JSON format, and the like.
  • the application "ElasticSearch”
  • the corresponding extraction method can be: take the first place of the path in the URL.
  • Step b according to the extraction method, extract the field value of the identifier field from the request data.
  • the requested application is: "ElasticSearch”, and the request is: "http://hostname:port/ ⁇ indexName ⁇ / ⁇ ", for example, when the first bit of the path in the URL is taken, the slave request data
  • the field value of the identifier field extracted in is: "indexName”.
  • step c the field value is taken as the first identifier.
  • Step 250 Modify the first identifier to the second identifier according to the tenant information.
  • modifying the first identifier to the second identifier according to the tenant information may include: adding the tenant information to the first identifier, thereby obtaining the second identifier.
  • the second identifier may be: “indexName_A”. It should be noted that the second identifier herein is only an exemplary description. In an actual application, it can be any identifier that can reflect tenant information and uniquely identify an application, which is not limited in this specification.
  • Step 260 Determine a new request and send according to the second identifier.
  • the request becomes a new request. That is, the difference between the new request and the original request is that the identity of the application contained in the two has changed.
  • the corresponding request is processed by the corresponding application and a response message is returned.
  • the second identifier may be extracted from the response message by referring to the extraction method of the first identifier. Then, according to the tenant information, the second identifier is modified to the first identifier. Specifically, the tenant information may be stripped from the second identifier to obtain the first identifier. As in the foregoing example, the tenant information: "A" in the second identifier "indexName_A" is stripped to obtain "indexName”. After modifying the second identifier in the response message to the first identifier, the response message becomes a new response message. That is, the difference between the new response message and the original response message is that the identity of the application included in the two has changed. After the new response message is obtained, the response message is returned to the user.
  • the first identifier in the request is modified to the second identifier, and then the method of modifying the second identifier in the response message to the first identifier reaches a multi-tenant transparent to both the user and the application. achieve.
  • the multi-tenant is advanced from the application level to the gateway, that is, the multi-tenancy is implemented by using the front-end gateway.
  • the exclusive and shared versions maintain the same source code for future iterations.
  • Multiple applications can be configured only at the gateway, which is convenient to use. Multi-tenancy can be easily implemented even with closed source applications.
  • FIG. 3 is an information interaction diagram of a method for processing a multi-tenant request according to another embodiment of the present disclosure. As shown in FIG. 3, the method may specifically include:
  • step 310 the user sends a request to the gateway to access the application.
  • the request may include the user's user identification and request data.
  • Step 320 Read corresponding tenant information from the tenant information table according to the user identifier.
  • the tenant information table can be used to record the correspondence between the user and the tenant.
  • Step 330 Determine the type of the application according to the request data.
  • Step 340 Read an identifier field of the application and a method for extracting the field value of the identifier field from the corresponding application information table according to the type of the application.
  • the application information table is used to record the correspondence between the type of the application, the extraction method of the identifier field and the field value of the identifier field.
  • Step 350 Extract a field value of the identifier field from the request data according to the extraction method.
  • step 360 the tenant information is added to the field value to obtain a new request.
  • step 370 the gateway sends a new request to the application.
  • the application processes the new request.
  • step 390 the application returns a response message of the new request to the gateway.
  • Step 3100 Strip the tenant information from the field value corresponding to the identifier field of the response message to obtain a new response message.
  • Step 3110 returning a new response message to the user.
  • the processing device of the multi-tenant request is further provided in an embodiment of the present specification. As shown in FIG. 4, the device includes:
  • the receiving unit 401 is configured to receive a request for a user to access an application, where the request includes a user identifier of the user and request data.
  • the determining unit 402 is configured to determine tenant information corresponding to the user identifier according to the correspondence between the user and the tenant.
  • the determining unit 402 is further configured to determine the type of the application according to the request data.
  • the extracting unit 403 is configured to extract the first identifier of the application from the request data according to the type determined by the determining unit 402.
  • the extracting unit 403 is specifically configured to:
  • the identifier field corresponding to the application of the type is determined according to the correspondence between the type of the application and the identifier field.
  • the field value of the identification field is extracted from the request data according to the identification field. Use the field value as the first identifier.
  • the correspondence between the type of the application and the identifier field may be stored in the two-dimensional relation table or may be stored in a storage system of the key value KV structure.
  • the correspondence between the type of application and the extraction method of the field value of the identification field may also be stored in the two-dimensional relational table or may be stored in a storage system of the key-value KV structure.
  • the modifying unit 404 is configured to modify the first identifier extracted by the extracting unit 403 to the second identifier according to the tenant information determined by the determining unit 402.
  • the determining unit 402 is further configured to determine a new request according to the second identifier modified by the modifying unit 404.
  • the sending unit 405 is configured to send a new request.
  • the receiving unit 401 is further configured to receive a response message of the new request, where the response message includes the second identifier.
  • the modifying unit 404 is further configured to modify the second identifier to the first identifier according to the tenant information.
  • the determining unit 402 is further configured to determine a new response message according to the first identifier modified by the modifying unit 404.
  • the sending unit 405 is further configured to return a new response message determined by the determining unit 402 to the user.
  • the modifying unit 404 can be specifically configured to:
  • the tenant information is appended to the first identifier to obtain the second identifier.
  • the tenant information is stripped from the second identifier to obtain the first identifier.
  • the receiving unit 401 receives a request for accessing the application by the user, and the request includes the user identifier and the request data of the user.
  • the determining unit 402 determines the tenant information corresponding to the user identifier according to the correspondence between the user and the tenant.
  • the determining unit 402 determines the type of the application based on the request data.
  • the extracting unit 403 extracts the first identifier of the application from the request data according to the type.
  • the modifying unit 404 modifies the first identifier to the second identifier according to the tenant information.
  • the determining unit 402 determines a new request based on the second identity.
  • the transmitting unit 405 sends a new request. Thereby, it is possible to quickly and accurately share an application among a plurality of tenants.
  • the functions described herein can be implemented in hardware, software, firmware, or any combination thereof.
  • the functions may be stored in a computer readable medium or transmitted as one or more instructions or code on a computer readable medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Information Transfer Between Computers (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

本说明书实施例提供一种多租户请求的处理方法及装置,在多租户请求的处理方法中,接收用户访问应用的请求,从用户与租户之间的对应关系中查找该用户对应的租户信息。根据请求中的请求数据,判断待访问应用的类型。根据应用的类型,从请求数据中提取该应用的唯一标识。根据租户信息,修改提取的唯一标识,从而得到修改后的请求。向上述应用转发该修改后的请求。

Description

多租户请求的处理方法及装置 技术领域
本说明书一个或多个实施例涉及计算机技术领域,尤其涉及一种多租户请求的处理方法及装置。
背景技术
随着对系统资源利用率的要求不断提高,普通的独占性应用逐渐无法满足资源利用率要求,共享型应用应运而生。
而共享型应用一般通过多租户技术来实现。多租户技术的思路是:让多个租户共用一个应用。因此,如何快速而准确地让多个租户共享应用就成为要解决的问题。
发明内容
本说明书一个或多个实施例描述了一种多租户请求的处理方法及装置,可以快速而准确地在多个租户之间共享应用。
第一方面,提供了一种多租户请求的处理方法,包括:
接收用户访问应用的请求,所述请求包括所述用户的用户标识和请求数据;
根据用户与租户之间的对应关系,确定所述用户标识对应的租户信息;
根据所述请求数据,确定所述应用的类型;
根据所述类型,从所述请求数据中提取所述应用的第一标识;
根据所述租户信息,将所述第一标识修改为第二标识;
根据所述第二标识,确定新请求并发送。
第二方面,提供了一种多租户请求的处理装置,包括:
接收单元,用于接收用户访问应用的请求,所述请求包括所述用户的用户标识和请求数据;
确定单元,用于根据用户与租户之间的对应关系,确定所述用户标识对应的租户信息;
所述确定单元,还用于根据所述请求数据,确定所述应用的类型;
提取单元,用于根据所述确定单元确定的所述类型,从所述请求数据中提取所述应用的第一标识;
修改单元,用于根据所述确定单元确定的所述租户信息,将所述提取单元提取的所述第一标识修改为第二标识;
所述确定单元,还用于根据所述修改单元修改的所述第二标识,确定新请求;
发送单元,用于发送所述新请求。
本说明书一个或多个实施例提供的多租户请求的处理方法及装置,接收用户访问应用的请求,从用户与租户之间的对应关系中查找该用户对应的租户信息。根据请求中的请求数据,判断待访问应用的类型。根据应用的类型,从请求数据中提取该应用的唯一标识。根据租户信息,修改提取的唯一标识,从而得到修改后的请求。向上述应用转发该修改后的请求。由此,可以快速而准确地在多个租户之间共享应用。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为本说明书一个实施例提供的多租户请求的处理方法的应用场景示意图;
图2为本说明书一个实施例提供的多租户请求的处理方法流程图;
图3为本说明另一个实施例提供的多租户请求的处理方法信息交互图;
图4为本说明书一个实施例提供的多租户请求的处理装置示意图。
具体实施方式
下面结合附图,对本说明书提供的方案进行描述。
本说明书一个实施例提供的多租户请求的处理方法可以应用于如图1所示的场景中,图1中,一个用户可以唯一地归属于一个租户,而一个租户可以对应多个用户。网关(也称中间人)用于接收用户发送的访问应用的请求,并将该请求转发给对应的应用; 还用于接收应用返回的响应消息,并将该响应消息转发给用户。需要说明的是,在本说明书中,网关可以对接收的请求或者返回的响应消息进行修改,具体修改方法后续进行说明。图1中的应用一(或者应用二)例如可以为数据库(database,DB)或者ElasticSearch(一种搜索服务器)等。
需要说明的是,图1中的网关可以以独立的形态出现,也可以以应用插件的形态出现。
图2为本说明书一个实施例提供的多租户请求的处理方法流程图。所述方法的执行主体可以为具有处理能力的设备:服务器或者系统或者装置,如,图1中的网关。如图2所示,所述方法具体可以包括:
步骤210,接收用户访问应用的请求。
该请求可以包括用户的用户标识和请求数据,该请求数据可以包括协议类型等信息。
在实施例中,以访问应用的请求为:“http://hostname:port/Index=indexName&×××”为例来说。
步骤220,根据用户与租户之间的对应关系,确定用户标识对应的租户信息。
此处,用户与租户之间的对应关系可以存储在二维关系表中。上述租户信息可以是指租户的唯一标识等。以租户信息为租户的唯一标识为例来说,用户与租户之间的对应关系可以如表1所示。
表1
用户标识 租户的唯一标识
步骤230,根据请求数据,确定应用的类型。
在一种实现方式中,可以通过分析请求数据中的协议类型,来确定应用的类型。当然,在实际应用中,也可以通过其它方式来确定应用的类型。如,通过判断请求数据中是否包含预设字符或者字符串,来确定应用的类型,其中,该预设字符或者字符串与特定类型的应用相对应。本说明书对此不复赘述。
步骤240,根据类型,从请求数据中提取应用的第一标识。
此处的第一标识可以是指任一能唯一地标识一个应用的标识。
在一种实现方式中,步骤240可以包括如下步骤:
步骤A,根据应用的类型与标识字段之间的对应关系,确定该类型的应用对应的标识字段。
此处,标识字段可以是指代表应用中的唯一键的字段,该标识字段的字段值可以唯一地标识一个应用。应用的类型与标识字段之间的对应关系可以存储在二维关系表中;或者,也可以存储在键值(key value,KV)结构的存储系统中。当存储在KV结构的存储系统中时,K可以为应用的类型。在本说明书中,上述对应关系可以由人为预先设定。
步骤A中,对不同类型的应用,其对应的标识字段通常是不一致的。如,在应用为:“DB”时,其对应的标识字段可以为:“DataBase”;而在应用为:“ElasticSearch”时,其对应的标识字段可以为“Index”。需要说明的是,上述只是为了便于理解本实施例而给出的示例性说明,并不作为对本说明书给出的方案的限定。在实际应用中,“DB”或者“ElasticSearch”对应的标识字段也可以为其它。
步骤B,根据标识字段,从请求数据中提取标识字段的字段值。
以上述请求:“http://hostname:port/Index=indexName&×××”为例来说,当该应用对应的标识字段为:“Index”时,提取的标识字段的字段值为:“indexName”。
步骤C,将字段值作为第一标识。
如前述例子,第一标识即为:“indexName”。
在另一种实现方式中,步骤240也可以包括如下步骤:
步骤a,根据应用的类型与标识字段的字段值的提取方法之间的对应关系,确定该类型的应用的标识字段的字段值的提取方法。
其中,应用的类型与标识字段的字段值的提取方法之间的对应关系可以存储在二维关系表中;或者,也可以存储在键值(key value,KV)结构的存储系统中。当存储在KV结构的存储系统中时,K可以为应用的类型。在本说明书中,上述对应关系可以由人为预先设定。在本说明书的其它实施方式中,上述二维关系表或者KV结构的存储系统中还可以包括其它内容,如标识字段等,本说明书对此不作限定。
在本说明书中,不同类型的应用,其对应的标识字段的字段值的提取方法是不一致的。在一种具体实现方式中,上述提取方法可以是指正则规则。举例来说,该提取方法可以包括:取统一资源定位符(Uniform Resource Locator,URL)中路径(path)的第几位或者取JSON格式的内容等等。以应用:“ElasticSearch”为例来说,其对应的提取方 法可以为:取URL中路径的第一位。
步骤b,根据提取方法,从请求数据中提取标识字段的字段值。
以请求的应用为:“ElasticSearch”,且请求为:“http://hostname:port/{indexName}/×××”为例来说,当取URL中路径的第一位时,从请求数据中提取的标识字段的字段值为:“indexName”。
步骤c,将字段值作为第一标识。
步骤250,根据租户信息,将第一标识修改为第二标识。
在一种实现方式中,根据租户信息将第一标识修改为第二标识可以包括:将租户信息追加到第一标识中,从而得到第二标识。如前述例子,假设租户信息为:“A”,则第二标识可以为:“indexName_A”。需要说明的是,此处的第二标识只是一种示例性说明。在实际应用中,其可以为任一指既能体现租户信息又能唯一地标识一个应用的标识,本说明书对此不作限定。
步骤260,根据第二标识,确定新请求并发送。
可以理解的是,在将原请求中的第一标识修改为第二标识之后,该请求就成为新请求。也即新请求与原请求的区别就是两者所包含的应用的标识发生了变化。在得到新请求之后,由对应的应用对该新请求进行对应的处理并返回响应消息(response)。
在接收到响应消息之后,可以参照第一标识的提取方法,从响应消息中提取第二标识。之后,根据租户信息,将第二标识修改为第一标识。具体地,可以从第二标识中剥离租户信息,从而得到第一标识。如前述例子,将第二标识“indexName_A”中的租户信息:“A”剥离,得到“indexName”。在将响应消息中的第二标识修改为第一标识之后,该响应消息就成为新响应消息。也即新响应消息与原响应消息的区别就是两者所包含的应用的标识发生了变化。在得到新响应消息之后,将该响应消息返回给用户。
综上,本说明书上述实施例中将请求中的第一标识修改为第二标识,之后再将响应消息中的第二标识修改为第一标识的方法达到了对用户和应用都透明的多租户实现。
此外,本说明书上述实施例,将多租户从应用级提前到网关,也就是利用前置网关实现多租户。无需对应用做修改,独占型和共享型保持同样源码,方便日后版本迭代。多个应用也仅需在网关处进行配置即可,使用方便。即使是闭源应用也可以轻松实现多租户。
图3为本说明书另一个实施例提供的多租户请求的处理方法的信息交互图。如图3所示,所述方法具体可以包括:
步骤310,用户向网关发送访问应用的请求。
该请求可以包括用户的用户标识和请求数据。
步骤320,根据用户标识,从租户信息表中读取对应的租户信息。
其中,租户信息表可以用于记录用户与租户之间的对应关系。
步骤330,根据请求数据,确定应用的类型。
步骤340,根据应用的类型,从对应的应用信息表中读取该应用的标识字段和该标识字段的字段值的提取方法。
其中,应用信息表用于记录应用的类型、标识字段与标识字段的字段值的提取方法之间的对应关系。
步骤350,根据提取方法,从请求数据中提取标识字段的字段值。
步骤360,在字段值中追加租户信息,得到新请求。
步骤370,网关向应用发送新请求。
步骤380,应用处理新请求。
步骤390,应用向网关返回新请求的响应消息。
步骤3100,从响应消息的标识字段对应的字段值中剥离租户信息,得到新响应消息。
步骤3110,向用户返回新响应消息。
通过本说明书上述一个或多个实施例提供的多租户请求的处理方法,可以实现快速而准确地在多个租户之间共享应用。
与上述多租户请求的处理方法对应地,本说明书一个实施例还提供的一种多租户请求的处理装置,如图4所示,该装置包括:
接收单元401,用于接收用户访问应用的请求,该请求包括用户的用户标识和请求数据。
确定单元402,用于根据用户与租户之间的对应关系,确定用户标识对应的租户信息。
确定单元402,还用于根据请求数据,确定应用的类型。
提取单元403,用于根据确定单元402确定的类型,从请求数据中提取应用的第一标识。
可选地,提取单元403具体可以用于:
根据应用的类型与标识字段之间的对应关系,确定该类型的应用对应的标识字段。根据标识字段,从请求数据中提取标识字段的字段值。将字段值作为第一标识。或者,根据应用的类型与标识字段的字段值的提取方法之间的对应关系,确定该类型的应用的标识字段的字段值的提取方法。根据提取方法,从请求数据中提取标识字段的字段值。将字段值作为第一标识。
其中,应用的类型与标识字段之间的对应关系可以存储在二维关系表中或者可以存储在键值KV结构的存储系统中。应用的类型与标识字段的字段值的提取方法之间的对应关系也可以存储在二维关系表中或者可以存储在键值KV结构的存储系统中。
修改单元404,用于根据确定单元402确定的租户信息,将提取单元403提取的第一标识修改为第二标识。
确定单元402,还用于根据修改单元404修改的第二标识,确定新请求。
发送单元405,用于发送新请求。
可选地,接收单元401,还用于接收新请求的响应消息,该响应消息包括第二标识。
修改单元404,还用于根据租户信息,将第二标识修改为第一标识。
确定单元402,还用于根据修改单元404修改的第一标识,确定新响应消息。
发送单元405,还用于向用户返回确定单元402确定的新响应消息。
可选地,修改单元404具体可以用于:
将租户信息追加到第一标识中,得到第二标识。
对应地,
从第二标识中剥离租户信息,得到第一标识。
本说明书上述实施例装置的各功能模块的功能,可以通过上述方法实施例的各步骤来实现,因此,本说明书一个实施例提供的装置的具体工作过程,在此不复赘述。
本说明书一个实施例提供的多租户请求的处理装置,接收单元401接收用户访问应 用的请求,该请求包括用户的用户标识和请求数据。确定单元402根据用户与租户之间的对应关系,确定用户标识对应的租户信息。确定单元402根据请求数据,确定应用的类型。提取单元403根据类型,从请求数据中提取应用的第一标识。修改单元404根据租户信息,将第一标识修改为第二标识。确定单元402根据第二标识,确定新请求。发送单元405发送新请求。由此,可以实现快速而准确地在多个租户之间共享应用。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本发明的保护范围之内。

Claims (10)

  1. 一种多租户请求的处理方法,其特征在于,包括:
    接收用户访问应用的请求,所述请求包括所述用户的用户标识和请求数据;
    根据用户与租户之间的对应关系,确定所述用户标识对应的租户信息;
    根据所述请求数据,确定所述应用的类型;
    根据所述类型,从所述请求数据中提取所述应用的第一标识;
    根据所述租户信息,将所述第一标识修改为第二标识;
    根据所述第二标识,确定新请求并发送。
  2. 根据权利要求1所述的方法,其特征在于,还包括:
    接收所述新请求的响应消息,所述响应消息包括所述第二标识;
    根据所述租户信息,将所述第二标识修改为所述第一标识;
    根据所述第一标识,确定新响应消息;
    向所述用户返回所述新响应消息。
  3. 根据权利要求1或2所述的方法,其特征在于,所述根据所述类型,从所述请求数据中提取所述应用的第一标识,包括:
    根据应用的类型与标识字段之间的对应关系,确定所述类型的应用对应的标识字段;
    根据所述标识字段,从所述请求数据中提取所述标识字段的字段值;
    将所述字段值作为所述第一标识;或者,
    根据应用的类型与标识字段的字段值的提取方法之间的对应关系,确定所述类型的应用的标识字段的字段值的提取方法;
    根据所述提取方法,从所述请求数据中提取所述标识字段的字段值;
    将所述字段值作为所述第一标识。
  4. 根据权利要求3所述的方法,其特征在于,所述应用的类型与标识字段之间的对应关系存储在二维关系表中或者存储在键值KV结构的存储系统中;或者,
    所述应用的类型与标识字段的字段值的提取方法之间的对应关系存储在二维关系表中或者存储在键值KV结构的存储系统中。
  5. 根据权利要求2所述的方法,其特征在于,
    所述根据所述租户信息,将所述第一标识修改为第二标识,包括:
    将所述租户信息追加到所述第一标识中,得到所述第二标识;
    对应地,所述根据所述租户信息,将所述第二标识修改为所述第一标识,包括:
    从所述第二标识中剥离所述租户信息,得到所述第一标识。
  6. 一种多租户请求的处理装置,其特征在于,包括:
    接收单元,用于接收用户访问应用的请求,所述请求包括所述用户的用户标识和请求数据;
    确定单元,用于根据用户与租户之间的对应关系,确定所述用户标识对应的租户信息;
    所述确定单元,还用于根据所述请求数据,确定所述应用的类型;
    提取单元,用于根据所述确定单元确定的所述类型,从所述请求数据中提取所述应用的第一标识;
    修改单元,用于根据所述确定单元确定的所述租户信息,将所述提取单元提取的所述第一标识修改为第二标识;
    所述确定单元,还用于根据所述修改单元修改的所述第二标识,确定新请求;
    发送单元,用于发送所述新请求。
  7. 根据权利要求6所述的装置,其特征在于,
    所述接收单元,还用于接收所述新请求的响应消息,所述响应消息包括所述第二标识;
    所述修改单元,还用于根据所述租户信息,将所述第二标识修改为所述第一标识;
    所述确定单元,还用于根据所述修改单元修改的所述第一标识,确定新响应消息;
    所述发送单元,还用于向所述用户返回所述确定单元确定的所述新响应消息。
  8. 根据权利要求6或7所述的装置,其特征在于,所述提取单元具体用于:
    根据应用的类型与标识字段之间的对应关系,确定所述类型的应用对应的标识字段;
    根据所述标识字段,从所述请求数据中提取所述标识字段的字段值;
    将所述字段值作为所述第一标识;或者,
    根据应用的类型与标识字段的字段值的提取方法之间的对应关系,确定所述类型的应用的标识字段的字段值的提取方法;
    根据所述提取方法,从所述请求数据中提取所述标识字段的字段值;
    将所述字段值作为所述第一标识。
  9. 根据权利要求8所述的装置,其特征在于,
    所述应用的类型与标识字段之间的对应关系存储在二维关系表中或者存储在键值KV结构的存储系统中;或者,
    所述应用的类型与标识字段的字段值的提取方法之间的对应关系存储在二维关系表中或者存储在键值KV结构的存储系统中。
  10. 根据权利要求7所述的装置,其特征在于,所述修改单元具体用于:
    将所述租户信息追加到所述第一标识中,得到所述第二标识;
    对应地,
    从所述第二标识中剥离所述租户信息,得到所述第一标识。
PCT/CN2018/107539 2017-11-17 2018-09-26 多租户请求的处理方法及装置 WO2019095862A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
SG11202000422SA SG11202000422SA (en) 2017-11-17 2018-09-26 Method and device for handling multi-tenant request
EP18878116.5A EP3637735B1 (en) 2017-11-17 2018-09-26 Method and device for handling multi-subscriber request
US16/796,679 US11115376B2 (en) 2017-11-17 2020-02-20 Method and device for handling multi-tenant request

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711141728.6 2017-11-17
CN201711141728.6A CN108093026B (zh) 2017-11-17 2017-11-17 多租户请求的处理方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/796,679 Continuation US11115376B2 (en) 2017-11-17 2020-02-20 Method and device for handling multi-tenant request

Publications (1)

Publication Number Publication Date
WO2019095862A1 true WO2019095862A1 (zh) 2019-05-23

Family

ID=62172702

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/107539 WO2019095862A1 (zh) 2017-11-17 2018-09-26 多租户请求的处理方法及装置

Country Status (6)

Country Link
US (1) US11115376B2 (zh)
EP (1) EP3637735B1 (zh)
CN (1) CN108093026B (zh)
SG (1) SG11202000422SA (zh)
TW (1) TWI688247B (zh)
WO (1) WO2019095862A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108093026B (zh) 2017-11-17 2020-04-07 阿里巴巴集团控股有限公司 多租户请求的处理方法及装置
CN111478961B (zh) * 2020-04-03 2021-12-17 中国建设银行股份有限公司 多租户的服务调用方法及装置
US11875046B2 (en) 2021-02-05 2024-01-16 Samsung Electronics Co., Ltd. Systems and methods for storage device resource management
US11914744B2 (en) * 2021-03-31 2024-02-27 Salesforce, Inc. Intelligent contextual help chat in a multi-tenant database system
CN113779625A (zh) * 2021-08-31 2021-12-10 成都商汤科技有限公司 一种数据访问的方法、装置、电子设备及存储介质
CN114693283B (zh) * 2022-06-01 2022-09-27 四川高灯企服科技有限公司 跨系统的业务流程审批处理方法、装置和计算机设备

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064927A (zh) * 2012-12-21 2013-04-24 曙光信息产业(北京)有限公司 分布式文件系统的数据访问方法和装置
US20130238557A1 (en) * 2012-03-08 2013-09-12 International Business Machines Corporation Managing tenant-specific data sets in a multi-tenant environment
CN103957246A (zh) * 2014-04-22 2014-07-30 广州杰赛科技股份有限公司 基于租户感知的动态负载均衡方法及系统
CN105049361A (zh) * 2012-06-06 2015-11-11 瞻博网络公司 针对虚拟网络分组流的物理路径确定
CN106326296A (zh) * 2015-07-01 2017-01-11 中兴通讯股份有限公司 数据查询方法及装置
CN107153565A (zh) * 2016-03-03 2017-09-12 华为技术有限公司 配置资源的方法及其网络设备
CN108093026A (zh) * 2017-11-17 2018-05-29 阿里巴巴集团控股有限公司 多租户请求的处理方法及装置

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11120300A (ja) * 1997-10-09 1999-04-30 Fujitsu Ltd 可搬型カード媒体,可搬型カード媒体のメモリ空間管理方法,可搬型カード媒体の発行方法および可搬型カード媒体のプログラムデータ書込方法並びにメモリ空間管理プログラムが記録されたコンピュータ読取可能な記録媒体
US20080162735A1 (en) * 2006-12-29 2008-07-03 Doug Voigt Methods and systems for prioritizing input/outputs to storage devices
JP5239966B2 (ja) * 2009-03-17 2013-07-17 富士通株式会社 中継装置、テナント管理プログラム
JP5348413B2 (ja) * 2009-09-01 2013-11-20 日本電気株式会社 アプリケーションサーバ、オブジェクト管理方法およびオブジェクト管理プログラム
CN102236762A (zh) * 2010-04-30 2011-11-09 国际商业机器公司 用于处理对多租户应用的文件访问的方法和文件代理装置
CN103036856A (zh) * 2011-10-09 2013-04-10 镇江金软计算机科技有限责任公司 基于saas应用的多租户系统实现
CN109905871B (zh) 2012-03-07 2022-05-17 英特尔公司 用于实现对等无线连接的系统和方法
US9979602B1 (en) * 2014-08-25 2018-05-22 Cisco Technology, Inc. Network function virtualization infrastructure pod in a network environment
US10425386B2 (en) * 2016-05-11 2019-09-24 Oracle International Corporation Policy enforcement point for a multi-tenant identity and data security management cloud service
BR112018077342A2 (pt) * 2016-06-30 2019-04-02 Huawei Technologies Co., Ltd. método e aparelho para gerenciar objeto de função gerenciada
US10536450B2 (en) * 2017-04-18 2020-01-14 Microsoft Technology Licensing, Llc. Personal identifier sign-in for organizational users
US10383046B2 (en) * 2017-10-20 2019-08-13 Verizon Patent And Licensing Inc. RAN-core pairing service

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130238557A1 (en) * 2012-03-08 2013-09-12 International Business Machines Corporation Managing tenant-specific data sets in a multi-tenant environment
CN105049361A (zh) * 2012-06-06 2015-11-11 瞻博网络公司 针对虚拟网络分组流的物理路径确定
CN103064927A (zh) * 2012-12-21 2013-04-24 曙光信息产业(北京)有限公司 分布式文件系统的数据访问方法和装置
CN103957246A (zh) * 2014-04-22 2014-07-30 广州杰赛科技股份有限公司 基于租户感知的动态负载均衡方法及系统
CN106326296A (zh) * 2015-07-01 2017-01-11 中兴通讯股份有限公司 数据查询方法及装置
CN107153565A (zh) * 2016-03-03 2017-09-12 华为技术有限公司 配置资源的方法及其网络设备
CN108093026A (zh) * 2017-11-17 2018-05-29 阿里巴巴集团控股有限公司 多租户请求的处理方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3637735A4 *

Also Published As

Publication number Publication date
TW201924308A (zh) 2019-06-16
US11115376B2 (en) 2021-09-07
CN108093026A (zh) 2018-05-29
US20200192718A1 (en) 2020-06-18
EP3637735B1 (en) 2021-08-18
SG11202000422SA (en) 2020-02-27
TWI688247B (zh) 2020-03-11
EP3637735A1 (en) 2020-04-15
EP3637735A4 (en) 2020-06-10
CN108093026B (zh) 2020-04-07

Similar Documents

Publication Publication Date Title
WO2019095862A1 (zh) 多租户请求的处理方法及装置
US11394805B1 (en) Automatic discovery of API information
US11880721B2 (en) Processing a query having calls to multiple data sources
CN110908997B (zh) 数据血缘构建方法、装置、服务器及可读存储介质
WO2018112944A1 (zh) 域名解析方法和装置
CN107169094B (zh) 信息聚合方法及装置
WO2017092351A1 (zh) 缓存数据的更新方法及装置
US8713368B2 (en) Methods for testing OData services
WO2015139539A1 (zh) 一种视频信息推送方法及装置
CN107423037B (zh) 应用程序接口定位方法及设备
US20160094680A1 (en) Content Sharing Method and Social Synchronization Apparatus
CN105743988A (zh) 网络用户追踪实现方法、装置及系统
US11038803B2 (en) Correlating network level and application level traffic
CN105071966A (zh) 一种日志信息管理方法及日志抽取服务器
CN115421968A (zh) 数据恢复方法及电子设备
US9948694B2 (en) Addressing application program interface format modifications to ensure client compatibility
WO2017000540A1 (zh) 数据查询方法及装置
CN111814020A (zh) 一种数据的获取方法和装置
CN112148728A (zh) 用于信息处理的方法、设备和计算机程序产品
CN107526530B (zh) 数据处理方法和设备
CN112783842B (zh) 一种日志收集方法和装置
US11057470B2 (en) Communication device and communication method for processing meta data
GB2546135A (en) Robust computing device identification framework
CN107562815B (zh) 一种客户端应用平台的统计方法和装置
CN109743188A (zh) 日志数据处理方法和装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18878116

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2018878116

Country of ref document: EP

Effective date: 20200110

NENP Non-entry into the national phase

Ref country code: DE