Method, system and equipment for realizing tenant level-to-level management and medium

By setting the level field and hierarchical management switch for the multi-tenant system, the tenants in the superior-subordinate relationship are identified, which solves the complexity of data isolation in multi-tenant mode, realizes tenant hierarchical management without additional data synchronization, simplifies development work and improves improve the flexibility and reliability of the system.

CN118568765APending Publication Date: 2024-08-30浪潮(山东)农业互联网有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410647577.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In multi-tenant mode, there may be a superior-subordinate relationship between user groups, and business data needs to be shared but isolated, resulting in additional data synchronization and increased development work.

Method used

By setting the level field and hierarchical management switch for the target web application, start the level check module to identify the tenants in the superior-subordinate relationship, and configure the business data of the subordinate tenants not to isolate them from their superior tenants during data isolation to avoid additional data synchronization. .

Benefits of technology

It realizes tenant hierarchical management without additional data synchronization, simplifies development work, and improves the flexibility and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568765A
    Figure CN118568765A
Patent Text Reader

Abstract

The invention provides a method, a system, equipment and a medium for realizing tenant level-to-level management, and belongs to the technical field of Web development, and the method comprises the following steps: determining a target Web application with tenant level-to-level management requirements, and setting level fields for each tenant of the target Web application; configuring a level-to-level management switch and a level checking module for the target Web application; and when the business data of each tenant of the target Web application is stored in the cloud platform, if the level-to-level management switch is turned on, the level check module is started, the tenants in the superior-subordinate relationship are identified, and when business data isolation is carried out, the business data identified as the subordinate tenants are configured to be not isolated from the superior tenants. The tenant level identification is carried out by setting the level field of the tenant, so that when data filtering is carried out, the business data of the low-level tenant is not isolated from the high-level business data, additional data synchronization opening work is not needed, a switch is set for tenant level-to-level management, and the use is flexible.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] Multi-tenancy is a software architecture in which a single software instance provides services to multiple different user groups, which share resources but keep data isolated. The so-called software instance includes applications, databases, servers, and network devices, and in Web development, the multi-tenant model has been widely used. Web applications share database resources and Web application codes to provide efficient, secure, and reliable services to multiple tenants, improve resource utilization, reduce maintenance costs, and improve the operating efficiency of Web applications.

[0003] In the multi-tenant mode of WEB applications, data isolation needs to be maintained between user groups. There are three main formats: one is isolation through different databases, one is to use the same database but different data structures for isolation, and the other is to use the same database and data structure, but distinguish different user groups and set up data tables for each user group for isolation. But no matter which method is used, data isolation is performed between different user groups to ensure security. However, a problem in actual use is that there may be a superior-subordinate relationship between different user groups. Such user groups need to share business data, but business data needs to be isolated based on multi-tenant restrictions, which requires additional data synchronization for sharing, and at this time, new development work for Web applications is added.

[0004] This is a shortcoming of the prior art. Therefore, in view of the above-mentioned defects in the prior art, it is very necessary to provide a method, system, device and medium for realizing tenant hierarchical management. Summary of the invention

[0005] According to the prior art, there may be a hierarchical relationship between the above-mentioned different user groups. Such user groups need to share business data, but the business data needs to be isolated based on multi-tenant restrictions, which requires additional data synchronization for sharing. At this time, the defect of new development work of Web pages is added. The present invention provides a method, system, device and medium for realizing tenant hierarchical management to solve the above-mentioned technical problems.

[0006] In a first aspect, the present invention provides a method for implementing tenant hierarchical management, comprising the following steps:

[0007] S1. Determine the target Web application that has tenant hierarchical management requirements, and set the level field for each tenant of the target Web application;

[0008] S2. Configure the hierarchical management switch and level check module for the target Web application;

[0009] S3. When storing the business data of each tenant of the target Web application to the cloud platform, if the hierarchical management switch is turned on, the level check module is started to identify the tenants of the superior and subordinate relationships, and when isolating the business data, the business data of the tenants identified as subordinates are configured not to be isolated from their superior tenants.

[0010] Furthermore, the specific steps of step S1 are as follows:

[0011] S11. Obtain the tenant hierarchical management requirements of the target Web application, parse the tenant hierarchical management requirements, and identify the tenant level topology;

[0012] S12. Encode the tenant according to its position in the level topology to obtain a tenant code with level information; S13. Insert the tenant code into the target Web application tenant ID field, so that the tenant ID field serves as a level field.

[0013] Furthermore, the specific steps in step S12 are as follows:

[0014] S121. Obtain the level topology of the tenants, determine the number of levels and the number of tenants in each level;

[0015] S122. Locate the highest level tenant, take the highest level tenant as the first level tenant, and set the tenant code of the first level tenant as the basic code;

[0016] S123. Locate the second highest level tenant, set the second highest level tenant as the second level tenant, set the second level tenant code as the basic code + second level auxiliary code, and set different second level tenants to different second level auxiliary codes;

[0017] S124. Positioning is performed level by level, and the codes of tenants at each level are set to the combination of the codes of the upper-level tenants and the auxiliary codes of the tenants at the positioning level, and the tenants at the same level of the positioning are set to have only different auxiliary codes at the positioning level. Further, the specific steps of step S2 are as follows:

[0018] S21. Set a hierarchical management switch for the target Web application in the Web application development tool, and configure the hierarchical management switch to respond to user instructions to turn on or off the hierarchical management function of the target Web application;

[0019] S22. Create a level check module in the Web application development tool, and assign the level check module to the target Web application.

[0020] Furthermore, in step S21, the user having the hierarchical management switch setting authority is an administrator user of the target Web application.

[0021] Furthermore, the specific steps of step S3 are as follows:

[0022] S31. The target Web application receives the business request from the front end and stores the business data of each tenant on the cloud platform;

[0023] S32. Whether the target Web application detects the hierarchical management switch is turned on;

[0024] If it is on, go to step S33;

[0025] If it is not enabled, the level check module is not started, and the business data of each tenant is normally isolated, and the process ends; S33. The target Web application starts the level check module, and determines the level of each tenant by identifying the tenant code in the tenant ID field;

[0026] S34. When the target Web application isolates business data through the MyBatis filter, the business data of the low-level tenant is used as a reverse condition for its high-level tenant, so that data isolation is not performed.

[0027] Furthermore, the specific steps of step S33 are as follows:

[0028] S331. After the level detection module is started, the tenant code of each tenant is extracted and the length of the tenant code is determined;

[0029] S332. Identify tenants of different levels according to the tenant code length, where the tenants with longer code lengths are of higher levels, and the tenants with shorter code lengths are of lower levels;

[0030] S333. Determine the subordinate tenants of each level of tenants according to the similarity of the codes, and obtain the tenant topology.

[0031] In a second aspect, the present invention provides a system for implementing tenant hierarchical management, including: a Web application level field setting unit, used to determine a target Web application for which tenant hierarchical management requirements exist, and to set a level field for each tenant of the target Web application;

[0032] A hierarchical management configuration unit, used to configure a hierarchical management switch and a level check module for a target Web application;

[0033] The isolation filtering unit is used to start the level checking module when storing the business data of each tenant of the target Web application to the cloud platform, if the hierarchical management switch is turned on, to identify the tenants of the upper and lower relationships, and when isolating the business data, configure the business data of the tenants identified as subordinates not to be isolated from their superior tenants.

[0034] In a third aspect, the present invention provides a device, comprising a processor and a memory;

[0035] The memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the device executes the method described in the first aspect above.

[0036] In a fourth aspect, the present invention provides a storage medium,

[0037] The storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method described in the first aspect.

[0038] The beneficial effects of the present invention are:

[0039] The method, system, device and medium for implementing tenant hierarchical management provided by the present invention identify the tenant level by setting the tenant level field, so that when filtering data, the business data of low-level tenants is not isolated from the high-level business data, and no additional data synchronization and opening work is required. A switch is set for tenant hierarchical management, which is flexible to use.

[0040] In addition, the invention has a reliable design principle, a simple structure and a very broad application prospect.

[0041] It can be seen that compared with the prior art, the present invention has outstanding substantive features and significant progress, and the beneficial effects of its implementation are also obvious. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0043] Figure 1 It is a flow chart of the method for implementing tenant hierarchical management according to the present invention.

[0044] Figure 2 It is a schematic diagram of a system for implementing tenant hierarchical management according to the present invention. DETAILED DESCRIPTION

[0045] The method, system, device and medium for implementing tenant hierarchical management provided by the present invention adopt the method of maintaining tenant superiors and subordinates to realize the function of multi-tenant hierarchical management. The hierarchical tenant management mode can be selectively opened to different applications by configuration to realize the function of managing the business data of subordinate tenants.

[0046] The method for implementing tenant hierarchical management can be applied to one or more devices, wherein the device is a device that can automatically perform numerical calculations 10 and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0047] The device can be any electronic product that can interact with the user, such as a personal computer, tablet computer, smart phone, personal digital assistant (PDA), interactive network television (IPTV), etc. The network where the device is located includes but is not limited to the Internet, wide area network, metropolitan area network, local area network, virtual private network (VPN), etc.

[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0049] See also Figure 1 The figure is a flowchart of a method for implementing tenant hierarchical management in a specific embodiment, and the method includes the following steps:

[0050] S1. Determine the target Web application that has tenant hierarchical management requirements, and set the level field for each tenant of the target Web application;

[0051] S2. Configure the hierarchical management switch and level check module for the target Web application;

[0052] S3. When storing the business data of each tenant of the target Web application to the cloud platform, if the hierarchical management switch is turned on, the level check module is started to identify the tenants of the superior and subordinate relationships, and when isolating the business data, the business data of the tenants identified as subordinates are configured not to be isolated from their superior tenants.

[0053] In this embodiment, the specific steps of step S1 are as follows:

[0054] S11. Obtain the tenant hierarchical management requirements of the target Web application, parse the tenant hierarchical management requirements, and identify the tenant level topology;

[0055] S12. Encode the tenant according to its position in the level topology to obtain a tenant code with level information; the specific steps in step S12 are as follows:

[0056] S121. Obtain the level topology of the tenants, determine the number of levels and the number of tenants in each level;

[0057] S122. Locate the highest level tenant, take the highest level tenant as the first level tenant, and set the tenant code of the first level tenant as the basic code;

[0058] S123. Locate the second highest level tenant, set the second highest level tenant as the second level tenant, set the second level tenant code as the basic code + second level auxiliary code, and set different second level tenants to different second level auxiliary codes;

[0059] S124. Positioning at each level, and setting the code of each tenant to the concatenation of the code of the upper tenant and the auxiliary code of the positioning level tenant, and setting the tenants of the same level to be positioned only with the auxiliary code of the positioning level different; S13. Inserting the tenant code in the target Web application tenant ID field, so that the tenant ID field is used as the level field;

[0060] The specific steps of step S2 are as follows:

[0061] S21. In the Web application development tool, a hierarchical management switch is set for the target Web application, and the hierarchical management switch is configured to respond to user instructions to turn on or off the hierarchical management function of the target Web application; in step S21, the administrator user has the authority to set the hierarchical management switch for the target Web application;

[0062] S22. Create a level check module in the Web application development tool and assign the level check module to the target Web application;

[0063] The specific steps of step S3 are as follows:

[0064] S31. The target Web application receives the business request from the front end and stores the business data of each tenant on the cloud platform;

[0065] S32. Whether the target Web application detects the hierarchical management switch is turned on;

[0066] If it is on, go to step S33;

[0067] If it is not enabled, the level check module is not started, and the business data of each tenant is normally isolated, and the process ends; S33. The target Web application starts the level check module, and determines the level of each tenant by identifying the tenant code in the tenant ID field; the specific steps of step S33 are as follows:

[0068] S331. After the level detection module is started, the tenant code of each tenant is extracted and the length of the tenant code is determined;

[0069] S332. Identify tenants of different levels according to the tenant code length, where the tenants with longer code lengths are of higher levels, and the tenants with shorter code lengths are of lower levels;

[0070] S333. Determine the subordinate tenants of each level of tenants according to the similarity of the codes, and obtain the tenant topology;

[0071] S34. When the target Web application isolates business data through the MyBatis filter, the business data of the low-level tenant is used as a reverse condition for its high-level tenant, so that data isolation is not performed.

[0072] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0073] The following is an embodiment of a system for implementing hierarchical tenant management provided by an embodiment of the present disclosure. The system and the methods for implementing hierarchical tenant management in the above-mentioned embodiments belong to the same inventive concept. For details not fully described in the embodiment of the system for implementing hierarchical tenant management, reference can be made to the embodiments of the methods for implementing hierarchical tenant management mentioned above.

[0074] like Figure 2 As shown, the system includes:

[0075] A web application level field setting unit is used to determine a target web application that has a tenant hierarchical management requirement and to set a level field for each tenant of the target web application;

[0076] A hierarchical management configuration unit, used to configure a hierarchical management switch and a level check module for a target Web application;

[0077] The isolation filtering unit is used to start the level checking module when storing the business data of each tenant of the target Web application to the cloud platform, if the hierarchical management switch is turned on, to identify the tenants of the upper and lower relationships, and when isolating the business data, configure the business data of the tenants identified as subordinates not to be isolated from their superior tenants.

[0078] The method for implementing tenant hierarchical management provided by the present invention is a combination of the modules and algorithm steps of each example described in the embodiments disclosed herein, and can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0079] Those skilled in the art will appreciate that the method for implementing tenant hierarchical management provided by the present invention can be implemented as a system, method or program product. Therefore, various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which can be collectively referred to as "circuit", "module" or "system" here. In the non-transitory computer-readable storage medium for implementing the tenant hierarchical management method, it can be but not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list of 10) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0080] Although the present invention has been described in detail by referring to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person of ordinary skill in the art may easily think of changes or substitutions within the technical scope disclosed by the present invention, and these shall be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. A method for implementing tenant hierarchical management, characterized in that: The steps include: S1. Determine the target Web application that has tenant hierarchical management requirements, and set the level field for each tenant of the target Web application; S2. Configure the hierarchical management switch and level check module for the target Web application; S3. When storing the business data of each tenant of the target Web application to the cloud platform, if the hierarchical management switch is turned on, the level check module is started to identify the tenants of the superior and subordinate relationships, and when isolating the business data, the business data of the tenants identified as subordinates are configured not to be isolated from their superior tenants.

2. The method for implementing tenant hierarchical management according to claim 1, characterized in that: The specific steps of step S1 are as follows: S11. Obtain the tenant hierarchical management requirements of the target Web application, parse the tenant hierarchical management requirements, and identify the tenant level topology; S12. Encode the tenant according to its position in the level topology to obtain a tenant code with level information; S13. Insert the tenant code into the target Web application tenant ID field, so that the tenant ID field serves as a level field.

3. The method for implementing tenant hierarchical management according to claim 2, characterized in that: The specific steps in step S12 are as follows: S121. Obtain the level topology of the tenants, determine the number of levels and the number of tenants in each level; S122. Locate the highest level tenant, take the highest level tenant as the first level tenant, and set the tenant code of the first level tenant as the basic code; S123. Locate the second highest level tenant, set the second highest level tenant as the second level tenant, set the second level tenant code as the basic code + second level auxiliary code, and set different second level tenants to different second level auxiliary codes; S124. Positioning is performed level by level, and the codes of tenants at each level are set to be the combination of the codes of the upper-level tenants and the auxiliary codes of the tenants at the positioning level, and the tenants at the same level of positioning are set to have only different auxiliary codes at the positioning level.

4. The method for implementing tenant hierarchical management according to claim 2, characterized in that: The specific steps of step S2 are as follows: S21. Set a hierarchical management switch for the target Web application in the Web application development tool, and configure the hierarchical management switch to respond to user instructions to turn on or off the hierarchical management function of the target Web application; S22. Create a level check module in the Web application development tool, and assign the level check module to the target Web application.

5. The method for implementing tenant hierarchical management according to claim 4, characterized in that: In step S21, the administrator user having the hierarchical management switch setting authority is the target Web application.

6. The method for implementing tenant hierarchical management according to claim 4, characterized in that: The specific steps of step S3 are as follows: S31. The target Web application receives the business request from the front end and stores the business data of each tenant on the cloud platform; S32. Whether the target Web application detects the hierarchical management switch is turned on; If it is on, go to step S33; If it is not enabled, the level check module will not be started, and the business data of each tenant will be isolated normally, and the process ends; S33. The target Web application starts the level check module, and determines the level of each tenant by identifying the tenant code in the tenant ID field; S34. When the target Web application isolates business data through the MyBatis filter, the business data of the low-level tenant is used as a reverse condition for its high-level tenant, so that data isolation is not performed.

7. The method for implementing tenant hierarchical management according to claim 6, characterized in that: The specific steps of step S33 are as follows: S331. After the level detection module is started, the tenant code of each tenant is extracted and the length of the tenant code is determined; S332. Identify tenants of different levels according to the tenant code length, where the tenants with longer code lengths are of higher levels, and the tenants with shorter code lengths are of lower levels; S333. Determine the subordinate tenants of each level of tenants according to the similarity of the codes, and obtain the tenant topology.

8. A system for implementing tenant hierarchical management, characterized in that: include: A web application level field setting unit is used to determine a target web application that has a tenant hierarchical management requirement and to set a level field for each tenant of the target web application; A hierarchical management configuration unit, used to configure a hierarchical management switch and a level check module for a target Web application; The isolation filtering unit is used to start the level checking module when storing the business data of each tenant of the target Web application to the cloud platform, if the hierarchical management switch is turned on, to identify the tenants of the upper and lower relationships, and when isolating the business data, configure the business data of the tenants identified as subordinates not to be isolated from their superior tenants.

9. A device, characterized in that: including a processor and a memory; The memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the device executes the method described in any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method described in any one of claims 1 to 7.