CN108491549B - Method and device for creating file directory in distributed storage system - Google Patents

Method and device for creating file directory in distributed storage system Download PDF

Info

Publication number
CN108491549B
CN108491549B CN201810312603.3A CN201810312603A CN108491549B CN 108491549 B CN108491549 B CN 108491549B CN 201810312603 A CN201810312603 A CN 201810312603A CN 108491549 B CN108491549 B CN 108491549B
Authority
CN
China
Prior art keywords
directory
file
target file
node
database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810312603.3A
Other languages
Chinese (zh)
Other versions
CN108491549A (en
Inventor
徐佳宏
李银
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ipanel TV Inc
Original Assignee
Shenzhen Ipanel TV Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Ipanel TV Inc filed Critical Shenzhen Ipanel TV Inc
Priority to CN201810312603.3A priority Critical patent/CN108491549B/en
Publication of CN108491549A publication Critical patent/CN108491549A/en
Application granted granted Critical
Publication of CN108491549B publication Critical patent/CN108491549B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The application discloses a method and a device for creating a file directory in a distributed storage system, which are used for acquiring a storage path of a target file node in the distributed storage system; according to the storage path of the target file node in the distributed storage system, creating a file directory of the target file node and a mapping relation between the file directory of the target file node and the target file node, wherein the file directory comprises a directory identifier, a directory path and a parent identifier; and storing the mapping relation between the file directory of the target file node and the target file node in a database, and realizing the effective management of the file in the distributed storage system by the user through the mapping relation between the file directory and the file node.

Description

Method and device for creating file directory in distributed storage system
Technical Field
The present invention relates to the field of distributed storage technologies, and in particular, to a method and an apparatus for creating a file directory in a distributed storage system.
Background
Directory management for a distributed file system unlike directories of a local file system, the node information of a directory stores sub-directory nodes and file nodes thereunder. In distributed file storage systems, most of the use is of file nodes. Each file node is in parallel relation, and each file node is numbered according to a certain rule, namely the file node is the identifier of the file. The identification of this file will typically include information such as the path of the file on the disks of the distributed storage, where the file is stored on which disk, etc. This file is less readable to the average user. Management is difficult. For example, a user wants to delete a certain group of files, which needs to be recorded by the user, otherwise, the user does not know which file is the user.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for creating a file directory in a distributed storage system, so as to implement effective management of a file in the distributed storage system by a user through a mapping relationship between the file directory and a file node.
A method for creating a file directory in a distributed storage system comprises the following steps:
acquiring a storage path of a target file node in a distributed storage system;
according to the storage path of the target file node in the distributed storage system, creating a file directory of the target file node and a mapping relation between the file directory of the target file node and the target file node;
and storing the mapping relation between the file directory of the target file node and the target file node in a database.
Optionally, the file directory includes a directory identifier, a directory path, and a parent identifier.
Optionally, the creating a file directory of the target file node according to a storage path of the target file node in the distributed storage system includes:
adding the file name of the target file node to the tail end of a storage path of the target file node in a distributed storage system to obtain a directory path of the target file node;
analyzing the directory path of the target file node to obtain directories of multiple levels of the target file node;
traversing the directories at multiple levels of the target file nodes according to the hierarchical relation of the directories at multiple levels of the target file nodes from a root directory to obtain a current directory, wherein the current directory is the directory currently being traversed;
judging whether the current directory exists in a database or not;
if yes, judging whether the current directory is the last layer of directory in the directories of the multiple levels of the target file node;
if so, ending the traversal of the directories of the multiple levels of the target file nodes;
if not, determining the subdirectory of the current directory as a new current directory, and returning to execute whether the current directory exists in the judgment database;
if the current directory does not exist, the current directory is created in a database, the identifier of the current directory is obtained, the identifier of the parent directory of the current directory is set as the identifier of the directory of the previous level of the current directory, and the judgment of whether the current directory is the last layer of directory in the directories of the multiple levels of the target file node is returned.
Optionally, the method further includes:
receiving a query request which is sent by a user and carries a reference directory;
judging whether the reference catalogue exists in a database or not;
if the reference directory does not exist, the user is fed back that the reference directory does not exist;
and if so, inquiring the file directory or the file node corresponding to the reference directory in a database, and feeding back the file directory or the file node corresponding to the reference directory to the user.
Optionally, the method further includes:
receiving a deletion request which is sent by a user and carries a reference directory;
judging whether the reference catalogue exists in a database or not;
if the reference directory does not exist, the user is fed back that the reference directory does not exist;
if yes, inquiring a directory identifier corresponding to the reference directory in a database, and judging whether a file directory with the directory identifier corresponding to the reference directory as a parent identifier exists in the database;
if the file directory exists, feeding back directory deletion failure information to the user;
and if the file directory does not exist, deleting the file directory corresponding to the reference directory, and feeding back directory deletion success information to the user.
Optionally, the method further includes:
receiving a file deletion request which is sent by a user and carries a reference directory;
judging whether the reference catalogue exists in a database or not;
if the reference directory does not exist, the user is fed back that the reference directory does not exist;
and if so, inquiring a file node corresponding to the reference directory in a database, deleting a file corresponding to the file node, and feeding back file deletion success information to the user.
An apparatus for creating a file directory in a distributed storage system, comprising:
the acquisition unit is used for acquiring a storage path of a target file node in the distributed storage system;
the creating unit is used for creating a file directory of the target file node and a mapping relation between the file directory of the target file node and the target file node according to a storage path of the target file node in a distributed storage system;
and the storage unit is used for storing the mapping relation between the file directory of the target file node and the target file node in a database.
Optionally, the file directory includes a directory identifier, a directory path, and a parent identifier.
Optionally, the creating unit is specifically configured to add the filename of the target file node to the end of a storage path of the target file node in the distributed storage system, so as to obtain a directory path of the target file node; analyzing the directory path of the target file node to obtain directories of multiple levels of the target file node; traversing the directories at multiple levels of the target file nodes according to the hierarchical relation of the directories at multiple levels of the target file nodes from a root directory to obtain a current directory, wherein the current directory is the directory currently being traversed; judging whether the current directory exists in a database or not; if yes, judging whether the current directory is the last layer of directory in the directories of the multiple levels of the target file node; if so, ending the traversal of the directories of the multiple levels of the target file nodes; if not, determining the subdirectory of the current directory as a new current directory, and returning to execute whether the current directory exists in the judgment database; if the current directory does not exist, the current directory is created in a database, the identifier of the current directory is obtained, the identifier of the parent directory of the current directory is set as the identifier of the directory of the previous level of the current directory, and the judgment of whether the current directory is the last layer of directory in the directories of the multiple levels of the target file node is returned.
Optionally, the apparatus further comprises:
the query unit is used for receiving a query request which is sent by a user and carries a reference directory; judging whether the reference catalogue exists in a database or not; if the reference directory does not exist, the user is fed back that the reference directory does not exist; and if so, inquiring the file directory or the file node corresponding to the reference directory in a database, and feeding back the file directory or the file node corresponding to the reference directory to the user.
Optionally, the apparatus further comprises:
the directory deleting unit is used for receiving a deleting request which is sent by a user and carries a reference directory; judging whether the reference catalogue exists in a database or not; if the reference directory does not exist, the user is fed back that the reference directory does not exist; if yes, inquiring a directory identifier corresponding to the reference directory in a database, and judging whether a file directory with the directory identifier corresponding to the reference directory as a parent identifier exists in the database; if the file directory exists, feeding back directory deletion failure information to the user; and if the file directory does not exist, deleting the file directory corresponding to the reference directory, and feeding back directory deletion success information to the user.
Optionally, the apparatus further comprises:
the file deleting unit is used for receiving a file deleting request which is sent by a user and carries a reference directory; judging whether the reference catalogue exists in a database or not; if the reference directory does not exist, the user is fed back that the reference directory does not exist; and if so, inquiring a file node corresponding to the reference directory in a database, deleting a file corresponding to the file node, and feeding back file deletion success information to the user.
Compared with the prior art, the invention has the following beneficial effects:
the invention discloses a method and a device for creating a file directory in a distributed storage system. When a user needs to access a certain file, the file node corresponding to the file can be obtained only by inquiring in the database according to the storage path of the file, and the effective management of the file in the distributed storage system by the user is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for creating a file directory in a distributed storage system according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for creating a file directory according to an embodiment of the present invention;
FIG. 3 is a flowchart of a directory query method according to an embodiment of the present invention;
FIG. 4 is a flowchart of a directory deletion method according to an embodiment of the present invention;
FIG. 5 is a flowchart of a file deleting method according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a file directory creating apparatus in a distributed storage system according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, the present embodiment discloses a method for creating a file directory in a distributed storage system, which specifically includes the following steps:
s101: acquiring a storage path of a target file node in a distributed storage system;
s102: according to the storage path of the target file node in the distributed storage system, creating a file directory of the target file node and a mapping relation between the file directory of the target file node and the target file node;
optionally, the file directory includes a directory identifier, a directory path, and a parent identifier.
On this basis, referring to fig. 2, the creating a file directory of the target file node according to the storage path of the target file node in the distributed storage system includes:
s201: adding the file name of the target file node to the tail end of a storage path of the target file node in a distributed storage system to obtain a directory path of the target file node;
s202: analyzing the directory path of the target file node to obtain directories of multiple levels of the target file node;
s203: traversing the directories at multiple levels of the target file node according to the hierarchical relation of the directories at multiple levels of the target file node from a root directory to obtain a current directory;
the current directory is a directory currently traversed;
s204: judging whether the current directory exists in a database or not;
if yes, executing S205: judging whether the current directory is the last layer directory in the directories of the multiple levels of the target file node;
if yes, executing S206: ending traversal of the directories of the multiple levels of the target file node;
if not, executing S207: determining the subdirectory of the current directory as a new current directory, and returning to execute S204;
if not, go to step S208: creating the current directory in a database, obtaining the identifier of the current directory, setting the identifier of the parent directory of the current directory as the identifier of the directory of the previous hierarchy of the current directory, and returning to execute S207.
Taking the storage path as "/home/second" file name as "third" as an example, the directory path of the target file node is obtained as "/home/second/third".
First, we split "/home/second/third" into the following directory format
/
/home
/home/second
/home/second/third
Then, check if the "/" root directory exists, if not, create the "/" directory in the database, please refer to table 1, the directory id is 1, and the parent id is 0. If yes, the directory identifier of the root directory is obtained without creating.
Thirdly, checking whether the/home directory exists or not, if not, creating a record of the directory, generating a unique directory identifier, and setting the parent-level identifier as a previous-layer directory identifier; if so, the creation is not repeated. The "directory identification" of the level is obtained.
Fourthly, checking whether the/home/second directory exists or not, if not, creating a record of the directory, generating a unique directory identifier, and setting the parent identifier as a previous layer directory identifier; if so, the creation is not repeated. The "directory identification" of the level is obtained.
Fifthly, checking whether the 'home/second/third' directory exists or not, if not, creating a record of the directory, generating a unique directory identifier, and setting the parent identifier as the directory identifier of the previous layer; if so, the creation is not repeated. The "directory identification" of the level is obtained.
S103: and storing the mapping relation between the file directory of the target file node and the target file node in a database.
And (3) directory identification: the method is described for the directory, the identifier of the root directory starts from 1, and the corresponding directory identifiers of all the following directories are not repeated.
Directory path: the path here includes a directory path or a file path, and the path here is an absolute path starting with "/". The middle does not allow for a path description of "." or ". multidot.. The end of a file or directory does not apply to the "/' end. The path middle may include a space. The description of the previous part of the path of a child directory or subfile must be identical to the path of the parent.
Parent level identification: this indicates which directory is the last level of the record and is used to determine to which directory this directory or file belongs. The parent identifier of the root directory "/" is 0, which means that the root directory, all other subdirectories or files point to the directory above the root directory, and the identifier is used for indexing which directory below the subdirectories is convenient for indexing. The index efficiency is improved.
File node: if the column has file association, a corresponding value exists; if the value in the column is empty for a directory. The file node is record information associated with an actual file.
Referring to table 1, a table of the mapping relationship between the file directory of the file node and the target file node stored in the database is as follows:
TABLE 1
Figure BDA0001622860800000081
The embodiment discloses a method for creating a file directory in a distributed storage system, which creates a file directory of a target file node and a mapping relationship between the file directory of the target file node and the target file node according to a storage path of the target file node in the distributed storage system, and stores the mapping relationship between the file directory of the target file node and the target file node in a database. When a user needs to access a certain file, the file node corresponding to the file can be obtained only by inquiring in the database according to the storage path of the file, and the effective management of the file in the distributed storage system by the user is realized.
After the mapping relationship between the file directory of the target file node and the target file node is stored in the database, the file directory may be queried, specifically referring to fig. 3, where the directory querying method specifically includes the following steps:
s301: receiving a query request which is sent by a user and carries a reference directory;
s302: judging whether the reference catalogue exists in a database or not;
if not, go to step S303: feeding back to the user that the reference directory does not exist;
if yes, executing S304: and inquiring a file directory or a file node corresponding to the reference directory in a database, and feeding back the file directory or the file node corresponding to the reference directory to the user.
The user gives a reference directory, and acquires all directories or files under the directory in the database by using the reference directory.
First, it is checked whether a reference directory given by the user exists. And inquiring whether the directory given by the user exists in the column of the directory path, and if not, feeding back that the reference directory does not exist to the user. Otherwise, 3 pieces of information of the directory identifier, the parent identifier and the file node of the directory are inquired. And the "file node" field is empty, indicating that the reference directory given by the user is a directory, otherwise the user queries a file, not a directory. Suppose the query path is "/home", the query has "directory id" of 2, and "parent id" of 1.
Secondly, the records of the queried directory identifier in the database table are searched through the queried directory identifier. Assuming that the query path is all subdirectories of "/home", the files are filtered out. The query is for all records with a parent id of 2 and a file node of null. The query results are as follows:
/home/name1
/home/name2
and feeding back the inquired result to the user.
The present invention also supports the directory deletion function, and referring to fig. 4, a directory deletion method includes:
s401: receiving a deletion request which is sent by a user and carries a reference directory;
s402: judging whether the reference catalogue exists in a database or not;
if not, executing S403: feeding back to the user that the reference directory does not exist;
if yes, go to S404: inquiring a directory identifier corresponding to the reference directory in a database;
s405: judging whether a file directory with a directory identifier corresponding to the reference directory as a parent identifier exists in a database;
if the file directory exists, execute S406: feeding back directory deletion failure information to the user;
if no file directory exists, execute S407: and deleting the file directory corresponding to the reference directory, and feeding back directory deletion success information to the user.
The most basic requirement for deleting a directory is that the directory must be an empty directory. There are no subdirectories or files under a given directory. The specific frying steps are as follows:
suppose there is a directory "/home" that needs to be deleted.
Firstly, checking whether the directory exists or not, and if not, directly feeding back that the user directory does not exist.
Second, check for presence, obtain the "directory id" for the directory.
And thirdly, searching the parent-level identification in the database table, and if the parent-level identification is capable of searching the directory identification corresponding to the given path. Indicating that the directory is not empty, the delete failure is returned directly.
Fourthly, the number of the searched records is 0, the directory is directly deleted, and the success of the user is fed back.
The present invention also supports a file deletion function, and referring to fig. 5, a file deletion method includes the following steps:
s501: receiving a file deletion request which is sent by a user and carries a reference directory;
s502: judging whether the reference catalogue exists in a database or not;
if not, go to step S503: feeding back to the user that the reference directory does not exist;
if yes, executing S504: and inquiring a file node corresponding to the reference directory in a database, deleting a file corresponding to the file node, and feeding back file deletion success information to the user.
It will be appreciated that file deletion is relatively simple, looking up the file name of the routed path given by the user directly in a database table. Searching the database, and if the database does not exist, returning failure; if yes, extracting 'file node' information in the record, and deleting the inquired record. And then deleting the specific content information of the file according to the file node.
Referring to fig. 6, the embodiment correspondingly discloses a device for creating a file directory in a distributed storage system, which specifically includes:
an obtaining unit 601, configured to obtain a storage path of a target file node in a distributed storage system;
a creating unit 602, configured to create a file directory of the target file node and a mapping relationship between the file directory of the target file node and the target file node according to a storage path of the target file node in a distributed storage system;
optionally, the file directory includes a directory identifier, a directory path, and a parent identifier.
On this basis, the creating unit 602 is specifically configured to add the file name of the target file node to the end of the storage path of the target file node in the distributed storage system, so as to obtain the directory path of the target file node; analyzing the directory path of the target file node to obtain directories of multiple levels of the target file node; traversing the directories at multiple levels of the target file nodes according to the hierarchical relation of the directories at multiple levels of the target file nodes from a root directory to obtain a current directory, wherein the current directory is the directory currently being traversed; judging whether the current directory exists in a database or not; if yes, judging whether the current directory is the last layer of directory in the directories of the multiple levels of the target file node; if so, ending the traversal of the directories of the multiple levels of the target file nodes; if not, determining the subdirectory of the current directory as a new current directory, and returning to execute whether the current directory exists in the judgment database; if the current directory does not exist, the current directory is created in a database, the identifier of the current directory is obtained, the identifier of the parent directory of the current directory is set as the identifier of the directory of the previous level of the current directory, and the judgment of whether the current directory is the last layer of directory in the directories of the multiple levels of the target file node is returned.
The storage unit 603 is configured to store the mapping relationship between the file directory of the target file node and the target file node in a database.
Optionally, the apparatus further comprises:
the query unit is used for receiving a query request which is sent by a user and carries a reference directory; judging whether the reference catalogue exists in a database or not; if the reference directory does not exist, the user is fed back that the reference directory does not exist; and if so, inquiring the file directory or the file node corresponding to the reference directory in a database, and feeding back the file directory or the file node corresponding to the reference directory to the user.
The directory deleting unit is used for receiving a deleting request which is sent by a user and carries a reference directory; judging whether the reference catalogue exists in a database or not; if the reference directory does not exist, the user is fed back that the reference directory does not exist; if yes, inquiring a directory identifier corresponding to the reference directory in a database, and judging whether a file directory with the directory identifier corresponding to the reference directory as a parent identifier exists in the database; if the file directory exists, feeding back directory deletion failure information to the user; and if the file directory does not exist, deleting the file directory corresponding to the reference directory, and feeding back directory deletion success information to the user.
The file deleting unit is used for receiving a file deleting request which is sent by a user and carries a reference directory; judging whether the reference catalogue exists in a database or not; if the reference directory does not exist, the user is fed back that the reference directory does not exist; and if so, inquiring a file node corresponding to the reference directory in a database, deleting a file corresponding to the file node, and feeding back file deletion success information to the user.
The device for creating a file directory in a distributed storage system disclosed in this embodiment creates a file directory of a target file node and a mapping relationship between the file directory of the target file node and the target file node according to a storage path of the target file node in the distributed storage system, and stores the mapping relationship between the file directory of the target file node and the target file node in a database. When a user needs to access a certain file, the file node corresponding to the file can be obtained only by inquiring in the database according to the storage path of the file, and the effective management of the file in the distributed storage system by the user is realized.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A method for creating a file directory in a distributed storage system is characterized by comprising the following steps:
acquiring a storage path of a target file node in a distributed storage system;
according to the storage path of the target file node in the distributed storage system, creating a file directory of the target file node and a mapping relation between the file directory of the target file node and the target file node; the file directory comprises a directory identifier, a directory path and a parent identifier;
storing the mapping relation between the file directory of the target file node and the target file node in a database;
the creating a file directory of the target file node according to the storage path of the target file node in the distributed storage system includes:
adding the file name of the target file node to the tail end of a storage path of the target file node in a distributed storage system to obtain a directory path of the target file node;
analyzing the directory path of the target file node to obtain directories of multiple levels of the target file node;
traversing the directories at multiple levels of the target file nodes according to the hierarchical relation of the directories at multiple levels of the target file nodes from a root directory to obtain a current directory, wherein the current directory is the directory currently being traversed;
judging whether the current directory exists in a database or not;
if yes, judging whether the current directory is the last layer of directory in the directories of the multiple levels of the target file node;
if so, ending the traversal of the directories of the multiple levels of the target file nodes;
if not, determining the subdirectory of the current directory as a new current directory, and returning to execute whether the current directory exists in the judgment database;
if the current directory does not exist, the current directory is created in a database, the identifier of the current directory is obtained, the identifier of the parent directory of the current directory is set as the identifier of the directory of the previous level of the current directory, and the judgment of whether the current directory is the last layer of directory in the directories of the multiple levels of the target file node is returned.
2. The method of claim 1, further comprising:
receiving a query request which is sent by a user and carries a reference directory;
judging whether the reference catalogue exists in a database or not;
if the reference directory does not exist, the user is fed back that the reference directory does not exist;
and if so, inquiring the file directory or the file node corresponding to the reference directory in a database, and feeding back the file directory or the file node corresponding to the reference directory to the user.
3. The method of claim 1, further comprising:
receiving a deletion request which is sent by a user and carries a reference directory;
judging whether the reference catalogue exists in a database or not;
if the reference directory does not exist, the user is fed back that the reference directory does not exist;
if yes, inquiring a directory identifier corresponding to the reference directory in a database, and judging whether a file directory with the directory identifier corresponding to the reference directory as a parent identifier exists in the database;
if the file directory exists, feeding back directory deletion failure information to the user;
and if the file directory does not exist, deleting the file directory corresponding to the reference directory, and feeding back directory deletion success information to the user.
4. The method of claim 1, further comprising:
receiving a file deletion request which is sent by a user and carries a reference directory;
judging whether the reference catalogue exists in a database or not;
if the reference directory does not exist, the user is fed back that the reference directory does not exist;
and if so, inquiring a file node corresponding to the reference directory in a database, deleting a file corresponding to the file node, and feeding back file deletion success information to the user.
5. An apparatus for creating a file directory in a distributed storage system, comprising:
the acquisition unit is used for acquiring a storage path of a target file node in the distributed storage system;
the creating unit is used for creating a file directory of the target file node and a mapping relation between the file directory of the target file node and the target file node according to a storage path of the target file node in a distributed storage system; the file directory comprises a directory identifier, a directory path and a parent identifier;
the storage unit is used for storing the mapping relation between the file directory of the target file node and the target file node in a database;
the creating unit is specifically configured to add the filename of the target file node to the end of a storage path of the target file node in the distributed storage system, so as to obtain a directory path of the target file node; analyzing the directory path of the target file node to obtain directories of multiple levels of the target file node; traversing the directories at multiple levels of the target file nodes according to the hierarchical relation of the directories at multiple levels of the target file nodes from a root directory to obtain a current directory, wherein the current directory is the directory currently being traversed; judging whether the current directory exists in a database or not; if yes, judging whether the current directory is the last layer of directory in the directories of the multiple levels of the target file node; if so, ending the traversal of the directories of the multiple levels of the target file nodes; if not, determining the subdirectory of the current directory as a new current directory, and returning to execute whether the current directory exists in the judgment database; if the current directory does not exist, the current directory is created in a database, the identifier of the current directory is obtained, the identifier of the parent directory of the current directory is set as the identifier of the directory of the previous level of the current directory, and the judgment of whether the current directory is the last layer of directory in the directories of the multiple levels of the target file node is returned.
6. The apparatus of claim 5, further comprising:
the query unit is used for receiving a query request which is sent by a user and carries a reference directory; judging whether the reference catalogue exists in a database or not; if the reference directory does not exist, the user is fed back that the reference directory does not exist; and if so, inquiring the file directory or the file node corresponding to the reference directory in a database, and feeding back the file directory or the file node corresponding to the reference directory to the user.
7. The apparatus of claim 5, further comprising:
the directory deleting unit is used for receiving a deleting request which is sent by a user and carries a reference directory; judging whether the reference catalogue exists in a database or not; if the reference directory does not exist, the user is fed back that the reference directory does not exist; if yes, inquiring a directory identifier corresponding to the reference directory in a database, and judging whether a file directory with the directory identifier corresponding to the reference directory as a parent identifier exists in the database; if the file directory exists, feeding back directory deletion failure information to the user; and if the file directory does not exist, deleting the file directory corresponding to the reference directory, and feeding back directory deletion success information to the user.
8. The apparatus of claim 5, further comprising:
the file deleting unit is used for receiving a file deleting request which is sent by a user and carries a reference directory; judging whether the reference catalogue exists in a database or not; if the reference directory does not exist, the user is fed back that the reference directory does not exist; and if so, inquiring a file node corresponding to the reference directory in a database, deleting a file corresponding to the file node, and feeding back file deletion success information to the user.
CN201810312603.3A 2018-04-09 2018-04-09 Method and device for creating file directory in distributed storage system Active CN108491549B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810312603.3A CN108491549B (en) 2018-04-09 2018-04-09 Method and device for creating file directory in distributed storage system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810312603.3A CN108491549B (en) 2018-04-09 2018-04-09 Method and device for creating file directory in distributed storage system

Publications (2)

Publication Number Publication Date
CN108491549A CN108491549A (en) 2018-09-04
CN108491549B true CN108491549B (en) 2022-02-01

Family

ID=63315166

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810312603.3A Active CN108491549B (en) 2018-04-09 2018-04-09 Method and device for creating file directory in distributed storage system

Country Status (1)

Country Link
CN (1) CN108491549B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109284629B (en) * 2018-09-13 2021-08-31 郑州云海信息技术有限公司 Authority control method and system of distributed file storage system
CN111209259B (en) * 2018-11-22 2023-09-05 杭州海康威视系统技术有限公司 NAS distributed file system and data processing method
CN109783449A (en) * 2018-12-13 2019-05-21 深圳壹账通智能科技有限公司 Data query processing method, platform, system and readable storage medium storing program for executing
CN110765073B (en) * 2019-09-11 2022-06-07 厦门卫星定位应用股份有限公司 File management method, medium, device and apparatus for distributed storage system
CN111966633B (en) * 2020-08-14 2024-04-09 北京百度网讯科技有限公司 Method, device, electronic equipment and medium for inquiring child node under directory
CN112148680B (en) * 2020-09-27 2024-04-05 极道科技(北京)有限公司 File system metadata management method based on distributed graph database
CN112612749B (en) * 2020-12-15 2023-07-04 重庆电子工程职业学院 Intelligent security management storage system
CN113282551B (en) * 2021-07-22 2022-05-31 阿里云计算有限公司 Data processing method, system and equipment
CN115293365A (en) * 2022-08-23 2022-11-04 网络通信与安全紫金山实验室 Management method, device, management platform and storage medium of machine learning model

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622412A (en) * 2011-11-28 2012-08-01 中兴通讯股份有限公司 Method and device of concurrent writes for distributed file system
CN103150394A (en) * 2013-03-25 2013-06-12 中国人民解放军国防科学技术大学 Distributed file system metadata management method facing to high-performance calculation
CN104537076A (en) * 2014-12-31 2015-04-22 北京奇艺世纪科技有限公司 File reading and writing method and device
CN105989007A (en) * 2015-01-27 2016-10-05 珠海金山办公软件有限公司 File path processing method and device
CN106682003A (en) * 2015-11-06 2017-05-17 中国电信股份有限公司 Path segmentation mapping method and device for distributed memory namespace
CN106874370A (en) * 2016-12-30 2017-06-20 厦门天锐科技股份有限公司 A kind of method for quickly retrieving of catalogue file

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9619295B1 (en) * 2008-05-21 2017-04-11 Qualcomm Incorporated Distributed system for application processing
CN102779185B (en) * 2012-06-29 2014-11-12 浙江大学 High-availability distribution type full-text index method
CN103064906B (en) * 2012-12-18 2016-08-03 华为技术有限公司 File management method and device
CN106919347A (en) * 2017-02-28 2017-07-04 北京华云网际科技有限公司 The creation method and device of the catalogue of distributed block storage system
CN107341207B (en) * 2017-06-23 2020-03-17 深圳市盛路物联通讯技术有限公司 Node information management method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622412A (en) * 2011-11-28 2012-08-01 中兴通讯股份有限公司 Method and device of concurrent writes for distributed file system
CN103150394A (en) * 2013-03-25 2013-06-12 中国人民解放军国防科学技术大学 Distributed file system metadata management method facing to high-performance calculation
CN104537076A (en) * 2014-12-31 2015-04-22 北京奇艺世纪科技有限公司 File reading and writing method and device
CN105989007A (en) * 2015-01-27 2016-10-05 珠海金山办公软件有限公司 File path processing method and device
CN106682003A (en) * 2015-11-06 2017-05-17 中国电信股份有限公司 Path segmentation mapping method and device for distributed memory namespace
CN106874370A (en) * 2016-12-30 2017-06-20 厦门天锐科技股份有限公司 A kind of method for quickly retrieving of catalogue file

Also Published As

Publication number Publication date
CN108491549A (en) 2018-09-04

Similar Documents

Publication Publication Date Title
CN108491549B (en) Method and device for creating file directory in distributed storage system
KR100856245B1 (en) File system device and method for saving and seeking file thereof
CN103282899B (en) The storage method of data, access method and device in file system
CN104572670B (en) A kind of storage of small documents, inquiry and delet method and system
CN103077199B (en) A kind of file resource Search and Orientation method and device
CN111045857B (en) Method for data backup and recovery, electronic device and computer readable storage medium
US9830324B2 (en) Content based organization of file systems
KR100946055B1 (en) Heterogeneous indexing for annotation systems
CN111209259B (en) NAS distributed file system and data processing method
US7287046B2 (en) Method and system of compacting sparse directories in a file system
CN106874481B (en) Method and system for reading metadata information of distributed file system
US8321487B1 (en) Recovery of directory information
CN109446160A (en) A kind of file reading, system, device and computer readable storage medium
US20130212136A1 (en) File list generation method, system, and program, and file list generation device
CN102169507A (en) Distributed real-time search engine
CN103384256A (en) Cloud storage method and device
CN106201771A (en) Data-storage system and data read-write method
CN109284273B (en) Massive small file query method and system adopting suffix array index
CN107679420B (en) Permission setting method and system based on distributed file system
CN115185891A (en) Data management method and device of file system, electronic equipment and storage medium
US20080250017A1 (en) System and method for aiding file searching and file serving by indexing historical filenames and locations
CN101866356B (en) Structural management method for disk directory information
CN100357943C (en) A method for inspecting garbage files in cluster file system
CN107832455B (en) Data acquisition method, system, equipment and storage medium of storage object
US8086638B1 (en) File handle banking to provide non-disruptive migration of files

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant