A method, system, computing device and medium for identifying tenant identification

By determining the target tenant identity parser based on the SaaS entry mode of different types of requests, analyzing the tenant context object, the problem of fixed single tenant identity recognition method in the prior art is solved, and effective identification and analysis of requests of different modes is realized.

CN117938936BActive Publication Date: 2025-04-29联通(山西)产业互联网有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410024654.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-08
Publication Date
2025-04-29
Estimated Expiration
2044-01-08

AI Technical Summary

Technical Problem

Existing tenant identification methods are usually fixed and single, and cannot meet the identification requirements of requests under different modes.

Method used

By obtaining different types of requests sent by the user, and determining at least one tenant identity parser according to the SaaS entry mode corresponding to each request, a target parser is used to parse the tenant context object to obtain the tenant identity.

Benefits of technology

It realizes the analysis and identification of requests in different modes, determines the tenant identity, meets the request identification needs in different modes, and reduces the amount of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117938936B_ABST
    Figure CN117938936B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, system, computing device and medium for identifying tenant identification, the method comprising: obtaining different types of requests sent by users, and obtaining the SaaS entry mode corresponding to each request; parsing and identifying multiple key parameters in each request, and assembling the key parameters of each request into a corresponding tenant context object; for each type, according to the corresponding SaaS entry mode, determining at least one tenant identification resolver corresponding to each request of the same type, and according to the resolution priority of each tenant identification resolver, determining the target resolver corresponding to each request of the same type; for each request of each type, using the corresponding target resolver to resolve the corresponding tenant context object, and obtaining the tenant identification corresponding to each request. The method solves the problem that the existing tenant identification identification method is usually fixed and single, and cannot meet the identification requirements of requests under different modes.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In a standard multi-tenant system, tenants should have data isolation both logically and physically. In order to allow Web requests to access data areas of different tenants, we need to specify the tenant ID in the current request.

[0003] The tenant ID is usually a unique identifier used to identify a specific tenant. Traditional tenant isolation methods usually use domain names, headers, parameters, etc. to identify tenant IDs, but these methods have certain limitations. For example, the domain name identification method requires tenants to use independent domain names, the header identification method requires tenants to carry tenant IDs in the request, and the parameter identification method requires tenants to specify tenant IDs in the request. Therefore, existing tenant ID identification methods are usually fixed and single, and cannot meet the identification requirements of requests in different modes. Summary of the invention

[0004] In order to overcome the problem that existing tenant identification methods are usually fixed and single and cannot meet the identification requirements of requests in different modes, the present invention provides a method, system, computing device and medium for identifying tenant identification.

[0005] In a first aspect, in order to solve the above technical problem, the present invention provides a method for identifying a tenant identifier, comprising:

[0006] Get different types of requests sent by users, and get the SaaS entry mode corresponding to each request;

[0007] Parse and identify multiple key parameters in each request, and assemble each key parameter of each request into a corresponding tenant context object;

[0008] For each type, according to the corresponding SaaS entry mode, determine at least one tenant identifier resolver corresponding to each request of the same type, and determine the target resolver corresponding to each request of the same type according to the resolution priority of each tenant identifier resolver;

[0009] For each type of request, the corresponding tenant context object is parsed using the corresponding target parser to obtain the tenant identifier corresponding to each request.

[0010] In a second aspect, the present invention further provides a system for identifying a tenant identifier, comprising:

[0011] The acquisition module is used to obtain different types of requests sent by users and obtain the SaaS entry mode corresponding to each request;

[0012] An assembly module is used to parse and identify multiple key parameters in each request, and assemble the key parameters of each request into a tenant context object corresponding to the request;

[0013] A determination module, for each type, according to the corresponding SaaS entry mode, determines at least one tenant identifier resolver corresponding to each request of the same type, and determines a target resolver corresponding to each request of the same type according to the resolution priority of each tenant identifier resolver;

[0014] The parsing module is used to parse the corresponding tenant context object using the corresponding target parser for each type of request to obtain the tenant identifier corresponding to each request.

[0015] In a third aspect, the present invention further provides a computing device, including a memory, a processor, and a program stored in the memory and running on the processor, wherein when the processor executes the program, the steps of a method for identifying a tenant identifier as described above are implemented.

[0016] In a fourth aspect, the present invention further provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the steps of a method for identifying a tenant identifier.

[0017] The beneficial effect of the present invention is that by utilizing the SaaS entry modes corresponding to different types of requests, each type of request can determine at least one corresponding tenant identification resolver that can meet the identification requirements. Then, according to the priority of each tenant identification resolver, the target resolver corresponding to each request is determined, and each target resolver is used to parse the tenant context object corresponding to each request to determine the corresponding tenant identification, so that other tenant identification resolvers except the target resolver do not need to parse the tenant context object, thereby reducing the amount of data processing while also being able to determine the tenant identification corresponding to each request. In this way, the above method can parse and identify requests of each type corresponding to each SaaS entry mode, determine the tenant identification corresponding to each request, and thus meet the identification requirements of requests under different modes. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic diagram of a flow chart of a method for identifying a tenant identifier according to the present invention;

[0019] Figure 2 It is a structural diagram of the tenant identifier resolver component of the present invention;

[0020] Figure 3 A schematic diagram of the configuration of the parser strategy set of the present invention;

[0021] Figure 4An interactive schematic diagram of a method for identifying a tenant identifier according to the present invention;

[0022] Figure 5 Another schematic diagram of a flow chart of a method for identifying a tenant identifier according to the present invention;

[0023] Figure 6 The present invention is a schematic diagram of the structure of a system for identifying a tenant identifier. DETAILED DESCRIPTION

[0024] The following examples are provided to further explain and supplement the present invention and do not constitute any limitation to the present invention.

[0025] The following describes a method, system, computing device, and medium for identifying a tenant identifier according to an embodiment of the present invention in conjunction with the accompanying drawings.

[0026] A method for identifying a tenant identifier in an embodiment of the present invention is applied to a terminal device. In this application scheme, the terminal device is used as the execution subject to illustrate the application scheme. The terminal device is used to execute the steps of a method for identifying a tenant identifier.

[0027] like Figure 1 As shown, the present invention provides a method for identifying a tenant identifier, comprising:

[0028] Step S1, obtaining different types of requests sent by users, and obtaining the SaaS entry mode corresponding to each request;

[0029] Step S2, parsing and identifying multiple key parameters in each request, and assembling each key parameter of each request into a corresponding tenant context object;

[0030] Step S3: for each type, according to the corresponding SaaS entry mode, determine at least one tenant identifier resolver corresponding to each request of the same type, and determine the target resolver corresponding to each request of the same type according to the resolution priority of each tenant identifier resolver;

[0031] Step S4: for each type of request, the corresponding tenant context object is parsed using the corresponding target parser to obtain the tenant identifier corresponding to each request.

[0032] The present embodiment provides a method for identifying tenant identifiers, which utilizes SaaS entry modes corresponding to different types of requests, so that each type of request can determine at least one corresponding tenant identifier resolver that can meet the identification requirements. Then, according to the priority of each tenant identifier resolver, the target resolver corresponding to each request is determined, and each target resolver is used to parse the tenant context object corresponding to each request to determine the corresponding tenant identifier, so that other tenant identifier resolvers other than the target resolver do not need to parse the tenant context object, thereby reducing the amount of data processing while also being able to determine the tenant identifier corresponding to each request of each type. In this way, the above method can parse and identify requests of each type corresponding to each SaaS entry mode, determine the tenant identifier corresponding to each request, and thus meet the identification requirements of requests under different modes.

[0033] In some embodiments, the tenant identifier resolver stores an identification strategy for resolving tenant context objects. The identification strategy is a path context matching strategy, an HttpHeader matching strategy, a domain name matching strategy, a Cookie matching strategy, or an HttpSession matching strategy; then, the corresponding tenant context object is parsed using the corresponding target resolver to obtain the tenant identifier corresponding to the request, including:

[0034] Using the corresponding path context matching strategy, obtain the tenant identifier from the context path of the corresponding tenant context object; or,

[0035] Use the corresponding HttpHeader matching strategy to obtain the tenant identifier from the header of the corresponding tenant context object; or,

[0036] Using the corresponding domain name matching strategy, obtain the tenant identifier from the host of the corresponding tenant context object; or,

[0037] Use the corresponding cookie matching strategy to obtain the tenant identifier from the cookie of the corresponding tenant context object; or,

[0038] Use the corresponding HttpSession matching strategy to obtain the tenant identifier from the session of the corresponding tenant context object.

[0039] Table 1 shows five identification strategies. Each identification strategy has its own unique strategy identifier and description, which is convenient for direct search in subsequent use.

[0040] Table 1

[0041]

[0042] Figure 2The structure diagram of the tenant identifier resolver component of the present invention is responsible for resolving the tenant identifier from the HTTP request. The tenant identifier is a unique identifier used to distinguish different tenants. Figure 2 As shown in the figure, TenantidentifierResolverComposite represents the container of all tenant identifier resolvers, which will select the appropriate tenant identifier resolver according to the requested SaaS entry mode. <SaasEntryMode,Function<SaasProperties,TenantidentifierResolver> >, which represents the constructor that maps the SaaS entry pattern to the tenant identity resolver. Resolvers List <tenantidentifierresolver>, indicating that all registered tenant identity resolvers are included. resolve(HttpServletRequest)Optional <string>, indicating that the appropriate tenant identifier resolver will be called to obtain the tenant identifier according to the requested SaaS entry mode. TenantidentifierResolver, represents an interface that defines the resolution strategy of each tenant identifier resolver. Each of its implementation classes is a resolution strategy. resolve(HttpServletRequest) indicates that the tenant identifier will be obtained from the request.

[0043] Among them, the TenantidentifierResolver interface corresponds to five implementation classes: 1. CookieTenantidentifierResolver, which means obtaining the tenant identifier from the Cookie in the request. SaasProperties, which means Saas configuration items. 2. CxtPathTenantidentifierResolver, which means obtaining the tenant identifier from the context path of the request. 3. SessionTenantidentifierResolver, which means obtaining the tenant identifier from the requested session. 4. HostTenantidentifierResolver, which means obtaining the tenant identifier from the requested host. getHost(String)String, which means obtaining the tenant identifier. 5. HeaderTenantidentifierResolver, which means obtaining the tenant identifier from the header of the request.

[0044] Before the method of the present invention is executed, the corresponding configuration items need to be declared in advance. Table 2 is the configuration item declaration of the present invention. This configuration item is a preference setting item launched for different application systems. Due to the differences in authentication systems, user structures, and session modes of different applications, different logics need to be implemented respectively. In actual use, it is necessary to select a specific operating mode based on the characteristics of the application system itself. By setting these configuration items, the identification logic of the tenant identity can be customized in a lightweight manner.

[0045] Table 2

[0046]

[0047] Use the spring configuration file to specify specific matching rules, such as the following configuration. This configuration is the same as the items in the above configuration item declaration, except that the camel case naming is converted to a hyphen. saas is the namespace for all configuration items. For example: Header matching is used first, followed by context path matching, and configuration items for each strategy are also specified. The corresponding code is as follows:

[0048]

[0049]

[0050] Among them, the TenantIdentifierResolverComposite class is a container for all tenant identifier resolvers. It will select the appropriate tenant identifier resolver based on the resolution strategy configured by the application and the specific request. The factories property is of Map type, which maps the SaaS entry pattern to the constructor of the tenant identifier resolver. The resolvers property is of List type, which contains all registered tenant identifier resolvers.

[0051] The specific matching logic implemented in the parsing strategy set is as follows:

[0052]

[0053] Figure 3 is a schematic diagram of the configuration of the parser strategy set of the present invention, such as Figure 3 As shown, the parser policy set obtains the enabled policy from SaaSProperties (SaaS configuration item) through getMatching(), obtains the policy enumeration, and starts traversal; then get() obtains the corresponding policy factory method (factories, i.e. policy factory map) through enumeration, and filters (Objects::nonNull) the unmatched items. Then factory.apppy(properties) passes in the properties, calls the factory method, and map() obtains the parser instance object collection to complete the configuration initialization of the parsing policy set.

[0054] Optionally, for each type of request, for each type, according to the corresponding SaaS entry mode, determining at least one tenant identifier resolver corresponding to each request of the same type includes:

[0055] For each type, at least one tenant identification resolver containing information about the SaaS entry pattern of each request of the same type is filtered out in the preset resolver policy set; wherein the preset resolver policy set stores multiple tenant identification resolvers, and one tenant identification resolver contains information about one type of SaaS entry pattern.

[0056] In this embodiment, multiple tenant identification resolvers are set up in advance, and the information of the SaaS entry mode corresponding to the request type that each tenant identification resolver can resolve is associated and stored in a preset resolver policy set. When a terminal device receives a request, it can directly call the corresponding tenant identification resolver in the preset resolver policy set according to the SaaS entry mode corresponding to the request, thereby improving the efficiency of identifying requests under different modes, thereby meeting the identification requirements of requests under different modes.

[0057] Optionally, for each type, according to the resolution priority of each tenant identifier resolver corresponding to the request, a target resolver corresponding to each request of the same type is determined, including:

[0058] For each type, the resolution priority of each tenant identifier resolver corresponding to each request of the same type is obtained, and the tenant identifier resolver with the highest resolution priority is used as the target resolver corresponding to the request of the corresponding type.

[0059] In this embodiment, since the speed and resource utilization rate of each tenant identifier resolver when resolving the corresponding tenant context object are different, it is generally necessary to consider both the resolution speed and the resource utilization rate during resolution, sort the resolution order of each tenant identifier resolver, and determine the resolution priority of each tenant identifier. In this way, after determining each tenant resolver corresponding to the request, the tenant identifier resolver with the highest resolution priority is used as the target resolver corresponding to the request, so that when the target resolver is subsequently used for the corresponding tenant context object, the resolution speed and the resource utilization rate during resolution are taken into account, so that the resolution speed can be guaranteed while improving the resource utilization rate.

[0060] Optionally, a method for identifying a tenant identifier further includes:

[0061] Each tenant ID is sent to the terminal device for display.

[0062] In this embodiment, each tenant identifier is sent to the terminal device for display, so that the user who sends the request can intuitively understand the tenant identifier corresponding to the request.

[0063] Optionally, a method for identifying a tenant identifier further includes:

[0064] For each type, if the tenant identifier resolver corresponding to each request of the same type is not determined according to the corresponding SaaS entry mode, information indicating that the response request is abnormal is sent to the terminal device.

[0065] In this embodiment, if the tenant identifier resolver corresponding to the request is not determined according to the SaaS entry mode corresponding to the request, the acquired request is in an abnormal state, so that the SaaS entry mode corresponding to the request cannot be normally identified, and therefore the tenant identifier resolver corresponding to the request cannot be determined. At this time, sending information about the abnormal response request to the terminal device can remind the user that the request sent this time is abnormal, so as to facilitate timely tracing and processing of the abnormality.

[0066] Optionally, a method for identifying a tenant identifier further includes:

[0067] For each type, the tenant identifier corresponding to each request of the same type is stored in the cache, and when each request ends, the corresponding tenant identifier is deleted from the cache.

[0068] In this embodiment, after a general user sends a request, the terminal device will execute the business logic corresponding to the request. In this process, the corresponding tenant identifier is parsed only when the request is sent for the first time, and the parsed tenant identifier is stored in the cache, so that when the business logic corresponding to the request is executed, the data corresponding to the tenant identifier can be directly used, thereby improving the execution efficiency of the business logic. At the end of the request, the corresponding tenant identifier is deleted from the cache, and useless data in the cache can be cleaned up in time, thereby improving the resource utilization of the cache.

[0069] In some embodiments, in a tenant context resolution function, a predefined tenant context cache is called, and after the first resolution, no repeated resolution is performed, and the cached tenant context object can be directly obtained.

[0070] The code for the specific implementation logic of automatically generating tenant context cache is as follows:

[0071]

[0072] The specific implementation class of identifierResolver (tenant identifier resolver) is the policy set composed of TenantIdentifierResolverComposite. The policy set has already specified which policies are used when it is initialized. The methods in the code are described as follows: The getContext() method is used to obtain the current tenant context. The bound property is Optional <tenantcontext>Type, representing the currently cached temporary tenant context. The currentRequest() method returns the current request. The flatMap() method maps the current request to a TenantIdentifierResolver object. The resolve() method gets the tenant identifier from the request. The map() method maps the tenant identifier to a TenantContext object. The orElseThrow() method throws an exception if the TenantContext object is empty.

[0073] Figure 4 An interactive schematic diagram of a method for identifying a tenant identifier of the present invention is shown in FIG. Figure 4 As shown, the bound attribute of the request is determined. If the attribute is not empty, it is returned directly. Then, the tenant context is obtained through getContext(), and the tenant context is obtained through

[0074] Resolve(HttpServletRequest) calls the tenant identifier resolver (TenantldentifierResolver), determines the target resolver, performs the result on the tenant context of the request, obtains the tenant identifier, that is, obtains the tenant identifier from the request, and returns the result (that is, the tenant identifier) ​​through resolve(HttpServletRequest). Then create a new context through create(), that is, create a new TenantContext object. If the acquisition fails, an exception is thrown. If the acquisition succeeds, get() gets the context object, and uses the new context object to call the tenant identifier resolver. After determining the target resolver, perform the result on the tenant context of the request, obtain the tenant identifier, and then return the tenant identifier to the request through getContext(), that is, display it on the front end that sends the request.

[0075] Figure 5 Another flowchart of a method for identifying a tenant identifier according to the present invention is shown in FIG. Figure 5 As shown, a SaaS entry mode initiates a request, and then obtains the context of the request: parses and identifies the key parameters in the request, and assembles them into a context object. Then, according to the SaaS entry mode, the matching strategy is traversed in the strategy set: traverse all strategy sets, execute strategies, and return parsing results. The parsing results are optional values, and the results can be filtered by judging the existence; if there is no match after traversal, an exception is thrown, that is, the response request is abnormal. At the same time, in the case of an exception, the abnormal status code 400 is directly returned, and the reason is informed. Secondly, find the first matching result: when traversing the match, one or more strategies may be matched. In the production environment, the first result can be selected. Here, it is equivalent to the higher priority of the policy configuration items at the front, and the parsing result returned by the highest priority strategy is used as the first result. Thirdly, put the first result into the cache: the first result is put into the cache so that it can be quickly obtained the next time it is accessed without re-parsing. The cache is only available within the scope of a single request and is destroyed when the request ends. Finally, respond to the data: respond to the tenant's data to the front end, that is, return the first result to the front end for display.

[0076] The present invention provides a method for identifying tenant identifiers, which uses configurable multi-mode identification of tenant identifiers under the HTTP protocol, enabling the system to flexibly obtain tenant key identifiers through any combination of one or more identification methods. The method identifies the tenant identifier in the HTTP request and isolates the database, business logic, etc. according to the tenant identifier, thereby achieving the security and data isolation of the multi-tenant system.

[0077] The method of the present invention has the following advantages: 1. Configurability: the identification method of the tenant identification can be configured as needed to meet the needs of different scenarios; 2. Flexibility: a variety of methods can be used to combine and identify the tenant identification to improve the accuracy of identification; 3. Security: by filtering tenant data, malicious requests are screened and the security of the system is improved. The method of the present invention can be applied to various multi-tenant systems, such as SaaS systems, cloud computing systems, etc. The method of the present invention can be used in combination with other multi-tenant isolation technologies to improve the security and data isolation of the system. A method for identifying tenant identification of the present invention can achieve the following effects: 1. The tenant identification mechanism avoids malicious attacks to a great extent on network requests. There must be a correct tenant identification, and the accessible resources of each tenant are limited within a controllable range, which can protect the system's advanced middleware account and system permissions. 2. Supporting five tenant identification strategies based on domain name, application context, session, Http Header, and Cookie, it can arbitrarily combine strategies to identify tenants, and there is no additional performance loss, which provides great scalability and convenience for third-party system access. 3. It supports static policy after a single application startup and can cache the parsing results after one parsing. It has high performance and can be used in high-concurrency production environments.

[0078] like Figure 6 As shown, the present invention provides a system for identifying a tenant identifier, comprising:

[0079] The acquisition module is used to obtain different types of requests sent by users and obtain the SaaS entry mode corresponding to each request;

[0080] An assembly module is used to parse and identify multiple key parameters in each request, and assemble the key parameters of each request into a tenant context object corresponding to the request;

[0081] A determination module, for each type, according to the corresponding SaaS entry mode, determines at least one tenant identifier resolver corresponding to each request of the same type, and determines a target resolver corresponding to each request of the same type according to the resolution priority of each tenant identifier resolver;

[0082] The parsing module is used to parse the corresponding tenant context object using the corresponding target parser for each type of request to obtain the tenant identifier corresponding to each request.

[0083] Optionally, a module is determined, specifically for:

[0084] For each type, at least one tenant identification resolver containing information about the SaaS entry pattern of each request of the same type is filtered out in the preset resolver policy set; wherein the preset resolver policy set stores multiple tenant identification resolvers, and one tenant identification resolver contains information about one type of SaaS entry pattern.

[0085] Optionally, a module is determined, specifically for:

[0086] For each type, the resolution priority of each tenant identifier resolver corresponding to each request of the same type is obtained, and the tenant identifier resolver with the highest resolution priority is used as the target resolver corresponding to the request of the corresponding type.

[0087] Optionally, a system for identifying a tenant identifier further includes a display module. The display module is specifically used to:

[0088] Each tenant ID is sent to the terminal device for display.

[0089] Optionally, a system for identifying a tenant identifier further includes an alarm module. The alarm module is specifically used to:

[0090] For each type, if the tenant identifier resolver corresponding to each request of the same type is not determined according to the corresponding SaaS entry mode, information indicating that the response request is abnormal is sent to the terminal device.

[0091] Optionally, a system for identifying a tenant identifier further includes a storage module. The storage module is specifically used to:

[0092] For each type, the tenant identifier corresponding to each request of the same type is stored in the cache, and when each request ends, the corresponding tenant identifier is deleted from the cache.

[0093] A computing device according to an embodiment of the present invention includes a memory, a processor, and a program stored in the memory and running on the processor. When the processor executes the program, some or all steps of the above-mentioned method for identifying a tenant identifier are implemented.

[0094] Among them, the computing device can be a computer, and correspondingly, its program is computer software. The above-mentioned parameters and steps in a computing device of the present invention can refer to the parameters and steps in an embodiment of a method for identifying a tenant identifier in the above text, and will not be repeated here.

[0095] In an embodiment of the present invention, a computer-readable storage medium stores instructions, and when the instructions are executed, the steps of the above-mentioned method for identifying a tenant identifier are executed.

[0096] The computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.

[0097] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method of the embodiment of the present disclosure. The aforementioned computer-readable storage medium may be a non-transitory computer-readable storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes, or a transient computer-readable storage medium.

[0098] Those skilled in the art know that the present invention can be implemented as a system, method or computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code. Computer-readable storage media can be, for example, but not limited to - electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above.

[0099] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0100] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.< / tenantcontext> < / string> < / tenantidentifierresolver>

Claims

1. A method for identifying a tenant identifier, characterized in that: include: Get different types of requests sent by users, and get the SaaS entry mode corresponding to each request; Parsing and identifying multiple key parameters in each of the requests, and assembling each of the key parameters of each of the requests into a corresponding tenant context object; For each type, according to the corresponding SaaS entry mode, determine at least one tenant identifier resolver corresponding to each request of the same type, and according to the resolution priority of each tenant identifier resolver, determine the target resolver corresponding to each request of the same type; For each of the requests of each type, the corresponding tenant context object is parsed using the corresponding target parser to obtain the tenant identifier corresponding to each of the requests.

2. The method according to claim 1, characterized in that For each type, determining at least one tenant identifier resolver corresponding to each request of the same type according to the corresponding SaaS entry mode includes: For each type, at least one tenant identification resolver containing information about the SaaS entry pattern of each request of the same type is filtered out in the preset resolver strategy set; wherein the preset resolver strategy set stores multiple tenant identification resolvers, and one tenant identification resolver contains information about one type of SaaS entry pattern.

3. The method according to claim 1, characterized in that For each type, determining the target parser corresponding to each request of the same type according to the parsing priority of each tenant identifier parser corresponding to the request includes: For each type, the resolution priority of each tenant identifier resolver corresponding to each request of the same type is obtained, and the tenant identifier resolver with the highest resolution priority is used as the target resolver corresponding to the request of the corresponding type.

4. The method according to any one of claims 1 to 3, characterized in that: Also includes: Each tenant identifier is sent to a terminal device for display.

5. The method according to any one of claims 1 to 3, characterized in that: Also includes: For each type, if the tenant identifier resolver corresponding to each request of the same type is not determined according to the corresponding SaaS entry mode, information indicating an abnormal response request is sent to the terminal device.

6. The method according to any one of claims 1 to 3, characterized in that: Also includes: For each type, the tenant identifier corresponding to each request of the same type is stored in the cache, and when each request ends, the corresponding tenant identifier is deleted from the cache.

7. A system for identifying a tenant ID, characterized in that: include: The acquisition module is used to obtain different types of requests sent by users and obtain the SaaS entry mode corresponding to each request; An assembly module, used for parsing and identifying a plurality of key parameters in each of the requests, and assembling the key parameters of each of the requests into a tenant context object corresponding to the request; A determination module, for each type, determining at least one tenant identifier resolver corresponding to each request of the same type according to the corresponding SaaS entry mode, and determining a target resolver corresponding to each request of the same type according to the resolution priority of each tenant identifier resolver; The parsing module is used to parse the corresponding tenant context object using the corresponding target parser for each request of each type, so as to obtain the tenant identifier corresponding to each request.

8. The system according to claim 7, characterized in that The determination module is specifically used for: For each type, at least one tenant identification resolver containing information about the SaaS entry pattern of each request of the same type is filtered out in the preset resolver strategy set; wherein the preset resolver strategy set stores multiple tenant identification resolvers, and one tenant identification resolver contains information about one type of SaaS entry pattern.

9. A computing device comprising a memory, a processor, and a program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the steps of a method for identifying a tenant identifier as described in any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the steps of a method for identifying a tenant identifier as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Information processing method and device, equipment and storage medium

    CN111611050A

  • Service processing method and device, electronic equipment and storage medium

    CN115118765A