Directory processing method and device in distributed file system

By using the coordinated work of cloud databases and local databases in a distributed file system, analyzing the key-value pairs of the directory tree to obtain node numbers, judging and executing directory operations, the data throughput limitation and consistency in the single-node data service mode is solved. Problem, efficient directory processing is achieved.

CN114817144BActive Publication Date: 2024-12-31ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210311942.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2024-12-31
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

In distributed file systems, as the cluster scale expands, the single-node data service storage model seriously affects data throughput. How to maintain strong consistency in file directory processing operations while ensuring data throughput becomes a challenge.

Method used

By obtaining the processing conditions of the pending directory sent by the cloud database, parse the key-value pairs of subdirectories at each level of the directory tree, obtain the node number, and judge whether the processing conditions are met based on the node number. If so, directory creation, renaming or The attribute update operation is to avoid conflicts and ensure strong consistency of the operation.

Benefits of technology

It effectively avoids conflicts in directory operations, ensures strong consistency in file directory processing in distributed file systems, and improves data throughput, solving the problem of limited data throughput in single-node data service mode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114817144B_ABST
    Figure CN114817144B_ABST
Patent Text Reader

Abstract

The present application provides a directory processing method and device in a distributed file system, the directory processing method in the distributed file system comprising: obtaining a processing condition of a directory to be processed sent by a cloud database, wherein the processing condition of the directory to be processed is used to prevent the modification or creation operation of the directory to be processed from being repeatedly executed; parsing the directory tree according to the key-value pairs of subdirectories at all levels of the directory tree corresponding to the directory to be processed to obtain the node number of the directory to be processed; judging whether the directory to be processed meets the processing condition of the directory to be processed according to the node number of the directory to be processed, and performing operation processing on the directory to be processed when the directory to be processed meets the processing condition of the directory to be processed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a directory processing method and device in a distributed file system. The present application also provides an electronic device and a computer storage medium. Background Art

[0002] In the distributed file system scenario, operations on file directories have strong consistency requirements.

[0003] In the existing technical solution, the directory tree is stored in the memory of the machine with a single-node metadata service (Namenode) in the form of a cascaded data structure. When the file client operates the directory tree in the distributed file system, the metadata service of the file system will lock the directory tree of the file system to prevent other clients or other threads from modifying the directory tree and conflicting with the current operation. However, as the cluster scale increases, the single-node data service storage mode seriously affects the data throughput of the entire distributed file system.

[0004] Therefore, how to ensure strong consistency of processing operations on file directories while ensuring the data throughput of the distributed file system has become a technical problem that technical personnel in this field urgently need to solve. Summary of the invention

[0005] The present application provides a directory processing method and device in a distributed file system to solve the above technical problems.

[0006] The directory processing method in the distributed file system provided by this application includes:

[0007] Obtaining a processing condition of a to-be-processed directory sent by a cloud database, wherein the processing condition of the to-be-processed directory is used to prevent a modification or creation operation on the to-be-processed directory from being repeatedly executed;

[0008] According to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be processed, the directory tree is parsed to obtain the node number of the directory to be processed;

[0009] According to the node number of the to-be-processed directory, it is judged whether the to-be-processed directory meets the processing condition of the to-be-processed directory, and when the to-be-processed directory meets the processing condition of the to-be-processed directory, the to-be-processed directory is operated and processed.

[0010] Optionally, the directory tree includes at least one level of sub-directory, the key of the key-value pair of any level of sub-directory includes the node name of the any level of sub-directory and the parent node number of the node corresponding to the any level of sub-directory, and the value of the key-value pair of any level of sub-directory includes the node number of the any level of sub-directory.

[0011] Optionally, parsing the directory tree according to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be processed to obtain the node number of the directory to be processed includes:

[0012] Obtain the root node number of the directory tree;

[0013] According to the root node number of the root directory and the node name of the first-level subdirectory of the root directory, a key in the first-level subdirectory key-value pair is obtained; and a local database is queried to obtain a node number of the first-level subdirectory that matches the key in the first-level subdirectory key-value pair;

[0014] Starting from the first-level subdirectory, obtaining the key in the key-value pair of the N+1-level subdirectory according to the node number of the N-level subdirectory and the node name of the N+1-level subdirectory of the root directory in turn; querying the local cache to obtain the node number of the N+1-level subdirectory that matches the key in the key-value pair of the N+1-level subdirectory; until the key in the key-value pair of the directory to be processed is obtained, wherein N is a natural number;

[0015] The key in the key-value pair of the directory to be processed is encoded, and the encoded value obtained by encoding is used as the node number of the directory to be processed.

[0016] Optionally, obtaining the processing conditions of the directory to be processed sent by the cloud database includes: obtaining creation condition information of the directory to be processed sent by the cloud database, and the creation condition information includes: when the node number of the directory to be processed does not exist, performing a creation operation on the directory to be processed.

[0017] Optionally, judging whether the directory to be processed meets the processing condition of the directory to be processed according to the node number of the directory to be processed, and processing the directory to be processed by a node operation module when the directory to be processed meets the processing condition of the directory to be processed, includes:

[0018] Obtaining the key in the key-value pair of the directory to be processed;

[0019] Querying a local database to determine whether the local database contains a node ID of the directory to be processed that matches a key in a key-value pair of the directory to be processed;

[0020] If there is no node number of the directory to be processed that matches the key in the key-value pair of the directory to be processed, call the application programming interface for creating the directory to create the directory according to the preset directory attribute information for the directory to be processed and the node number of the directory to be processed.

[0021] Optionally, obtaining the processing conditions of the directory to be processed sent by the cloud database includes: obtaining renaming condition information of the directory to be processed sent by the cloud database, and the renaming condition information includes: deleting the node number of the directory to be processed, and completing the renaming operation on the directory to be processed.

[0022] Optionally, judging whether the directory to be processed meets the processing condition of the directory to be processed according to the node number of the directory to be processed, and processing the directory to be processed by a node operation module when the directory to be processed meets the processing condition of the directory to be processed, includes:

[0023] Creating a first node number of the to-be-processed directory after the renaming and a renamed name of the to-be-processed directory after the renaming;

[0024] Call the application programming interface used to complete the directory rename operation, doing the following:

[0025] The node number of the directory to be processed is deleted, and a second key-value pair of the directory to be processed is created according to the first node number and the renamed name of the directory to be processed, and the renaming operation of the directory to be processed is completed based on the second key-value pair.

[0026] Optionally, obtaining the processing conditions of the directory to be processed sent by the cloud database includes: obtaining attribute update condition information of the directory to be processed sent by the cloud database, and the attribute update condition information includes: when the node attribute information used to update the directory to be processed is the same as the node attribute information of the directory to be processed stored in the cloud database, updating the attributes of the directory to be processed according to the node attribute information used to update the directory to be processed.

[0027] Optionally, judging whether the directory to be processed meets the processing condition of the directory to be processed according to the node number of the directory to be processed, and processing the directory to be processed by a node operation module when the directory to be processed meets the processing condition of the directory to be processed, includes:

[0028] Determining whether the node attribute information used to update the directory to be processed is the same as the node attribute information of the directory to be processed stored in the cloud database;

[0029] If the node attribute information used to update the directory to be processed is the same as the node attribute information of the directory to be processed stored in the cloud database, the application programming interface used to complete the directory attribute update operation is called to update the attributes of the directory to be processed, wherein the key-value pair of the directory to be processed after the attribute update includes the node number of the directory to be processed and the node attribute information used to update the directory to be processed.

[0030] The present application also provides a directory processing device in a distributed file system, including:

[0031] An obtaining unit, used for obtaining a processing condition of a to-be-processed directory sent by a cloud database, wherein the processing condition of the to-be-processed directory is used to prevent a modification or creation operation of the to-be-processed directory from being repeatedly executed;

[0032] A parsing unit, configured to parse the directory tree according to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be processed, and obtain the node number of the directory to be processed;

[0033] The processing unit is used to determine whether the directory to be processed meets the processing condition of the directory to be processed according to the node number of the directory to be processed, and perform operation processing on the directory to be processed when the directory to be processed meets the processing condition of the directory to be processed.

[0034] The present application also provides a method for creating a directory in a distributed file system, including:

[0035] Obtaining a processing condition of a directory to be created sent by a cloud database, wherein the processing condition of the directory to be created is used to prevent a creation operation of the directory to be created from being repeatedly executed;

[0036] According to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be created, the directory tree is parsed to obtain the node number of the directory to be created;

[0037] According to the node number of the directory to be created, it is determined whether the directory to be created meets the processing condition of the directory to be created, and when the directory to be created meets the processing condition of the directory to be created, a creation operation is performed on the directory to be created.

[0038] This application also provides a directory renaming method for a distributed file system, including:

[0039] Obtaining a processing condition of the directory to be renamed sent by the cloud database, wherein the processing condition of the directory to be renamed is used to ensure that the directory to be renamed is not named repeatedly after being renamed;

[0040] According to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be renamed, the directory tree is parsed to obtain the node number of the directory to be renamed;

[0041] According to the node number of the directory to be renamed, it is judged whether the directory to be renamed meets the processing condition for the directory to be renamed, and when the directory to be renamed meets the processing condition for the directory to be renamed, a renaming operation is performed on the directory to be renamed.

[0042] The present application also provides a method for updating a directory of a distributed file system, including:

[0043] Obtaining a processing condition of the directory to be updated sent by the cloud database, wherein the processing condition of the directory to be updated is used to ensure that the updated directory to be updated does not contain the directory attributes before the update;

[0044] According to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be updated, the directory tree is parsed to obtain the node number of the directory to be updated;

[0045] According to the node number of the directory to be updated, it is determined whether the directory to be updated meets the processing condition of the directory to be updated, and when the directory to be updated meets the processing condition of the directory to be updated, the attribute of the directory to be updated is updated.

[0046] The present application also provides a directory processing system for a distributed file system, comprising: a client, a cloud database, wherein the client comprises: a local database and a directory tree node operation unit;

[0047] The local database is used to store key-value pairs of subdirectories at all levels in the directory tree;

[0048] The cloud database is used to send the processing conditions of the directory to be processed to the directory tree node operation unit, wherein the processing conditions of the directory to be processed are used to prevent the modification or creation operation of the directory to be processed from being repeatedly executed;

[0049] The directory tree node operation unit is used to parse the directory tree according to the key-value pairs of the sub-directories at all levels of the directory tree corresponding to the directory to be processed, and obtain the node number of the directory to be processed; according to the node number of the directory to be processed, determine whether the directory to be processed meets the processing conditions of the directory to be processed, and when the directory to be processed meets the processing conditions of the directory to be processed, operate the directory to be processed.

[0050] The present application also provides an electronic device, including:

[0051] processor;

[0052] The memory is used to store a program of the method, and when the program is read and executed by the processor, any one of the above methods is executed.

[0053] The present application also provides a computer storage medium, wherein the computer storage medium stores a computer program, and the program performs any of the above methods when executed.

[0054] Compared with the prior art, this application has the following advantages:

[0055] The directory processing method in a distributed file system includes: obtaining the processing conditions of the directory to be processed sent by a cloud database, wherein the processing conditions of the directory to be processed are used to prevent the modification or creation operation of the directory to be processed from being repeatedly executed; parsing the directory tree according to the key-value pairs of the sub-directories at all levels of the directory tree corresponding to the directory to be processed to obtain the node number of the directory to be processed; judging whether the directory to be processed meets the processing conditions of the directory to be processed according to the node number of the directory to be processed, and performing operation processing on the directory to be processed when the directory to be processed meets the processing conditions of the directory to be processed.

[0056] The directory processing method provided in the present application determines the node number of the directory to be processed by parsing the key-value pairs of the directory to be processed, and calls the processing conditions of the directory to be processed through the cloud so that the processing operation on the directory to be processed is not repeatedly executed. Combined with the node number of the directory to be processed and the processing conditions of the directory to be processed, it is ensured that the processing operation of the directory to be processed meets the strong consistency operation requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 A schematic diagram of the structure of a directory processing system in a distributed file system provided for an embodiment of the present application scenario;

[0058] Figure 2 A flow chart of a directory processing method in a distributed file system provided in the first embodiment of the present application;

[0059] Figure 3 A schematic diagram of the structure of a directory processing device in a distributed file system provided in the second embodiment of the present application;

[0060] Figure 4 A flow chart of a method for creating a directory in a distributed file system provided in the third embodiment of the present application;

[0061] Figure 5 A flow chart of a directory renaming method for a distributed file system provided in the fourth embodiment of the present application;

[0062] Figure 6A flow chart of a directory updating method of a distributed file system provided in the fifth embodiment of the present application;

[0063] Figure 7 A schematic diagram of the structure of an electronic device provided in the sixth embodiment of the present application. DETAILED DESCRIPTION

[0064] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application. Therefore, the present application is not limited to the specific embodiments disclosed below.

[0065] Please refer to Figure 1 , which is a schematic diagram of the structure of a directory processing system in a distributed file system provided in an embodiment of the scenario of this application.

[0066] The directory processing system includes: a client 101 and a cloud database 102 , wherein the client 101 includes: a local database 103 and a directory tree node operation unit 104 .

[0067] Among them, the local database 103 is used to store key-value pairs of sub-directories at all levels in the directory tree. Specifically, the local database stores key-value pairs for determining the node number of the directory to be processed in the directory tree in the form of table storage (Table Store), wherein the key of the key-value pair of any level-one sub-directory of the directory tree includes the node name of the any level-one sub-directory and the parent node number of the node corresponding to the any level-one sub-directory, and the value of the key-value pair of any level-one sub-directory includes the node number of the any sub-directory.

[0068] The directory tree node operation unit 104 is used to parse the directory tree according to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be processed, and obtain the node number of the directory to be processed; according to the node number of the directory to be processed, determine whether the directory to be processed meets the processing condition of the directory to be processed, and perform operation processing on the directory to be processed when the directory to be processed meets the processing condition of the directory to be processed;

[0069] The cloud database 102 is used to send the processing conditions of the directory to be processed to the directory tree node operation unit, wherein the processing conditions of the directory to be processed are used to prevent the modification or creation operation of the directory to be processed from being repeatedly executed.

[0070] Specifically, the first embodiment of the present application provides a directory processing method in a distributed file system for the directory processing system. Specifically, the process of completing the above-mentioned directory processing operation through the above-mentioned system can refer to the directory processing method in a distributed file system provided in the first embodiment of the present application, which will not be repeated here.

[0071] Please refer to Figure 2 , which is a flow chart of a directory processing method in a distributed file system provided in the first embodiment of the present application, the method comprising: steps S201 to S203.

[0072] Step S201, obtaining a processing condition of a directory to be processed sent by a cloud database, wherein the processing condition of the directory to be processed is used to prevent a modification or creation operation on the directory to be processed from being repeatedly executed.

[0073] In an embodiment of the present application, the processing conditions of the directory to be processed correspond to the processing operation type of the directory to be processed, wherein the operation type of the directory to be processed includes: a creation operation on the directory to be processed, a renaming operation on the directory to be processed, and an attribute update operation on the directory to be processed, etc.

[0074] Specifically, when performing a creation operation on the to-be-processed directory, the processing condition of the to-be-processed directory is as follows: when the node number of the to-be-processed directory does not exist, performing a creation operation on the to-be-processed directory;

[0075] When performing a renaming operation on the directory to be processed, the processing condition of the directory to be processed is specifically: deleting the node number of the directory to be processed, and completing the renaming operation on the directory to be processed;

[0076] When performing an attribute update operation on the directory to be processed, the processing conditions of the directory to be processed are specifically as follows: obtaining the attribute update condition information of the directory to be processed sent by the cloud database, the attribute update condition information including: when the node attribute information used to update the directory to be processed is the same as the node attribute information of the directory to be processed stored in the cloud database, updating the attributes of the directory to be processed according to the node attribute information used to update the directory to be processed.

[0077] In an embodiment of the present application, the processing condition of the directory to be processed is specifically used to avoid conflicts between the modification operations of the directory tree by other clients or other threads and the current operation, so as to ensure strong consistency of the directory tree corresponding to the directory to be processed.

[0078] Step S202: According to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be processed, the directory tree is parsed to obtain the node number of the directory to be processed.

[0079] In an embodiment of the present application, the directory tree includes at least one level of sub-directory, the key of the key-value pair of any level of sub-directory includes the node name of the any level of sub-directory and the parent node number of the node corresponding to the any level of sub-directory, and the value of the key-value pair of any level of sub-directory includes the node number of the any level of sub-directory.

[0080] In the computer field, key-value pairs are a basic way of representing data, usually in<key,value> In the form of, key is the key of the key-value pair, and value is the value of the key-value pair. The value corresponding to the key can be directly found through the key of the key-value pair.

[0081] In an embodiment of the present application, the specific form of the key-value pair is <directory node name + directory parent node number, directory node number>, that is, the node number of the key-value pair can be directly found through the key in the directory key-value pair of this level.

[0082] The node of the directory can be understood as the index node of the directory. In the computer field, there is an index node for directories at different levels of a directory tree. The index node is an area in the Unix / Linux file system used to store file metadata, that is, all information except the file name of the directory is stored in the index node, including the node number.

[0083] For example, for a directory tree with a hierarchical relationship of / user / hive / warehouse / file1, the directory name of the lowest-level subdirectory is file1 (folder 1), and all data under the folder except the directory name is stored in the corresponding index node of the directory.

[0084] Step S203: judging whether the directory to be processed meets the processing condition of the directory to be processed according to the node number of the directory to be processed, and performing operation processing on the directory to be processed when the directory to be processed meets the processing condition of the directory to be processed.

[0085] In order to facilitate understanding of the directory processing method in the distributed file system provided by the present application, the first embodiment of the present application respectively introduces the above steps S202 and S203 in detail in combination with the creation, renaming and updating of the attributes of the directory.

[0086] First, in order to facilitate understanding of the directory processing method in the distributed file system provided in this application, the following takes the creation of " / user / hive / warehouse / file1" as an example to introduce step S202 and step S203.

[0087] Specifically, the step S202 includes parsing the directory tree level by level according to the key-value pairs of the subdirectories at each level of the directory tree corresponding to the directory to be processed through the following steps S1 to S4, thereby obtaining the node number of the directory to be processed:

[0088] Step S1, obtaining the root node number of the directory tree.

[0089] The root directory refers to the top-level directory of the logical drive, which is relative to the directories of different nodes in the directory tree. For example, open "My Computer" in the computer, double-click the C drive to enter the root directory of the C drive, and double-click the D drive to enter the root directory of the D drive. Further, in the directory tree structure in the form of " / user / hive / warehouse / file1", the " / " in " / user" is the root directory of the directory tree; it can be understood that the root directory shown in the above example is only one form of many root directories. In other embodiments, the root directory can also have other forms of expression. For example, in the directory tree structure in the form of "abc / file2 / 3.txt", its root directory is "abc / ".

[0090] Step S2, obtaining the key in the first-level subdirectory key-value pair according to the root node number of the root directory and the node name of the first-level subdirectory of the root directory; querying the local database to obtain the node number of the first-level subdirectory that matches the key in the first-level subdirectory key-value pair.

[0091] The first-level subdirectory of the root directory is specifically "user". Assuming that the root node number of the root directory tree is 0, the key "0user" in the key-value pair of the first-level subdirectory can be obtained by splicing the root node number of the directory tree and the node name of the first-level subdirectory of the root directory. By traversing the local cache, the key-value pair that matches "0user" is determined, and the node number of the first-level subdirectory is obtained (for the sake of ease of description, the node number of the first-level subdirectory is assumed to be 100 in the embodiment of the present application).

[0092] Step S3, starting from the first-level subdirectory, obtain the key in the key-value pair of the N+1-level subdirectory according to the node number of the N-level subdirectory and the node name of the N+1-level subdirectory of the root directory; query the local cache to obtain the node number of the N+1-level subdirectory that matches the key in the key-value pair of the N+1-level subdirectory; until the key in the key-value pair of the directory to be processed is obtained, where N is a natural number.

[0093] In the first embodiment of the present application, the directory to be processed is "file1" (folder 1).

[0094] That is, the above step S3 is specifically as follows:

[0095] The node number (100) of the first-level subdirectory and the node name "hive" of the second-level subdirectory are concatenated to obtain the key "100hive" in the key-value pair of the second-level subdirectory.

[0096] Traverse the local cache, determine the key-value pair that matches "100hive", and obtain the node number of the second-level subdirectory (for ease of description, it is assumed in the embodiment of the present application that the node number of the second-level subdirectory is 101).

[0097] The node number (101) of the second-level subdirectory and the node name (warehouse) of the third-level subdirectory are concatenated to obtain the key "101warehouse" in the key-value pair of the third-level subdirectory.

[0098] Traverse the local cache, determine the key-value pair that matches "101warehouse", and obtain the node number of the third-level subdirectory (for ease of description, it is assumed in the embodiment of the present application that the node number of the third-level subdirectory is (102).

[0099] Concatenate the node number (102) of the third-level subdirectory and the node name "file1" of the fourth-level subdirectory (i.e., concatenate the node ID of the third-level subdirectory and the node name of the subdirectory to be created) to obtain the key "102file1" in the key-value pair of the directory to be processed.

[0100] Step S4, encoding the key in the key-value pair of the directory to be processed, and using the encoded value obtained by encoding as the node number of the directory to be processed.

[0101] In the first embodiment of the present application, since the directory to be processed has not been created, there is no corresponding key-value pair for the directory to be processed (file1), that is, the value in the key-value pair of the directory to be processed cannot be directly found according to the key in the key-value pair of the directory to be processed obtained in the above step S202. Therefore, it is necessary to encode the key in the key-value pair of the directory to be processed and determine the node ID of the directory to be processed in order to create the directory to be processed (here, it is assumed that the encoding value obtained after encoding the key in the key-value pair of the directory to be processed is 103, that is, the node number of the directory to be processed is 103).

[0102] Step S203: Create the directory to be processed according to the node number of the directory to be processed and the preset directory attribute information. In the process of creating the directory to be processed, the client first assumes that the node of the directory to be processed does not exist, but in the process of implementing directory creation, there may be a problem of duplicate creation.

[0103] In order to avoid the problem of repeated directory creation, step S203 of the present application includes the following steps S5 to S8:

[0104] Step S5, obtaining the key in the key-value pair of the directory to be processed;

[0105] That is, a key of the form "102file1" is obtained.

[0106] Step S6, querying the local database to determine whether there is a node number of the directory to be processed that matches the key in the key-value pair of the directory to be processed in the local database;

[0107] Step S7, if there is no node number of the directory to be processed that matches the key in the key-value pair of the directory to be processed, call the application programming interface for creating the directory, and create the directory to be processed according to the preset directory attribute information for the directory to be processed and the node number of the directory to be processed.

[0108] That is, determine whether the directory to be processed already exists in the local database. If the directory to be processed exists in the local database, determine that the directory has been created. To ensure the strong consistency of the directory tree, the directory to be processed cannot be created; if the directory does not exist, execute the directory creation instruction.

[0109] In the embodiment of the present application, the attribute information of the directory is the metadata information in the directory to be created. This part of information is stored in the index node of the directory to be created, and may include: the creation / update time of the file and the owner of the file. Specifically, the directory attribute information preset in the directory to be processed can be set according to actual conditions, and this application does not limit this.

[0110] In an optional embodiment of the present application, the local database may be a Serverless NoSQL multi-model database for storing structured data, which can provide a Wide Column model, a message model, and a space-time model compatible with Hbase (a distributed, column-oriented open source database), and can provide PB-level data storage, tens of millions of data throughput, and millisecond-level data delay service capabilities to reduce data transmission delays and improve system stability.

[0111] In another optional implementation of the present application, the above directory processing method can also be applied to the creation of nested directories.

[0112] Assume that the directory " / user / hive" already exists. On this basis, we want to further create the directory " / warehouse / dir1", that is, create a directory with the structure of " / user / hive / warehouse / dir1". The above nested directory creation process is basically the same as the above process of creating the directory to be processed. That is, after determining the directory tree hierarchy of the directory to be processed, parse the directory tree according to the key-value pair to obtain the node number of the directory to be processed.

[0113] Here, the node number of the directory to be processed refers to the subdirectory "warehouse".

[0114] Afterwards, step S202 and step S203 are executed to complete the creation of the directory " / user / hive / warehouse".

[0115] That is, the node ID of the root node " / " of the directory tree is obtained (here, it is still assumed that the number of the root node of the directory tree is 0).

[0116] Concatenate the root node number of the directory tree and the node name "user" of the first-level subdirectory of the root node, obtain the key "0user" in the first-level subdirectory key-value pair, query the local cache, and obtain the node number of the first-level subdirectory that matches the key in the first-level subdirectory key-value pair (here, it is still assumed that the node number of the first-level subdirectory is 100).

[0117] The node number (100) of the first-level subdirectory and the node name "hive" of the second-level subdirectory are concatenated to obtain the key "100hive" in the key-value pair of the second-level subdirectory.

[0118] The local cache is traversed to determine the key-value pair that matches "100hive", and the node ID of the second-level subdirectory is obtained (here, it is still assumed that the node ID of the second-level subdirectory is 101).

[0119] The node number (101) of the second-level subdirectory and the node name (warehouse) of the first directory to be processed are concatenated to obtain the key "101warehouse" in the key-value pair of the first directory to be processed.

[0120] Furthermore, since the directory has not been created yet, the key "101warehouse" in the key-value pair of the first directory to be processed is encoded to obtain the node number of the first directory to be processed (here, it is assumed that the node number of the first directory to be processed is 102).

[0121] The local database is queried to determine whether there is a node ID of the first directory to be created that matches the key in the first directory key-value pair to be processed in the local database.

[0122] If the judgment result is no, a first subdirectory with a key-value pair of <102, preset first node attribute information> is created.

[0123] If the judgment result is yes, a prompt message of creation conflict is returned to the client used to complete the creation of the pending directory.

[0124] After the first directory to be created is successfully created, a second directory to be created "file1" is further created.

[0125] At this point, for the sake of ease of description, the first directory to be processed that is created will be referred to as a third-level subdirectory.

[0126] The node number (102) of the third-level subdirectory and the node name (file1) of the second directory to be processed are concatenated to obtain the key (102file1) in the key-value pair of the second directory to be processed.

[0127] Furthermore, since the directory has not been created yet, the key "102file1" in the key-value pair of the second directory to be processed is encoded to obtain the node number of the second directory to be processed (here, it is assumed that the node number of the first directory to be processed is 103).

[0128] The local database is queried to determine whether there is a node ID of the second to-be-processed directory that matches the key in the key-value pair of the second to-be-processed directory in the local database.

[0129] If the judgment result is no, a second subdirectory with a key-value pair of <103, preset second node attribute information> is created.

[0130] If the judgment result is yes, a prompt message of creation conflict is returned to the client for completing the creation of the subdirectory to be created.

[0131] Furthermore, the first embodiment of the present application also introduces the above-mentioned step S202 and step S203 in conjunction with the directory renaming process.

[0132] The following introduces the directory renaming method provided in the second embodiment of the present application by taking the example of renaming the directory " / user / hive / warehouse / file1" to " / user / hive / warehouse / file2".

[0133] Similar to the process of creating the above directory, the above step S202 includes the following steps S9 to S12:

[0134] Step S9, obtaining the root node number of the directory tree;

[0135] Step S10, obtaining a key in a key-value pair of the first-level subdirectory according to the root node number of the root directory and the node name of the first-level subdirectory of the root directory; querying a local database to obtain a node number of the first-level subdirectory that matches the key in the key-value pair of the first-level subdirectory;

[0136] Step S11, starting from the first-level subdirectory, obtaining the key in the key-value pair of the N+1-level subdirectory according to the node number of the N-level subdirectory and the node name of the N+1-level subdirectory of the root directory in turn; querying the local cache to obtain the node number of the N+1-level subdirectory that matches the key in the key-value pair of the N+1-level subdirectory; until the key in the key-value pair of the directory to be processed is obtained, wherein N is a natural number;

[0137] The steps S9 to S11 are basically the same as the steps S1 to S3 in the first embodiment of the present application. Therefore, the above steps will not be described in detail. For relevant details, please refer to the description of the steps S1 to S3 in the first embodiment of the present application.

[0138] Step S12, encoding the key in the key-value pair of the directory to be processed, and using the encoded value obtained by encoding as the node number of the directory to be processed.

[0139] In step S12 , the key in the key-value pair of the directory to be processed is specifically “102file1”. For the sake of description, it is assumed here that the encoded value thereof is “103”, that is, the original node number of the directory to be processed is 103.

[0140] Furthermore, the above step S203 includes the following steps S13 to S14:

[0141] Step S13, creating a first node number of the to-be-processed directory after the name is renamed and a renamed name of the to-be-processed directory after the name is renamed;

[0142] Specifically, the first node number after the renaming of the directory to be processed is the ID of the node after the directory to be processed is renamed. For example, the key "102file1" in the key-value pair of the directory to be processed should have an encoded value of 103. Here, the renamed node ID is the encoded value obtained after re-encoding the key. In this application, for the convenience of description, the encoded value obtained after re-encoding is set to 104. In the embodiment of the present application, the encoded value obtained after re-encoding is referred to as the first node number.

[0143] Furthermore, in order to ensure that there is only one index node for the same subdirectory, it is also necessary to call an application programming interface for completing the directory renaming operation and perform the following steps:

[0144] Step S14, deleting the node number of the directory to be processed, and creating a second key-value pair of the directory to be processed according to the first node number and the renamed name of the directory to be processed, and completing the renaming operation of the directory to be processed based on the second key-value pair.

[0145] That is to say, when the to-be-processed directory is renamed, it is necessary to ensure that the original node code is deleted.

[0146] In an optional implementation of the present application, the renaming of the to-be-processed directory can be achieved by conditional updating, that is, during the renaming process, atomic Batch is set to true, and the to-be-processed directory is renamed. Wherein, setting atomic Batch to true means that while creating a new directory with a key-value pair of <104, content of the to-be-processed directory>, the original node number (103) of the to-be-processed directory is deleted.

[0147] Furthermore, the first embodiment of the present application introduces the above-mentioned step S202 and step S203 in conjunction with the attribute update process of the directory.

[0148] Similar to the process of creating the above directory, the above step S202 includes the following steps S15 to S18:

[0149] Step S15, obtaining the root node number of the directory tree;

[0150] Step S16, obtaining a key in a key-value pair of the first-level subdirectory according to the root node number of the root directory and the node name of the first-level subdirectory of the root directory; querying a local database to obtain a node number of the first-level subdirectory that matches the key in the key-value pair of the first-level subdirectory;

[0151] Step S17, starting from the first-level subdirectory, obtaining the key in the key-value pair of the N+1-level subdirectory according to the node number of the N-level subdirectory and the node name of the N+1-level subdirectory of the root directory in turn; querying the local cache to obtain the node number of the N+1-level subdirectory that matches the key in the key-value pair of the N+1-level subdirectory; until the key in the key-value pair of the directory to be processed is obtained, wherein N is a natural number;

[0152] The steps S15 to S17 are basically the same as the steps S1 to S3 in the first embodiment of the present application. Therefore, the above steps will not be described in detail here. For relevant details, please refer to the description of the steps S1 to S3 in the first embodiment of the present application.

[0153] Step S18, encoding the key in the key-value pair of the directory to be processed, and using the encoded value obtained by encoding as the node number of the directory to be processed.

[0154] In step S18 , the key in the key-value pair of the subdirectory to be updated is specifically “102file1”. For ease of description, it is assumed here that the encoded value thereof is “103”, that is, the node number of the directory to be processed is 103.

[0155] Furthermore, the above step S203 mainly includes the following steps S19 and S20:

[0156] Step S19, determining whether the node attribute information used to update the directory to be processed is the same as the node attribute information of the directory to be processed stored in the cloud database;

[0157] Step S20: If the node attribute information used to update the directory to be processed is the same as the node attribute information of the directory to be processed stored in the cloud database, the application programming interface used to complete the directory attribute update operation is called to update the attributes of the directory to be processed, wherein the key-value pair of the directory to be processed after the attribute update includes the node number of the directory to be processed and the node attribute information used to update the directory to be processed.

[0158] The second embodiment of the present application provides a directory processing device. Since the embodiment of the device is basically similar to the first embodiment of the present application, the description is relatively simple. For relevant matters, please refer to the above partial description of the first embodiment of the present application, which will not be repeated here.

[0159] Please refer to Figure 3 , which is a schematic diagram of the structure of a directory processing device in a distributed file system provided in the second embodiment of the present application.

[0160] The device includes:

[0161] The obtaining unit 301 is used to obtain the processing condition of the directory to be processed sent by the cloud database, wherein the processing condition of the directory to be processed is used to prevent the modification or creation operation of the directory to be processed from being repeatedly executed;

[0162] The parsing unit 302 is used to parse the directory tree according to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be processed, and obtain the node number of the directory to be processed;

[0163] The processing unit 303 is used to determine whether the directory to be processed meets the processing condition of the directory to be processed according to the node number of the directory to be processed, and perform operation processing on the directory to be processed when the directory to be processed meets the processing condition of the directory to be processed.

[0164] Optionally, the directory tree includes at least one level of sub-directory, the key of the key-value pair of any level of sub-directory includes the node name of the any level of sub-directory and the parent node number of the node corresponding to the any level of sub-directory, and the value of the key-value pair of any level of sub-directory includes the node number of the any level of sub-directory.

[0165] Optionally, parsing the directory tree according to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be processed to obtain the node number of the directory to be processed includes:

[0166] Obtain the root node number of the directory tree;

[0167] According to the root node number of the root directory and the node name of the first-level subdirectory of the root directory, a key in the first-level subdirectory key-value pair is obtained; and a local database is queried to obtain a node number of the first-level subdirectory that matches the key in the first-level subdirectory key-value pair;

[0168] Starting from the first-level subdirectory, obtaining the key in the key-value pair of the N+1-level subdirectory according to the node number of the N-level subdirectory and the node name of the N+1-level subdirectory of the root directory in turn; querying the local cache to obtain the node number of the N+1-level subdirectory that matches the key in the key-value pair of the N+1-level subdirectory; until the key in the key-value pair of the directory to be processed is obtained, wherein N is a natural number;

[0169] The key in the key-value pair of the directory to be processed is encoded, and the encoded value obtained by encoding is used as the node number of the directory to be processed.

[0170] Optionally, obtaining the processing conditions of the directory to be processed sent by the cloud database includes: obtaining creation condition information of the directory to be processed sent by the cloud database, and the creation condition information includes: when the node number of the directory to be processed does not exist, performing a creation operation on the directory to be processed.

[0171] Optionally, judging whether the directory to be processed meets the processing condition of the directory to be processed according to the node number of the directory to be processed, and processing the directory to be processed by a node operation module when the directory to be processed meets the processing condition of the directory to be processed, includes:

[0172] Obtaining the key in the key-value pair of the directory to be processed;

[0173] Querying a local database to determine whether the local database contains a node ID of the directory to be processed that matches a key in a key-value pair of the directory to be processed;

[0174] If there is no node number of the directory to be processed that matches the key in the key-value pair of the directory to be processed, call the application programming interface for creating the directory to create the directory according to the preset directory attribute information for the directory to be processed and the node number of the directory to be processed.

[0175] Optionally, obtaining the processing conditions of the directory to be processed sent by the cloud database includes: obtaining renaming condition information of the directory to be processed sent by the cloud database, and the renaming condition information includes: deleting the node number of the directory to be processed, and completing the renaming operation on the directory to be processed.

[0176] Optionally, judging whether the directory to be processed meets the processing condition of the directory to be processed according to the node number of the directory to be processed, and processing the directory to be processed by a node operation module when the directory to be processed meets the processing condition of the directory to be processed, includes:

[0177] Creating a first node number of the to-be-processed directory after the renaming and a renamed name of the to-be-processed directory after the renaming;

[0178] Call the application programming interface used to complete the directory rename operation, doing the following:

[0179] The node number of the directory to be processed is deleted, and a second key-value pair of the directory to be processed is created according to the first node number and the renamed name of the directory to be processed, and the renaming operation of the directory to be processed is completed based on the second key-value pair.

[0180] Optionally, obtaining the processing conditions of the directory to be processed sent by the cloud database includes: obtaining attribute update condition information of the directory to be processed sent by the cloud database, and the attribute update condition information includes: when the node attribute information used to update the directory to be processed is the same as the node attribute information of the directory to be processed stored in the cloud database, updating the attributes of the directory to be processed according to the node attribute information used to update the directory to be processed.

[0181] Optionally, judging whether the directory to be processed meets the processing condition of the directory to be processed according to the node number of the directory to be processed, and processing the directory to be processed by a node operation module when the directory to be processed meets the processing condition of the directory to be processed, includes:

[0182] Determining whether the node attribute information used to update the directory to be processed is the same as the node attribute information of the directory to be processed stored in the cloud database;

[0183] If the node attribute information used to update the directory to be processed is the same as the node attribute information of the directory to be processed stored in the cloud database, then the application programming interface for completing the directory attribute update operation is called to update the attributes of the directory to be processed, wherein the key-value pair of the directory to be processed after the attribute update includes the node number of the directory to be processed and the node attribute information used to update the directory to be processed

[0184] The third embodiment of the present application also provides a method for creating a directory in a distributed file system. Since this method embodiment is basically similar to the first embodiment mentioned above, the description is relatively simple. For related matters, please refer to the above introduction to the first embodiment of the present application. The following introduction to the third embodiment of the present application is merely illustrative.

[0185] Please refer to Figure 4 , which is a flow chart of a directory creation method in a distributed file system provided in the third embodiment of the present application.

[0186] like Figure 4 As shown, the method includes the following steps S401 to S403:

[0187] Step S401, obtaining a processing condition of a directory to be created sent by a cloud database, wherein the processing condition of the directory to be created is used to prevent a creation operation of the directory to be created from being repeatedly executed;

[0188] Step S402, parsing the directory tree according to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be created, and obtaining the node number of the directory to be created;

[0189] Step S403: judging whether the directory to be created satisfies the processing condition of the directory to be created according to the node number of the directory to be created, and performing a creation operation on the directory to be created if the directory to be created satisfies the processing condition of the directory to be created.

[0190] Optionally, the directory tree includes at least one level of sub-directory, the key of the key-value pair of any level of sub-directory includes the node name of the any level of sub-directory and the parent node number of the node corresponding to the any level of sub-directory, and the value of the key-value pair of any level of sub-directory includes the node number of the any level of sub-directory.

[0191] Optionally, parsing the directory tree according to the key-value pairs of subdirectories at all levels of the directory tree corresponding to the directory to be created to obtain the node number of the directory to be created includes:

[0192] Obtain the root node number of the directory tree;

[0193] According to the root node number of the root directory and the node name of the first-level subdirectory of the root directory, a key in the first-level subdirectory key-value pair is obtained; and a local database is queried to obtain a node number of the first-level subdirectory that matches the key in the first-level subdirectory key-value pair;

[0194] Starting from the first-level subdirectory, obtaining the key in the key-value pair of the N+1-level subdirectory according to the node number of the N-level subdirectory and the node name of the N+1-level subdirectory of the root directory in turn; querying the local cache to obtain the node number of the N+1-level subdirectory that matches the key in the key-value pair of the N+1-level subdirectory; until the key in the key-value pair of the directory to be created is obtained, wherein N is a natural number;

[0195] The key in the key-value pair of the directory to be created is encoded, and the encoded value obtained by encoding is used as the node number of the directory to be created.

[0196] Optionally, obtaining the processing conditions of the directory to be created sent by the cloud database includes: obtaining creation condition information of the directory to be created sent by the cloud database, and the creation condition information includes: when the node number of the directory to be created does not exist, performing a creation operation on the directory to be created.

[0197] Optionally, judging whether the directory to be created satisfies a processing condition of the directory to be created according to the node number of the directory to be created, and performing a creation operation on the directory to be created when the directory to be created satisfies the processing condition of the directory to be created, includes:

[0198] Obtaining a key in a key-value pair of the directory to be created;

[0199] Querying a local database to determine whether the local database contains a node ID of the directory to be created that matches a key in a key-value pair of the directory to be created;

[0200] If there is no node number of the directory to be created that matches the key in the key-value pair of the directory to be created, call the application programming interface for creating the directory, and create the directory to be created according to the directory attribute information preset for the directory to be created and the node number of the directory to be created.

[0201] The fourth embodiment of the present application also provides a directory renaming method for a distributed file system. Since the method embodiment is basically similar to the above-mentioned first embodiment, the description is relatively simple. For related matters, please refer to the above-mentioned introduction to the first embodiment of the present application. The following introduction to the fourth embodiment of the present application is merely illustrative.

[0202] Please refer to Figure 5 , which is a flow chart of a directory renaming method for a distributed file system provided in the fourth embodiment of the present application.

[0203] like Figure 5 As shown, the method includes the following steps S501 to S503:

[0204] Step S501, obtaining a processing condition of a directory to be renamed sent by a cloud database, wherein the processing condition of the directory to be renamed is used to ensure that the directory to be renamed is not named repeatedly after being renamed;

[0205] Step S502, parsing the directory tree according to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be renamed, and obtaining the node number of the directory to be renamed;

[0206] Step S503: judging whether the directory to be renamed satisfies the processing condition for renaming according to the node number of the directory to be renamed, and performing a renaming operation on the directory to be renamed when the directory to be renamed satisfies the processing condition for renaming.

[0207] Optionally, the directory tree includes at least one level of sub-directory, the key of the key-value pair of any level of sub-directory includes the node name of the any level of sub-directory and the parent node number of the node corresponding to the any level of sub-directory, and the value of the key-value pair of any level of sub-directory includes the node number of the any level of sub-directory.

[0208] Optionally, parsing the directory tree according to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be renamed to obtain the node number of the directory to be renamed includes:

[0209] Obtain the root node number of the directory tree;

[0210] According to the root node number of the root directory and the node name of the first-level subdirectory of the root directory, a key in the first-level subdirectory key-value pair is obtained; and a local database is queried to obtain a node number of the first-level subdirectory that matches the key in the first-level subdirectory key-value pair;

[0211] Starting from the first-level subdirectory, obtaining the key in the key-value pair of the N+1-level subdirectory according to the node number of the N-level subdirectory and the node name of the N+1-level subdirectory of the root directory in turn; querying the local cache to obtain the node number of the N+1-level subdirectory that matches the key in the key-value pair of the N+1-level subdirectory; until the key in the key-value pair of the to-be-renamed directory is obtained, wherein N is a natural number;

[0212] The key in the key-value pair of the directory to be renamed is encoded, and the encoded value obtained by encoding is used as the node number of the directory to be renamed.

[0213] Optionally, obtaining the processing conditions of the directory to be renamed sent by the cloud database includes: obtaining renaming condition information of the directory to be renamed sent by the cloud database, the renaming condition information including: deleting the node number of the directory to be renamed, and completing the renaming operation on the directory to be renamed.

[0214] Optionally, judging whether the directory to be renamed satisfies the processing condition for renaming according to the node number of the directory to be renamed, and performing a renaming operation on the directory to be renamed when the directory to be renamed satisfies the processing condition for renaming, comprises:

[0215] Creating a renamed first node number of the to-be-renamed directory and a renamed name of the to-be-renamed directory;

[0216] Call the application programming interface used to complete the directory rename operation, doing the following:

[0217] The node number of the directory to be renamed is deleted, and a second key-value pair of the directory to be renamed is created according to the first node number and the renamed name of the directory to be renamed, and the renaming operation of the directory to be renamed is completed based on the second key-value pair.

[0218] The fifth embodiment of the present application also provides a directory update method for a distributed file system. Since the method embodiment is basically similar to the above-mentioned first embodiment, the description is relatively simple. For related matters, please refer to the above-mentioned introduction to the first embodiment of the present application. The following introduction to the fifth embodiment of the present application is merely illustrative.

[0219] Please refer to Figure 6 , which is a flow chart of a directory updating method of a distributed file system provided in the fifth embodiment of the present application.

[0220] like Figure 6 As shown, the method includes the following steps S601 to S603:

[0221] Step S601, obtaining a processing condition of a directory to be updated sent by a cloud database, wherein the processing condition of the directory to be updated is used to ensure that the updated directory to be updated does not contain directory attributes before the update;

[0222] Step S602, parsing the directory tree according to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be updated, and obtaining the node number of the directory to be updated;

[0223] Step S603: judging whether the directory to be updated satisfies the processing condition of the directory to be updated according to the node number of the directory to be updated, and updating the attributes of the directory to be updated when the directory to be updated satisfies the processing condition of the directory to be updated.

[0224] Optionally, the directory tree includes at least one level of sub-directory, the key of the key-value pair of any level of sub-directory includes the node name of the any level of sub-directory and the parent node number of the node corresponding to the any level of sub-directory, and the value of the key-value pair of any level of sub-directory includes the node number of the any level of sub-directory.

[0225] Optionally, parsing the directory tree according to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be updated to obtain the node number of the directory to be updated includes:

[0226] Obtain the root node number of the directory tree;

[0227] According to the root node number of the root directory and the node name of the first-level subdirectory of the root directory, a key in the first-level subdirectory key-value pair is obtained; and a local database is queried to obtain a node number of the first-level subdirectory that matches the key in the first-level subdirectory key-value pair;

[0228] Starting from the first-level subdirectory, obtaining the key in the key-value pair of the N+1-level subdirectory according to the node number of the N-level subdirectory and the node name of the N+1-level subdirectory of the root directory in turn; querying the local cache to obtain the node number of the N+1-level subdirectory that matches the key in the key-value pair of the N+1-level subdirectory; until the key in the key-value pair of the directory to be updated is obtained, wherein N is a natural number;

[0229] The key in the key-value pair of the directory to be updated is encoded, and the encoded value obtained by encoding is used as the node number of the directory to be updated.

[0230] Optionally, obtaining the processing conditions of the directory to be updated sent by the cloud database includes: obtaining attribute update condition information of the directory to be updated sent by the cloud database, the attribute update condition information including: when the node attribute information used to update the directory to be updated is the same as the node attribute information of the directory to be updated stored in the cloud database, updating the attributes of the directory to be updated according to the node attribute information used to update the directory to be updated.

[0231] Optionally, judging whether the directory to be updated satisfies a processing condition of the directory to be updated according to the node number of the directory to be updated, and updating the attributes of the directory to be updated when the directory to be updated satisfies the processing condition of the directory to be updated, includes:

[0232] Determining whether the node attribute information used to update the directory to be updated is the same as the node attribute information of the directory to be updated stored in the cloud database;

[0233] If the node attribute information used to update the directory to be updated is the same as the node attribute information of the directory to be updated stored in the cloud database, the application programming interface used to complete the directory attribute update operation is called to update the attributes of the directory to be updated, wherein the key-value pairs of the directory to be updated after the attribute update include the node number of the directory to be updated and the node attribute information used to update the directory to be updated.

[0234] The sixth embodiment of the present application provides an electronic device. Since the electronic device embodiment is basically similar to the above method embodiment, the description is relatively simple. For relevant matters, please refer to the above description of the method embodiment of the present application, which will not be repeated here.

[0235] Please refer to Figure 7 , which is a schematic diagram of the structure of an electronic device provided in the sixth embodiment of the present application.

[0236] The electronic device includes:

[0237] Processor 701;

[0238] The memory 702 is used to store the program of the method. When the program is processed, read and executed, the method described in the above method embodiment is executed.

[0239] The embodiments of the present application also provide a computer storage medium, wherein the computer storage medium stores a computer program, and when the program is executed, any one of the methods of the embodiments is executed.

[0240] It should be noted that for the detailed description of the computer storage medium provided in the embodiment of the present application, reference can be made to the relevant description of the above-mentioned method embodiment provided in the present application, and no further details will be given.

[0241] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.

[0242] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0243] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0244] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.

[0245] 2. Those skilled in the art should understand that the embodiments of the present application can be provided as a system or electronic device. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

Claims

1. A directory processing method in a distributed file system, characterized in that: include: Obtaining a processing condition of a to-be-processed directory sent by a cloud database, wherein the processing condition of the to-be-processed directory is used to prevent a modification or creation operation on the to-be-processed directory from being repeatedly executed; According to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be processed, the directory tree is parsed to obtain the node number of the directory to be processed; the directory tree includes at least one level of subdirectories, the key of the key-value pair of any level of subdirectory includes the node name of the any level of subdirectory and the parent node number of the node corresponding to the any level of subdirectory, and the value of the key-value pair of any level of subdirectory includes the node number of the any level of subdirectory; According to the node number of the to-be-processed directory, it is judged whether the to-be-processed directory meets the processing condition of the to-be-processed directory, and when the to-be-processed directory meets the processing condition of the to-be-processed directory, the to-be-processed directory is operated and processed.

2. The method according to claim 1, characterized in that The step of parsing the directory tree according to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be processed to obtain the node number of the directory to be processed includes: Obtain the root node number of the directory tree; According to the root node number of the root directory and the node name of the first-level subdirectory of the root directory, the key in the first-level subdirectory key-value pair is obtained; the local database is queried to obtain the node number of the first-level subdirectory that matches the key in the first-level subdirectory key-value pair; Starting from the first-level subdirectory, obtaining the key in the key-value pair of the N+1-level subdirectory according to the node number of the N-level subdirectory and the node name of the N+1-level subdirectory of the root directory in turn; querying the local cache to obtain the node number of the N+1-level subdirectory that matches the key in the key-value pair of the N+1-level subdirectory; until the key in the key-value pair of the directory to be processed is obtained, wherein N is a natural number; The key in the key-value pair of the directory to be processed is encoded, and the encoded value obtained by encoding is used as the node number of the directory to be processed.

3. The method according to claim 1, characterized in that The obtaining of the processing condition of the directory to be processed sent by the cloud database includes: obtaining creation condition information of the directory to be processed sent by the cloud database, wherein the creation condition information includes: when the node number of the directory to be processed does not exist, executing a creation operation on the directory to be processed.

4. The method according to claim 3, characterized in that: The step of judging whether the directory to be processed satisfies the processing condition of the directory to be processed according to the node number of the directory to be processed, and processing the directory to be processed by a node operation module when the directory to be processed satisfies the processing condition of the directory to be processed, includes: Obtaining the key in the key-value pair of the directory to be processed; Querying a local database to determine whether the local database contains a node ID of the directory to be processed that matches a key in a key-value pair of the directory to be processed; If there is no node number of the directory to be processed that matches the key in the key-value pair of the directory to be processed, call the application programming interface for creating the directory to create the directory according to the preset directory attribute information for the directory to be processed and the node number of the directory to be processed.

5. The method according to claim 1, characterized in that The obtaining of the processing conditions of the directory to be processed sent by the cloud database includes: obtaining renaming condition information of the directory to be processed sent by the cloud database, wherein the renaming condition information includes: deleting the node number of the directory to be processed and completing the renaming operation on the directory to be processed.

6. The method according to claim 5, characterized in that The step of judging whether the directory to be processed satisfies the processing condition of the directory to be processed according to the node number of the directory to be processed, and processing the directory to be processed by a node operation module when the directory to be processed satisfies the processing condition of the directory to be processed, includes: Creating a first node number of the to-be-processed directory after the renaming and a renamed name of the to-be-processed directory after the renaming; Call the application programming interface used to complete the directory rename operation, doing the following: The node number of the directory to be processed is deleted, and a second key-value pair of the directory to be processed is created according to the first node number and the renamed name of the directory to be processed, and the renaming operation of the directory to be processed is completed based on the second key-value pair.

7. The method according to claim 1, characterized in that The obtaining of the processing conditions of the directory to be processed sent by the cloud database includes: obtaining the attribute update condition information of the directory to be processed sent by the cloud database, the attribute update condition information including: when the node attribute information used to update the directory to be processed is the same as the node attribute information of the directory to be processed stored in the cloud database, updating the attributes of the directory to be processed according to the node attribute information used to update the directory to be processed.

8. The method according to claim 7, characterized in that The step of judging whether the directory to be processed satisfies the processing condition of the directory to be processed according to the node number of the directory to be processed, and processing the directory to be processed by a node operation module when the directory to be processed satisfies the processing condition of the directory to be processed, includes: Determining whether the node attribute information used to update the directory to be processed is the same as the node attribute information of the directory to be processed stored in the cloud database; If the node attribute information used to update the directory to be processed is the same as the node attribute information of the directory to be processed stored in the cloud database, the application programming interface used to complete the directory attribute update operation is called to update the attributes of the directory to be processed, wherein the key-value pair of the directory to be processed after the attribute update includes the node number of the directory to be processed and the node attribute information used to update the directory to be processed.

9. A directory processing device in a distributed file system, characterized in that: include: An obtaining unit, used for obtaining a processing condition of a to-be-processed directory sent by a cloud database, wherein the processing condition of the to-be-processed directory is used to prevent a modification or creation operation of the to-be-processed directory from being repeatedly executed; A parsing unit, configured to parse the directory tree according to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be processed, and obtain the node number of the directory to be processed; the directory tree includes at least one level of subdirectories, the key of the key-value pair of any level of subdirectory includes the node name of the any level of subdirectory and the parent node number of the node corresponding to the any level of subdirectory, and the value of the key-value pair of any level of subdirectory includes the node number of the any level of subdirectory; The processing unit is used to determine whether the directory to be processed meets the processing condition of the directory to be processed according to the node number of the directory to be processed, and perform operation processing on the directory to be processed when the directory to be processed meets the processing condition of the directory to be processed.

10. A method for creating a directory in a distributed file system, characterized in that: include: Obtaining a processing condition of a directory to be created sent by a cloud database, wherein the processing condition of the directory to be created is used to prevent a creation operation of the directory to be created from being repeatedly executed; According to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be created, the directory tree is parsed to obtain the node number of the directory to be created; the directory tree includes at least one level of subdirectories, the key of the key-value pair of any level of subdirectory includes the node name of the any level of subdirectory and the parent node number of the node corresponding to the any level of subdirectory, and the value of the key-value pair of any level of subdirectory includes the node number of the any level of subdirectory; According to the node number of the directory to be created, it is determined whether the directory to be created meets the processing condition of the directory to be created, and when the directory to be created meets the processing condition of the directory to be created, a creation operation is performed on the directory to be created.

11. A method for renaming a directory in a distributed file system, characterized in that: include: Obtaining a processing condition of the directory to be renamed sent by the cloud database, wherein the processing condition of the directory to be renamed is used to ensure that the directory to be renamed is not named repeatedly after being renamed; According to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be renamed, the directory tree is parsed to obtain the node number of the directory to be renamed; the directory tree includes at least one level of subdirectories, the key of the key-value pair of any level of subdirectory includes the node name of the any level of subdirectory and the parent node number of the node corresponding to the any level of subdirectory, and the value of the key-value pair of any level of subdirectory includes the node number of the any level of subdirectory; According to the node number of the directory to be renamed, it is judged whether the directory to be renamed meets the processing condition for the directory to be renamed, and when the directory to be renamed meets the processing condition for the directory to be renamed, a renaming operation is performed on the directory to be renamed.

12. A method for updating a directory of a distributed file system, characterized in that: include: Obtaining a processing condition of the directory to be updated sent by the cloud database, wherein the processing condition of the directory to be updated is used to ensure that the updated directory to be updated does not contain the directory attributes before the update; According to the key-value pairs of the subdirectories at all levels of the directory tree corresponding to the directory to be updated, the directory tree is parsed to obtain the node number of the directory to be updated; the directory tree includes at least one level of subdirectories, the key of the key-value pair of any level of subdirectory includes the node name of the any level of subdirectory and the parent node number of the node corresponding to the any level of subdirectory, and the value of the key-value pair of any level of subdirectory includes the node number of the any level of subdirectory; According to the node number of the directory to be updated, it is determined whether the directory to be updated meets the processing condition of the directory to be updated, and when the directory to be updated meets the processing condition of the directory to be updated, the attribute of the directory to be updated is updated.

13. A directory processing system for a distributed file system, comprising: Client, cloud database, wherein the client includes: a local database and a directory tree node operation unit; The local database is used to store key-value pairs of subdirectories at all levels in the directory tree; the directory tree includes at least one level of subdirectories, the key of the key-value pair of any level of subdirectory includes the node name of the any level of subdirectory and the parent node number of the node corresponding to the any level of subdirectory, and the value of the key-value pair of any level of subdirectory includes the node number of the any level of subdirectory; The cloud database is used to send the processing conditions of the directory to be processed to the directory tree node operation unit, wherein the processing conditions of the directory to be processed are used to prevent the modification or creation operation of the directory to be processed from being repeatedly executed; The directory tree node operation unit is used to parse the directory tree according to the key-value pairs of the sub-directories at all levels of the directory tree corresponding to the directory to be processed, and obtain the node number of the directory to be processed; according to the node number of the directory to be processed, determine whether the directory to be processed meets the processing conditions of the directory to be processed, and when the directory to be processed meets the processing conditions of the directory to be processed, operate the directory to be processed.

14. An electronic device, characterized in that: include: processor; A memory for storing a method program, wherein when the program is read and executed by a processor, the method according to any one of claims 1 to 12 is executed.