A method, system, device and medium for implementing multi-tenancy based on catalog partitioning

By introducing directory partitioning and metadata attributes into the distributed file system, the problem of poor integration of multi-tenant technology is solved, resource isolation between tenants and users is achieved, resource requirements are reduced, and the file system's integration and business adaptability are improved.

CN115859346BActive Publication Date: 2026-05-29JINAN INSPUR DATA TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JINAN INSPUR DATA TECH CO LTD
Filing Date
2022-11-11
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing multi-tenant technologies have poor integration between multi-tenant services and file system services, leading to increased business operating costs and requiring fewer resources to support both multi-tenant and file system services.

Method used

By introducing directory partitions into the distributed file system, tenant root directories and user directories are created. Resource isolation between tenants and users is achieved by utilizing directory type metadata attributes. QoS configuration and resource quota management are also performed, and switching between multi-tenant mode and normal mode is supported.

Benefits of technology

It achieves resource isolation between tenants and users, reduces resource requirements, improves the integration of the file system, and meets the performance and resource constraints of different business needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115859346B_ABST
    Figure CN115859346B_ABST
Patent Text Reader

Abstract

The application relates to a method, system, device and medium for realizing multi-tenancy based on directory partitioning. In the multi-tenancy mode, a first target root directory with a true tenant root directory attribute is created, and a target first-level subdirectory with a true target working directory attribute of a tenant is created under the first target root directory according to the tenant; the target first-level subdirectory is only visible and accessible to the corresponding tenant; a target second-level subdirectory with a true target namespace working directory attribute of a user under the corresponding tenant is created under the target first-level subdirectory, and the target second-level subdirectory is only visible and accessible to the corresponding user to realize resource isolation between different users; and the user can create a subdirectory with a true ordinary directory attribute under the corresponding target second-level subdirectory to realize file management index. The application realizes resource isolation between tenants and users by using directory partitioning of a file system directory, so as to meet the multi-tenancy and multi-user demand.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of multi-tenancy implementation methods, and in particular to a method, system, apparatus and medium for implementing multi-tenancy based on directory partitioning. Background Technology

[0002] Multi-tenancy technology is a software architecture technique that explores and implements how to share the same system or program components in a multi-user environment while still ensuring the isolation of data between users.

[0003] The key to implementing multi-tenancy technology lies in the isolation of application context and data between different tenants. This ensures that applications from different tenants do not interfere with each other, while also maintaining strong data confidentiality. For the application side: process isolation is achieved through processes or environments that support multiple applications running simultaneously (such as web servers like Apache or IIS), or isolation within the same server process using threads. For the data side: different mechanisms are used to isolate data from different tenants. For example, Force uses metadata for segmentation, while Microsoft MSDN technical documents demonstrate isolation using structural descriptions. Existing multi-tenancy technologies suffer from poor integration between multi-tenant services and file system services, requiring the cluster to provide resources for both services, increasing operational costs. Therefore, how to achieve a distributed file system compatible with both single-tenancy and multi-tenancy, increasing the integration between multi-tenant and file system services, and enabling the cluster to support both services with fewer resources, is a pressing issue that needs to be addressed. Summary of the Invention

[0004] To solve the above-mentioned technical problems, or at least partially solve them, the present invention provides a method, system, apparatus and medium for implementing multi-tenancy based on directory partitioning.

[0005] In a first aspect, the present invention provides a method for implementing multi-tenancy based on directory partitioning, providing a multi-tenant mode suitable for multi-tenancy or a normal mode suitable for single-tenancy, including:

[0006] In the multi-tenant mode, a first target root directory with the tenant root directory attribute set to true is created. Under the first target root directory, a corresponding target first-level subdirectory with the tenant working directory attribute set to true is created according to the distributed file system tenant. The target first-level subdirectory is only visible and accessible to the corresponding tenant to achieve resource isolation between different tenants. Users within a tenant only create target second-level subdirectories with the namespace working directory attribute set to true under the corresponding target first-level subdirectory. The target second-level subdirectories are only visible and accessible to the corresponding users to achieve resource isolation between different users. Ordinary subdirectories with the ordinary directory attribute set to true can be arbitrarily created under the target second-level subdirectory to implement file management indexing.

[0007] Furthermore, a directory type metadata attribute is added to the file system directory of the distributed file system. The directory type metadata attribute is used to distinguish the type of the file system directory. The directory type metadata attribute includes: the ordinary directory attribute, the tenant root directory attribute, the tenant working directory attribute, and the namespace working directory attribute. The attribute value of the directory type metadata attribute is of Boolean type.

[0008] Furthermore, when deploying the distributed file system of the cluster, a prompt is made to choose whether to enable the multi-tenant mode. If the multi-tenant mode is enabled, the system will enter the multi-tenant mode; if the multi-tenant mode is disabled, the system will enter the normal mode. In the normal mode, a second target root directory with a false tenant root directory attribute is created as the root directory of the distributed file system. Any subdirectories with a true normal directory attribute can be created under the second target root directory to implement file management indexing.

[0009] Furthermore, in the multi-tenant mode, the preset QoS configuration strategy is based on the QoS characteristics of the directory and performs QoS configuration on each of the target first-level subdirectories and / or the target second-level subdirectories. The configured QoS parameters include: the total bandwidth, read bandwidth, write bandwidth, total OPS, read OPS and write OPS of each of the target first-level subdirectories and the target second-level subdirectories; to realize the allocation of bandwidth resources among different tenants and users.

[0010] Furthermore, in the multi-tenant mode, the preset resource configuration interface sets quotas for each of the target first-level subdirectories and / or the target second-level subdirectories based on the quota characteristics of the directory. The configured quota parameters include: the maximum space usage of each target first-level subdirectory and / or the maximum space usage of each target second-level subdirectory; thereby realizing the allocation of storage resources among different tenants and users.

[0011] Furthermore, in the multi-tenant mode, directory resources are displayed according to a first directory resource display method, which is as follows: for any tenant, the directory resources of the target first-level subdirectory and its subsequent hierarchical directories corresponding to that tenant are displayed; for any user, the directory resources of the target second-level subdirectory and its subsequent hierarchical directories corresponding to that user are displayed; for management interface resource accounts or super administrators, only the target first-level subdirectories at the target first-level subdirectory level are displayed.

[0012] In the normal mode, directory resources are displayed in the second directory resource display method, which is to display the directory resources of the second target root directory and its subsequent level directories created in the normal mode.

[0013] Secondly, the present invention provides a system for implementing multi-tenancy based on directory partitioning, characterized in that it includes: a metadata attribute construction module, wherein the metadata attribute construction module constructs directory type metadata attributes for the directory, including: ordinary directory attributes, tenant root directory attributes, tenant working directory attributes and namespace working directory attributes;

[0014] The tenant user maintenance module is used to maintain all tenants of the distributed file system and maintain user information under each tenant.

[0015] A multi-tenant mode execution module includes a multi-tenant directory partitioning creation unit. In the multi-tenant mode, this unit creates a first target root directory with a tenant root directory attribute set to true. Based on the distributed file system tenant, it creates a corresponding first-level target subdirectory with a tenant working directory attribute set to true under the first target root directory. The first-level target subdirectory is only visible and accessible to the corresponding tenant to achieve resource isolation between different tenants. Under the first-level target subdirectory, it creates a second-level target subdirectory with a namespace working directory attribute set to true based on the user under the corresponding tenant. The second-level target subdirectory is only visible and accessible to the corresponding user to achieve resource isolation between different users. Users can arbitrarily create subdirectories with ordinary directory attributes set to true under the corresponding second-level target subdirectory for file management indexing.

[0016] The normal mode execution module includes: in the normal mode, creating a second target root directory with the tenant root directory attribute set to false as the root directory of the distributed file system, and arbitrarily creating subdirectories with the normal directory attribute set to true under the second target root directory for implementing file management index.

[0017] Furthermore, the multi-tenant mode execution module includes a QoS configuration unit and a resource configuration unit. The QoS configuration unit configures QoS for each target first-level subdirectory and / or target second-level subdirectory based on the directory's QoS characteristics. The configured QoS parameters include: total bandwidth, read bandwidth, write bandwidth, total OPS, read OPS, and write OPS for each target first-level subdirectory and target second-level subdirectory; enabling bandwidth resource allocation among different tenants and users. The resource configuration unit sets quotas for each target first-level subdirectory and / or target second-level subdirectory based on the directory's quota characteristics. The configured quota parameters include: maximum space usage for each target first-level subdirectory and / or maximum space usage for each target second-level subdirectory; enabling storage resource allocation among different tenants and users.

[0018] Thirdly, the present invention provides an apparatus for implementing multi-tenancy based on directory partitioning, comprising at least two storage nodes. Each storage node includes at least one processing unit, a storage unit, a bus unit, and an interface unit. The bus unit connects the processing unit, the storage unit, and the interface unit. The interface units between different storage nodes are connected via a network. The storage unit stores a computer program, and the processing unit executes the computer program to implement the multi-tenancy implementation method based on directory partitioning.

[0019] Fourthly, the present invention provides a storage medium for implementing a multi-tenant implementation method based on directory partitioning, the storage medium storing a computer program that, when executed by a processor, implements the multi-tenant implementation method based on directory partitioning.

[0020] The technical solutions provided in the embodiments of the present invention have the following advantages compared with the prior art:

[0021] In this invention, under the multi-tenant mode, a first target root directory with the tenant root directory attribute set to true is created. Based on the distributed file system tenant, a corresponding first-level target subdirectory with the tenant working directory attribute set to true is created under the first target root directory. This first-level target subdirectory is only visible and accessible to the corresponding tenant to achieve resource isolation between different tenants. Under the first-level target subdirectory, a second-level target subdirectory with the namespace working directory attribute set to true is created based on the user under the corresponding tenant. This second-level target subdirectory is only visible and accessible to the corresponding user to achieve resource isolation between different users. Users can arbitrarily create ordinary directory subdirectories with the ordinary directory attribute set to true under the corresponding second-level target subdirectory for file management indexing. For file services, directory partitioning of the file system directory is used to isolate resources between tenants and users to meet the needs of multi-tenancy and multi-user operations. Simultaneously, the directory characteristics of the file system directory are reused to implement QoS configuration and resource quotas, meeting different business needs and achieving fine-grained performance and resource constraints. Multi-tenancy is integrated with the file system service, avoiding additional overhead. In the normal mode, a second target root directory with the tenant root directory attribute set to false is created as the root directory of the distributed file system. Subdirectories with the normal directory attribute set to true can be arbitrarily created under the second target root directory to implement file management indexing; compatible with both multi-tenant mode and normal mode. Attached Figure Description

[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

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

[0024] Figure 1 A flowchart illustrating a method for implementing multi-tenancy based on directory partitioning, provided in an embodiment of the present invention;

[0025] Figure 2 This is a schematic diagram of a directory partition in a multi-tenant mode provided in an embodiment of the present invention;

[0026] Figure 3 A flowchart of a multi-tenant mode directory partitioning provided in an embodiment of the present invention;

[0027] Figure 4 A schematic diagram of a directory partition in a normal mode provided in an embodiment of the present invention;

[0028] Figure 5A flowchart of a directory partitioning process in a normal mode provided in an embodiment of the present invention;

[0029] Figure 6 A schematic diagram of a system for implementing multi-tenancy based on directory partitioning, provided as an embodiment of the present invention;

[0030] Figure 7 This is a schematic diagram of a device for implementing multi-tenancy based on directory partitioning, provided as an embodiment of the present invention. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0032] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0033] Example 1

[0034] See Figure 1 As shown, this invention provides a method for implementing multi-tenancy based on directory partitioning, offering a multi-tenant mode suitable for multi-tenancy or a normal mode suitable for single-tenancy, including:

[0035] S100, add a directory type metadata attribute to the file system directory of the distributed file system. The directory type metadata attribute is used to distinguish the type of the file system directory so as to implement multi-tenant mode or single-tenant mode based on the directory partition of different types of file system directories.

[0036] Specifically, the directory type metadata attributes include: the ordinary directory attribute, the tenant root directory attribute, the tenant working directory attribute, and the namespace working directory attribute, and the attribute value of the directory type metadata attribute is of Boolean type.

[0037] Of the specified attributes—ordinary directory, tenant root directory, tenant working directory, and namespace working directory—a true value for only the ordinary directory attribute indicates that the file system directory is an ordinary directory used for storing files. A true value for only the tenant root directory attribute indicates that the file system directory is the first target root directory visible and accessible only to the management interface resource account or super administrator in multi-tenant mode. A true value for only the tenant working directory attribute indicates that the file system directory is a target first-level subdirectory visible and accessible only to tenants in multi-tenant mode. A true value for only the namespace working directory attribute indicates that the file system directory is a target second-level subdirectory visible and accessible only to users within the tenant in multi-tenant mode. The target first-level subdirectory acts as the root directory for the tenant and is visible, accessible, and operable only to the corresponding tenant. The target second-level subdirectory acts as the root directory for the user and is visible and accessible only to the corresponding user. A false value for all attributes—ordinary directory, tenant root directory, tenant working directory, and namespace working directory—indicates that the file system directory is the second target root directory in ordinary mode.

[0038] In step S200, when deploying the distributed file system of the cluster, a prompt appears asking whether to enable multi-tenant mode. If enabled, proceed to step S300; otherwise, proceed to step S400. Specifically, the management software deploying the distributed file system provides a selection box for choosing whether to enable multi-tenant mode. If multi-tenant mode is enabled via this selection box, the "Client Multi-tenant Namespace" configuration item in the configuration file, which determines whether multi-tenant mode is enabled, is set to 1; otherwise, it is set to 0. The system detects whether multi-tenant mode is enabled when the "Client Multi-tenant Namespace" configuration item in the configuration file is 1, and whether normal mode is enabled when it is 0.

[0039] S300, enter the multi-tenant mode.

[0040] In the specific implementation process, refer to Figure 2 and Figure 3 As shown, the directory partitioning method in the multi-tenant mode is as follows:

[0041] S301, After entering multi-tenant mode, create the first target root directory with the tenant root directory attribute set to true;

[0042] S302, obtain the tenants registered in the distributed file system, and create corresponding target first-level subdirectories under the first target root directory according to the distributed file system tenants. The tenant working directory attribute of the target first-level subdirectories is true. Specifically, in addition to creating target first-level subdirectories for the registered tenants in the distributed file system, a default target first-level subdirectory is created for the default tenant in the distributed file system. The target first-level subdirectories are only visible and accessible to the corresponding tenants to achieve resource isolation between different tenants.

[0043] S303, obtain the registered users within the tenant, and create a target second-level subdirectory with the namespace working directory attribute set to true under the target first-level subdirectory based on the users under the corresponding tenant; the target second-level subdirectory is only visible and accessible to the corresponding users.

[0044] S304, Users can arbitrarily create subdirectories with the normal directory attribute set to true under the corresponding target second-level subdirectory to implement file management indexing.

[0045] As a preferred implementation, the characteristics of the file system directory are reused to implement QoS configuration and resource quotas, enabling QoS configuration and resource quotas with fine-grained hierarchical structure to meet the business needs of different tenant users.

[0046] Specifically, the QoS features of the file system directory are reused to implement QoS configuration in multi-tenant mode: A preset QoS configuration strategy, based on the directory's QoS features, configures QoS for each target first-level subdirectory and / or target second-level subdirectory. The configured QoS parameters include: total bandwidth, read bandwidth, write bandwidth, total OPS, read OPS, and write OPS for each target first-level and target second-level subdirectory; this enables bandwidth resource allocation among different tenants and users. The QoS configuration strategy includes, but is not limited to: configuring QoS parameters based on the tenant user's activity level and / or priority; higher activity or priority results in larger QoS parameter values. The QoS configuration strategy is a mature existing technology and will not be elaborated upon here. Only the existing QoS configuration strategy is modified to configure the QoS parameters generated by the QoS configuration strategy in the QoS features of different directories in multi-tenant mode.

[0047] Specifically, the quota feature of the file system directory is reused to implement resource quota settings in multi-tenant mode: the preset resource configuration interface is based on the quota feature of the directory to set quotas for each of the target first-level subdirectories and / or the target second-level subdirectories. The configured quota parameters include: the maximum space usage of each target first-level subdirectory and / or the maximum space usage of each target second-level subdirectory; to realize the allocation of storage resources among different tenants and users.

[0048] In a preferred implementation, under the multi-tenant mode, directory resources are displayed according to a first directory resource display method. This first directory resource display method involves: for any tenant, displaying the directory resources of the target first-level subdirectory and its subsequent hierarchical directories corresponding to that tenant; for any user, displaying the directory resources of the target second-level subdirectory and its subsequent hierarchical directories corresponding to that user, thereby achieving resource isolation between tenants and between users under a tenant. For management interface resource accounts or super administrators, only the target first-level subdirectories at the target first-level subdirectory level are displayed, and the directory resources within each directory within the target first-level subdirectories cannot be accessed, thus achieving data protection.

[0049] S400, enter the normal mode.

[0050] In the specific implementation process, please refer to Figure 4 and Figure 5 As shown, the directory partitioning method in the normal mode is as follows:

[0051] In the normal mode, a second target root directory with a false tenant root directory attribute is created as the root directory of the distributed file system. Any subdirectories with a true ordinary directory attribute can be created under the second target root directory to implement file management indexing. In the normal mode, directory resources are displayed according to the second directory resource display method, which is to display the directory resources of the second target root directory and its subsequent hierarchical directories.

[0052] Example 2

[0053] See Figure 6 As shown, this embodiment of the invention provides a system for implementing multi-tenancy based on directory partitioning, including:

[0054] The metadata attribute construction module constructs directory type metadata attributes, including: ordinary directory attributes, tenant root directory attributes, tenant working directory attributes, and namespace working directory attributes.

[0055] The tenant user maintenance module is used to maintain all tenants of the distributed file system and the users under each tenant.

[0056] The selection module is used to prompt whether to enable multi-tenant mode when the distributed file system of the cluster is deployed. If the multi-tenant mode is enabled, the multi-tenant mode is implemented through the multi-tenant mode execution module. If the multi-tenant mode is disabled, the normal mode is implemented through the normal mode execution module.

[0057] A multi-tenant mode execution module, which is used to implement multi-tenant mode, includes: a multi-tenant directory partition creation unit, a QoS configuration unit, and a resource configuration unit.

[0058] The multi-tenant directory partitioning creation unit, in the multi-tenant mode, creates a first target root directory with the tenant root directory attribute set to true. Based on the distributed file system tenant, it creates a corresponding first-level target subdirectory with the tenant working directory attribute set to true under the first target root directory. This first-level target subdirectory is only visible and accessible to the corresponding tenant to achieve resource isolation between different tenants. Under the first-level target subdirectory, it creates a second-level target subdirectory with the namespace working directory attribute set to true based on the user under the corresponding tenant. This second-level target subdirectory is only visible and accessible to the corresponding user to achieve resource isolation between different users. Users can arbitrarily create ordinary directory subdirectories with the ordinary directory attribute set to true under the corresponding second-level target subdirectory for file management indexing. Directory resources are displayed according to the first directory resource display method.

[0059] The QoS configuration unit configures QoS for each target first-level subdirectory and / or target second-level subdirectory based on the QoS characteristics of the directory. The configured QoS parameters include: total bandwidth, read bandwidth, write bandwidth, total OPS, read OPS, and write OPS for each target first-level subdirectory and target second-level subdirectory; thereby realizing the allocation of bandwidth resources among different tenants and users.

[0060] The resource allocation unit sets quotas for each target first-level subdirectory and / or target second-level subdirectory based on the quota characteristics of the directory. The configured quota parameters include the maximum space usage of each target first-level subdirectory and / or the maximum space usage of each target second-level subdirectory, thereby realizing the allocation of storage resources among different tenants and users.

[0061] The normal mode execution module includes: in the normal mode, creating a second target root directory with the tenant root directory attribute set to false as the root directory of the distributed file system, and arbitrarily creating subdirectories with the normal directory attribute set to true under the second target root directory for implementing file management index.

[0062] Example 3

[0063] See Figure 7 As shown, this embodiment of the invention provides an apparatus for implementing multi-tenancy based on directory partitioning, including at least two storage nodes. Each storage node includes at least one processing unit, a storage unit, a bus unit, and an interface unit. The bus unit connects the processing unit, the storage unit, and the interface unit. The interface units between different storage nodes are connected via a network. The storage unit stores a computer program, and the processing unit executes the computer program to implement the multi-tenancy implementation method based on directory partitioning.

[0064] Example 4

[0065] This invention provides a storage medium for implementing a directory-partition-based multi-tenant implementation method. Through the above description of the implementation methods, those skilled in the art will clearly understand that this invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, can be embodied in the form of a computer program. This computer program can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk. When the computer program is executed by a processor, it implements the directory-partition-based multi-tenant implementation method.

[0066] In the embodiments provided by this invention, it should be understood that the disclosed structures and methods can be implemented in other ways. For example, the structural embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, structures, or units, and may be electrical, mechanical, or other forms.

[0067] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0068] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0069] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for implementing multi-tenancy based on directory partitioning, characterized in that, Provides a multi-tenant mode suitable for multiple tenants or a normal mode suitable for single tenants, including: Add a directory type metadata attribute to the file system directory of the distributed file system. The directory type metadata attribute is used to distinguish the type of the file system directory. The directory type metadata attribute includes: ordinary directory attribute, tenant root directory attribute, tenant working directory attribute and namespace working directory attribute. The attribute value of the directory type metadata attribute is of boolean type. Of the specified attributes—ordinary directory, tenant root directory, tenant working directory, and namespace working directory—only the ordinary directory attribute being true indicates that the file system directory is an ordinary directory used for storing files. Only the tenant root directory attribute being true indicates that the file system directory is a first target root directory visible and accessible only to the management interface resource account or super administrator in multi-tenant mode. Only the tenant working directory attribute being true indicates that the file system directory is a target first-level subdirectory visible and accessible only to tenants in multi-tenant mode. Only the namespace working directory attribute being true indicates that the file system directory is a target second-level subdirectory visible and accessible only to users within the tenant in multi-tenant mode. The target first-level subdirectory acts as a root directory for the tenant, visible, accessible, and operable only to the corresponding tenant. The target second-level subdirectory acts as a root directory for the user, visible and accessible only to the corresponding user. All three attributes—ordinary directory, tenant root directory, tenant working directory, and namespace working directory—being false indicate that the file system directory is a second target root directory in ordinary mode. When starting to deploy the distributed file system of the cluster, you are prompted to choose whether to enable the multi-tenant mode. If you choose to enable it, you will enter the multi-tenant mode. If you choose not to enable it, you will enter the normal mode. In the normal mode, a second target root directory with the tenant root directory attribute of false is created as the root directory of the distributed file system. Any subdirectories with the normal directory attribute of true can be created under the second target root directory to implement file management index. In the multi-tenant mode, a first target root directory with the tenant root directory attribute set to true is created. Based on the distributed file system tenant, a corresponding first-level target subdirectory with the tenant working directory attribute set to true is created under the first target root directory. This first-level target subdirectory is only visible and accessible to the corresponding tenant to achieve resource isolation between different tenants. Under the first-level target subdirectory, a second-level target subdirectory with the namespace working directory attribute set to true is created based on the user under the corresponding tenant. This second-level target subdirectory is only visible and accessible to the corresponding user to achieve resource isolation between different users. Users can arbitrarily create subdirectories with the ordinary directory attribute set to true under the corresponding second-level target subdirectory for file management indexing. The directory characteristics of the file system directory are reused to implement QoS configuration and resource quotas, meeting different business needs and achieving fine-grained performance and resource constraints.

2. The method for implementing multi-tenancy based on directory partitioning according to claim 1, characterized in that, In the multi-tenant mode, the preset QoS configuration policy is based on the QoS characteristics of the directory and performs QoS configuration on each of the target first-level subdirectories and / or the target second-level subdirectories. The configured QoS parameters include: the total bandwidth, read bandwidth, write bandwidth, total OPS, read OPS and write OPS of each of the target first-level subdirectories and the target second-level subdirectories; to realize the allocation of bandwidth resources among different tenants and users.

3. The method for implementing multi-tenancy based on directory partitioning according to claim 1, characterized in that, In the multi-tenant mode, the preset resource configuration interface sets quotas for each target first-level subdirectory and / or target second-level subdirectory based on the quota characteristics of the directory. The configured quota parameters include: the maximum space usage of each target first-level subdirectory and / or the maximum space usage of each target second-level subdirectory; thereby realizing the allocation of storage resources among different tenants and users.

4. The method for implementing multi-tenancy based on directory partitioning according to claim 1, characterized in that, In the multi-tenant mode, directory resources are displayed according to the first directory resource display method, which is as follows: for any tenant, the directory resources of the target first-level subdirectory and its subsequent hierarchical directories corresponding to that tenant are displayed; for any user, the directory resources of the target second-level subdirectory and its subsequent hierarchical directories corresponding to that user are displayed; for management interface resource accounts or super administrators, only each target first-level subdirectory at the target first-level subdirectory level is displayed. In the normal mode, directory resources are displayed in the second directory resource display method, which is to display the second target root directory created in the normal mode and its subsequent hierarchical directories and directory resources.

5. A system for implementing multi-tenancy based on directory partitioning, characterized in that, include: The metadata attribute construction module, which constructs the file system directory for the distributed file system, includes directory type metadata attributes such as ordinary directory attributes, tenant root directory attributes, tenant working directory attributes, and namespace working directory attributes. The attribute values ​​of these directory type metadata attributes are Boolean. Among the ordinary directory attribute, the tenant root directory attribute, the tenant working directory attribute, and the namespace working directory attribute, a true value for only the ordinary directory attribute indicates that the file system directory is an ordinary directory used for storing files. A true value for only the tenant root directory attribute indicates that the file system directory is the first target root directory that is visible and accessible only to the management interface resource account or super administrator in multi-tenant mode. A true value for the "Tenant-only working directory" attribute indicates that the file system directory is a target first-level subdirectory that is only visible and accessible to tenants in multi-tenant mode. A true value for the "Namespace-only working directory" attribute indicates that the file system directory is a target second-level subdirectory that is only visible and accessible to users within the tenant in multi-tenant mode. The target first-level subdirectory acts as the root directory for the tenant and is only visible, accessible, and operable to the corresponding tenant. The target second-level subdirectory acts as the root directory for the user and is only visible and accessible to the corresponding user. When the "normal directory" attribute, the "tenant root directory" attribute, the "tenant working directory" attribute, and the "namespace working directory" attribute are all false, it indicates that the file system directory is the second target root directory in normal mode. The tenant user maintenance module is used to maintain all tenants of the distributed file system and maintain user information under each tenant. A multi-tenant mode execution module includes a multi-tenant directory partitioning creation unit. In the multi-tenant mode, this unit creates a first target root directory with a tenant root directory attribute set to true. Based on the distributed file system tenant, it creates a corresponding first-level target subdirectory with a tenant working directory attribute set to true under the first target root directory. This first-level target subdirectory is only visible and accessible to the corresponding tenant to achieve resource isolation between different tenants. Under the first-level target subdirectory, it creates a second-level target subdirectory with a namespace working directory attribute set to true based on the user under the corresponding tenant. This second-level target subdirectory is only visible and accessible to the corresponding user to achieve resource isolation between different users. Users can arbitrarily create ordinary directory subdirectories with a true attribute under the corresponding second-level target subdirectory for file management indexing. The module reuses the directory characteristics of the file system directory to implement QoS configuration and resource quotas, meeting different business needs and achieving fine-grained performance and resource constraints. The normal mode execution module includes: in the normal mode, creating a second target root directory with the tenant root directory attribute set to false as the root directory of the distributed file system, and arbitrarily creating subdirectories with the normal directory attribute set to true under the second target root directory for implementing file management index.

6. The system for implementing multi-tenancy based on directory partitioning according to claim 5, characterized in that, The multi-tenant mode execution module includes a QoS configuration unit and a resource configuration unit. The QoS configuration unit configures QoS for each target first-level subdirectory and / or target second-level subdirectory based on the directory's QoS characteristics. The configured QoS parameters include: total bandwidth, read bandwidth, write bandwidth, total OPS, read OPS, and write OPS for each target first-level subdirectory and target second-level subdirectory; enabling bandwidth resource allocation among different tenants and users. The resource configuration unit sets quotas for each target first-level subdirectory and / or target second-level subdirectory based on the directory's quota characteristics. The configured quota parameters include: maximum space usage for each target first-level subdirectory and / or maximum space usage for each target second-level subdirectory; enabling storage resource allocation among different tenants and users.

7. An apparatus for implementing multi-tenancy based on directory partitioning, comprising at least two storage nodes, characterized in that, The storage node includes at least one processing unit, a storage unit, a bus unit, and an interface unit. The bus unit connects the processing unit, the storage unit, and the interface unit. The interface units between different storage nodes are connected via a network. The storage unit stores a computer program. The processing unit executes the computer program to implement the multi-tenant method based on directory partitioning as described in any one of claims 1-4.

8. A storage medium for implementing a multi-tenant implementation method based on directory partitioning, the storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for multi-tenancy based on directory partitioning as described in any one of claims 1-4.