CN114896206A - Retrieval method and device of object storage file system - Google Patents

Retrieval method and device of object storage file system Download PDF

Info

Publication number
CN114896206A
CN114896206A CN202210460407.7A CN202210460407A CN114896206A CN 114896206 A CN114896206 A CN 114896206A CN 202210460407 A CN202210460407 A CN 202210460407A CN 114896206 A CN114896206 A CN 114896206A
Authority
CN
China
Prior art keywords
information
tree node
directory tree
node meta
object storage
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.)
Pending
Application number
CN202210460407.7A
Other languages
Chinese (zh)
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.)
Jingdong City Beijing Digital Technology Co Ltd
Original Assignee
Jingdong City Beijing Digital Technology Co Ltd
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 Jingdong City Beijing Digital Technology Co Ltd filed Critical Jingdong City Beijing Digital Technology Co Ltd
Priority to CN202210460407.7A priority Critical patent/CN114896206A/en
Publication of CN114896206A publication Critical patent/CN114896206A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/164File meta data generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files

Abstract

The invention discloses a retrieval method and a retrieval device of an object storage file system, and relates to the technical field of computers. One embodiment of the method comprises: obtaining directory tree node meta-information transferred by a hook function; the hook function is established in an object storage file system and used for transmitting the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, wherein the directory tree node meta-information comprises a directory name, a file name and the last modification time; and storing the directory tree node meta information in an external index system and establishing a full-text index for all fields of the directory tree node meta information, wherein the external index system is independent of the object storage file system. The implementation method can solve the technical problems that the computing resource consumption is large, the index cannot be dynamically expanded, and the non-index field retrieval is not supported.

Description

Retrieval method and device of object storage file system
Technical Field
The invention relates to the technical field of computers, in particular to a retrieval method and a retrieval device of an object storage file system.
Background
In object storage file systems, file indexing is typically done internally by building a B-Tree (Multi-way search Tree) or other data structure for the directory Tree of the file system. The index is triggered to be updated in real time by the change of the directory tree of the file system, and when a large quantity of files are written, a large amount of computing resources are consumed by index updating, so that the performance of the object storage system is obviously reduced. In addition, the inside of the file system is usually only used for establishing indexes for preset fields, and the indexes cannot be changed or dynamically expanded after the indexes are established, so that the file system does not support the retrieval for non-index fields.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for retrieving an object storage file system, so as to solve the technical problems of high computing resource consumption, incapability of dynamically expanding an index, and incapability of supporting non-index field retrieval.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a retrieval method of an object storage file system, including:
obtaining directory tree node meta-information transferred by a hook function; the hook function is established in an object storage file system and used for transmitting the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, wherein the directory tree node meta-information comprises a directory name, a file name and the last modification time;
and storing the directory tree node meta information in an external index system and establishing a full-text index for all fields of the directory tree node meta information, wherein the external index system is independent of the object storage file system.
Optionally, obtaining the directory tree node meta information transferred by the hook function includes:
obtaining a message from the message queue and consuming the message, thereby obtaining directory tree node meta-information; and the hook function is used for sending the changed directory tree node meta-information to the message queue in an asynchronous mode when the directory tree node meta-information is changed.
Optionally, the directory tree node meta information further includes a file operation type, a file size, a file creator, a file creation time, and a file version number.
Optionally, after storing the directory tree node meta information in an external indexing system and establishing a full-text index for all fields of the directory tree node meta information, the method further includes:
receiving an index query request sent by a client;
retrieving a retrieval result corresponding to the index query request from the external index system;
returning the retrieval result to the client;
wherein each item of content in the retrieval result comprises directory tree node meta-information.
In addition, according to another aspect of an embodiment of the present invention, there is provided a method for retrieving an object storage file system, including:
establishing a hook function in an object storage file system, wherein the hook function is used for transmitting the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, and the directory tree node meta-information comprises a directory name, a file name and the last modification time;
obtaining directory tree node meta-information transferred by the hook function;
and storing the directory tree node meta information in an external index system and establishing a full-text index for all fields of the directory tree node meta information, wherein the external index system is independent of the object storage file system.
Optionally, the hook function is configured to send the changed meta information of the directory tree node to the message queue in an asynchronous manner when the meta information of the directory tree node is changed.
Optionally, obtaining the directory tree node meta information transferred by the hook function includes:
and acquiring the message from the message queue and consuming the message, thereby obtaining the node meta-information of the directory tree.
Optionally, the directory tree node meta information further includes a file operation type, a file size, a file creator, a file creation time, and a file version number.
Optionally, after storing the directory tree node meta information in an external indexing system and establishing a full-text index for all fields of the directory tree node meta information, the method further includes:
receiving an index query request sent by a client;
retrieving a retrieval result corresponding to the index query request from the external index system;
returning the retrieval result to the client;
wherein each item of content in the retrieval result comprises directory tree node meta-information.
Optionally, after the retrieving result is returned to the client, the method further includes:
receiving a file read-write request sent by the client; the file reading and writing request carries a directory name and a file name;
reading a target file corresponding to the file read-write request from the object storage file system;
and returning the target file and the global label of the target file to the client.
Optionally, the global tag is a last modification time or a file version number.
In addition, according to another aspect of the embodiments of the present invention, there is provided a retrieving apparatus of an object storage file system, including:
the acquisition module is used for acquiring directory tree node meta-information transferred by the hook function; the hook function is established in an object storage file system and used for transmitting the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, wherein the directory tree node meta-information comprises a directory name, a file name and the last modification time;
and the storage module is used for storing the directory tree node meta-information in an external index system and establishing full-text index for all fields of the directory tree node meta-information, and the external index system is independent of the object storage file system.
Optionally, the obtaining module is further configured to:
obtaining a message from the message queue and consuming the message, thereby obtaining directory tree node meta-information; and the hook function is used for sending the changed directory tree node meta-information to the message queue in an asynchronous mode when the directory tree node meta-information is changed.
Optionally, the directory tree node meta information further includes a file operation type, a file size, a file creator, a file creation time, and a file version number.
Optionally, the system further comprises a retrieving module, configured to:
receiving an index query request sent by a client;
retrieving a retrieval result corresponding to the index query request from the external index system;
returning the retrieval result to the client;
wherein each item of content in the retrieval result comprises directory tree node meta-information.
In addition, according to another aspect of the embodiments of the present invention, there is provided a retrieving apparatus of an object storage file system, including:
the device comprises an establishing module, a processing module and a modification module, wherein the establishing module is used for establishing a hook function in an object storage file system, the hook function is used for transmitting the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, and the directory tree node meta-information comprises a directory name, a file name and the last modification time;
the acquisition module is used for acquiring the directory tree node meta-information transferred by the hook function;
and the storage module is used for storing the directory tree node meta-information in an external index system and establishing full-text index for all fields of the directory tree node meta-information, and the external index system is independent of the object storage file system.
Optionally, the hook function is configured to send the changed directory tree node meta information to the message queue in an asynchronous manner when the directory tree node meta information is changed.
Optionally, the obtaining module is further configured to:
and acquiring the message from the message queue and consuming the message, thereby obtaining the node meta-information of the directory tree.
Optionally, the directory tree node meta information further includes a file operation type, a file size, a file creator, a file creation time, and a file version number.
Optionally, the system further comprises a retrieving module, configured to:
receiving an index query request sent by a client;
retrieving a retrieval result corresponding to the index query request from the external index system;
returning the retrieval result to the client;
wherein each item of content in the retrieval result comprises directory tree node meta-information.
Optionally, the apparatus further includes a read-write module, configured to:
receiving a file read-write request sent by the client; the file reading and writing request carries a directory name and a file name;
reading a target file corresponding to the file read-write request from the object storage file system;
and returning the target file and the global label of the target file to the client.
Optionally, the global tag is a last modification time or a file version number.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any of the embodiments described above.
According to another aspect of the embodiments of the present invention, there is also provided a computer readable medium, on which a computer program is stored, which when executed by a processor implements the method of any of the above embodiments.
One embodiment of the above invention has the following advantages or benefits: because the technical means of acquiring the directory tree node meta-information transferred by the hook function, storing the directory tree node meta-information in an external index system independent of an object storage file system and establishing full-text indexes for all fields in the directory tree node meta-information are adopted, the technical problems that in the prior art, the computing resource consumption is large, the indexes cannot be dynamically expanded and non-index field retrieval is not supported are solved. When the directory tree node meta-information of the object storage file system is changed, the embodiment of the invention transfers the changed directory tree node meta-information through the hook function, and the index updating is not directly performed inside the object storage file system, but the directory tree node meta-information is stored in an external index system and a full-text index is established for the directory tree node meta-information, so that the influence on the performance of the object storage file system when large-batch data is changed can be avoided, and information retrieval and fuzzy query of any dimension can be performed in the external index system.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main flow of a retrieval method of an object store file system according to one embodiment of the present invention;
FIG. 2 is a schematic diagram of creating a full-text index according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a main flow of a retrieval method of an object storage file system according to a referential embodiment of the present invention;
FIG. 4 is a schematic diagram of retrieving a file from an object store file system according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of creating an index and retrieving files according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a main flow of a retrieval method of an object storage file system according to another embodiment of the present invention;
FIG. 7 is a diagram illustrating a main flow of a retrieval method of an object storage file system according to another referential embodiment of the present invention;
FIG. 8 is a schematic diagram of the main modules of a retrieval apparatus of an object storage file system according to one embodiment of the present invention;
FIG. 9 is a schematic diagram of the main modules of a retrieving apparatus of an object storage file system according to another embodiment of the present invention;
FIG. 10 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 11 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a retrieval method of an object storage file system according to an embodiment of the present invention. As an embodiment of the present invention, as shown in fig. 1, the method for retrieving the object storage file system may include:
step 101, obtaining directory tree node meta-information transferred by a hook function; the hook function is established in the object storage file system and used for transmitting the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, wherein the directory tree node meta-information comprises a directory name, a file name and the last modification time.
In order to transmit the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, a hook function T is firstly established in the object storage file system, and a directory tree node meta-information change event is constructed through the hook function. When a client side creates, modifies or deletes files and directories in the object storage file system through the object storage interface, the object storage file system calls a hook function at the directory tree change position, and the directory tree node meta-information is referred through the hook function. It should be noted that the hook function is called and then returns immediately without blocking, so that the normal change flow of the directory tree in the object storage file system is not affected.
Optionally, the directory tree node meta-information includes necessary information such as a directory name, a file name, and a last modification time, and the file and the directory can be accurately located through the directory tree node meta-information. Optionally, the directory tree node meta-information may further include a file operation type, a file size, a file creator, a file creation time, and a file version number, and the information is transmitted to facilitate an external indexing system to construct a full-text index, so that a client can conveniently perform full-text retrieval in the external indexing system through the information. It should be noted that each time a file is modified, the file version number is sequentially incremented.
Optionally, the hook function is configured to send the changed directory tree node meta information to the message queue in an asynchronous manner when the directory tree node meta information is changed. As shown in fig. 2, when a client performs creation, modification or deletion operations on files and directories in an object storage file system through an object storage interface, a hook function triggers a change event (directory tree node meta-information) to be cached in a server internal queue, and the event is sent to a message queue in an asynchronous manner.
When a client side creates, modifies or deletes files and directories in an object storage file system through an object storage interface, the object storage file system calls a hook function at a directory tree change position, and transmits and refers to directory tree node meta-information through the hook function, so that the directory tree node meta-information is obtained
Optionally, step 101 may comprise: and acquiring the message from the message queue and consuming the message, thereby obtaining the node meta-information of the directory tree. As shown in fig. 2, when a client performs creation, modification or deletion operations on files and directories in an object storage file system through an object storage interface, a hook function triggers a change event (directory tree node meta-information) to send the event to a message queue in an asynchronous manner, and then an external indexing system acquires messages from the message queue and consumes the messages, thereby obtaining directory tree node meta-information.
And 102, storing the directory tree node meta information in an external index system and establishing a full-text index for all fields of the directory tree node meta information, wherein the external index system is independent of the object storage file system.
The obtained directory tree node meta-information is stored in an external index system, and the external index system establishes full-text indexes for all fields of the directory tree node meta-information instead of establishing indexes for specific fields so as to support information retrieval and fuzzy retrieval of any dimensionality.
Therefore, when the client retrieves the object storage file, the directory tree node meta-information is retrieved from the external index system, and then the target file is located in the object storage file system through the directory tree node meta-information, so as to perform file operations on the target file, such as file operations of creation, modification or deletion.
Optionally, the last modification time or the file version number may be used as a global tag, and the embodiment of the present invention stores the global tag in the meta information of each directory tree node to determine whether the node is in the latest state, and returns the global tag to the client together in the search result, which facilitates the client to process the delay of the index system.
According to the various embodiments described above, it can be seen that the technical means of the embodiments of the present invention, by obtaining the directory tree node meta-information transferred by the hook function, storing the directory tree node meta-information in the external index system independent of the object storage file system and establishing the full-text index for all the fields in the directory tree node meta-information, solves the technical problems in the prior art that the computing resource consumption is large, the index cannot be dynamically expanded, and the non-indexed field retrieval is not supported. When the directory tree node meta-information of the object storage file system is changed, the embodiment of the invention transfers the changed directory tree node meta-information through the hook function, and the index updating is not directly performed inside the object storage file system, but the directory tree node meta-information is stored in an external index system and full-text index is established for the directory tree node meta-information, so that the influence on the performance of the object storage file system when large-batch data is changed can be avoided, and information retrieval and fuzzy retrieval of any dimensionality can be performed in the external index system.
Fig. 3 is a schematic diagram of a main flow of a retrieval method of an object storage file system according to a referential embodiment of the present invention. As still another embodiment of the present invention, as shown in fig. 3, the method for retrieving the object storage file system may include:
step 301, obtaining directory tree node meta-information transferred by a hook function; the hook function is established in the object storage file system and used for transmitting the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, wherein the directory tree node meta-information comprises a directory name, a file name and the last modification time.
Step 302, storing the directory tree node meta information in an external index system and establishing a full-text index for all fields of the directory tree node meta information, wherein the external index system is independent of the object storage file system.
Step 303, receiving an index query request sent by a client.
After the full-text index is established in the external index system, as shown in fig. 4, the client can perform information retrieval and fuzzy retrieval of any dimension, such as directory name, file name, last modification time, file operation type, file size, file creator, file creation time, file version number, and the like, through an interface provided by the external index system.
Step 304, retrieving a retrieval result corresponding to the index query request from the external index system. Wherein each item of content in the retrieval result comprises directory tree node meta-information.
The index query request carries a retrieval field input by a user through a client, and an external index system performs full-text retrieval according to the retrieval field to obtain a retrieval result corresponding to the index query request. Wherein each item of content in the retrieval result comprises directory tree node meta-information.
Step 305, returning the retrieval result to the client.
The external index system returns the search result meeting the query condition to the client, and each item of content in the search result list comprises directory tree node meta-information, such as directory name, file name, last modification time, file operation type, file size, file creator, file creation time, file version number and the like.
It should be noted that in the retrieval result returned by the external index system, the last modification time or the file version number in the directory tree node meta information may be used as a global tag, which is convenient for the client to handle the delay of the index system.
The client user checks a retrieval result returned by the external index system, and sends a file read-write request to the object storage file system according to the retrieval result, the object storage file system receives the file read-write request sent by the client, and the file read-write request carries a directory name and a file name in order to locate a target file in the object storage file system. As shown in fig. 4, the object storage file system locates the target file according to the directory name and the file name carried in the file read-write request. The target storage file system returns the located target file to the client, meanwhile, the target file carries a global label, the global label can be the last modification time or the file version number, and the client compares the global label returned by the external index system with the global label returned by the target storage file system to find whether the delay of the external index system exists or not through comparison.
When the client performs creation, modification or deletion operations on files and directories in the object storage file system through the object storage interface, the hook function triggers a change event (directory tree node meta-information) to be cached in the internal queue of the server, sends the event to the message queue in an asynchronous manner, then the external indexing system acquires messages from the message queue and consumes the messages, so as to obtain the directory tree node meta-information, and then stores the directory tree node meta-information in the external indexing system, as shown in fig. 5.
In addition, in a reference embodiment of the present invention, the detailed implementation of the retrieving method of the object storage file system is already described in detail in the above retrieving method of the object storage file system, so that the repeated description is not repeated here.
Fig. 6 is a schematic diagram of a main flow of a retrieval method of an object storage file system according to another embodiment of the present invention. As still another embodiment of the present invention, as shown in fig. 6, the method for retrieving the object storage file system may include:
step 601, establishing a hook function in the object storage file system, where the hook function is used to transfer the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, and the directory tree node meta-information includes a directory name, a file name, and a last modification time.
In order to transmit the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, a hook function T is firstly established in the object storage file system, and a directory tree node meta-information change event is constructed through the hook function. When a client side creates, modifies or deletes files and directories in the object storage file system through the object storage interface, the object storage file system calls a hook function at the directory tree change position, and the directory tree node meta-information is referred through the hook function. It should be noted that the hook function is called and then returns immediately without blocking, so that the normal change flow of the directory tree in the object storage file system is not affected.
Optionally, the directory tree node meta-information includes necessary information such as a directory name, a file name, and a last modification time, and the file and the directory can be accurately located through the directory tree node meta-information. Optionally, the directory tree node meta-information may further include a file operation type, a file size, a file creator, a file creation time, and a file version number, and the information is transmitted to facilitate an external indexing system to construct a full-text index, so that a client can conveniently perform full-text retrieval in the external indexing system through the information. It should be noted that each time a file is modified, the file version number is sequentially incremented.
Optionally, the hook function is configured to send the changed directory tree node meta information to the message queue in an asynchronous manner when the directory tree node meta information is changed. As shown in fig. 2, when a client performs creation, modification or deletion operations on files and directories in an object storage file system through an object storage interface, a hook function triggers a change event (directory tree node meta-information) to be cached in a server internal queue, and the event is sent to a message queue in an asynchronous manner.
Step 602, obtaining the directory tree node meta-information transferred by the hook function.
When a client side creates, modifies or deletes files and directories in an object storage file system through an object storage interface, the object storage file system calls a hook function at a directory tree change position, and transmits and refers to directory tree node meta-information through the hook function, so that the directory tree node meta-information is obtained
Optionally, step 602 may include: and acquiring the message from the message queue and consuming the message, thereby obtaining the node meta-information of the directory tree. As shown in fig. 2, when a client performs creation, modification or deletion operations on files and directories in an object storage file system through an object storage interface, a hook function triggers a change event (directory tree node meta-information) to send the event to a message queue in an asynchronous manner, and then an external indexing system acquires messages from the message queue and consumes the messages, thereby obtaining directory tree node meta-information.
Step 603, storing the directory tree node meta information in an external index system and establishing a full-text index for all fields of the directory tree node meta information, wherein the external index system is independent of the object storage file system.
The obtained directory tree node meta-information is stored in an external index system, and the external index system establishes full-text indexes for all fields of the directory tree node meta-information instead of establishing indexes for specific fields so as to support information retrieval and fuzzy retrieval of any dimensionality.
Therefore, when the client retrieves the object storage file, the directory tree node meta-information is retrieved from the external index system, and then the target file is located in the object storage file system through the directory tree node meta-information, so as to perform file operations on the target file, such as file operations of creation, modification or deletion.
Optionally, the last modification time or the file version number may be used as a global tag, and the embodiment of the present invention stores the global tag in the meta information of each directory tree node to determine whether the node is in the latest state, and returns the global tag to the client together in the search result, which facilitates the client to process the delay of the index system.
According to the various embodiments described above, it can be seen that the technical means of the embodiments of the present invention, by obtaining the directory tree node meta-information transferred by the hook function, storing the directory tree node meta-information in the external index system independent of the object storage file system and establishing the full-text index for all the fields in the directory tree node meta-information, solves the technical problems in the prior art that the computing resource consumption is large, the index cannot be dynamically expanded, and the non-indexed field retrieval is not supported. When the directory tree node meta-information of the object storage file system is changed, the embodiment of the invention transfers the changed directory tree node meta-information through the hook function, and the index updating is not directly performed inside the object storage file system, but the directory tree node meta-information is stored in an external index system and full-text index is established for the directory tree node meta-information, so that the influence on the performance of the object storage file system when large-batch data is changed can be avoided, and information retrieval and fuzzy retrieval of any dimensionality can be performed in the external index system.
Fig. 7 is a schematic diagram of a main flow of a retrieval method of an object storage file system according to another referenceable embodiment of the present invention. As another embodiment of the present invention, as shown in fig. 7, the method for retrieving the object storage file system may include:
step 701, a hook function is established in the object storage file system, and the hook function is used for sending the changed directory tree node meta information to a message queue in an asynchronous mode when the directory tree node meta information is changed.
In order to transmit the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, a hook function T is firstly established in the object storage file system, and a directory tree node meta-information change event is constructed through the hook function. When a client side creates, modifies or deletes files and directories in the object storage file system through the object storage interface, the object storage file system calls a hook function at a directory tree change position, the hook function is used for transmitting the meta information of the directory tree nodes, and the events are sent to a message queue in an asynchronous mode. The directory tree node meta information comprises a directory name, a file name, last modification time, a file operation type, a file size, a file creator, file creation time and a file version number.
Step 702, obtaining the message from the message queue and consuming the message, thereby obtaining the directory tree node meta-information.
When a client side creates, modifies or deletes files and directories in an object storage file system through an object storage interface, a hook function triggers a change event (directory tree node meta-information), the event is sent to a message queue in an asynchronous mode, and then an external index system acquires messages from the message queue and consumes the messages, so that the directory tree node meta-information is obtained.
Step 703, storing the directory tree node meta information in an external index system and establishing a full-text index for all fields of the directory tree node meta information, where the external index system is independent of the object storage file system and is used to establish a full-text index for all fields.
The obtained directory tree node meta-information is stored in an external index system, and the external index system establishes full-text indexes for all fields of the directory tree node meta-information instead of establishing indexes for specific fields so as to support information retrieval and fuzzy retrieval of any dimensionality.
Step 704, receiving an index query request sent by a client.
The client can perform information retrieval and fuzzy retrieval of any dimensionality such as directory name, file name, last modification time, file operation type, file size, file creator, file creation time, file version number and the like through an interface provided by an external index system.
Step 705, retrieving a retrieval result corresponding to the index query request from the external index system, and returning the retrieval result to the client.
The index query request carries a retrieval field input by a user through a client, and an external index system carries out full-text retrieval according to the retrieval field to obtain a retrieval result corresponding to the index query request. Wherein each item of content in the retrieval result comprises directory tree node meta-information.
The external index system returns the search result meeting the query condition to the client, and each item of content in the search result list comprises directory tree node meta-information, such as directory name, file name, last modification time, file operation type, file size, file creator, file creation time, file version number and the like.
It should be noted that in the retrieval result returned by the external index system, the last modification time or the file version number in the directory tree node meta information may be used as a global tag, which is convenient for the client to handle the delay of the index system.
Step 706, receiving a file read-write request sent by the client.
The client user checks a retrieval result returned by the external index system, and sends a file read-write request to the object storage file system according to the retrieval result, the object storage file system receives the file read-write request sent by the client, and the file read-write request carries a directory name and a file name in order to locate a target file in the object storage file system.
Step 707, reading a target file corresponding to the file read-write request from the object storage file system.
As shown in fig. 4, the object storage file system locates the target file according to the directory name and the file name carried in the file read-write request.
Step 708, returning the target file and the global tag (which may be the last modification time or the file version number) of the target file to the client.
The target storage file system returns the located target file to the client, meanwhile, the target file carries a global label, the global label can be the last modification time or the file version number, and the client compares the global label returned by the external index system with the global label returned by the target storage file system to find whether the delay of the external index system exists or not through comparison.
When the client performs creation, modification or deletion operations on files and directories in the object storage file system through the object storage interface, the hook function triggers a change event (directory tree node meta-information) to be cached in the internal queue of the server, sends the event to the message queue in an asynchronous manner, then the external indexing system acquires messages from the message queue and consumes the messages, so as to obtain the directory tree node meta-information, and then stores the directory tree node meta-information in the external indexing system, as shown in fig. 5.
In addition, in another embodiment of the present invention, the detailed implementation of the retrieving method of the object storage file system is described in detail in the above-mentioned retrieving method of the object storage file system, and therefore, the repeated content will not be described herein.
Fig. 8 is a schematic diagram of main blocks of a retrieving apparatus of an object storage file system according to an embodiment of the present invention. As shown in fig. 8, the retrieving apparatus 800 of the object storage file system includes an obtaining module 801 and a storing module 802; the obtaining module 801 is configured to obtain directory tree node meta information transferred by a hook function; the hook function is established in an object storage file system and used for transmitting the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, wherein the directory tree node meta-information comprises a directory name, a file name and the last modification time; the storage module 802 is configured to store the directory tree node meta information in an external index system, and build a full-text index for all fields of the directory tree node meta information, where the external index system is independent of the object storage file system.
Optionally, the obtaining module 801 is further configured to:
obtaining a message from the message queue and consuming the message, thereby obtaining directory tree node meta-information; the hook function is used for sending the changed directory tree node element information to a message queue in an asynchronous mode when the directory tree node element information is changed.
Optionally, the directory tree node meta information further includes a file operation type, a file size, a file creator, a file creation time, and a file version number.
Optionally, the system further comprises a retrieving module, configured to:
receiving an index query request sent by a client;
retrieving a retrieval result corresponding to the index query request from the external index system;
returning the retrieval result to the client;
wherein each item of content in the retrieval result comprises directory tree node meta-information.
It should be noted that, in the implementation of the retrieving apparatus for an object storage file system according to the present invention, the above-mentioned retrieving method for an object storage file system has been described in detail, and therefore, the repeated description is omitted here.
Fig. 9 is a schematic diagram of main blocks of a retrieving apparatus of an object storage file system according to another embodiment of the present invention. As shown in fig. 9, the retrieving apparatus 900 of the object storage file system includes an establishing module 901, an obtaining module 902 and a storing module 903; when the directory tree node meta-information of the object storage file system of the establishing module 901 is changed, the changed directory tree node meta-information is transmitted, wherein the directory tree node meta-information comprises a directory name, a file name and the last modification time; the obtaining module 902 is configured to obtain directory tree node meta information transferred by the hook function; the storage module 903 is configured to store the directory tree node meta information in an external index system, and build a full-text index for all fields of the directory tree node meta information, where the external index system is independent of the object storage file system.
Optionally, the hook function is configured to send the changed directory tree node meta information to the message queue in an asynchronous manner when the directory tree node meta information is changed.
Optionally, the obtaining module 902 is further configured to:
and acquiring the message from the message queue and consuming the message, thereby obtaining the node meta-information of the directory tree.
Optionally, the directory tree node meta information further includes a file operation type, a file size, a file creator, a file creation time, and a file version number.
Optionally, the system further comprises a retrieval module, configured to:
receiving an index query request sent by a client;
retrieving a retrieval result corresponding to the index query request from the external index system;
returning the retrieval result to the client;
wherein each item of content in the retrieval result comprises directory tree node meta-information.
Optionally, the apparatus further includes a read-write module, configured to:
receiving a file read-write request sent by the client; the file reading and writing request carries a directory name and a file name;
reading a target file corresponding to the file read-write request from the object storage file system;
and returning the target file and the global label of the target file to the client.
Optionally, the global tag is a last modification time or a file version number.
It should be noted that, in the implementation of the retrieving apparatus for an object storage file system according to the present invention, the above-mentioned retrieving method for an object storage file system has been described in detail, and therefore, the repeated description is omitted here.
Fig. 10 shows an exemplary system architecture 1000 to which the object store file system retrieval method or the object store file system retrieval apparatus of the embodiments of the present invention can be applied.
As shown in fig. 10, the system architecture 1000 may include terminal devices 1001, 1002, 1003, a network 1004, and a server 1005. The network 1004 is used to provide a medium for communication links between the terminal devices 1001, 1002, 1003 and the server 1005. Network 1004 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 1001, 1002, 1003 to interact with a server 1005 via a network 1004 to receive or transmit messages or the like. The terminal devices 1001, 1002, 1003 may have installed thereon various messenger client applications such as shopping applications, web browser applications, search applications, instant messenger, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 1001, 1002, 1003 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 1005 may be a server that provides various services, such as a backend management server (for example only) that supports shopping websites browsed by users using the terminal devices 1001, 1002, 1003. The background management server can analyze and process the received data such as the article information query request and feed back the processing result to the terminal equipment.
It should be noted that the retrieval method of the object storage file system provided by the embodiment of the present invention is generally executed by the server 1005, and accordingly, the retrieval device of the object storage file system is generally disposed in the server 1005.
It should be understood that the number of terminal devices, networks, and servers in fig. 10 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 11, shown is a block diagram of a computer system 1100 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 11 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 11, the computer system 1100 includes a Central Processing Unit (CPU)1101, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)1102 or a program loaded from a storage section 1108 into a Random Access Memory (RAM) 1103. In the RAM1103, various programs and data necessary for the operation of the system 1100 are also stored. The CPU 1101, ROM 1102, and RAM1103 are connected to each other by a bus 1104. An input/output (I/O) interface 1105 is also connected to bus 1104.
The following components are connected to the I/O interface 1105: an input portion 1106 including a keyboard, mouse, and the like; an output portion 1107 including a signal output unit such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 1108 including a hard disk and the like; and a communication section 1109 including a network interface card such as a LAN card, a modem, or the like. The communication section 1109 performs communication processing via a network such as the internet. A driver 1110 is also connected to the I/O interface 1105 as necessary. A removable medium 1111 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1110 as necessary, so that a computer program read out therefrom is mounted into the storage section 1108 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication portion 1109 and/or installed from the removable medium 1111. The above-described functions defined in the system of the present invention are executed when the computer program is executed by a Central Processing Unit (CPU) 1101.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer programs according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a setup module, an acquisition module, and a storage module, where the names of the modules do not in some cases constitute a limitation on the modules themselves.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, implement the method of: establishing a hook function in an object storage file system, wherein the hook function is used for transmitting the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, and the directory tree node meta-information comprises a directory name, a file name and the last modification time; obtaining directory tree node meta-information transferred by the hook function; and storing the directory tree node meta information in an external index system and establishing a full-text index for all fields of the directory tree node meta information, wherein the external index system is independent of the object storage file system.
According to the technical scheme of the embodiment of the invention, because the technical means of acquiring the directory tree node meta-information transferred by the hook function, storing the directory tree node meta-information in the external index system independent of the object storage file system and establishing full-text indexes for all fields in the directory tree node meta-information are adopted, the technical problems that the computing resource consumption is large, the indexes cannot be dynamically expanded and non-index field retrieval is not supported in the prior art are solved. When the directory tree node meta-information of the object storage file system is changed, the embodiment of the invention transfers the changed directory tree node meta-information through the hook function, and the index updating is not directly performed inside the object storage file system, but the directory tree node meta-information is stored in an external index system and a full-text index is established for the directory tree node meta-information, so that the influence on the performance of the object storage file system when large-batch data is changed can be avoided, and information retrieval and fuzzy query of any dimension can be performed in the external index system.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (14)

1. A method for retrieving an object storage file system, comprising:
obtaining directory tree node meta-information transferred by a hook function; the hook function is established in an object storage file system and used for transmitting the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, wherein the directory tree node meta-information comprises a directory name, a file name and the last modification time;
and storing the directory tree node meta information in an external index system and establishing a full-text index for all fields of the directory tree node meta information, wherein the external index system is independent of the object storage file system.
2. The method of claim 1, wherein obtaining directory tree node meta-information passed by the hook function comprises:
obtaining a message from the message queue and consuming the message, thereby obtaining directory tree node meta-information; and the hook function is used for sending the changed directory tree node meta-information to the message queue in an asynchronous mode when the directory tree node meta-information is changed.
3. The method of claim 1, wherein the directory tree node meta information further comprises a file operation type, a file size, a file creator, a file creation time, and a file version number.
4. The method of claim 1, wherein after storing the directory tree node meta-information in an external indexing system and building a full-text index for all fields of the directory tree node meta-information, further comprising:
receiving an index query request sent by a client;
retrieving a retrieval result corresponding to the index query request from the external index system;
returning the retrieval result to the client;
wherein each item of content in the retrieval result comprises directory tree node meta-information.
5. A method for retrieving an object storage file system, comprising:
establishing a hook function in an object storage file system, wherein the hook function is used for transmitting the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, and the directory tree node meta-information comprises a directory name, a file name and the last modification time;
obtaining directory tree node meta-information transferred by the hook function;
and storing the directory tree node meta information in an external index system and establishing a full-text index for all fields of the directory tree node meta information, wherein the external index system is independent of the object storage file system.
6. The method of claim 5, wherein the hooking function is configured to send the changed directory tree node meta-information to the message queue in an asynchronous manner when the directory tree node meta-information is changed.
7. The method of claim 6, wherein obtaining the meta-information of the directory tree node passed by the hooking function comprises:
and acquiring the message from the message queue and consuming the message, thereby obtaining the node meta-information of the directory tree.
8. The method of claim 5, wherein the directory tree node meta information further comprises a file operation type, a file size, a file creator, a file creation time, and a file version number.
9. The method of claim 5, wherein after storing the directory tree node meta-information in an external indexing system and building a full-text index over all fields of the directory tree node meta-information, further comprising:
receiving an index query request sent by a client;
retrieving a retrieval result corresponding to the index query request from the external index system;
returning the retrieval result to the client; each item of content in the retrieval result comprises directory tree node meta-information;
receiving a file read-write request sent by the client; the file reading and writing request carries a directory name and a file name;
reading a target file corresponding to the file read-write request from the object storage file system;
and returning the target file and the global label of the target file to the client.
10. The method of claim 9, wherein the global tag is a last modification time or a file version number.
11. A retrieving apparatus of an object storage file system, comprising:
the acquisition module is used for acquiring the directory tree node meta-information transferred by the hook function; the hook function is established in an object storage file system and used for transmitting the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, wherein the directory tree node meta-information comprises a directory name, a file name and the last modification time;
and the storage module is used for storing the directory tree node meta-information in an external index system and establishing full-text index for all fields of the directory tree node meta-information, and the external index system is independent of the object storage file system.
12. A retrieving apparatus of an object storage file system, comprising:
the system comprises an establishing module, a storage module and a modification module, wherein the establishing module is used for establishing a hook function in an object storage file system, the hook function is used for transmitting the changed directory tree node meta-information when the directory tree node meta-information of the object storage file system is changed, and the directory tree node meta-information comprises a directory name, a file name and the last modification time;
the acquisition module is used for acquiring the directory tree node meta-information transferred by the hook function;
and the storage module is used for storing the directory tree node meta-information in an external index system and establishing full-text index for all fields of the directory tree node meta-information, and the external index system is independent of the object storage file system.
13. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
the one or more programs, when executed by the one or more processors, implement the method of any of claims 1-10.
14. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-10.
CN202210460407.7A 2022-04-28 2022-04-28 Retrieval method and device of object storage file system Pending CN114896206A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210460407.7A CN114896206A (en) 2022-04-28 2022-04-28 Retrieval method and device of object storage file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210460407.7A CN114896206A (en) 2022-04-28 2022-04-28 Retrieval method and device of object storage file system

Publications (1)

Publication Number Publication Date
CN114896206A true CN114896206A (en) 2022-08-12

Family

ID=82719821

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210460407.7A Pending CN114896206A (en) 2022-04-28 2022-04-28 Retrieval method and device of object storage file system

Country Status (1)

Country Link
CN (1) CN114896206A (en)

Similar Documents

Publication Publication Date Title
CN109254733B (en) Method, device and system for storing data
CN109413127B (en) Data synchronization method and device
CN107491382B (en) Log output method and device
CN110928912A (en) Method and device for generating unique identifier
CN111061680A (en) Data retrieval method and device
CN110555068A (en) Data export method and device
CN114817146A (en) Method and device for processing data
CN112783887A (en) Data processing method and device based on data warehouse
CN111241189A (en) Method and device for synchronizing data
CN113361236A (en) Method and device for editing document
CN111258988A (en) Asset management method, device, electronic device, and medium
CN112748866A (en) Method and device for processing incremental index data
CN112711572B (en) Online capacity expansion method and device suitable for database and table division
CN114896206A (en) Retrieval method and device of object storage file system
US10114864B1 (en) List element query support and processing
CN113760928A (en) Cache data updating system and method
CN113742376A (en) Data synchronization method, first server and data synchronization system
CN113722007A (en) Configuration method, device and system of VPN branch equipment
CN113704242A (en) Data processing method and device
CN109087097B (en) Method and device for updating same identifier of chain code
CN113742321A (en) Data updating method and device
CN113127416A (en) Data query method and device
CN110019671B (en) Method and system for processing real-time message
CN113347052A (en) Method and device for counting user access data through access log
CN113760860B (en) Data reading method and device

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