Data recovery method and device for distributed file system, equipment and medium
By adding the delete mark in the original directory of the distributed file system, the renamed directory is obtained and the data is controlled. It solves the problem of performance loss caused by the tree structure in the existing technology and realizes efficient data recovery performance.
Patent Information
- Application Number
- CN202411303133.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-01-28
AI Technical Summary
In distributed file systems, the prior art uses a tree structure directory method when implementing the trash mechanism, especially in the scenarios based on database storage.
By adding the preset deletion mark in the original directory of the distributed file system, the renamed directory is obtained, and the target data of the renamed directory control target data is in an invisible state, avoiding creating new directory and data movement operations.
Improve the data recovery performance of the distributed file system, reduce the consumption of system resources, and improve efficiency.
Smart Images

Figure CN119377187A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, specifically to technical fields such as cloud storage, cloud computing, and big data, and in particular to a data recovery method, device, equipment, and medium for a distributed file system. Background Art
[0002] In a distributed file system, the data deleted by users is processed through a recycling bin (trash) mechanism, which can avoid the problem of data being unrecoverable due to accidental deletion by users.
[0003] In the Hadoop Distributed File System (HDFS), for the trash mechanism, a tree-structured trash directory is usually established, and the deleted data is then moved into the trash directory.
[0004] The amount of data in a distributed file system is usually large, and the directory information in the distributed file system can be stored in a database. The data structure in the database is a flat structure. If the trash mechanism is still implemented by establishing a tree-structured trash directory, it will cause more performance loss, waste computing resources, and affect efficiency. Summary of the invention
[0005] The present invention provides a data recovery method, device, equipment and medium for a distributed file system.
[0006] According to one aspect of the present disclosure, a data recovery method for a distributed file system is provided, comprising: in response to a deletion instruction for target data in a distributed file system, adding a preset deletion mark to an original directory of the distributed file system to obtain a renamed directory; based on the renamed directory, controlling the target data to be in an invisible state.
[0007] According to another aspect of the present disclosure, a data recovery device for a distributed file system is provided, comprising: a renaming module, for adding a preset deletion mark to an original directory of the distributed file system in response to a deletion instruction for target data in the distributed file system to obtain a renamed directory; and a hiding module, for controlling the target data to be in an invisible state based on the renamed directory.
[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any method as described in any of the above aspects.
[0009] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods according to any one of the above aspects.
[0010] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the methods described in any one of the above aspects.
[0011] According to the embodiments of the present disclosure, the data recovery performance of the distributed file system can be improved.
[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0014] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;
[0015] Figure 2 is a schematic diagram of an application scenario for implementing an embodiment of the present disclosure;
[0016] Figure 3 is a schematic diagram of adding a deletion mark when the target data is a file according to an embodiment of the present disclosure;
[0017] Figure 4 is a schematic diagram of adding a deletion mark when the target data is a subdirectory according to an embodiment of the present disclosure;
[0018] Figure 5 is a schematic diagram of an index table provided according to an embodiment of the present disclosure;
[0019] Figure 6 is a schematic diagram of a visualization view provided according to an embodiment of the present disclosure;
[0020] Figure 7 is a schematic diagram according to a second embodiment of the present disclosure;
[0021] Figure 8 is a schematic diagram according to a third embodiment of the present disclosure;
[0022] Fig. 9 It is a schematic diagram of an electronic device used to implement the data recovery method of the distributed file system of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0024] In HDFS, data recycling is achieved by creating a trash directory. Specifically, HDFS creates a trash directory for each user, with the path / user / username / .Trash / . Under the .Trash / directory, there is usually a current subdirectory for storing files or directories recently deleted by the user. As time goes by, HDFS creates subdirectories named with timestamps (such as yyMMddHHmm) and moves files or directories in the current directory to the directories named with these timestamps. HDFS uses a background thread (Emptier) in the NameNode to regularly clean up files in the trash. This thread checks whether the files in the trash have exceeded the set retention time. If so, these files are automatically deleted. Users can use the HDFS mv command to move files or directories from the trash to the original location or other location to restore data before the trash is automatically cleaned up. HDFS's native tree structure based on full memory storage can naturally use the directory structure to retain trash data, which is simple to operate.
[0025] In the scenario based on database storage, due to the natural flat structure, if the complete directory tree is implemented according to HDFS, it will inevitably bring a large number of two-phase commit (2PC) transactions. At the same time, the need to establish the complete path of the parent directory will also bring great performance loss.
[0026] In order to improve data recovery performance, the present disclosure provides the following embodiments.
[0027] Figure 1 is a schematic diagram according to the first embodiment of the present disclosure. This embodiment provides a data recovery method for a distributed file system, such as Figure 1 As shown, the method includes:
[0028] 101. In response to a deletion instruction for target data in a distributed file system, add a deletion mark to an original directory of the distributed file system to obtain a renamed directory.
[0029] 102. Based on the renaming directory, control the target data to be in an invisible state.
[0030] The deletion instruction may be generated by a user. For example, the user sends a deletion instruction to the distributed file system through a client. The deletion instruction includes information about the data to be deleted, so that the corresponding data is deleted through the deletion instruction.
[0031] In order to prevent users from accidentally deleting data, a trash mechanism can be used, that is, when a deletion instruction is received, the data is not actually deleted, but is treated as trash data. After the expiration time of the trash data is reached, the data is actually deleted.
[0032] The target data refers to the data to be deleted corresponding to the deletion instruction, that is, the recycle bin data, which can be a file or a subdirectory.
[0033] The original directory is used to indicate the complete storage path of a file in the distributed file system.
[0034] For example, for a distributed file system fs1, its original directory is: / fs1 / dir1 / dir2 / file1, which indicates that the next level of directory fs1 is subdirectory dir1, the next level of dir1 is subdirectory dir2, and the next level of dir2 is file file1.
[0035] Deletion markers are preset, for example, .trash.ts. is used as a deletion marker.
[0036] A renamed directory is a directory created by adding a delete mark to the original directory.
[0037] Specifically, a deletion mark may be added to the name corresponding to the target data in the original directory, and specifically, the deletion mark may be used as a prefix part of the corresponding name.
[0038] For example, when the delete command is used to delete the file file1, the above-mentioned delete mark is inserted before the file name file1 of the original directory. At this time, the renamed directory is: / fs1 / dir1 / dir2 / .trash.ts.file1.
[0039] For another example, when the delete instruction is used to delete a subdirectory, such as deleting the subdirectory dir2, the above-mentioned delete mark is inserted before the name of the subdirectory in the original directory. At this time, the renamed directory is: / fs1 / dir1 / .trash.ts.dir2 / file1.
[0040] After obtaining the renamed directory, the control target data is in an invisible state.
[0041] In the related art, when data is recycled, it is necessary to create a new trash directory and then move the target data to be recycled into the storage location corresponding to the trash directory.
[0042] In the present embodiment, there is no need to create a new directory, but to modify the original directory. In addition, there is no need to move the target data, but to keep the storage location of the target data unchanged, and just control the target data to be in an invisible state.
[0043] Specifically, when displaying data, the distributed file system can filter out data with a deletion mark before the name, so that the data is not displayed to the user and is invisible to the user.
[0044] Taking the target data as file file1 as an example, when the distributed file system receives a delete instruction for file file1, it inserts a delete mark in front of the name of file1 in the original directory, controls file file1 to be invisible, and does not perform the file move operation. In this way, the usual two-phase commit (2PC) transaction can be changed to a one-phase commit (1PC) transaction, saving system resources, improving efficiency, and thus improving data recovery performance.
[0045] In this embodiment, a deleted directory is obtained by adding a deletion mark to the original directory, and the target data is controlled to be invisible based on the renamed directory. There is no need to create a new directory or move data, thereby improving data recovery performance.
[0046] In order to better understand the present disclosure, the application scenarios involved in the present disclosure are described as follows:
[0047] Figure 2 It is a schematic diagram of an application scenario for implementing the embodiment of the present disclosure.
[0048] like Figure 2 As shown, this application scenario includes: a client and a distributed file system.
[0049] The client is deployed on the user terminal 201, and the user terminal may include: a personal computer (PC), a mobile device (such as a mobile phone), a tablet computer, a laptop computer, a smart wearable device, etc.
[0050] A distributed file system refers to a file system that manages physical storage resources that are not necessarily directly connected to a local node, but are connected to a node (which can be simply understood as a computer) through a computer network; or a complete hierarchical file system formed by combining several different logical disk partitions or volumes.
[0051] A distributed file system generally includes a management node 202 and multiple storage nodes 203a-203n. The management node is used to store and manage metadata of files, such as managing directories. Each storage node is used to store one or more files (or file blocks).
[0052] The client interacts with the management node to obtain the metadata of the data to be accessed, and interacts with the corresponding storage node based on the metadata to perform read and write operations on the data.
[0053] In a distributed file system, there are massive files and directories, and the amount of metadata is very huge. Therefore, a database can be used to store these metadata.
[0054] The basic building block of a database is a data table, which defines how the data is organized, including which rows or records the table contains.
[0055] Record: A row in a data table. A data table contains one or more records (rows). In a big data scenario, a data table may have many rows, such as tens of millions.
[0056] Field: A column in a data table. A data table includes one or more fields (columns).
[0057] Field value: The value corresponding to the field. For example, for the same column, it can correspond to multiple rows, and the value of each row corresponding to the column is the field value. For example, for the "distributed file system identifier (fs_id)" field, the field value can include "fs1", "fs2", etc.
[0058] Fields and their field values can also be considered as key-value (KV) formats. For this reason, the database can also be called a KV database, and the corresponding storage method is called KV database-based storage of distributed file system metadata.
[0059] In the above-mentioned KV database-based storage scenario, since the data structure of the database is a flat structure, and the directory is logically a tree structure, it is difficult to create a new trash directory, and moving the target data also causes certain system overhead. Therefore, for the trash mechanism of the distributed file system, the embodiment of the present disclosure adopts a method of modifying the original directory to keep the target data storage location unchanged and control the target data to be invisible.
[0060] Specifically, a preset deletion mark, such as .trash.ts., is inserted before the name corresponding to the target data in the original directory.
[0061] Figure 3It is a schematic diagram of adding a deletion mark when the target data is a file according to an embodiment of the present disclosure.
[0062] like Figure 3 As shown, the left side is the original directory: / fs1 / dir1 / dir2 / file1. Assuming that the file file1 is deleted, the renamed directory shown on the right side is obtained: / fs1 / dir1 / dir2 / .trash.ts.file1.
[0063] Figure 4 It is a schematic diagram of adding a deletion mark when the target data is a subdirectory according to an embodiment of the present disclosure.
[0064] like Figure 4 As shown, the left side is the original directory: / fs1 / dir1 / dir2 / file1. Assuming that the subdirectory dir2 is deleted, the renamed directory shown on the right side is obtained: / fs1 / dir1 / .trash.ts.dir2 / file1.
[0065] In addition, in order to facilitate the retrieval of the recycle bin (trash) data (target data), an index table may be established, in which the relevant information of the parent directory of the target data is stored.
[0066] Figure 5 It is a schematic diagram of an index table provided according to an embodiment of the present disclosure.
[0067] like Figure 5 As shown, the index table may include the following fields: a distributed file system identifier (fs_id), a parent directory identifier of the target data (parent_inode), the number of recycle bin data under the parent directory (trash_num), and an expiration time (expiration_time) of the recycle bin data under the parent directory.
[0068] Take the target data file1 as an example. Since it belongs to fs1, the field value of fs_id in the row corresponding to the target data is fs1. The parent directory identifier can be the number of the index node (inode) where the parent directory is located, such as inode1. The parent directory is located by the inode number. Trash_num is used to indicate the number of trash under the parent directory. The number n is a positive integer. Assuming that only file1 is deleted under the parent directory, the number is 1. In addition, the number can be updated over time. For example, after a period of time, file2 under the parent directory is also deleted, then the number can be updated to 2; or, after a period of time, the recycle bin data may be cleaned up (completely deleted). For example, after the number is updated to 2, file1 is completely deleted after a period of time, then the number is updated to 1 again. The target data will expire after a set period of time. Therefore, the expiration time can be determined based on the deletion time of the target data and the set period of time. The parent directory may include multiple target data, so the expiration time may specifically be the latest expiration time of all target data, which is assumed to be represented by t1.
[0069] Based on this, Figure 5 As shown, the records (rows) in the index table corresponding to the file1 file are: fs1, innode1, n, t1.
[0070] Multiple similar records can be generated based on different target data, and an index table can be formed based on different records.
[0071] After obtaining the index table, subsequent processing can be performed based on the index table. For example, when the most recent expiration time t1 is reached, the target data corresponding to t1 is cleaned up, that is, the target data is actually deleted (completely deleted) in the distributed file system. Or, when the number of recycle bin data of a certain record n=0, the record is deleted from the index table to save resources.
[0072] In addition, a visual view can be generated based on the index table to facilitate users to understand the status of the recycle bin data in the distributed file system.
[0073] Figure 6 It is a schematic diagram of a visualization view provided according to an embodiment of the present disclosure.
[0074] like Figure 6 As shown, the visualization view may be a tree structure, corresponding to the parent directory of the target data (such as file1), and the parent directory may be obtained through the index table.
[0075] In combination with the above application scenarios, the present disclosure also provides the following embodiments.
[0076] Figure 7is a schematic diagram according to a second embodiment of the present disclosure. This embodiment provides a data recovery method for a distributed file system, the method comprising:
[0077] 701. In response to a deletion instruction for target data in a distributed file system, add a preset deletion mark to an original directory of the distributed file system to obtain a renamed directory.
[0078] 702. Based on the renaming directory, control the target data to be in an invisible state.
[0079] For example, refer to Figure 3 , assuming the target data is file1, you can get Figure 3 Rename the directory as shown on the right, or refer to Figure 4 , assuming the target data is the subdirectory dir2, you can get Figure 4 Rename the directory as shown on the right.
[0080] The target data may also be referred to as trash data. Afterwards, the trash data may be viewed, restored, deleted, cleaned, etc. These operations may be performed based on the index table. To this end, the method may further include:
[0081] 703. Generate an index table based on the parent directory information of the target data.
[0082] 704. Perform recycle bin processing based on the index table.
[0083] For example, you can generate Figure 5 The index table shown in FIG. 1 records the parent directory information of the target data. Afterwards, the index table is used to perform recycle bin related processing.
[0084] In this embodiment, by generating an index table and performing recycle bin processing based on the index table, compared with the method of traversing the trash directory tree to query information, the index table can more efficiently query the required information, thereby improving the efficiency of recycle bin processing.
[0085] In some embodiments, the index table includes: an expiration time of the target data, and accordingly, if the expiration time is reached, the target data is cleared.
[0086] For example, the expiration time is the most recent expiration time, and the most recent expiration time is t1. If the current time reaches t1, the recycle bin data corresponding to t1 is cleaned up. For example, the recycle bin data includes file1 and file2, and the recycle bin data corresponding to t1 is file1, then file1 is cleaned up. Cleaning up means completely deleting file1, that is, when a deletion instruction for file1 is received, file1 is not actually deleted, but when the expiration time t1 of file1 is reached, file1 is actually deleted in the distributed file system.
[0087] In this embodiment, by recording the expiration time of the target data in the index table, the target data can be cleaned up based on the expiration time, thereby realizing the cleanup function of the recycle bin.
[0088] In some embodiments, the index table includes: a parent directory identifier of the target data; accordingly, in response to a viewing instruction for the parent directory of the target data, if the viewing instruction includes a preset target data viewing mark, the parent directory is determined based on the parent directory identifier; and the target data under the parent directory is displayed.
[0089] Among them, the user can generate a viewing instruction for a certain directory or subdirectory, and the viewing instruction includes the directory information to be viewed. For example, if the directory to be viewed is the parent directory of file1, the viewing instruction includes / fs1 / dir1 / dir2 information, and the files under the parent directory can be displayed at this time. Assuming that file1 is recycle bin data, that is, a delete instruction for file1 has been received before, then file1 is in an invisible state at this time. Assuming that there is file2 that has not been deleted under the parent directory, file2 will be displayed.
[0090] In order to query the Recycle Bin data under the parent directory, such as file1 mentioned above, you can add a preset target data (Recycle Bin data) viewing mark in the viewing instruction, such as adding "@list_trash@" as the target data viewing mark after the above-mentioned parent directory. At this time, the Recycle Bin data under the parent directory is displayed, such as file1 mentioned above, and file2 is no longer displayed.
[0091] In this embodiment, by adding a target data viewing mark in the viewing instruction, the function of viewing the recycle bin data can be realized.
[0092] After knowing the data in the recycle bin, you can delete or restore the data in the recycle bin as needed.
[0093] In some embodiments, after displaying the target data, the following steps may also be included:
[0094] In response to a restore instruction for the target data, removing the deletion mark in the renamed directory to restore the original directory, and controlling the target data to be in a visible state based on the original directory; or,
[0095] In response to a deletion instruction for the target data, the target data is deleted in the distributed file system.
[0096] In this embodiment, the function of restoring or deleting the recycle bin data can be realized as needed through the restore instruction or the delete instruction.
[0097] 705. Generate a visualization view based on the index table, where the visualization view is used to show the tree structure of the parent directory of the target data.
[0098] For example, you can generate Figure 6 The visual view shown can help users understand the overall situation of the recycle bin data in the distributed file system.
[0099] Figure 8 It is a schematic diagram according to the third embodiment of the present disclosure. This embodiment provides a data recovery device for a distributed file system. The device 800 includes: a renaming module 801 and a hiding module 802.
[0100] The renaming module 801 is used to respond to a deletion instruction for target data in a distributed file system, and add a preset deletion mark to the original directory of the distributed file system to obtain a renamed directory; the hiding module 802 is used to control the target data to be in an invisible state based on the renamed directory.
[0101] In this embodiment, a deleted directory is obtained by adding a deletion mark to the original directory, and the target data is controlled to be invisible based on the renamed directory. There is no need to create a new directory or move data, thereby improving data recovery performance.
[0102] In some embodiments, the apparatus 800 further includes:
[0103] A generating module, used for generating an index table based on the parent directory information of the target data;
[0104] A processing module is used to perform recycle bin processing based on the index table.
[0105] In this embodiment, by generating an index table and performing recycle bin processing based on the index table, compared with the method of traversing the trash directory tree to query information, the index table can more efficiently query the required information, thereby improving the efficiency of recycle bin processing.
[0106] In some embodiments, the index table includes: the expiration time of the target data;
[0107] The processing module is further configured to:
[0108] If the expiration time is reached, the recycle bin data is cleared.
[0109] In this embodiment, by recording the expiration time of the target data in the index table, the target data can be cleaned up based on the expiration time, thereby realizing the cleanup function of the recycle bin.
[0110] In some embodiments, the index table includes: a parent directory identifier of the target data;
[0111] The processing module is further configured to:
[0112] In response to a viewing instruction for a parent directory of the target data, if the viewing instruction includes a preset target data viewing mark, determining the parent directory based on the parent directory identifier;
[0113] Display the target data under the parent directory.
[0114] In this embodiment, by adding a target data viewing mark in the viewing instruction, the function of viewing the recycle bin data can be realized.
[0115] In some embodiments, the processing module is further configured to:
[0116] In response to a restore instruction for the target data, removing the deletion mark in the renamed directory to restore the original directory, and controlling the target data to be in a visible state based on the original directory; or,
[0117] In response to a deletion instruction for the target data, the target data is deleted in the distributed file system.
[0118] In this embodiment, the function of restoring or deleting the recycle bin data can be realized as needed through the restore instruction or the delete instruction.
[0119] In some embodiments, the apparatus 800 further includes:
[0120] The view module is used to generate a visual view based on the index table, and the visual view is used to show the tree structure of the parent directory of the target data.
[0121] In this way, it is convenient for users to understand the overall situation of the recycle bin data in the distributed file system.
[0122] It can be understood that in the embodiments of the present disclosure, the same or similar contents in different embodiments can be referenced to each other.
[0123] It can be understood that the “first”, “second”, etc. in the embodiments of the present disclosure are only used for distinction and do not indicate the degree of importance, time sequence, etc.
[0124] It is understandable that unless there is any special limitation on the sequence of steps in the process, it means that the timing relationship between these steps is not limited.
[0125] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0126] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0127] Fig. 9 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device 900 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0128] like Fig. 9 As shown, the electronic device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0129] Multiple components in the electronic device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the electronic device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0130] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as a data recovery method for a distributed file system. For example, in some embodiments, the data recovery method for a distributed file system may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the data recovery method for the distributed file system described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the data recovery method for the distributed file system in any other appropriate manner (e.g., by means of firmware).
[0131] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0132] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable task processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0133] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0134] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0135] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0136] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0137] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0138] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A data recovery method for a distributed file system, comprising: In response to a deletion instruction for target data in a distributed file system, adding a preset deletion mark to an original directory of the distributed file system to obtain a renamed directory; Based on the renamed directory, the target data is controlled to be in an invisible state.
2. The method according to claim 1, further comprising: Generate an index table based on the parent directory information of the target data; Recycle bin processing is performed based on the index table.
3. The method according to claim 2, wherein: The index table includes: the expiration time of the target data; The performing recycle bin processing based on the index table includes: If the expiration time is reached, the recycle bin data is cleared.
4. The method according to claim 2, wherein: The index table includes: a parent directory identifier of the target data; The performing recycle bin processing based on the index table includes: In response to a viewing instruction for a parent directory of the target data, if the viewing instruction includes a preset target data viewing mark, determining the parent directory based on the parent directory identifier; Display the target data under the parent directory.
5. The method according to claim 4, after displaying the target data under the parent directory, performing recycle bin processing based on the index table, further comprises: In response to a restore instruction for the target data, removing the deletion mark in the renamed directory to restore the original directory, and controlling the target data to be in a visible state based on the original directory; or, In response to a deletion instruction for the target data, the target data is deleted in the distributed file system.
6. The method according to claim 2, further comprising: Based on the index table, a visual view is generated, where the visual view is used to show the tree structure of the parent directory of the target data.
7. A data recovery device for a distributed file system, comprising: a renaming module, configured to, in response to a deletion instruction for target data in a distributed file system, add a preset deletion mark to an original directory of the distributed file system to obtain a renamed directory; The hidden module is used to control the target data to be in an invisible state based on the renamed directory.
8. The apparatus according to claim 7, further comprising: A generating module, used for generating an index table based on the parent directory information of the target data; A processing module is used to perform recycle bin processing based on the index table.
9. The device according to claim 8, wherein: The index table includes: the expiration time of the target data; The processing module is further configured to: If the expiration time is reached, the recycle bin data is cleared.
10. The device according to claim 8, wherein: The index table includes: a parent directory identifier of the target data; The processing module is further configured to: In response to a viewing instruction for a parent directory of the target data, if the viewing instruction includes a preset target data viewing mark, determining the parent directory based on the parent directory identifier; The target data under the parent directory is displayed.
11. The device according to claim 10, wherein: The processing module is also used for: In response to a restore instruction for the target data, removing the deletion mark in the renamed directory to restore the original directory, and controlling the target data to be in a visible state based on the original directory; or, In response to a deletion instruction for the target data, the target data is deleted in the distributed file system.
12. The apparatus according to claim 8, further comprising: The view module is used to generate a visual view based on the index table, and the visual view is used to show the tree structure of the parent directory of the target data.
13. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.
15. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Virtual deletion in merged file system directories
CN101535968A
Method for fast deleting files in distributed file system
CN104156474A
Data deleting method, device, electronic equipment and storage medium
CN110377616A
Method and device for processing metadata in distributed file system, equipment and medium
CN116860700A
Storage management method and apparatus, and storage system
WO2021196957A1