CN113553219A - Data recovery method applied to network storage device and related device - Google Patents

Data recovery method applied to network storage device and related device Download PDF

Info

Publication number
CN113553219A
CN113553219A CN202110874407.7A CN202110874407A CN113553219A CN 113553219 A CN113553219 A CN 113553219A CN 202110874407 A CN202110874407 A CN 202110874407A CN 113553219 A CN113553219 A CN 113553219A
Authority
CN
China
Prior art keywords
file
target
network storage
storage device
suspected
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110874407.7A
Other languages
Chinese (zh)
Other versions
CN113553219B (en
Inventor
张庸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Yiwo Tech Development Co ltd
Original Assignee
Chengdu Yiwo Tech Development Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Yiwo Tech Development Co ltd filed Critical Chengdu Yiwo Tech Development Co ltd
Priority to CN202110874407.7A priority Critical patent/CN113553219B/en
Publication of CN113553219A publication Critical patent/CN113553219A/en
Application granted granted Critical
Publication of CN113553219B publication Critical patent/CN113553219B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1471Saving, restoring, recovering or retrying involving logging of persistent data for recovery
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0605Improving or facilitating administration, e.g. storage management by facilitating the interaction with a user or administrator

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data recovery method applied to a network storage device and a related device, wherein the method comprises the steps of establishing communication connection with a client through the network storage device, and enabling the network storage device to analyze a file system of a target partition based on operation at the client so as to obtain an existing file and a suspected deleted file of the target partition; and scanning the network storage equipment sector by sector to obtain a suspected lost file. And determining a target file in the existing file, the suspected deleted file and the suspected lost file by the client, and realizing the recovery of the target file. According to the invention, data recovery can be carried out without dismounting the hard disk of the network storage device, a user can carry out convenient operation based on the client to realize file recovery, and the recovery effect is not influenced by the structure of the hard disk, so that the efficiency and the success rate of the recovery of deleted data in the network storage device are improved.

Description

Data recovery method applied to network storage device and related device
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data recovery method applied to a network storage device and a related device.
Background
With the increasing Storage capacity of magnetic disks and the mass production of data, such as NAS (Network Attached Storage) Storage devices, these Storage devices are used by more and more individuals and enterprises. During the use of the network storage device, a user may delete data by mistake or format a disk by mistake, which may cause a part of the data to be lost.
When the part of data needs to be recovered, the current common practice is: the hard disk needs to be first removed from the network storage device and accessed to another system, and then restored by dedicated data restoration software. However, in this processing manner, a user is required to have a certain operation capability on the network storage device hardware, and meanwhile, a built-in hard disk of the network storage device usually adopts a RAID (Redundant Arrays of Independent Disks) structure, which causes difficulty in user operation and reduces a success rate of recovering deleted data.
Disclosure of Invention
In view of the above problems, the present invention provides a data recovery method applied to a network storage device and a related device, so as to improve the efficiency and success rate of recovering deleted data in the network storage device.
In order to achieve the purpose, the invention provides the following technical scheme:
a data recovery method applied to a network storage device comprises the following steps:
responding to the establishment of communication connection with the client, and receiving a query instruction which is sent by the client and used for querying partitions on the network storage device;
based on the query instruction, sending partition information of the network storage device to the client to determine a target partition;
analyzing the file system of the target partition to obtain an existing file and a suspected deleted file of the target partition;
scanning the network storage equipment sector by sector to obtain a suspected lost file;
and in response to receiving a recovery instruction for recovering a target file, recovering the target file, wherein the target file is a file determined by the client based on the existing file, the suspected deleted file and the suspected lost file.
Optionally, the analyzing the file system of the target partition to obtain an existing file and a suspected deletion file of the target partition includes:
acquiring a tree structure of the file system of the target partition;
positioning a root directory based on the tree structure for traversing to obtain the existing file of the target partition;
and acquiring an expansion tree of the file system, traversing the expansion tree to acquire a suspected deleted file, wherein the expansion tree is used for managing unused space of a disk.
Optionally, the obtaining the expanded tree of the file system, traversing the expanded tree, and obtaining the suspected deleted file includes:
acquiring file basic information of an existing file of the target partition;
traversing the expanded tree of the file system to obtain a data block of the expanded tree;
detecting whether file basic information corresponding to the data blocks of the expansion tree is the same as that of the existing file or not;
and if the data blocks are different, determining the file corresponding to the data block as a suspected deletion file.
Optionally, the performing a sector-by-sector scan on the network storage device to obtain a suspected-loss file includes:
determining the sectors traversed by the root directory traversal and the expansion tree traversal as scanned sectors;
determining the sectors in the network storage device except the scanned sectors as target sectors;
and scanning the target sector by sector to obtain a suspected lost file.
Optionally, the performing sector-by-sector scanning on the target sector to obtain a file suspected of being lost includes:
scanning the target sector by sector to obtain sector data;
detecting whether the file information corresponding to the sector data is the same as the file basic information of the existing file or not;
and if the file is different, determining the file corresponding to the sector data as a suspected lost file.
Optionally, the restoring the target file includes:
acquiring an original storage path of the target file;
reading the file content of the target file;
and storing the file content to the original storage path.
Optionally, the restoring the target file includes:
reading the file content of the target file;
and sending the file content to the client so that the client saves the file content to a target area.
A network storage device, comprising:
the first receiving unit is used for responding to the establishment of communication connection with the client and receiving a query instruction which is sent by the client and used for querying partitions on the network storage device;
a first sending unit, configured to send partition information of the network storage device to the client based on the query instruction, so as to determine a target partition;
the analysis unit is used for analyzing the file system of the target partition to obtain the existing file and the suspected deleted file of the target partition;
the scanning unit is used for scanning the network storage device sector by sector to obtain a suspected lost file;
and the recovery unit is used for responding to a received recovery instruction for recovering a target file, and recovering the target file, wherein the target file is a file determined by the client based on the existing file, the suspected deleted file and the suspected lost file.
A data recovery system comprising: a client and a network storage device, the client and the network storage device being communicatively coupled, wherein,
the client is used for sending a query instruction for querying the partitions on the network storage device to the network storage device;
the network storage device is used for sending the partition information of the network storage device to the client based on the query instruction so as to determine a target partition; analyzing the file system of the target partition to obtain an existing file and a suspected deleted file of the target partition; scanning the network storage equipment sector by sector to obtain a suspected lost file; sending the existing file, the suspected deleted file and the suspected lost file to the client;
the client is further configured to determine a target file among the existing file, the suspected deleted file and the suspected lost file, and send a recovery instruction for recovering the target file to the network storage device;
the network storage device is further configured to restore the target file based on the restoration instruction.
Optionally, the client is further configured to:
inputting device identification information of a network storage device to connect to the network storage device based on the device identification information.
Compared with the prior art, the invention provides a data recovery method applied to a network storage device and a related device, wherein in the method, the network storage device establishes communication connection with a client, and the network storage device can analyze a file system of a target partition based on operation at the client to obtain an existing file and a suspected deleted file of the target partition; and scanning the network storage equipment sector by sector to obtain a suspected lost file. And determining a target file in the existing file, the suspected deleted file and the suspected lost file by the client, and realizing the recovery of the target file. According to the invention, data recovery can be carried out without dismounting the hard disk of the network storage device, a user can carry out convenient operation based on the client to realize file recovery, and the recovery effect is not influenced by the structure of the hard disk, so that the efficiency and the success rate of the recovery of deleted data in the network storage device are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flowchart of a data recovery method applied to a network storage device according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a network storage device according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of data processing of a data recovery system according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first" and "second," and the like in the description and claims of the present invention and the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not set forth for a listed step or element but may include steps or elements not listed.
To facilitate description of the embodiments of the present invention, terms that may be used in the embodiments of the present invention are described.
Nas (network Attached storage): the system is called network additional storage or network storage equipment, can provide a cross-platform file sharing function, is a special data storage equipment, can be directly connected to a network, does not need to be hung at the back end of a server, and avoids increasing I/O load to the server. The NAS uses embedded system software, provides cross-platform file sharing and can realize centralized data management.
Partitioning: computer terminology refers to a portion of a physical disk that operates as a physically separate disk. After a partition is created, the data must be formatted into a specified file system before it is stored in the partition.
File System (File System): are methods and data structures used by an operating system to specify files on a storage device or partition; i.e. a method of organizing files on a storage device. The software mechanism in the operating system that is responsible for managing and storing file information is called a file management system, referred to as a file system for short.
RAID (Redundant Arrays of Independent Disks, disk array): there is the meaning of "array with redundancy capability made of independent disks". The disk array is a disk group with huge capacity composed of a plurality of independent disks, and the performance of the whole disk system is improved by the additive effect generated by providing data by individual disks.
Example one
The embodiment of the invention provides a data recovery method applied to a network storage device, wherein the network storage device is usually an NAS. In the invention, the application programs are respectively installed on the client and the network storage equipment (NAS) end and are mutually connected, after the connection is successful, the client application program informs the NAS end application program, the file system information on the NAS end application program is analyzed, the desired effective data is obtained, the NAS end application program transmits the found lost file information to the client application program to complete data recovery, and the problem of recovering data from the NAS as far as possible after the data is deleted by mistake is solved.
Referring to fig. 1, a schematic flow chart of a data recovery method applied to a network storage device according to an embodiment of the present invention is shown, where the method applied to a network storage device side may include the following steps:
s101, responding to the establishment of communication connection with the client, and receiving a query instruction which is sent by the client and used for querying partitions on the network storage device.
S102, based on the query instruction, sending the partition information of the network storage device to the client to determine a target partition.
And starting an application program for reading the disk data at the network storage device end and waiting for connection. After the client starts the data interaction application program and is connected to a network storage device end (such as an NAS end), after the connection is successful, the client generates a query instruction for querying partitions on the network storage device and sends the query instruction to the NAS end, so that the NAS end can enumerate all the partitions on the NAS end based on the query instruction and find out the partitions where the data is stored by the user.
And the NAS end application program sends the inquired partition information to the client, and a user of the client determines the partition to be scanned in the partition information to serve as a target partition.
S103, analyzing the file system of the target partition to obtain the existing file and the suspected deleted file of the target partition.
When a user designates a partition to be scanned through a client, namely, a target partition is designated, the NAS end scans the target partition, namely, the NAS end opens the partition designated by the user, and the NAS file system is analyzed. During scanning, firstly, the file system tree structure is positioned to the root directory and then traversal is started, the existing file on the network storage device is found, then the expanded tree is scanned, namely the file system is analyzed to be used for managing the disk space distribution tree except the file tree, and unused space is uniformly managed by using the tree, so that data deleted by the file system is stored on the tree, the tree is traversed, and data blocks on the tree are analyzed to obtain a suspected deleted file.
S104, scanning the network storage device sector by sector to obtain suspected lost files;
s105, responding to the received restoration instruction for restoring the target file, and restoring the target file.
The target file is a file determined by the client based on the existing file, the suspected deleted file and the suspected lost file.
After the analysis is completed according to the structure of the file system, the scanning is carried out sector by sector, and the missing data caused by operations such as disk formatting and the like is prevented. The network storage device side sends the scanned existing file, suspected deleted file and suspected lost file to the client side, and the client side determines the target file needing to be recovered. And after the client determines the target file, the target file is restored to the specified position by the network storage equipment.
The embodiment of the invention provides a data recovery method applied to network storage equipment, which is characterized in that communication connection is established between the network storage equipment and a client, and the network storage equipment can analyze a file system of a target partition based on operation at the client to obtain an existing file and a suspected deleted file of the target partition; and scanning the network storage equipment sector by sector to obtain a suspected lost file. And determining a target file in the existing file, the suspected deleted file and the suspected lost file by the client, and realizing the recovery of the target file. According to the invention, data recovery can be carried out without dismounting the hard disk of the network storage device, a user can carry out convenient operation based on the client to realize file recovery, and the recovery effect is not influenced by the structure of the hard disk, so that the efficiency and the success rate of the recovery of deleted data in the network storage device are improved.
Example two
In a possible implementation manner of the embodiment of the present invention, the analyzing the file system of the target partition to obtain the existing file and the suspected deleted file of the target partition includes:
acquiring a tree structure of the file system of the target partition;
positioning a root directory based on the tree structure for traversing to obtain the existing file of the target partition;
and acquiring an expansion tree of the file system, traversing the expansion tree to acquire a suspected deleted file, wherein the expansion tree is used for managing unused space of a disk.
In this embodiment, the file system is parsed, traversal is started after the root directory is located to obtain the existing file on the network storage device, and then traversal is performed on the expansion tree to obtain the suspected deleted file, wherein the expansion tree is used for managing the unused space of the disk. In a possible implementation manner, the obtaining an expanded tree of the file system, and traversing the expanded tree to obtain a suspected deleted file includes: acquiring file basic information of an existing file of the target partition; traversing the expanded tree of the file system to obtain a data block of the expanded tree; detecting whether file basic information corresponding to the data blocks of the expansion tree is the same as that of the existing file or not; and if the data blocks are different, determining the file corresponding to the data block as a suspected deletion file.
Specifically, through a file system tree structure, traversal is started after a root directory is located, files existing in a partition and basic information of the files are found, the found existing files are fed back to a client, and sectors occupied by file data can be recorded, wherein the basic information of the files includes but is not limited to file names, file sizes, data storage positions and other information. The reason why the sectors obtained by scanning the existing files are recorded is to avoid scanning the sectors in the subsequent scanning, thereby improving the processing efficiency. Further, after the client obtains the existing file, the existing file can be presented to the user through the display interface.
And further analyzing an expansion tree of the file system, except the file tree, for managing the distribution of the disk space, wherein unused space can be uniformly managed by using the tree. So the tree has data deleted by the file system. Traversing the tree, analyzing the data blocks on the tree, and judging whether the data blocks of the expanded tree have file information.
If the file is a data block with file information, analyzing information such as a file name, a file size, a date, a file data storage position and the like from the data block, matching the found file with the existing file, and if the file is matched with the existing file, determining that the file is not a deleted file and discarding the file. If yes, the files are determined to be suspected to be deleted, the information is fed back to the client side, and the files are presented to the user.
In another embodiment of the present invention, the performing a sector-by-sector scan on a network storage device to obtain a suspected-loss file includes: determining the sectors traversed by the root directory traversal and the expansion tree traversal as scanned sectors; determining the sectors in the network storage device except the scanned sectors as target sectors; and scanning the target sector by sector to obtain a suspected lost file.
Further, the sector-by-sector scanning the target sector to obtain the suspected-loss file includes: scanning the target sector by sector to obtain sector data; detecting whether the file information corresponding to the sector data is the same as the file basic information of the existing file or not; and if the file is different, determining the file corresponding to the sector data as a suspected lost file.
In this embodiment, the previously traversed sector is taken as a scanned sector, then the sector from which the scanned sector is removed is taken as a target sector, and the target sector is scanned sector by sector, so that the processing efficiency can be improved, and missing data can be prevented. Specifically, after the analysis is completed according to the file system structure, the scanning is performed sector by sector, so that missing data is prevented. If the sector is scanned in the file system tree structure, skipping; and judging whether the sector data is recorded with file information. And if so, analyzing the file information. If not, analyzing whether the sector data are in common file formats (such as pictures, videos or documents) or not, if so, analyzing according to the file formats, and feeding back the files as suspected lost files to the client.
After the existing file, the suspected deleted file and the suspected lost file are fed back to the client, the client determines a target file needing to be recovered from the existing file, the suspected deleted file and the suspected lost file. When the target file is restored, the target file can be restored according to the original storage path, namely, stored to the original storage path. Or the data can be sent to the client and stored by the client. Therefore, when the target file is restored in the embodiment of the present invention, one possible manner is as follows: acquiring an original storage path of the target file; reading the file content of the target file; and storing the file content to the original storage path. Another possible implementation is: reading the file content of the target file; and sending the file content to the client so that the client saves the file content to a target area.
Specifically, the user searches the found files through the client and checks the target files to be restored. The client informs the NAS end of the data storage position of the target file which needs to be restored by the user, and the NAS end serves the file content according to the information transmitted by the computer end and stores the file content in the NAS end or the client.
According to the embodiment of the invention, data recovery can be carried out without dismounting the hard disk of the network storage device, a user can carry out convenient operation based on the client to realize file recovery, and the recovery effect is not influenced by the structure of the hard disk, so that the recovery efficiency and the success rate of deleted data in the network storage device are improved.
EXAMPLE III
In a third embodiment of the present invention, a network storage device is further provided, with reference to fig. 2, where the network storage device includes:
a first receiving unit 10, configured to receive, in response to establishing a communication connection with a client, an inquiry instruction for inquiring a partition on a network storage device sent by the client;
a first sending unit 20, configured to send partition information of the network storage device to the client to determine a target partition based on the query instruction;
the analysis unit 30 is configured to analyze the file system of the target partition to obtain an existing file and a suspected deletion file of the target partition;
a scanning unit 40, configured to perform sector-by-sector scanning on the network storage device to obtain a suspected lost file;
a recovering unit 50, configured to recover, in response to receiving a recovery instruction for recovering a target file, the target file, where the target file is a file determined by a client based on the existing file, the suspected deleted file, and the suspected lost file.
Optionally, the parsing unit includes:
the first acquiring subunit is used for acquiring a tree structure of the file system of the target partition;
the first traversal subunit is used for positioning a root directory based on the tree structure to traverse to obtain the existing file of the target partition;
and the second traversal subunit is used for acquiring the expansion tree of the file system, performing traversal on the expansion tree and acquiring a suspected deleted file, wherein the expansion tree is used for managing the unused space of the disk.
Further, the second traversal subunit is specifically configured to:
acquiring file basic information of an existing file of the target partition;
traversing the expanded tree of the file system to obtain a data block of the expanded tree;
detecting whether file basic information corresponding to the data blocks of the expansion tree is the same as that of the existing file or not;
and if the data blocks are different, determining the file corresponding to the data block as a suspected deletion file.
Optionally, the scanning unit includes:
the first determining subunit is used for determining the sectors traversed by the root directory traversal and the expansion tree traversal as scanned sectors;
a second determining subunit, configured to determine, as a target sector, a sector in the network storage device that is left by excluding the scanned sector;
and the scanning subunit is used for scanning the target sector by sector to obtain a suspected lost file.
Further, the scanning subunit is specifically configured to:
scanning the target sector by sector to obtain sector data;
detecting whether the file information corresponding to the sector data is the same as the file basic information of the existing file or not;
and if the file is different, determining the file corresponding to the sector data as a suspected lost file.
Optionally, the recovery unit includes:
the second acquisition subunit is used for acquiring an original storage path of the target file;
the first reading subunit is used for reading the file content of the target file;
and the first storage subunit is used for storing the file content to the original storage path.
Optionally, the recovery unit includes:
the second reading subunit is used for reading the file content of the target file;
and the sending subunit is configured to send the file content to the client, so that the client stores the file content in a target area.
In a third embodiment of the present invention, a network storage device is provided, including: the first receiving unit responds to the establishment of communication connection with the client and receives a query instruction which is sent by the client and used for querying partitions on the network storage device; the first sending unit sends the partition information of the network storage device to the client based on the query instruction so as to determine a target partition; the analysis unit analyzes the file system of the target partition to obtain an existing file and a suspected deleted file of the target partition; the scanning unit scans the network storage device sector by sector to obtain a suspected lost file; and the recovery unit is used for responding to a received recovery instruction for recovering a target file, and recovering the target file, wherein the target file is a file determined by the client based on the existing file, the suspected deleted file and the suspected lost file. According to the invention, data recovery can be carried out without dismounting the hard disk of the network storage device, a user can carry out convenient operation based on the client to realize file recovery, and the recovery effect is not influenced by the structure of the hard disk, so that the efficiency and the success rate of the recovery of deleted data in the network storage device are improved.
Example four
In a fourth embodiment of the present invention, a data recovery system is further provided, including: a client and a network storage device, the client and the network storage device being communicatively coupled, wherein,
the client is used for sending a query instruction for querying the partitions on the network storage device to the network storage device;
the network storage device is used for sending the partition information of the network storage device to the client based on the query instruction so as to determine a target partition; analyzing the file system of the target partition to obtain an existing file and a suspected deleted file of the target partition; scanning the network storage equipment sector by sector to obtain a suspected lost file; sending the existing file, the suspected deleted file and the suspected lost file to the client;
the client is further configured to determine a target file among the existing file, the suspected deleted file and the suspected lost file, and send a recovery instruction for recovering the target file to the network storage device;
the network storage device is further configured to restore the target file based on the restoration instruction.
Optionally, the client is further configured to:
inputting device identification information of a network storage device to connect to the network storage device based on the device identification information.
Referring to fig. 3, a schematic flow chart of data processing of a data recovery system provided in an embodiment of the present invention is shown. In the data recovery system in fig. 3, the network storage device side is represented by a NAS side, and the client side is represented by an application side (i.e., a computer side).
The NAS end always waits for the connection of the application program end after starting the connection program, and the NAS end cannot exit even if the connection of the application program end is disconnected unless a user manually exits the program. The application side is connected with the NAS side, and the connection is not limited to network connection as long as the application side knows the existence of the NAS side, for example, the connection may be bluetooth connection.
The NAS may enumerate all partitions on the NAS and let the user select the partition that needs to be scanned. After the user selects the partition, the NAS end analyzes what file system the partition selected by the user is, and scans according to the corresponding file system format, but the technical scheme is not changed, namely, existing files are analyzed firstly, deleted files are found out, and finally sector-by-sector scanning is carried out. After the user selects the file needing to be restored, the user can inform the NAS end of restoring, and the restored file can be stored in the NAS end or the end where the application program is located.
The following description will take the Btrfs file system as an example. Among them, the Btrfs file system aims to replace the Linux ext3 file system, improve the ext3 restriction, especially the restriction of the single file size, the total file system size restriction, and add file checksum characteristics. Specifically, the method comprises the following steps:
(1) the application is started on the NAS side and waits for connection to the computer side.
(2) And opening a computer program, manually inputting the IP and the connection port number of the NAS end, and establishing connection with the NAS.
(3) And after the connection is successful, informing the NAS end to enumerate all the partitions on the NAS and finding the partition where the user stores the data.
(4) And the NAS end transmits the found partition information to the computer end and presents the partition information to a user.
(5) The user designates the partition to be scanned, the computer end informs the NAS end of scanning, and the NAS end opens the partition device designated by the user and starts to analyze the Btrfs file system.
(6) The NAS end firstly finds the partitioned FS Tree (file system Tree structure), starts traversing after positioning to the root directory, firstly finds existing files and basic information (file names, sizes and data storage positions) of the files, feeds the found existing files back to the computer end, and the computer end presents the files to users according to needs. While recording the sectors occupied by the file data (the subsequent scans do not scan these sectors anymore).
(7) And after the FS Tree is traversed, searching for an extended Tree of a file system expansion Tree, wherein the extended Tree stores data deleted by the file system. Traversing the tree, analyzing all data blocks on the tree, and judging whether the data blocks store file information.
(8) If the file information data block is the file information data block, information such as a file name, a file size, a date and a file data storage position is analyzed from the data block, the information is fed back to a computer terminal, and the file information is presented to a user by the computer terminal.
(9) And traversing the extended Tree, and scanning sector by sector to prevent missing data. If the sector is scanned in the FS Tree and the extended Tree, skipping the sector; otherwise, judging whether the sector data is stored with file information. If yes, executing the step (8).
(10) The user retrieves the found files and selects the files to be restored. The computer end informs the NAS end of the data storage position of the file which needs to be recovered by a user, the NAS end reads the file content according to the information transmitted by the computer end and transmits the file content to the computer end through a network, and the computer end stores the file content into a new file.
The data recovery system provided by the embodiment of the invention can process the data on the local and network, and can perform sector-by-sector scanning after the file system is analyzed, thereby preventing data omission and avoiding the problem of incomplete data recovery. The user does not need to dismount the NAS hard disk, so that the recovery effect is not influenced even if the NAS hard disk is of a RAID structure, and the operation of the user on NAS hardware is also avoided; the user can directly recover data under a familiar Windows, Linux or Mac operating system, and the method is convenient and quick.
Based on the foregoing embodiments, embodiments of the present invention provide a computer-readable storage medium storing one or more programs, which are executable by one or more processors to implement the steps of the data recovery method applied to a network storage device as any one of the above.
The embodiment of the invention also provides an electronic device, which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the program, and the steps of the data recovery method applied to the network storage device are realized.
The Processor or the CPU may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is to be understood that the electronic device implementing the above-described processor function may be other electronic devices, and the embodiments of the present invention are not particularly limited.
The computer storage medium/Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read Only Memory (EPROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a magnetic Random Access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical Disc, or a Compact Disc Read-Only Memory (CD-ROM); but may also be various terminals such as mobile phones, computers, tablet devices, personal digital assistants, etc., that include one or any combination of the above-mentioned memories.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit. Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media capable of storing program codes, such as a removable Memory device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, and an optical disk.
The methods disclosed in the several method embodiments provided by the present invention can be combined arbitrarily without conflict to obtain new method embodiments.
Features disclosed in several of the product embodiments provided by the invention may be combined in any combination to yield new product embodiments without conflict.
The features disclosed in the several method or apparatus embodiments provided by the present invention may be combined arbitrarily, without conflict, to arrive at new method embodiments or apparatus embodiments.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A data recovery method applied to a network storage device is characterized by comprising the following steps:
responding to the establishment of communication connection with the client, and receiving a query instruction which is sent by the client and used for querying partitions on the network storage device;
based on the query instruction, sending partition information of the network storage device to the client to determine a target partition;
analyzing the file system of the target partition to obtain an existing file and a suspected deleted file of the target partition;
scanning the network storage equipment sector by sector to obtain a suspected lost file;
and in response to receiving a recovery instruction for recovering a target file, recovering the target file, wherein the target file is a file determined by the client based on the existing file, the suspected deleted file and the suspected lost file.
2. The method of claim 1, wherein parsing the file system of the target partition to obtain existing files and suspected deleted files of the target partition comprises:
acquiring a tree structure of the file system of the target partition;
positioning a root directory based on the tree structure for traversing to obtain the existing file of the target partition;
and acquiring an expansion tree of the file system, traversing the expansion tree to acquire a suspected deleted file, wherein the expansion tree is used for managing unused space of a disk.
3. The method of claim 2, wherein the obtaining the expanded tree of the file system, and traversing the expanded tree to obtain the suspected deleted file comprises:
acquiring file basic information of an existing file of the target partition;
traversing the expanded tree of the file system to obtain a data block of the expanded tree;
detecting whether file basic information corresponding to the data blocks of the expansion tree is the same as that of the existing file or not;
and if the data blocks are different, determining the file corresponding to the data block as a suspected deletion file.
4. The method of claim 3, wherein the performing a sector-by-sector scan of the network storage device to obtain suspected lost files comprises:
determining the sectors traversed by the root directory traversal and the expansion tree traversal as scanned sectors;
determining the sectors in the network storage device except the scanned sectors as target sectors;
and scanning the target sector by sector to obtain a suspected lost file.
5. The method of claim 4, wherein the sector-by-sector scanning the target sector to obtain the suspected-missing file comprises:
scanning the target sector by sector to obtain sector data;
detecting whether the file information corresponding to the sector data is the same as the file basic information of the existing file or not;
and if the file is different, determining the file corresponding to the sector data as a suspected lost file.
6. The method of claim 1, wherein the restoring the target file comprises:
acquiring an original storage path of the target file;
reading the file content of the target file;
and storing the file content to the original storage path.
7. The method of claim 1, wherein the restoring the target file comprises:
reading the file content of the target file;
and sending the file content to the client so that the client saves the file content to a target area.
8. A network storage device, comprising:
the first receiving unit is used for responding to the establishment of communication connection with the client and receiving a query instruction which is sent by the client and used for querying partitions on the network storage device;
a first sending unit, configured to send partition information of the network storage device to the client based on the query instruction, so as to determine a target partition;
the analysis unit is used for analyzing the file system of the target partition to obtain the existing file and the suspected deleted file of the target partition;
the scanning unit is used for scanning the network storage device sector by sector to obtain a suspected lost file;
and the recovery unit is used for responding to a received recovery instruction for recovering a target file, and recovering the target file, wherein the target file is a file determined by the client based on the existing file, the suspected deleted file and the suspected lost file.
9. A data recovery system, comprising: a client and a network storage device, the client and the network storage device being communicatively coupled, wherein,
the client is used for sending a query instruction for querying the partitions on the network storage device to the network storage device;
the network storage device is used for sending the partition information of the network storage device to the client based on the query instruction so as to determine a target partition; analyzing the file system of the target partition to obtain an existing file and a suspected deleted file of the target partition; scanning the network storage equipment sector by sector to obtain a suspected lost file; sending the existing file, the suspected deleted file and the suspected lost file to the client;
the client is further configured to determine a target file among the existing file, the suspected deleted file and the suspected lost file, and send a recovery instruction for recovering the target file to the network storage device;
the network storage device is further configured to restore the target file based on the restoration instruction.
10. The system of claim 9, wherein the client is further configured to:
inputting device identification information of a network storage device to connect to the network storage device based on the device identification information.
CN202110874407.7A 2021-07-30 2021-07-30 Data recovery method applied to network storage device and related device Active CN113553219B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110874407.7A CN113553219B (en) 2021-07-30 2021-07-30 Data recovery method applied to network storage device and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110874407.7A CN113553219B (en) 2021-07-30 2021-07-30 Data recovery method applied to network storage device and related device

Publications (2)

Publication Number Publication Date
CN113553219A true CN113553219A (en) 2021-10-26
CN113553219B CN113553219B (en) 2022-12-02

Family

ID=78105070

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110874407.7A Active CN113553219B (en) 2021-07-30 2021-07-30 Data recovery method applied to network storage device and related device

Country Status (1)

Country Link
CN (1) CN113553219B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116561768A (en) * 2023-05-19 2023-08-08 国家计算机网络与信息安全管理中心 Device firmware vulnerability detection method, device and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140337296A1 (en) * 2013-05-10 2014-11-13 Bryan Knight Techniques to recover files in a storage network
CN107633059A (en) * 2017-09-20 2018-01-26 郑州云海信息技术有限公司 A kind of data processing method and system for distributed file system
CN107704341A (en) * 2017-08-31 2018-02-16 湖北灰科信息技术有限公司 File access pattern method, apparatus and electronic equipment
CN110569147A (en) * 2019-09-05 2019-12-13 厦门市美亚柏科信息股份有限公司 Deleted file recovery method based on index, terminal device and storage medium
CN110781157A (en) * 2019-09-27 2020-02-11 苏州浪潮智能科技有限公司 Backup and recovery method and device based on NAS
CN111176901A (en) * 2019-12-31 2020-05-19 厦门市美亚柏科信息股份有限公司 HDFS deleted file recovery method, terminal device and storage medium
CN112052121A (en) * 2020-09-03 2020-12-08 北京尖晶尖科技有限公司 Hard disk data recovery method and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140337296A1 (en) * 2013-05-10 2014-11-13 Bryan Knight Techniques to recover files in a storage network
CN107704341A (en) * 2017-08-31 2018-02-16 湖北灰科信息技术有限公司 File access pattern method, apparatus and electronic equipment
CN107633059A (en) * 2017-09-20 2018-01-26 郑州云海信息技术有限公司 A kind of data processing method and system for distributed file system
CN110569147A (en) * 2019-09-05 2019-12-13 厦门市美亚柏科信息股份有限公司 Deleted file recovery method based on index, terminal device and storage medium
CN110781157A (en) * 2019-09-27 2020-02-11 苏州浪潮智能科技有限公司 Backup and recovery method and device based on NAS
CN111176901A (en) * 2019-12-31 2020-05-19 厦门市美亚柏科信息股份有限公司 HDFS deleted file recovery method, terminal device and storage medium
CN112052121A (en) * 2020-09-03 2020-12-08 北京尖晶尖科技有限公司 Hard disk data recovery method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116561768A (en) * 2023-05-19 2023-08-08 国家计算机网络与信息安全管理中心 Device firmware vulnerability detection method, device and storage medium
CN116561768B (en) * 2023-05-19 2024-05-28 国家计算机网络与信息安全管理中心 Device firmware vulnerability detection method, device and storage medium

Also Published As

Publication number Publication date
CN113553219B (en) 2022-12-02

Similar Documents

Publication Publication Date Title
US10216740B2 (en) System and method for fast parallel data processing in distributed storage systems
US20190213171A1 (en) Directory Deletion Method and Apparatus, and Storage Server
CN105550073A (en) Database backup method and system thereof
US10289494B1 (en) Smart connector for network data management protocol (NDMP) backups
US10684923B2 (en) Real time file alteration sensing-based automatic backup device
CN109522160B (en) Method and system for comparing and backing up file directory by saving file information abstract
CN108415986B (en) Data processing method, device, system, medium and computing equipment
CN109271545B (en) Feature retrieval method and device, storage medium and computer equipment
US10318387B1 (en) Automated charge backup modelling
CN113687974B (en) Client log processing method and device and computer equipment
US11474910B2 (en) Method, device and computer program product to backup data
JP2009048377A (en) File difference management apparatus, file difference management method and file difference management program
WO2012089079A1 (en) Mobile terminal and method for processing test log thereof
CN113553219B (en) Data recovery method applied to network storage device and related device
CN108600779B (en) Target object operation method and device based on video content
CN114281779A (en) Data synchronization method and device, computer equipment and storage medium
CN114116611A (en) File scanning method and related device
CN107220146B (en) File scanning recovery method and device
CN114020522A (en) Data backup method and device, electronic equipment and system
CN111176901B (en) HDFS deleted file recovery method, terminal device and storage medium
CN108170372B (en) Data processing method and device based on cloud hard disk
US9852031B2 (en) Computer system and method of identifying a failure
KR20110023580A (en) The method and system for recovering data
CN114968937A (en) Data access method, device, equipment and computer readable storage medium
CN112988684A (en) Method and system for extracting and de-duplicating electronic official document data based on Hash algorithm

Legal Events

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