Retrieval method and device for recycled file information, computer equipment and storage medium

By deploying elastic search services in distributed storage systems, the problem of inefficient retrieval of recycling files is solved, a more efficient and faster retrieval process is achieved, and the user experience is improved.

CN119669161APending Publication Date: 2025-03-21INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411849624.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

In a distributed file system, the retrieval efficiency of recycled files is low, resulting in poor user experience. The prior art such as the find command has high requirements for user operation capabilities and does not meet the requirements of software ease of use.

Method used

By deploying elastic search services on the storage nodes of the distributed storage system, receiving search conditions sent by the management node, obtaining recycling file information from multiple storage nodes, and finding target recycling file information based on the search conditions, and quickly sending feedback to the management node.

Benefits of technology

It improves the efficiency and speed of recycled file retrieval, improves the user experience, and makes the search process more efficient and easy to use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119669161A_ABST
    Figure CN119669161A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a retrieval method and device for recycled file information, computer equipment and a storage medium. The method is applied to first storage nodes. The method comprises the steps that when elastic search services are deployed in a first storage node and at least one second storage node, at least one retrieval condition from a management node is received, and at least one piece of first recycling file information is stored in the elastic search service of the first storage node; obtaining at least one piece of second recovery file information pre-stored in the elastic search service of each second storage node; based on the at least one retrieval condition, searching for target recycled file information corresponding to the at least one retrieval condition in the at least one piece of first recycled file information and the at least one piece of second recycled file information; and sending the target recovery file information to the management node, so that the management node feeds back the target recovery file information to the client. The problems that the retrieval efficiency of the recycled file is low and the user experience is poor can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for retrieving recovered file information, a computer device and a storage medium. Background Art

[0002] In the current big data environment, in order to meet the needs of data storage and analysis, more and more files are stored in distributed file systems. For example, the distributed file system can be (Hadoop Distributed File System, HDFS).

[0003] Since the number of files stored in the distributed file system is very large, the corresponding recycle bin stores a relatively large number of deleted files. The core value of the recycle bin is to temporarily store deleted files, so that they can be restored or immediately deleted to free up space. When the recycle bin stores a large number of files, simply using the find command provided by the Linux operating system to search for them will take hours or even days to search, resulting in low search efficiency and poor user experience. In addition, although the results can be retrieved in the end, the find command also requires the user's common Linux operation skills, which obviously does not meet the requirements of software usability. Summary of the invention

[0004] In view of this, the present invention provides a method, device, computer equipment and storage medium for retrieving recycled file information to solve the problems of low efficiency in retrieval of recycled files and poor user experience.

[0005] In a first aspect, the present invention provides a method for retrieving recycled file information, which is applied to a first storage node, wherein the first storage node, at least one second storage node and a management node form a distributed storage system; the method comprises: receiving at least one retrieval condition sent from a management node when both the first storage node and the at least one second storage node are deployed with an elastic search service, the elastic search service of the first storage node storing at least one first recycled file information; obtaining at least one second recycled file information pre-stored in the elastic search service of each second storage node from at least one second storage node; based on at least one retrieval condition, searching for target recycled file information corresponding to at least one retrieval condition in at least one first recycled file information and at least one second recycled file information; and sending the target recycled file information to the management node so that the management node feeds back the target recycled file information to the client.

[0006] Based on the method of the first aspect above, when the first storage node and at least one second storage node are both deployed with the elastic search service, the first storage node can obtain at least one second recycled file information pre-stored from the elastic search service of at least one other second storage node in the distributed storage system, and query the target recycled file information corresponding to at least one retrieval condition from the at least one first recycled file information and at least one second recycled file information stored by itself, and send it to the management node.

[0007] Since the first storage node and at least one second storage node are both deployed with an elastic search service, and the elastic search services in the first storage node and each second storage node pre-store multiple pieces of recycled file information, the first storage node can quickly query the target recycled file information through the elastic search service. Compared with the method in the related art where a user uses the find command to retrieve recycled files, the method of the present invention that uses the elastic search service to retrieve is more efficient, has a faster retrieval speed, and provides a better user experience.

[0008] In an optional embodiment, before the elastic search service of the first storage node stores at least one first recycled file information, the method further includes: when the elastic search service is deployed on the first storage node, receiving a deletion request from a client, the deletion request is used to request deletion of at least one first recycled file, the deletion request carries file information and operation information of at least one first recycled file; based on the file information and the operation information, generating at least one first recycled file information; storing the at least one first recycled file information in the elastic search service deployed on the first storage node.

[0009] Based on the above method, before the elastic search service of the first storage node stores at least one first recycled file information, when the user deletes the first recycled file on the client, the first storage node can store the deleted first recycled file information in the elastic search service to facilitate the subsequent retrieval of the target recycled file information through the elastic search service.

[0010] In an optional embodiment, the first storage node is also deployed with a metadata service; the metadata service is used to manage a deletion log; storing at least one first recovered file information in the elastic search service deployed on the first storage node, including: writing at least one first recovered file information into the deletion log through the metadata service, and sending at least one first recovered file information included in the deletion log to the elastic search service deployed on the first storage node, so that the elastic search service deployed on the first storage node stores at least one first recovered file information; judging through the metadata service whether at least one first recovered file information is sent successfully; if so, continuing to send other recovered file information included in the deletion log through the metadata service; if not, writing at least one first recovered file information into the deletion log through the metadata service, and sending it again to the elastic search service deployed on the first storage node until at least one first recovered file information is sent successfully.

[0011] Based on the above method, the first storage node can store the first recycled file information in the elastic search service through the deployed metadata service, so as to facilitate the subsequent retrieval of the target recycled file information through the elastic search service.

[0012] In an optional embodiment, based on at least one search condition, in at least one first recovered file information and at least one second recovered file information, searching for target recovered file information corresponding to at least one search condition includes: parsing at least one search condition to obtain at least one search statement that conforms to the syntax of the elastic search service; searching for target recovered file information in at least one first recovered file information and at least one second recovered file information according to a preset corresponding relationship and at least one search statement, the preset corresponding relationship being a corresponding relationship between at least one search statement and the target recovered file information.

[0013] Based on the above method, the target recycling file information can be found through at least one search condition, so that the management node feeds back the target recycling file information to the client, and then the user searches for the target recycling file according to the target recycling file information received by the client.

[0014] In a second aspect, the present invention provides a method for retrieving recycled file information, which is applied to a management node, wherein the management node, a first storage node and at least one second storage node constitute a distributed storage system; the method comprises: when receiving at least one retrieval condition sent from a client, detecting whether the first storage node and the at least one second storage node are deployed with an elastic search service; if so, sending at least one retrieval condition to the first storage node, the elastic search service of the first storage node stores at least one first recycled file information, the first storage node is used to obtain at least one second recycled file information from at least one second storage node, and based on at least one retrieval condition, searching for target recycled file information corresponding to at least one retrieval condition in at least one first recycled file information and at least one second recycled file information, and sending it to the management node; receiving the target recycled file information sent from the first storage node, and feeding back the target recycled file information to the client.

[0015] Based on the method of the second aspect above, when the management node receives at least one retrieval condition sent by the client, it can detect whether the first storage node and at least one second storage node are deployed with the elastic search service; and when both are deployed with the elastic search service, send at least one retrieval condition to the first storage node, so that the first storage node can query the target recovery file information, and then feed back the target recovery file information to the client.

[0016] Since the first storage node and at least one second storage node are both deployed with an elastic search service, and the elastic search services in the first storage node and each second storage node pre-store multiple pieces of recycled file information, the target recycled file information can be quickly queried through the elastic search service deployed by the first storage node. Compared with the method in the related art where users use the find command to retrieve recycled files, the method of the present invention using the elastic search service for retrieval is more efficient, has a faster retrieval speed, and provides a better user experience.

[0017] In an optional embodiment, when it is detected that neither the first storage node nor the at least one second storage node is deployed with the elastic search service, at least one third recycled file information stored in the first storage node and at least one fourth recycled file information stored in each second storage node are obtained; and it is determined whether the total number of at least one third recycled file information and at least one fourth recycled file information is less than or equal to a preset threshold.

[0018] If the total number is less than or equal to a preset threshold, a preset search command is used to search for target recycled file information corresponding to at least one search condition from at least one third recycled file information and at least one fourth recycled file information.

[0019] If the total number is greater than a preset threshold, determine whether at least one search condition includes the deletion time of the target recovery file; if at least one search condition does not include the deletion time, send a first message to the client, the first message is used to prompt the client to add the deletion time in at least one search condition, and send at least two search conditions with the added deletion time to the management node; receive at least two search conditions, and based on the deletion time, search for the target recovery file information corresponding to the at least one search condition from at least one third recovery file information and at least one fourth recovery file information through a preset search command, and feed back the target recovery file information to the client.

[0020] Based on the above method, when it is detected that neither the first storage node nor the at least one second storage node has the elastic search service deployed, the total number of at least one third recycled file information and at least one fourth recycled file information, whether at least one search condition includes the deletion time of the target recycled file, and further a preset search command can be used to search for the target recycled file, thereby achieving full-scenario recycled file information retrieval function coverage.

[0021] In a third aspect, the present invention provides a device for retrieving recovered file information, the device comprising:

[0022] The first transceiver module is used to receive at least one search condition sent from the management node when both the first storage node and at least one second storage node are deployed with an elastic search service, and the elastic search service of the first storage node stores at least one first recycled file information.

[0023] The first transceiver module is also used to obtain at least one second recycled file information pre-stored in the elastic search service of each second storage node from at least one second storage node.

[0024] The first processing module is used to search for target recycled file information corresponding to at least one retrieval condition in at least one first recycled file information and at least one second recycled file information based on at least one retrieval condition.

[0025] The first transceiver module is further used to send the target recovery file information to the management node, so that the management node feeds back the target recovery file information to the client.

[0026] In a fourth aspect, the present invention provides a device for retrieving recovered file information, the device comprising:

[0027] The second transceiver module is used to receive at least one search condition sent from the client.

[0028] The second processing module is used to detect whether the first storage node and at least one second storage node are deployed with the elastic search service.

[0029] The second transceiver module is also used to send at least one retrieval condition to the first storage node when the second processing module detects that an elastic search service is deployed, wherein the elastic search service of the first storage node stores at least one first recovered file information, and the first storage node is used to obtain at least one second recovered file information from at least one second storage node, and based on the at least one retrieval condition, search for target recovered file information corresponding to at least one retrieval condition in the at least one first recovered file information and the at least one second recovered file information, and send it to the management node.

[0030] The second transceiver module is further used to receive the target recovery file information sent from the first storage node, and feed back the target recovery file information to the client.

[0031] In a fifth aspect, the present invention provides a retrieval system for recovered file information, the system comprising a management node, a first storage node and at least one second storage node.

[0032] The management node is used to detect whether the first storage node and at least one second storage node are deployed with an elastic search service when receiving at least one search condition sent from a client.

[0033] The management node is further configured to send at least one search condition to the first storage node if the search condition is true, and the elastic search service of the first storage node stores at least one first recycled file information.

[0034] The first storage node is used to receive at least one search condition sent from the management node when the first storage node and at least one second storage node are both deployed with an elastic search service, and the elastic search service of the first storage node stores at least one first recycled file information.

[0035] The first storage node is also used to obtain, from at least one second storage node, at least one second recycled file information pre-stored in the elastic search service of each second storage node.

[0036] The first storage node is further used to search, based on at least one search condition, for target recycled file information corresponding to at least one search condition in at least one first recycled file information and at least one second recycled file information.

[0037] The first storage node is further configured to send the target recycled file information to the management node, so that the management node feeds back the target recycled file information to the client.

[0038] The management node is further used to receive the target recycling file information sent from the first storage node, and feed back the target recycling file information to the client.

[0039] In a sixth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for retrieving recovered file information of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0040] In a seventh aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for retrieving recovered file information of the first aspect or any corresponding embodiment thereof.

[0041] In an eighth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method for retrieving recovered file information of the first aspect or any corresponding embodiment thereof.

[0042] The present invention provides a method for retrieving recycled file information. When the first storage node and at least one second storage node are both deployed with an elastic search service, the first storage node can obtain at least one second recycled file information pre-stored from the elastic search service of at least one other second storage node in the distributed storage system, and query the target recycled file information corresponding to at least one retrieval condition from the at least one first recycled file information and at least one second recycled file information stored by itself, and send it to the management node. Since the first storage node and at least one second storage node are both deployed with an elastic search service, and the elastic search service in the first storage node and each second storage node pre-stores a plurality of recycled file information, the first storage node can quickly query the target recycled file information through the elastic search service. Compared with the method in the related art in which users use the find command to retrieve recycled files, the method of the present invention that uses the elastic search service for retrieval is more efficient, has a faster retrieval speed, and provides a better user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 is a topological diagram of a retrieval system 10 for recovered file information according to an embodiment of the present invention;

[0045] Figure 2 is a flow chart of a method for retrieving recovered file information according to an embodiment of the present invention;

[0046] Figure 3 is a schematic diagram of re-inserting the recovered file information into a deletion log according to an embodiment of the present invention;

[0047] Figure 4 is a schematic diagram of storing recycled file information into an ES service according to an embodiment of the present invention;

[0048] Figure 5 This is a first schematic diagram of switching of abnormal connection between MDS service and ES service in an embodiment of the present invention;

[0049] Figure 6 This is a second schematic diagram of switching of abnormal connection between the MDS service and the ES service according to an embodiment of the present invention;

[0050] Figure 7 is a flow chart of another method for retrieving recovered file information according to an embodiment of the present invention;

[0051] Figure 8 is a flow chart of another method for retrieving recovered file information according to an embodiment of the present invention;

[0052] Fig. 9 is a structural block diagram of a device for retrieving recovered file information according to an embodiment of the present invention;

[0053] Fig.10 is a structural block diagram of another device for retrieving recovered file information according to an embodiment of the present invention;

[0054] Fig.11 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0056] The present invention is applied to a distributed storage system. A large number of deleted files / recycled files are stored in a recycle bin in a distributed storage system. The distributed storage system is a cluster composed of multiple storage node servers. Files are stored in blocks, with objects as the basic unit. It supports storing a copy of data on multiple nodes. Each node can obtain complete data through inter-node communication. When a node goes down, complete data can be restored according to the configured policy. It has the characteristics of high availability, high performance, high scalability, etc. The recycle bin is used to store documents temporarily deleted by users. Documents are organized according to the deletion time, with 10 minutes as a directory. Files deleted within 10 minutes in the same day and hour are stored in the same deletion time directory.

[0057] As described in the background art, using the find command provided by the Linux operating system to search for recovered files requires hours or even days of search time, resulting in low search efficiency and poor user experience.

[0058] In order to solve the above technical problems, an embodiment of the present invention provides a method for retrieving recovered file information, which achieves the effect of improving retrieval efficiency by retrieving recovered files through an elastic search service deployed on a storage node.

[0059] Below Figure 1 Taking the recovered file information retrieval system 100 as an example, the method provided in the embodiment of the present application is described. Figure 1 It is only a schematic diagram and does not constitute a limitation on the applicable scenarios of the technical solution provided in this application.

[0060] like Figure 1 As shown, Figure 1 4 is a topological diagram of a system for retrieving recovered file information according to an embodiment of the present invention. Figure 1 In the embodiment, the retrieval system 100 for reclaiming file information may include a first storage node 101 , a second storage node 102 , a management node 103 and a client 104 .

[0061] The first storage node 101 or the second storage node 102 in the embodiment of the present application may be any storage node in the distributed storage system.

[0062] Both the first storage node and the second storage node can deploy the Elasticsearch (ES) service. The ES service is an open source distributed, RESTful-style search and data analysis engine. It encapsulates Lucene and provides a simple and consistent RESTful API for storage and retrieval. Multiple ES services construct a distributed search cluster. After an ES service fails, the ES cluster can still provide services normally. The ES service is a distributed search engine and a distributed database. The ES service deployment requires at least 32G of memory, and the stored data is stored on non-volatile memory (NVME).

[0063] Optionally, the first storage node and the second storage node may also deploy a metadata service (MetadataServer, MDS). The MDS service is used to maintain file metadata and process different metadata requests from clients. Multiple MDS services construct a metadata service cluster, and each MDS service is responsible for different subtrees of the entire system file tree to form a distributed metadata service cluster.

[0064] The management node 103 in the embodiment of the present application may be a device with communication functions and computing functions, such as a server, a cloud server or a virtual machine, etc. The management node 103 may be used to manage the first storage node 101 and the second storage node 102 .

[0065] The client 104 in the embodiment of the present application may be any device with communication capability and display function. It is understandable that the client may have a display interface, which can be used by the user to perform search operations and display search results.

[0066] Figure 1 The retrieval system 100 for recovered file information is only used as an example and is not intended to limit the technical solution of the present application. Those skilled in the art should understand that in the specific implementation process, the retrieval system 100 for recovered file information may also include other storage nodes, and the number of the first storage node and the second storage node may also be determined according to specific needs without limitation.

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

[0068] In this embodiment, a method for retrieving recovered file information is provided, which can be used for the above-mentioned first storage node. The first storage node, at least one second storage node and a management node constitute a distributed storage system. Figure 2 is a flow chart of a method for retrieving recovered file information according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0069] S201: When the elastic search service is deployed on a first storage node and at least one second storage node, receive at least one search condition sent from a management node.

[0070] The elastic search service of the first storage node stores at least one first recycled file information.

[0071] In one example, when an elastic search service is deployed on a first storage node, the first storage node receives a deletion request from a client, where the deletion request is used to request deletion of at least one first recycled file, and the deletion request carries file information and operation information of the at least one first recycled file; based on the file information and the operation information, at least one first recycled file information is generated; and the at least one first recycled file information is stored in the elastic search service deployed on the first storage node.

[0072] The file information includes the file identifier (also called file ID or file inode number), file name, file size, file owner, and original path of the first recovered file. The original path of the file is the storage path before the first recovered file is deleted.

[0073] The operation information includes the deletion time, deletion user identifier, modification time, access time, and creation time of the first recycled file. The deletion time is the time when the first recycled file enters the recycling bin, or the deletion time when the first recycled file is deleted. It can be understood that after the first recycled file enters the recycling bin, it is stored in the first storage node.

[0074] The first storage node is also deployed with a metadata service, and the metadata service is used to manage a deletion log.

[0075] Exemplarily, the MDS service deployed on the first storage node receives a deletion request from a client; generates at least one first recovered file information based on the file inode number, file name, file size, file owner, and original path included in the deletion request; and stores the at least one first recovered file information in the ES service deployed on the first storage node.

[0076] In some optional embodiments, the first storage node writes at least one first recovered file information into a deletion log through a metadata service, and sends at least one first recovered file information included in the deletion log to an elastic search service deployed by the first storage node, so that the elastic search service deployed by the first storage node stores at least one first recovered file information; determines through the metadata service whether the at least one first recovered file information is sent successfully; if so, continues to send other recovered file information included in the deletion log through the metadata service; if not, writes at least one first recovered file information into the deletion log through the metadata service, and sends it again to the elastic search service deployed by the first storage node until at least one first recovered file information is sent successfully.

[0077] The file format of the deletion log is fixed, and one piece of recovered file information in the deletion log is a basic item unit. Multiple pieces of recovered file information are stored in the deletion log.

[0078] Exemplarily, the first storage node writes at least one first recovered file information to the end of the queue of the deletion log through the MDS service, and reports or sends all the recovered file information included in the deletion log item by item to the ES service deployed by the first storage node through the HTTPClient timer thread of the MDS service (also known as deletion log consumption). Figure 3 As shown, Figure 3 is a schematic diagram of re-inserting the recovered file information into the deletion log according to an embodiment of the present invention; Figure 3 If at least one first recovered file information fails to be reported or sent, the at least one first recovered file information is written (inserted) to the end of the deletion log queue again through the MDS service, and will continue to be reported later. It can be understood that the item corresponding to the recovered file information after the reporting is completed will be deleted from the deletion log queue log file.

[0079] In one example, Figure 4 As shown, Figure 4It is a schematic diagram of storing recovered file information in an ES service according to an embodiment of the present invention; when the first storage node and at least one second storage node are deployed with ES services, all ES services constitute an ES cluster; the first storage node or any second storage node can deploy the MDS service. For example, the first storage node deploys the MDS service, and the MDS service receives a deletion request (also called a metadata request) from a client (Client), processes the metadata request, generates recovered file information and writes / inserts it into a deletion log (i.e., constructs a deletion log item); the HTTPClient timer thread of the MDS service constructs a batch request, consumes the item in the deletion log, and constructs the item into a batch request, sends a batch request to the ES cluster, and reports all recovered file information included in the deletion log to the ES cluster in batches. The ES cluster returns a response and notifies the HTTPClient timer thread of the MDS service that the recovery file information reporting is complete. The HTTPClient timer thread receives the response and deletes the recovered file information from the deletion log queue log file.

[0080] Optionally, before the HTTPClient timer of the MDS service of the first storage node sends a batch request to the ES cluster, it monitors in real time whether the connection with the ES service of the first storage node is normal (if the connection is abnormal, an error will be reported during the reporting process). Figure 5 or Figure 6 As shown, Figure 5 This is a first schematic diagram of switching of abnormal connection between MDS service and ES service in an embodiment of the present invention; Figure 6 This is a second schematic diagram of switching between an abnormal connection between an MDS service and an ES service according to an embodiment of the present invention. Figure 5 or Figure 6 In the example, if the MDS service is not connected to the ES service normally, the MDS service of the first storage node will select the ES service of other storage nodes in the ES cluster for connection reporting. If the ES service connection of the first storage node is restored, the MDS will reconnect to the ES service of the first storage node. It can be understood that this method can achieve load balancing and high availability of reporting.

[0081] It is understandable that one storage node deploys one ES service. The MDS service only needs to be deployed on any storage node.

[0082] S202: Acquire, from at least one second storage node, at least one second recycled file information pre-stored in the elastic search service of each second storage node.

[0083] It can be understood that, in the case where any second storage node among at least one second storage node is deployed with an elastic search service, the second storage node receives a deletion request from a client, the deletion request is used to request deletion of a second recovered file, and the deletion request carries file information and operation information of the second recovered file; based on the file information and the operation information, a second recovered file information is generated; and the second recovered file information is stored in the elastic search service deployed on the second storage node.

[0084] S203: Based on at least one search condition, searching for target recycled file information corresponding to the at least one search condition in at least one first recycled file information and at least one second recycled file information.

[0085] In some optional embodiments, the first storage node parses at least one search condition to obtain at least one search statement that conforms to the syntax of the elastic search service; and searches for target recovered file information in at least one first recovered file information and at least one second recovered file information based on a preset correspondence relationship and the at least one search statement.

[0086] The preset corresponding relationship is the corresponding relationship between at least one search statement and the target recovery file information. For example, if at least one search statement includes the keyword "first file inode number", the preset corresponding relationship is the corresponding relationship between "first file inode number" and the target recovery file information. It can be understood that the file inode number of the target recovery file is "first file inode number".

[0087] S204: Send the target recycled file information to the management node, so that the management node feeds back the target recycled file information to the client.

[0088] It is understandable that after the management node feeds back the target recovery file information to the client, the user can quickly find the target recovery file according to the target recovery file information displayed on the client interface. For example, the user can directly copy the original path included in the target recovery file information for operation, or can choose to specify the target recovery file to be directly deleted by force.

[0089] Based on the above method, when the first storage node and at least one second storage node are both deployed with the elastic search service, the first storage node can obtain at least one second recycled file information pre-stored from the elastic search service of at least one other second storage node in the distributed storage system, and query the target recycled file information corresponding to at least one retrieval condition from the at least one first recycled file information and at least one second recycled file information stored by itself, and send it to the management node.

[0090] Since the first storage node and at least one second storage node are both deployed with an elastic search service, and the elastic search services in the first storage node and each second storage node pre-store multiple pieces of recycled file information, the first storage node can quickly query the target recycled file information through the elastic search service. Compared with the method in the related art where a user uses the find command to retrieve recycled files, the method of the present invention that uses the elastic search service to retrieve is more efficient, has a faster retrieval speed, and provides a better user experience.

[0091] In this embodiment, another method for retrieving recovered file information is provided, which can be used in the above management node. Figure 7 FIG. 1 is a flowchart of another method for retrieving recovered file information according to an embodiment of the present invention. Figure 7 As shown, the process includes the following steps:

[0092] S701: When receiving at least one search condition sent from a client, detect whether an elastic search service is deployed on a first storage node and at least one second storage node.

[0093] The at least one search condition may include: directory name, file name, file size, file type, file owner, original path of the file, deletion time of the first recovered file, deletion user identifier, modification time, access time, creation time. Optionally, the search condition may also be a directory name.

[0094] The directory name is used to retrieve the recycled files in the specified directory in the Recycle Bin.

[0095] The file name is used to retrieve the recycled files in the recycle bin that match the specified characteristics, and supports wildcards such as * and ?.

[0096] File size is used to retrieve the recycle bin of a specified size. It supports operations greater than, less than or equal to, and supports unit selection. For example, retrieve the recycle bin for files greater than 1GB or less than or equal to 1TB.

[0097] The file type is used to retrieve the recycle files of the specified type in the recycle bin. For example, the specified type can be doc type or txt type.

[0098] The file owner is used to retrieve the recycled files of the specified owner in the Recycle Bin.

[0099] Deletion time is used to retrieve the time when the files were deleted, that is, to retrieve the time when the files entered the Recycle Bin. It supports year, month, day, and week units. For example, the deletion time can be within 1 week or more than 1 month.

[0100] Exemplarily, in response to at least one search condition selected by a user on a client, when the management node receives at least one search condition sent from the client, it detects whether the first storage node and at least one second storage node are deployed with an elastic search service.

[0101] S702: If yes, send at least one search condition to the first storage node.

[0102] The first storage node is used to obtain at least one second recycled file information from at least one second storage node, and based on at least one search condition, search for target recycled file information corresponding to at least one search condition in at least one first recycled file information and at least one second recycled file information, and send the search condition to the management node. Figure 2 Steps S201 - S204 of the illustrated embodiment are not described in detail here.

[0103] In some optional embodiments, when the management node detects that the elastic search service is not deployed on the first storage node and at least one second storage node, it obtains at least one third recycled file information stored in the first storage node and at least one fourth recycled file information stored in each second storage node; and determines whether the total number of at least one third recycled file information and at least one fourth recycled file information is less than or equal to a preset threshold.

[0104] If the total number is less than or equal to a preset threshold, the management node searches for target recycled file information corresponding to at least one search condition from at least one third recycled file information and at least one fourth recycled file information through a preset search command.

[0105] If the total number is greater than a preset threshold, the management node determines whether at least one retrieval condition includes the deletion time of the target recovery file; if at least one retrieval condition does not include the deletion time, a first message is sent to the client, the first message is used to prompt the client to add the deletion time to at least one retrieval condition, and at least two retrieval conditions with the added deletion time are sent to the management node; at least two retrieval conditions are received, and based on the deletion time, a preset search command is used to search for the target recovery file information corresponding to at least one retrieval condition from at least one third recovery file information and at least one fourth recovery file information, and the target recovery file information is fed back to the client.

[0106] Optionally, if at least one retrieval condition includes a deletion time, the management node searches for target recovered file information corresponding to at least one retrieval condition from at least one third recovered file information and at least one fourth recovered file information based on the deletion time through a preset search command, and feeds back the target recovered file information to the client.

[0107] The preset threshold value can be set according to actual needs without limitation. For example, the preset threshold value can be one million.

[0108] The deletion time can be set according to actual needs without limitation. For example, the deletion time can be set to within one week or one month.

[0109] The preset search command may be a find command.

[0110] S703: Receive target reclaimed file information sent from the first storage node, and feed back the target reclaimed file information to the client.

[0111] Based on the above Figure 7 According to the method, when the management node receives at least one retrieval condition sent by the client, it can detect whether the first storage node and at least one second storage node are deployed with the elastic search service; and when both are deployed with the elastic search service, at least one retrieval condition is sent to the first storage node, so that the first storage node can query the target recycled file information, and then feed back the target recycled file information to the client.

[0112] Since the first storage node and at least one second storage node are both deployed with an elastic search service, and the elastic search services in the first storage node and each second storage node pre-store multiple pieces of recycled file information, the target recycled file information can be quickly queried through the elastic search service deployed by the first storage node. Compared with the method in the related art where users use the find command to retrieve recycled files, the method of the present invention using the elastic search service for retrieval is more efficient, has a faster retrieval speed, and provides a better user experience.

[0113] In this embodiment, another retrieval system for recovered file information is provided. Figure 8 FIG. 1 is a schematic diagram of another method for retrieving recovered file information according to an embodiment of the present invention. Figure 8 As shown, the schematic diagram includes the following steps:

[0114] S801: The management node receives at least one search condition sent from a client.

[0115] S802: The management node detects whether the first storage node and at least one second storage node are deployed with an elastic search service.

[0116] S803: If yes, the management node sends at least one search condition to the first storage node.

[0117] For S303 specifically:

[0118] S8031: The first storage node receives at least one retrieval condition.

[0119] S8032: The first storage node obtains at least one second recycled file information pre-stored in the elastic search service of at least one second storage node.

[0120] S8033: The first storage node searches for target recycled file information in at least one first recycled file information and at least one second recycled file information of the first storage node based on at least one search condition.

[0121] S804: If no, that is, it is detected that the first storage node and the at least one second storage node are not deployed with the elastic search service, the management node determines whether the total amount of recycled file information of the first storage node and the at least one second storage node is less than or equal to a preset threshold;

[0122] S8041: If yes, that is, whether the total number is less than or equal to the preset threshold, the management node searches for target recovery file information through the find command;

[0123] S8042: If not, that is, the total number is greater than or equal to the preset threshold, the management node determines whether at least one search condition includes the deletion time; if it does, the management node searches for the target recovery file information through the find command.

[0124] S8043: If not included, the management node sends a first message to the client, prompting the client to add a deletion time, and after adding the deletion time, searches for target recovery file information through a find command;

[0125] S805: The management node feeds back the target recovery file information to the client.

[0126] This embodiment also provides a system for retrieving recovered file information, which includes a management node, a first storage node, and at least one second storage node.

[0127] The management node is used to detect whether the first storage node and at least one second storage node are deployed with an elastic search service when receiving at least one search condition sent from a client.

[0128] The management node is further configured to send at least one search condition to the first storage node if the search condition is true, and the elastic search service of the first storage node stores at least one first recycled file information.

[0129] The first storage node is used to receive at least one search condition sent from the management node when the first storage node and at least one second storage node are both deployed with an elastic search service, and the elastic search service of the first storage node stores at least one first recycled file information.

[0130] The first storage node is also used to obtain, from at least one second storage node, at least one second recycled file information pre-stored in the elastic search service of each second storage node.

[0131] The first storage node is further used to search, based on at least one search condition, for target recycled file information corresponding to at least one search condition in at least one first recycled file information and at least one second recycled file information.

[0132] The first storage node is further configured to send the target recycled file information to the management node, so that the management node feeds back the target recycled file information to the client.

[0133] The management node is further used to receive the target recycling file information sent from the first storage node, and feed back the target recycling file information to the client.

[0134] In this embodiment, a retrieval device for recovered file information is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0135] This embodiment provides a device for retrieving recovered file information. Fig. 9 As shown, Fig. 9 is a structural block diagram of a device for retrieving recovered file information according to an embodiment of the present invention, comprising:

[0136] The first transceiver module 901 is used to receive at least one search condition sent from the management node when the first storage node and at least one second storage node are both deployed with an elastic search service, and the elastic search service of the first storage node stores at least one first recycled file information.

[0137] The first transceiver module 901 is further used to obtain, from at least one second storage node, at least one second recycled file information pre-stored in the elastic search service of each second storage node.

[0138] The first processing module 902 is used to search for target recycled file information corresponding to at least one retrieval condition in at least one first recycled file information and at least one second recycled file information based on at least one retrieval condition.

[0139] The first transceiver module 901 is further configured to send target recycled file information to the management node, so that the management node feeds back the target recycled file information to the client.

[0140] In some optional embodiments, before the elastic search service of the first storage node stores at least one first recycled file information, the first transceiver module 901 is further used to receive a deletion request from the client when the elastic search service is deployed on the first storage node, the deletion request is used to request deletion of at least one first recycled file, and the deletion request carries file information and operation information of at least one first recycled file; the first processing module 902 is used to generate at least one first recycled file information based on the file information and operation information; the first processing module 902 is used to store at least one first recycled file information in the elastic search service deployed on the first storage node.

[0141] In some optional embodiments, the first storage node is also deployed with a metadata service; the metadata service is used to manage a deletion log; the first processing module 902 is specifically used to write at least one first recovered file information into the deletion log through the metadata service, and send at least one first recovered file information included in the deletion log to the elastic search service deployed on the first storage node, so that the elastic search service deployed on the first storage node stores at least one first recovered file information; the first processing module 902 is specifically used to determine whether at least one first recovered file information is sent successfully through the metadata service; the first processing module 902 is specifically used to, if yes, continue to send other recovered file information included in the deletion log through the metadata service; the first processing module 902 is specifically used to, if not, write at least one first recovered file information into the deletion log through the metadata service, and send it again to the elastic search service deployed on the first storage node until at least one first recovered file information is sent successfully.

[0142] In some optional embodiments, the first processing module 902 is further specifically used to parse at least one search condition to obtain at least one search statement that satisfies the elastic search service; the first processing module 902 is further specifically used to search for target recovered file information in at least one first recovered file information and at least one second recovered file information based on a preset correspondence relationship and at least one search statement, and the preset correspondence relationship is a correspondence relationship between at least one search statement and the target recovered file information.

[0143] This embodiment provides a device for retrieving recovered file information. Fig.10 As shown, Fig.10 is a structural block diagram of another device for retrieving recovered file information according to an embodiment of the present invention, the device comprising:

[0144] The second transceiver module 1002 is configured to receive at least one search condition sent from a client.

[0145] The second processing module 1001 is used to detect whether the first storage node and at least one second storage node are deployed with an elastic search service.

[0146] The second transceiver module 1002 is also used to send at least one retrieval condition to the first storage node when the second processing module detects that an elastic search service is deployed. The elastic search service of the first storage node stores at least one first recovered file information. The first storage node is used to obtain at least one second recovered file information from at least one second storage node, and based on the at least one retrieval condition, search for target recovered file information corresponding to at least one retrieval condition in at least one first recovered file information and at least one second recovered file information, and send it to the management node.

[0147] The second transceiver module 1002 is further configured to receive target recycled file information sent from the first storage node, and feed back the target recycled file information to the client.

[0148] In some optional embodiments, the second processing module 1001 is also used to obtain at least one third recycled file information stored in the first storage node and at least one fourth recycled file information stored in each second storage node when it is detected that the elastic search service is not deployed on the first storage node and at least one second storage node.

[0149] The second processing module 1001 is further used to determine whether the total number of at least one third recycled file information and at least one fourth recycled file information is less than or equal to a preset threshold.

[0150] The second processing module 1001 is further used to search for target recovered file information corresponding to at least one search condition from at least one third recovered file information and at least one fourth recovered file information through a preset search command if the total number is less than or equal to a preset threshold.

[0151] The second processing module 1001 is further configured to determine whether at least one search condition includes a deletion time of a target recycled file if the total number is greater than a preset threshold.

[0152] The second transceiver module 1002 sends a first message to the client if at least one search condition does not include the deletion time, the first message is used to prompt the client to add the deletion time to at least one search condition, and sends at least two search conditions with the deletion time added to the management node.

[0153] The second processing module 1001 is also used to receive at least two retrieval conditions, and based on the deletion time, search for target recovered file information corresponding to at least one retrieval condition from at least one third recovered file information and at least one fourth recovered file information through a preset search command, and feed back the target recovered file information to the client.

[0154] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0155] The retrieval device for recovered file information in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0156] The embodiment of the present invention also provides a computer device having the above Fig. 9 or Fig.10 The retriever of the recovered file information is shown.

[0157] See also Fig.11 , Fig.11 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig.11 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.11 A processor 10 is taken as an example.

[0158] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0159] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0160] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0161] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0162] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0163] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0164] Part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes but is not limited to source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0165] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for retrieving recovered file information, characterized in that: Applied to a first storage node, the first storage node, at least one second storage node and a management node form a distributed storage system; the method comprises: In a case where both the first storage node and the at least one second storage node are deployed with an elastic search service, receiving at least one search condition sent from the management node, the elastic search service of the first storage node storing at least one first recycled file information; Acquire at least one second recycled file information pre-stored in the elastic search service of each second storage node from the at least one second storage node; Based on the at least one search condition, searching for target recycled file information corresponding to the at least one search condition in the at least one first recycled file information and the at least one second recycled file information; The target recycling file information is sent to the management node, so that the management node feeds back the target recycling file information to the client.

2. The method according to claim 1, characterized in that Before the elastic search service of the first storage node stores the at least one first recycled file information, the method further includes: In a case where the elastic search service is deployed on the first storage node, receiving a deletion request from the client, the deletion request is used to request deletion of at least one first recycled file, and the deletion request carries file information and operation information of the at least one first recycled file; generating the at least one first recycling file information based on the file information and the operation information; The at least one first recycled file information is stored in the elastic search service deployed by the first storage node.

3. The method according to claim 2, characterized in that The first storage node is also deployed with a metadata service; the metadata service is used to manage a deletion log; the storing of the at least one first recycled file information in the elastic search service deployed by the first storage node includes: Writing the at least one first recycled file information into the deletion log through the metadata service, and sending the at least one first recycled file information included in the deletion log to the elastic search service deployed by the first storage node, so that the elastic search service deployed by the first storage node stores the at least one first recycled file information; Determining, by the metadata service, whether the at least one first recycled file information is sent successfully; If yes, continue to send other recovered file information included in the deletion log through the metadata service; If not, the at least one first recycled file information is written into the deletion log through the metadata service, and is sent again to the elastic search service deployed by the first storage node until the at least one first recycled file information is sent successfully.

4. The method according to claim 1, characterized in that The searching, based on the at least one search condition, in the at least one first recycled file information and the at least one second recycled file information for target recycled file information corresponding to the at least one search condition comprises: Parsing the at least one search condition to obtain at least one search statement that meets the requirements of the elastic search service; According to a preset correspondence and the at least one search statement, the target recycled file information is searched in the at least one first recycled file information and the at least one second recycled file information, wherein the preset correspondence is a correspondence between the at least one search statement and the target recycled file information.

5. A method for retrieving recovered file information, characterized in that: Applied to a management node, the management node, a first storage node and at least one second storage node form a distributed storage system; the method comprises: When receiving at least one search condition sent from the client, detecting whether the first storage node and the at least one second storage node are deployed with an elastic search service; If yes, the at least one search condition is sent to the first storage node, the elastic search service of the first storage node stores at least one first recycled file information, the first storage node is used to obtain at least one second recycled file information from the at least one second storage node, and based on the at least one search condition, search for the target recycled file information corresponding to the at least one search condition in the at least one first recycled file information and the at least one second recycled file information, and send it to the management node; The target recycling file information is received from the first storage node, and the target recycling file information is fed back to the client.

6. The method according to claim 5, characterized in that The method further comprises: When it is detected that the elastic search service is not deployed on the first storage node and the at least one second storage node, obtaining at least one third recycled file information stored in the first storage node and at least one fourth recycled file information stored in each second storage node; Determining whether the total number of the at least one third recycled file information and the at least one fourth recycled file information is less than or equal to a preset threshold; If the total number is less than or equal to the preset threshold, searching the target recycled file information corresponding to the at least one search condition from the at least one third recycled file information and the at least one fourth recycled file information through a preset search command; If the total number is greater than the preset threshold, determining whether the at least one search condition includes the deletion time of the target recycled file; If the at least one search condition does not include the deletion time, sending first information to the client, the first information is used to prompt the client to add the deletion time to the at least one search condition, and sending at least two search conditions to which the deletion time has been added to the management node; Receive the at least two retrieval conditions, and based on the deletion time, search the target recycled file information corresponding to the at least one retrieval condition from the at least one third recycled file information and the at least one fourth recycled file information through the preset search command, and feed back the target recycled file information to the client.

7. A device for retrieving recovered file information, characterized in that: The device comprises: A first transceiver module is used to receive at least one search condition sent from a management node when both the first storage node and the at least one second storage node are deployed with an elastic search service, and the elastic search service of the first storage node stores at least one first recycled file information; The first transceiver module is further used to obtain, from the at least one second storage node, at least one second recycled file information pre-stored in the elastic search service of each second storage node; A first processing module, configured to search, based on the at least one search condition, in the at least one first recycled file information and the at least one second recycled file information for target recycled file information corresponding to the at least one search condition; The first transceiver module is further configured to send the target recycled file information to the management node, so that the management node feeds back the target recycled file information to the client.

8. A device for retrieving recovered file information, characterized in that: The device comprises: A second transceiver module, configured to receive at least one search condition sent from a client; A second processing module, used to detect whether the first storage node and the at least one second storage node are deployed with an elastic search service; The second transceiver module is further used to send the at least one search condition to the first storage node when the second processing module detects that the elastic search service is deployed, wherein the elastic search service of the first storage node stores at least one first recycled file information, and the first storage node is used to obtain at least one second recycled file information from the at least one second storage node, and based on the at least one search condition, search for target recycled file information corresponding to the at least one search condition in the at least one first recycled file information and the at least one second recycled file information, and send the search result to the management node; The second transceiver module is further configured to receive the target recycled file information sent from the first storage node, and feed back the target recycled file information to the client.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are connected to each other for communication, the memory stores computer instructions, and the processor executes the method for retrieving recycled file information according to any one of claims 1 to 6 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for retrieving recycled file information according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Metadata retrieval method and system, terminal and storage medium

    CN114490527A

  • Distributed file management service center based on lightweight file system FastDFS

    CN114490536A

  • Data management method and device, equipment and storage medium

    CN114968926A