Namespace processing method and device

By virtualizing the namespace into a directory structure, the problem of unified namespace interaction requirements in container application scenarios is solved, and the client dynamic management of file system is realized, which improves management efficiency.

CN113312311BActive Publication Date: 2025-02-28ALIBABA GROUP HOLDING LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010734200.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-27
Publication Date
2025-02-28
Estimated Expiration
2040-07-27

AI Technical Summary

Technical Problem

The configuration table-based approach in the prior art cannot meet the interaction requirements of unified namespaces in container application scenarios, especially in the dynamic creation and deletion of sub-file systems.

Method used

By determining that the client creates and mounts the namespace and virtualizes the namespace into a directory structure in the container application scenario, the client can access the file system through the directory structure. Get the directory level and target operations to be executed in the directory structure of the target object to be controlled, and control the target objects to be executed according to the directory level.

Benefits of technology

It supports client dynamic creation and deletion of file systems in container application scenarios, meets the interaction requirements of unified namespaces, provides an interaction method based on native posix interfaces, and improves operation and maintenance management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113312311B_ABST
    Figure CN113312311B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for processing a namespace. The method includes: determining that a client creates and mounts a namespace, wherein the namespace includes at least one file system; virtualizing the namespace into a directory structure so that the client can access the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; obtaining the directory level of the target object to be controlled in the directory structure and the target operation to be performed; controlling the target object to perform the target operation according to the directory level. The present application solves the technical problem that the configuration table-based method in the prior art cannot meet the interaction requirements of a unified namespace in a container application scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for processing a namespace. Background Art

[0002] In the prior art, a network attached storage system mainly implements a unified namespace based on a configuration table, so as to export multiple file systems using a single mount domain name.

[0003] However, this traditional configuration table-based method requires manual configuration on the management page. Although the file system can be synchronized to the client using heartbeat-based methods, the client cannot freely and dynamically create and delete sub-file systems. That is, the traditional configuration table-based method is not convenient to use in actual usage scenarios, and the business may need to be modified for adaptation, which greatly limits the scope of use.

[0004] Especially for scenarios like container applications, it is necessary to dynamically create a working directory for tenants at startup according to the configuration, and delete the directory when the container exits. When migrating to a unified namespace, the tenant's working directory corresponds to an independent file system, so it is necessary to support the client's dynamic creation and deletion of file systems under the namespace. However, the traditional configuration table-based approach obviously cannot meet this requirement.

[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0006] The embodiments of the present application provide a method and device for processing a namespace, so as to at least solve the technical problem that the configuration table-based method in the prior art cannot meet the interaction requirements of a unified namespace in a container application scenario.

[0007] According to one aspect of an embodiment of the present application, a method for processing a namespace is provided, including: determining that a client creates and mounts a namespace, wherein the namespace includes at least one file system; in a container application scenario, virtualizing the namespace into a directory structure so that the client can access the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple levels of subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; obtaining the directory hierarchy of the target object to be controlled in the directory structure and the target operation to be performed; and controlling the target object to perform the target operation according to the directory hierarchy.

[0008] According to another aspect of an embodiment of the present application, a method for processing a namespace is also provided, including: creating a namespace and mounting the namespace to a client, so that the server virtualizes the namespace into a directory structure in a container application scenario, wherein the namespace includes at least one file system, and the directory structure includes: a root directory and multiple subdirectories, the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; based on the directory structure, a control command is sent to the server, so that the server obtains the directory hierarchy of the target object to be controlled in the directory structure and the target operation to be performed according to the control command, and controls the target object to perform the target operation according to the directory hierarchy.

[0009] According to another aspect of an embodiment of the present application, a namespace processing device is also provided, including: a determination module, used to determine that a client creates and mounts a namespace, wherein the namespace includes at least one file system; an access module, used to virtualize the namespace into a directory structure in a container application scenario, so that the client can access the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple levels of subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; an acquisition module, used to obtain the directory hierarchy of the target object to be controlled in the directory structure and the target operation to be performed; and a control module, used to control the target object to perform the target operation according to the directory hierarchy.

[0010] According to another aspect of an embodiment of the present application, a namespace processing device is also provided, including: a creation module, used to create a namespace and mount the above namespace to a client, so that the server can virtualize the above namespace into a directory structure in a container application scenario, wherein the above namespace includes at least one file system, and the above directory structure includes: a root directory and multiple levels of subdirectories, the above namespace is virtualized into the above root directory, and the above at least one file system is virtualized into a first-level subdirectory; a processing module, used to send a control command to the above server based on the above directory structure, so that the above server obtains the directory hierarchy of the target object to be controlled in the above directory structure and the target operation to be performed according to the above control command, and controls the above target object to perform the above target operation according to the above directory hierarchy.

[0011] According to another aspect of an embodiment of the present application, a storage medium is further provided, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute any one of the above-mentioned namespace processing methods.

[0012] According to another aspect of an embodiment of the present application, a computing device is also provided, including: a processor; and a memory, connected to the above-mentioned processor, for providing the above-mentioned processor with instructions for processing the following processing steps: determining that a client creates and mounts a namespace, wherein the above-mentioned namespace includes at least one file system; in a container application scenario, virtualizing the above-mentioned namespace into a directory structure so that the above-mentioned client accesses the above-mentioned at least one file system through the above-mentioned directory structure, wherein the above-mentioned directory structure includes: a root directory and multiple levels of subdirectories, wherein the above-mentioned namespace is virtualized into the above-mentioned root directory, and the above-mentioned at least one file system is virtualized into a first-level subdirectory; obtaining the directory hierarchy of the target object to be controlled in the above-mentioned directory structure and the target operation to be performed; and controlling the above-mentioned target object to perform the above-mentioned target operation according to the above-mentioned directory hierarchy.

[0013] In an embodiment of the present application, it is determined that a client creates and mounts a namespace, wherein the namespace includes at least one file system; in a container application scenario, the namespace is virtualized into a directory structure so that the client can access the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; the directory hierarchy of the target object to be controlled in the directory structure and the target operation to be performed are obtained; and the target object is controlled to perform the target operation according to the directory hierarchy.

[0014] It is easy to notice that in the container application scenario, the embodiment of the present application virtualizes the namespace into a directory structure, wherein the first-level subdirectory is at least one sub-file system of the namespace. Therefore, the namespace can be presented to the client in the form of a directory structure, so that the above-mentioned client can access the above-mentioned at least one file system through the above-mentioned directory structure, and by obtaining the directory hierarchy of the target object to be controlled in the above-mentioned directory structure and the target operation to be performed, it is possible to control the above-mentioned target object to perform the above-mentioned target operation according to the above-mentioned directory hierarchy. If the target operation is for the first-level subdirectory of the directory structure in the namespace, it is a file system operation; otherwise, it is a real file / directory operation under the file system.

[0015] Therefore, the embodiment of the present application achieves the purpose of meeting the interaction requirements of the unified namespace in the container application scenario, thereby realizing the technical effect of the client operating the file system under the unified namespace based on the interaction method of the native POSIX interface, and further solving the technical problem that the configuration table-based method in the prior art cannot meet the interaction requirements of the unified namespace in the container application scenario. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0017] Figure 1 It is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a namespace processing method according to an embodiment of the present application;

[0018] Figure 2 is a flowchart of a method for processing a namespace according to an embodiment of the present application;

[0019] Figure 3 is a scenario diagram of an optional namespace processing method according to an embodiment of the present application;

[0020] Figure 4 is a scenario diagram of another optional namespace processing method according to an embodiment of the present application;

[0021] Figure 5 is a scenario diagram of another optional namespace processing method according to an embodiment of the present application;

[0022] Figure 6 is a scenario diagram of another optional namespace processing method according to an embodiment of the present application;

[0023] Figure 7 is a flowchart of another method for processing a namespace according to an embodiment of the present application;

[0024] Figure 8 is a structural schematic diagram of a namespace processing device according to an embodiment of the present application;

[0025] Fig. 9 is a structural schematic diagram of another namespace processing device according to an embodiment of the present application;

[0026] Fig.10 is a schematic diagram of the structure of a computing device according to an embodiment of the present application;

[0027] Fig.11 It is a structural block diagram of another computer terminal according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:

[0031] Network Attached Storage (NAS) is a technology that integrates distributed, independent data into a large, centrally managed data center to facilitate access to different hosts and application servers.

[0032] Unified namespace: It is a function of NAS that can merge multiple file systems into a unified mount domain name, also called a single namespace.

[0033] Portable Operating System Interface of UNIX (Posix interface): It is a general term for a series of interrelated standards that define APIs for running software on various UNIX operating systems.

[0034] Home Directory: It is created for each user account added to the Internet. It can provide users with a place to create subdirectories, store files, and install personal applications. It is the system user's home directory, or the user's working directory. Each user is independent of each other.

[0035] Example 1

[0036] According to an embodiment of the present application, an embodiment of a method for processing a namespace is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0037] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a namespace processing method is shown. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0038] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0039] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the namespace processing method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned namespace processing method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0040] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0041] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0042] Under the above operating environment, this application provides Figure 2 A method of processing namespaces is shown in Figure 2 is a flowchart of a method for processing a namespace according to an embodiment of the present application, such as Figure 2 As shown, the method for processing the above namespace includes:

[0043] Step S202, determining that the client creates and mounts a namespace, wherein the namespace includes at least one file system;

[0044] Step S204, in a container application scenario, virtualizing the namespace into a directory structure, so that the client can access the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory;

[0045] Step S206, obtaining the directory level of the target object to be controlled in the above directory structure and the target operation to be performed;

[0046] Step S208: controlling the target object to perform the target operation according to the directory hierarchy.

[0047] In an embodiment of the present application, it is determined that a client creates and mounts a namespace, wherein the namespace includes at least one file system; in a container application scenario, the namespace is virtualized into a directory structure so that the client can access the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; the directory hierarchy of the target object to be controlled in the directory structure and the target operation to be performed are obtained; and the target object is controlled to perform the target operation according to the directory hierarchy.

[0048] It is easy to notice that in the container application scenario, the embodiment of the present application virtualizes the namespace into a directory structure, wherein the first-level subdirectory is at least one sub-file system of the namespace. Therefore, the namespace can be presented to the client in the form of a directory structure, so that the above-mentioned client can access the above-mentioned at least one file system through the above-mentioned directory structure, and by obtaining the directory hierarchy of the target object to be controlled in the above-mentioned directory structure and the target operation to be performed, it is possible to control the above-mentioned target object to perform the above-mentioned target operation according to the above-mentioned directory hierarchy. If the target operation is for the first-level subdirectory of the directory structure in the namespace, it is a file system operation; otherwise, it is a real file / directory operation under the file system.

[0049] Therefore, the embodiment of the present application achieves the purpose of meeting the interaction requirements of the unified namespace in the container application scenario, thereby realizing the technical effect of the client operating the file system under the unified namespace based on the interaction method of the native POSIX interface, and further solving the technical problem that the configuration table-based method in the prior art cannot meet the interaction requirements of the unified namespace in the container application scenario.

[0050] It should be noted that the executor of the embodiment of the present application is the server. In the container application scenario, the server virtualizes the namespace into a directory structure (for example, a root directory structure), and the first-level subdirectory of the directory structure is at least one sub-file system of the namespace (for example, a unified namespace). It can then determine whether the target operation to be executed is for the sub-file system under the namespace or the real directory under the sub-file system.

[0051] Specifically, in the embodiment of the present application, the namespace and the sub-file system thereunder are virtualized into a root directory structure and a first-level sub-directory, respectively, and presented to the client in the form of a directory, so that the client can use the native POSIX interface to operate the sub-file system under the unified namespace, including creating, deleting, traversing, and renaming the sub-file system, providing a more friendly interaction method for the application. In addition, the directory structure of the embodiment of the present application is used in the same way as an ordinary directory, so that it can be seamlessly adapted to the upper-level application.

[0052] As an optional embodiment, combined with the multi-tenant capability, the client can create an independent unified namespace for each business application and use each subdirectory as the tenant's working directory. Specifically, first create a namespace and a mount point on the client, and then mount it on the client, so that the client can operate the sub-file system under the unified namespace like operating a normal directory.

[0053] For example, taking container applications as an example, the client can create a file system for each tenant, mapped in the unified namespace as the tenant's private home directory. Through the mapping function of the posix interface supported by the embodiment of the present application, the client can operate the file system under the unified namespace through the native posix interface (and the corresponding shell command), so as to achieve seamless use of the unified namespace just like using an ordinary directory, so that the implementation process of the embodiment of the present application is no different from the use of an ordinary directory, and no special configuration is required, which can greatly improve the operation and maintenance management efficiency of the client.

[0054] It should be noted that the namespace processing method provided in the embodiment of the present application breaks through the traditional use of the unified namespace based on the mount table. In the container application scenario, it provides a unified namespace and the sub-file systems under the unified namespace to be virtualized into a root directory structure and a first-level sub-directory, respectively, and presents them to the client in the form of a directory. Therefore, the client can use the native POSIX interface to operate the sub-file system under the unified namespace.

[0055] As an optional embodiment, the virtual directory abstraction of the namespace is proposed in the embodiment of the present application, the target operation to be executed in the namespace is abstracted as a posix interface, and the target operation to be executed is connected to the posix interface. Optionally, the main four posix interfaces in the embodiment of the present application are as follows:

[0056] 1) mkdir interface, which is the native mkdir posix interface of the NAS file system, and the corresponding shell command is the mkdir command; 2) rmdir interface, which is the native rmdir posix interface of the NAS file system, and the corresponding shell command is the rmdir / rm command; 3) readdir interface, which is the native readdir posix interface of the NAS file system, and the corresponding shell command is the ls command; 4) rename interface, which is the native mkdir posix interface of the NAS file system, and the corresponding shell command is the mv command.

[0057] Therefore, the client can dynamically create, delete, traverse, and rename the file system through shell commands or by directly calling the posix operation interface through the program, just like operating a normal directory. The embodiment of the present application provides a more user-friendly operation mode for the application by mapping the native commands of the NAS file system to the management operations of the unified namespace. In addition, the functions involved in the embodiment of the present application are visible to the user, and the interaction mode is perceptible to the user.

[0058] In an optional embodiment, obtaining the directory level of the target object and the target operation includes:

[0059] Step S302, receiving a first control command from the client, wherein the first control command is used to create a new file system in the namespace or a new directory under the current file system, and the current file system is virtualized into the remaining subdirectories of the multi-level subdirectories except the first-level subdirectory;

[0060] Step S304: determining the directory level and the target operation based on the first control command.

[0061] Optionally, the first control command is an NFS protocol command, and specifically the first control command is a mkdir shell command corresponding to the mkdir interface. When the client uses the mkdir interface to create a new file system or a new directory, the client sends the mkdir shell command corresponding to the mkdir interface to the server.

[0062] In the above optional embodiment, the first control command is used to create a new file system in the above namespace or to create a new directory under the current file system, and since the first-level subdirectory in the multi-level subdirectory is a sub-file system, the current file system is virtualized into the remaining hierarchical subdirectories in the above-mentioned multi-level subdirectories except the above-mentioned first-level subdirectory, and then when the server receives the first control command sent by the client, the server determines the directory level and target operation of the above-mentioned target object according to the first control instruction.

[0063] In an optional embodiment, controlling the target object to perform the target operation according to the directory hierarchy includes:

[0064] Step S402, when the directory level is the first-level subdirectory, a new file system is created in the namespace;

[0065] Step S404: when the directory level is not the first-level subdirectory, a new directory is created in the current file system.

[0066] As an optional embodiment, Figure 3 As shown, when the client uses the mkdir interface to create a new file system or a new directory, the client sends the first control command corresponding to the mkdir interface to the server, that is, the NFS server of the NAS system. The NFS server determines whether to create a new file system under the namespace according to the request content. Specifically, when the directory level indicated by the first control command is the above-mentioned first-level subdirectory, a new file system is created in the above-mentioned namespace and the directory name is set; when the directory level indicated by the first control command is not the above-mentioned first-level subdirectory, the current file system information is parsed, and the storage service (storage) is called to create a new directory under the current file system.

[0067] In an optional embodiment, obtaining the directory level of the target object and the target operation includes:

[0068] Step S502, receiving a second control command from the client, wherein the second control command is used to delete a target file system in the namespace or to delete a target directory under the current file system, the current file system being virtualized into the remaining subdirectories of the multi-level subdirectories except the first-level subdirectory;

[0069] Step S504: determine the directory level and the target operation based on the second control command.

[0070] Optionally, the second control command is an NFS protocol command, and specifically the second control command is the rmdir / rm command corresponding to the rmdir interface. As an optional embodiment, when the client uses the rmdir interface to delete the target file system in the above namespace or deletes the target directory under the current file system, the client sends the rmdir / rm command corresponding to the rmdir interface to the server, and then the server determines the above directory hierarchy and the above target operation based on the above rmdir / rm command.

[0071] In an optional embodiment, controlling the target object to perform the target operation according to the directory hierarchy includes:

[0072] Step S602, when the directory level is the first-level subdirectory, deleting the target file system in the namespace;

[0073] Step S604: when the directory level is not the first-level subdirectory, the target directory is deleted in the current file system.

[0074] As an optional embodiment, Figure 4 As shown, when the client uses the rmdir interface to delete the target file system in the above-mentioned namespace or delete the target directory under the current file system, the client sends the rmdir / rm command corresponding to the rmdir interface to the server, that is, the NFS server of the NAS system. The NFS server determines whether to delete the file system under the namespace according to the request content. Specifically, when the directory level indicated by the second control command is the above-mentioned first-level subdirectory, the file system is searched in the above-mentioned namespace and deleted; when the directory level indicated by the second control command is not the above-mentioned first-level subdirectory, the current file system information is parsed, and the storage service storage is called to delete the target directory under the current file system.

[0075] In an optional embodiment, obtaining the directory level of the target object and the target operation includes:

[0076] Step S702, receiving a third control command from the client, wherein the third control command is used to query the created file system in the namespace or query the created directory under the current file system, and the current file system is virtualized into the remaining hierarchical subdirectories in the multi-level subdirectories except the first-level subdirectory;

[0077] Step S704: determine the directory level and the target operation based on the third control command.

[0078] Optionally, the third control command is an NFS protocol command, and specifically the third control command is the ls command corresponding to the readdir interface. As an optional embodiment, when the client uses the readdir interface to query the created file system in the above namespace or queries the created directory under the current file system, the client sends the ls command corresponding to the readdir interface to the server, and then the server determines the above directory hierarchy and the above target operation based on the ls command.

[0079] In an optional embodiment, controlling the target object to perform the target operation according to the directory hierarchy includes:

[0080] Step S802, when the directory level is the first-level subdirectory, query the created file system in the namespace;

[0081] Step S804: when the directory level is not the first-level subdirectory, query the created directory in the current file system.

[0082] As an optional embodiment, Figure 5 As shown, when the client uses the readdir interface to query the created file system in the above namespace or to query the created directory under the current file system, the client sends the ls command corresponding to the readdir interface to the server, that is, the NFS server of the NAS system. The NFS server determines whether to list the file systems under the namespace according to the request content. Specifically, when the directory level indicated by the third control command is the above-mentioned first-level subdirectory, the file system created in the traversal namespace is returned to the client in the form of a directory entry; when the directory level indicated by the third control command is not the above-mentioned first-level subdirectory, the current file system information is parsed, and the storage service storage is called to traverse the created directory under the current file system.

[0083] In an optional embodiment, obtaining the directory level of the target object and the target operation includes:

[0084] Step S902, receiving a fourth control command from the client, wherein the fourth control command is used to rename the source file system to the destination file system when the source file system and the destination file system in the namespace are both located in the first-level subdirectory, or to rename the source directory under the current file system to the destination directory, and the current file system is virtualized into the remaining level subdirectories in the multi-level subdirectories except the first-level subdirectory;

[0085] Step S904: determine the directory level and the target operation based on the fourth control command.

[0086] Optionally, the fourth control command is an NFS protocol command, and specifically the fourth control command is the mv command corresponding to the rename interface. As an optional embodiment, when the client uses the rename interface and the source file system and the destination file system in the namespace are both located in the first-level subdirectory, the source file system is renamed as the destination file system, or the source directory under the current file system is renamed as the destination directory, the client sends the mv command corresponding to the rename interface to the server, and the server determines the directory level and the target operation based on the mv command.

[0087] In an optional embodiment, controlling the target object to perform the target operation according to the directory hierarchy includes:

[0088] Step S1002, when the directory level is the first-level subdirectory, rename the source file system to the destination file system;

[0089] Step S1004: when the directory level is not the first-level subdirectory, rename the source directory under the current file system to the destination directory.

[0090] As an optional embodiment, Figure 6 As shown, when the client uses the rename interface and the source file system and the destination file system in the above-mentioned name space are both located in the above-mentioned first-level subdirectory, the above-mentioned source file system is renamed as the above-mentioned destination file system, or, when the source directory under the current file system is renamed as the destination directory, the client sends the mv command corresponding to the rename interface to the server, that is, the NFS server of the NAS system, and the NFS server determines whether to rename the source file system to the above-mentioned destination file system according to the request content. Specifically, when the directory level indicated by the fourth control command is the above-mentioned first-level subdirectory, and the source file system and the destination file system are in the same-level directory, the above-mentioned source file system is renamed as the above-mentioned destination file system. If the source file system and the destination file system are not in the same-level directory, an error is returned; when the above-mentioned directory level is not the above-mentioned first-level subdirectory, the current file system information is parsed, and the storage service storage is called to rename the source directory under the current file system to the destination directory.

[0091] According to an embodiment of the present application, an embodiment of another method for processing a namespace is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0092] Under the above operating environment, this application provides Figure 7 Another way to handle namespaces is shown in Figure 7 is a flowchart of another method for processing a namespace according to an embodiment of the present application, such as Figure 7 As shown, the method for processing the above namespace includes:

[0093] Step S1102: Create a namespace and mount the namespace to the client, so that the server virtualizes the namespace into a directory structure in a container application scenario, wherein the namespace includes at least one file system, and the directory structure includes: a root directory and multiple subdirectories, the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory;

[0094] Step S1104, sending a control command to the server based on the directory structure, so that the server obtains the directory level of the target object to be controlled in the directory structure and the target operation to be performed according to the control command, and controls the target object to perform the target operation according to the directory level.

[0095] In an embodiment of the present application, a namespace is created and the namespace is mounted to a client, so that the server can virtualize the namespace into a directory structure in a container application scenario, wherein the namespace includes at least one file system, and the directory structure includes: a root directory and multiple sub-directories, the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level sub-directory; a control command is sent to the server based on the directory structure, so that the server obtains the directory level of the target object to be controlled in the directory structure and the target operation to be performed according to the control command, and controls the target object to perform the target operation according to the directory level.

[0096] It is easy to notice that in the container application scenario, the embodiment of the present application virtualizes the namespace into a directory structure through the server, and its first-level subdirectory is at least one sub-file system of the namespace. Therefore, the namespace can be presented to the client in the form of a directory structure, so that the above-mentioned client can access the above-mentioned at least one file system through the above-mentioned directory structure, and by obtaining the directory hierarchy of the target object to be controlled in the above-mentioned directory structure and the target operation to be executed, it is possible to control the above-mentioned target object to perform the above-mentioned target operation according to the above-mentioned directory hierarchy. If the target operation is for the first-level subdirectory of the directory structure in the namespace, it is a file system operation; otherwise, it is a real file / directory operation under the file system.

[0097] Therefore, the embodiment of the present application achieves the purpose of meeting the interaction requirements of the unified namespace in the container application scenario, thereby realizing the technical effect of the client operating the file system under the unified namespace based on the interaction method of the native POSIX interface, and further solving the technical problem that the configuration table-based method in the prior art cannot meet the interaction requirements of the unified namespace in the container application scenario.

[0098] It should be noted that the executor of the embodiment of the present application is the client. In the container application scenario, the client creates a namespace and mounts the namespace to the client so that the server virtualizes the namespace into a directory structure (for example, a root directory structure), and the first-level subdirectory of the directory structure is at least one sub-file system of the namespace (for example, a unified namespace), so as to determine whether the target operation to be executed is for the sub-file system under the namespace or for the real directory under the sub-file system.

[0099] Specifically, in the embodiment of the present application, the namespace and the sub-file system thereunder are virtualized into a root directory structure and a first-level sub-directory, respectively, and presented to the client in the form of a directory, so that the client can use the native POSIX interface to operate the sub-file system under the unified namespace, including creating, deleting, traversing, and renaming the sub-file system, providing a more friendly interaction method for the application. In addition, the directory structure of the embodiment of the present application is used in the same way as an ordinary directory, so that it can be seamlessly adapted to the upper-level application.

[0100] As an optional embodiment, combined with the multi-tenant capability, the client can create an independent unified namespace for each business application and use each subdirectory as the tenant's working directory. Specifically, first create a namespace and a mount point on the client, and then mount it on the client, so that the client can operate the sub-file system under the unified namespace like operating a normal directory.

[0101] For example, taking container applications as an example, the client can create a file system for each tenant, mapped in the unified namespace as the tenant's private home directory. Through the mapping function of the posix interface supported by the embodiment of the present application, the client can operate the file system under the unified namespace through the native posix interface (and the corresponding shell command), so as to achieve seamless use of the unified namespace just like using an ordinary directory, so that the implementation process of the embodiment of the present application is no different from the use of an ordinary directory, and no special configuration is required, which can greatly improve the operation and maintenance management efficiency of the client.

[0102] It should be noted that the namespace processing method provided in the embodiment of the present application breaks through the traditional use of a unified namespace based on a mount table, and provides a unified namespace and a sub-file system under the unified namespace that are virtualized into a root directory structure and a first-level sub-directory, respectively, and presented to the client in the form of a directory, so that the client can use the native POSIX interface to operate the sub-file system under the unified namespace.

[0103] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the above methods of each embodiment of the present application.

[0105] Example 2

[0106] According to an embodiment of the present application, a device embodiment for implementing the above-mentioned namespace processing method is also provided. Figure 8 is a structural diagram of a namespace processing device according to an embodiment of the present application, such as Figure 8 As shown, the device includes: a determination module 80, an access module 82, an acquisition module 84 and a control module 86, wherein:

[0107] A determination module 80 is used to determine whether a client creates and mounts a namespace, wherein the namespace includes at least one file system; an access module 82 is used to virtualize the namespace into a directory structure in a container application scenario, so that the client can access the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; an acquisition module 84 is used to obtain the directory hierarchy of the target object to be controlled in the directory structure and the target operation to be performed; a control module 86 is used to control the target object to perform the target operation according to the directory hierarchy.

[0108] It should be noted that the above-mentioned determination module 80, access module 82, acquisition module 84 and control module 86 correspond to steps S202 to S208 in Example 1, and the examples and application scenarios implemented by the four modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules as part of the device can be run in the computer terminal 10 provided in Example 1.

[0109] According to an embodiment of the present application, another device embodiment for implementing the above-mentioned namespace processing method is also provided. Fig. 9 is a schematic diagram of the structure of another namespace processing device according to an embodiment of the present application, such as Fig. 9 As shown, the device includes: a creation module 90 and a processing module 92, wherein:

[0110] A creation module 90 is used to create a namespace and mount the above namespace to the client, so that the server virtualizes the above namespace into a directory structure, wherein the above namespace includes at least one file system, and the above directory structure includes: a root directory and multiple sub-directories, the above namespace is virtualized into the above root directory, and the above at least one file system is virtualized into a first-level sub-directory; a processing module 92 is used to send a control command to the above server based on the above directory structure, so that the above server obtains the directory hierarchy of the target object to be controlled in the above directory structure and the target operation to be performed according to the above control command, and controls the above target object to perform the above target operation according to the above directory hierarchy.

[0111] It should be noted that the creation module 90 and the processing module 92 correspond to steps S1102 to S1104 in Example 1, and the examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules, as part of the device, can be run in the computer terminal 10 provided in Example 1.

[0112] It should also be noted that the preferred implementation of this embodiment can refer to the relevant description in Example 1, which will not be repeated here.

[0113] Example 3

[0114] According to an embodiment of the present application, an embodiment of a computing device is also provided. The computing device may be any computing device in a computing device group. Fig.10 is a schematic diagram of a computing device according to an embodiment of the present application, such as Fig.10 As shown, the computing device includes: a processor 500 and a memory 502, wherein:

[0115] A processor 500; and a memory 502, connected to the processor 500, for providing instructions for the processor to process the following processing steps: determining that a client creates and mounts a namespace, wherein the namespace includes at least one file system; in a container application scenario, virtualizing the namespace into a directory structure so that the client can access the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple levels of subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; obtaining a directory level of a target object to be controlled in the directory structure and a target operation to be performed; and controlling the target object to perform the target operation according to the directory level.

[0116] In an embodiment of the present application, it is determined that a client creates and mounts a namespace, wherein the namespace includes at least one file system; in a container application scenario, the namespace is virtualized into a directory structure so that the client can access the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; the directory hierarchy of the target object to be controlled in the directory structure and the target operation to be performed are obtained; and the target object is controlled to perform the target operation according to the directory hierarchy.

[0117] It is easy to notice that in the container application scenario, the embodiment of the present application virtualizes the namespace into a directory structure, wherein the first-level subdirectory is at least one sub-file system of the namespace. Therefore, the namespace can be presented to the client in the form of a directory structure, so that the above-mentioned client can access the above-mentioned at least one file system through the above-mentioned directory structure, and by obtaining the directory hierarchy of the target object to be controlled in the above-mentioned directory structure and the target operation to be performed, it is possible to control the above-mentioned target object to perform the above-mentioned target operation according to the above-mentioned directory hierarchy. If the target operation is for the first-level subdirectory of the directory structure in the namespace, it is a file system operation; otherwise, it is a real file / directory operation under the file system.

[0118] Therefore, the embodiment of the present application achieves the purpose of meeting the interaction requirements of the unified namespace in the container application scenario, thereby realizing the technical effect of the client operating the file system under the unified namespace based on the interaction method of the native POSIX interface, and further solving the technical problem that the configuration table-based method in the prior art cannot meet the interaction requirements of the unified namespace in the container application scenario.

[0119] It should also be noted that the preferred implementation of this embodiment can refer to the relevant description in Example 1, which will not be repeated here.

[0120] Example 4

[0121] According to an embodiment of the present application, an embodiment of a computer terminal is also provided, and the computer terminal can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the above-mentioned computer terminal can also be replaced by a terminal device such as a mobile terminal.

[0122] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of the computer network.

[0123] In this embodiment, the computer terminal can execute the following steps of the namespace processing method: determine that the client creates and mounts a namespace, wherein the namespace includes at least one file system; in a container application scenario, virtualize the namespace into a directory structure so that the client can access the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; obtain the directory level of the target object to be controlled in the directory structure and the target operation to be performed; and control the target object to perform the target operation according to the directory level.

[0124] Optionally, Fig.11 is a structural block diagram of another computer terminal according to an embodiment of the present application, such as Fig.11 As shown, the computer terminal may include: one or more (only one is shown in the figure) processors 602 , a memory 604 , and a peripheral interface 606 .

[0125] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the namespace processing method and device in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned namespace processing method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories can be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0126] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: determine that the client creates and mounts a namespace, wherein the namespace includes at least one file system; in a container application scenario, virtualize the namespace into a directory structure so that the client can access the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; obtain the directory hierarchy of the target object to be controlled in the directory structure and the target operation to be performed; and control the target object to perform the target operation according to the directory hierarchy.

[0127] Optionally, the processor may also execute program code for the following steps: receiving a first control command from the client, wherein the first control command is used to create a new file system in the namespace or a new directory under the current file system, and the current file system is virtualized into the remaining hierarchical subdirectories in the multi-level subdirectories except the first-level subdirectory; determining the directory level and the target operation based on the first control command.

[0128] Optionally, the processor may also execute program code of the following steps: when the directory level is the first-level subdirectory, create a new file system in the namespace; when the directory level is not the first-level subdirectory, create a new directory under the current file system.

[0129] Optionally, the processor may also execute program code for the following steps: receiving a second control command from the client, wherein the second control command is used to delete a target file system in the namespace or to delete a target directory under the current file system, and the current file system is virtualized into remaining hierarchical subdirectories in the multi-level subdirectories except the first-level subdirectory; determining the directory level and the target operation based on the second control command.

[0130] Optionally, the processor may also execute program code of the following steps: when the directory level is the first-level subdirectory, deleting the target file system in the namespace; when the directory level is not the first-level subdirectory, deleting the target directory under the current file system.

[0131] Optionally, the processor may also execute the program code of the following steps: receiving a third control command from the client, wherein the third control command is used to query a created file system in the namespace or to query a created directory under the current file system, and the current file system is virtualized into the remaining hierarchical subdirectories in the multi-level subdirectories except the first-level subdirectory; determining the directory level and the target operation based on the third control command.

[0132] Optionally, the processor may also execute program code of the following steps: when the directory level is the first-level subdirectory, query the created file system in the namespace; when the directory level is not the first-level subdirectory, query the created directory under the current file system.

[0133] Optionally, the processor may also execute program code of the following steps: receiving a fourth control command from the client, wherein the fourth control command is used to rename the source file system to the destination file system when the source file system and the destination file system in the namespace are both located in the first-level subdirectory, or to rename the source directory under the current file system to the destination directory, and the current file system is virtualized into the remaining levels of subdirectories in the multi-level subdirectories except the first-level subdirectory; determining the directory level and the target operation based on the fourth control command.

[0134] Optionally, the processor may also execute the following program code: when the directory level is the first-level subdirectory, rename the source file system to the destination file system; when the directory level is not the first-level subdirectory, rename the source directory under the current file system to the destination directory.

[0135] Optionally, the processor may also execute program code for the following steps: creating a namespace and mounting the namespace to the client, so that the server virtualizes the namespace into a directory structure, wherein the namespace includes at least one file system, and the directory structure includes: a root directory and multiple levels of subdirectories, the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; based on the directory structure, a control command is sent to the server, so that the server obtains the directory level of the target object to be controlled in the directory structure and the target operation to be performed according to the control command, and controls the target object to perform the target operation according to the directory level.

[0136] Using the embodiment of the present application, a namespace processing scheme is provided. In the embodiment of the present application, by determining that a client creates and mounts a namespace, wherein the namespace includes at least one file system; in a container application scenario, the namespace is virtualized into a directory structure so that the client can access the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; the directory level of the target object to be controlled in the directory structure and the target operation to be performed are obtained; and the target object is controlled to perform the target operation according to the directory level.

[0137] It is easy to notice that in the container application scenario, the embodiment of the present application virtualizes the namespace into a directory structure, wherein the first-level subdirectory is at least one sub-file system of the namespace. Therefore, the namespace can be presented to the client in the form of a directory structure, so that the above-mentioned client can access the above-mentioned at least one file system through the above-mentioned directory structure, and by obtaining the directory hierarchy of the target object to be controlled in the above-mentioned directory structure and the target operation to be performed, it is possible to control the above-mentioned target object to perform the above-mentioned target operation according to the above-mentioned directory hierarchy. If the target operation is for the first-level subdirectory of the directory structure in the namespace, it is a file system operation; otherwise, it is a real file / directory operation under the file system.

[0138] Therefore, the embodiment of the present application achieves the purpose of meeting the interaction requirements of the unified namespace in the container application scenario, thereby realizing the technical effect of the client operating the file system under the unified namespace based on the interaction method of the native POSIX interface, and further solving the technical problem that the configuration table-based method in the prior art cannot meet the interaction requirements of the unified namespace in the container application scenario.

[0139] It can be understood by those skilled in the art that Fig.11 The structure shown is for illustration only, and the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Fig.11 It does not limit the structure of the above electronic device. For example, the computer terminal may also include Fig.11 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig.11 Different configurations are shown.

[0140] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0141] Example 5

[0142] According to an embodiment of the present application, an embodiment of a storage medium is also provided. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the namespace processing method provided in the above embodiment.

[0143] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0144] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: determining that the client creates and mounts a namespace, wherein the namespace includes at least one file system; in a container application scenario, virtualizing the namespace into a directory structure so that the client can access the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple levels of subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; obtaining the directory hierarchy of the target object to be controlled in the directory structure and the target operation to be performed; and controlling the target object to perform the target operation according to the directory hierarchy.

[0145] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: receiving a first control command from the above-mentioned client, wherein the above-mentioned first control command is used to create a new file system in the above-mentioned namespace or a new directory under the current file system, and the above-mentioned current file system is virtualized into the remaining hierarchical subdirectories in the above-mentioned multi-level subdirectories except the above-mentioned first-level subdirectory; determining the above-mentioned directory level and the above-mentioned target operation based on the above-mentioned first control command.

[0146] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: when the above directory level is the above first-level subdirectory, create a new file system in the above namespace; when the above directory level is not the above-mentioned first-level subdirectory, create a new directory under the current file system.

[0147] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: receiving a second control command from the above-mentioned client, wherein the above-mentioned second control command is used to delete the target file system in the above-mentioned namespace or delete the target directory under the current file system, and the above-mentioned current file system is virtualized into the remaining hierarchical subdirectories in the above-mentioned multi-level subdirectories except the above-mentioned first-level subdirectory; determining the above-mentioned directory level and the above-mentioned target operation based on the above-mentioned second control command.

[0148] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: when the above directory level is the above first-level subdirectory, deleting the target file system in the above namespace; when the above directory level is not the above-mentioned first-level subdirectory, deleting the target directory under the current file system.

[0149] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: receiving a third control command from the above-mentioned client, wherein the above-mentioned third control command is used to query the created file system in the above-mentioned namespace or to query the created directory under the current file system, and the above-mentioned current file system is virtualized into the remaining hierarchical subdirectories in the above-mentioned multi-level subdirectories except the above-mentioned first-level subdirectory; determining the above-mentioned directory level and the above-mentioned target operation based on the above-mentioned third control command.

[0150] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: when the above-mentioned directory level is the above-mentioned first-level subdirectory, query the created file system in the above-mentioned namespace; when the above-mentioned directory level is not the above-mentioned first-level subdirectory, query the created directory under the current file system.

[0151] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: receiving a fourth control command from the client, wherein the fourth control command is used to rename the source file system into the destination file system when the source file system and the destination file system in the namespace are both located in the first-level subdirectory, or to rename the source directory under the current file system into the destination directory, and the current file system is virtualized into the remaining hierarchical subdirectories in the multi-level subdirectories except the first-level subdirectory; determining the directory level and the target operation based on the fourth control command.

[0152] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: when the above-mentioned directory level is the above-mentioned first-level subdirectory, renaming the above-mentioned source file system to the above-mentioned destination file system; when the above-mentioned directory level is not the above-mentioned first-level subdirectory, renaming the source directory under the current file system to the destination directory.

[0153] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: creating a namespace and mounting the namespace to the client, so that the server virtualizes the namespace into a directory structure in a container application scenario, wherein the namespace includes at least one file system, and the directory structure includes: a root directory and multiple subdirectories, the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; sending a control command to the server based on the directory structure, so that the server obtains the directory hierarchy of the target object to be controlled in the directory structure and the target operation to be performed according to the control command, and controls the target object to perform the target operation according to the directory hierarchy.

[0154] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0155] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0156] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

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

[0158] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0159] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0160] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for processing a namespace, comprising: Determine that the client creates and mounts a namespace, wherein the namespace includes at least one file system; In a container application scenario, the namespace is virtualized into a directory structure so that the client accesses the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple levels of subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; Obtaining the directory level of the target object to be controlled in the directory structure and the target operation to be performed; Controlling the target object to perform the target operation according to the directory hierarchy; Among them, controlling the target object to perform the target operation according to the directory hierarchy includes: when the directory hierarchy is the first-level subdirectory, controlling the namespace to perform the target operation; when the directory hierarchy is not the first-level subdirectory, controlling the current file system to perform the target operation.

2. The method according to claim 1, wherein: Acquiring the directory level and the target operation of the target object includes: Receiving a first control command from the client, wherein the first control command is used to create a new file system in the namespace or a new directory under the current file system, and the current file system is virtualized into the remaining hierarchical subdirectories in the multi-level subdirectories except the first-level subdirectory; The directory level and the target operation are determined based on the first control command.

3. The method according to claim 2, wherein: Controlling the target object to perform the target operation according to the directory hierarchy includes: When the directory level is the first-level subdirectory, creating a new file system in the namespace; When the directory level is not the first-level subdirectory, a new directory is created under the current file system.

4. The method according to claim 1, wherein: Acquiring the directory level and the target operation of the target object includes: receiving a second control command from the client, wherein the second control command is used to delete a target file system in the namespace or to delete a target directory under a current file system, wherein the current file system is virtualized into remaining hierarchical subdirectories in the multi-level subdirectories except the first-level subdirectory; The directory level and the target operation are determined based on the second control command.

5. The method according to claim 4, wherein: Controlling the target object to perform the target operation according to the directory hierarchy includes: When the directory level is the first-level subdirectory, deleting the target file system in the namespace; When the directory level is not the first-level subdirectory, the target directory is deleted in the current file system.

6. The method according to claim 1, wherein: Acquiring the directory level and the target operation of the target object includes: receiving a third control command from the client, wherein the third control command is used to query a created file system in the namespace or to query a created directory under the current file system, the current file system being virtualized into remaining hierarchical subdirectories in the multi-level subdirectories except the first-level subdirectory; The directory level and the target operation are determined based on the third control command.

7. The method according to claim 6, wherein: Controlling the target object to perform the target operation according to the directory hierarchy includes: When the directory level is the first-level subdirectory, querying the created file system in the namespace; When the directory level is not the first-level subdirectory, the created directory is queried in the current file system.

8. The method according to claim 1, wherein: Acquiring the directory level and the target operation of the target object includes: receiving a fourth control command from the client, wherein the fourth control command is used to rename the source file system to the destination file system when both the source file system and the destination file system in the namespace are located in the first-level subdirectory, or to rename the source directory under the current file system to the destination directory, and the current file system is virtualized into the remaining level subdirectories in the multi-level subdirectories except the first-level subdirectory; The directory level and the target operation are determined based on the fourth control command.

9. The method according to claim 8, wherein: Controlling the target object to perform the target operation according to the directory hierarchy includes: When the directory level is the first-level subdirectory, renaming the source file system to the destination file system; When the directory level is not the first-level subdirectory, the source directory under the current file system is renamed as the destination directory.

10. A method for processing a namespace, comprising: Create a namespace and mount the namespace to the client, so that the server virtualizes the namespace into a directory structure in a container application scenario, wherein the namespace includes at least one file system, the directory structure includes: a root directory and multiple subdirectories, the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; Sending a control command to the server based on the directory structure, so that the server obtains the directory level of the target object to be controlled in the directory structure and the target operation to be performed according to the control command, and controls the target object to perform the target operation according to the directory level; Among them, controlling the target object to perform the target operation according to the directory hierarchy includes: when the directory hierarchy is the first-level subdirectory, controlling the namespace to perform the target operation; when the directory hierarchy is not the first-level subdirectory, controlling the current file system to perform the target operation.

11. A namespace processing device, comprising: A determination module, used to determine that a client creates and mounts a namespace, wherein the namespace includes at least one file system; an access module, configured to virtualize the namespace into a directory structure in a container application scenario, so that the client can access the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple levels of subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; An acquisition module, used to acquire the directory level of the target object to be controlled in the directory structure and the target operation to be performed; A control module, used for controlling the target object to perform the target operation according to the directory hierarchy; The control module is further used to: when the directory level is the first-level subdirectory, control the namespace to execute the target operation; when the directory level is not the first-level subdirectory, control the current file system to execute the target operation.

12. A namespace processing device, comprising: A creation module, used to create a namespace and mount the namespace to the client, so that the server virtualizes the namespace into a directory structure in a container application scenario, wherein the namespace includes at least one file system, and the directory structure includes: a root directory and multiple subdirectories, the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; a processing module, configured to send a control command to the server based on the directory structure, so that the server obtains the directory level of the target object to be controlled in the directory structure and the target operation to be performed according to the control command, and controls the target object to perform the target operation according to the directory level; The processing module is further used to: when the directory level is the first-level subdirectory, control the namespace to execute the target operation; when the directory level is not the first-level subdirectory, control the current file system to execute the target operation.

13. A storage medium, wherein: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the namespace processing method according to any one of claims 1 to 10.

14. A computing device, wherein: include: processor; as well as A memory, connected to the processor, configured to provide the processor with instructions for processing the following processing steps: Determine that the client creates and mounts a namespace, wherein the namespace includes at least one file system; In a container application scenario, the namespace is virtualized into a directory structure so that the client accesses the at least one file system through the directory structure, wherein the directory structure includes: a root directory and multiple levels of subdirectories, wherein the namespace is virtualized into the root directory, and the at least one file system is virtualized into a first-level subdirectory; Obtaining the directory level of the target object to be controlled in the directory structure and the target operation to be performed; Controlling the target object to perform the target operation according to the directory hierarchy; Among them, controlling the target object to perform the target operation according to the directory hierarchy includes: when the directory hierarchy is the first-level subdirectory, controlling the namespace to perform the target operation; when the directory hierarchy is not the first-level subdirectory, controlling the current file system to perform the target operation.

Citation Information

Patent Citations

  • Method for organizing dummy catalog and managing naming space for distributed file systems

    CN101334785A

  • Application program authority control method and device and electronic device

    CN108985086A