File-level data recovery method and device, equipment, medium and product
By generating virtual file system directories and mapping relationships, the problem of poor flexibility in file-level recovery methods is solved, enabling efficient data recovery across systems and disk file systems. It supports full and incremental backup data recovery and is suitable for storing backup data in object storage on disk formats.
Patent Information
- Application Number
- CN202511707097.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-20
- Publication Date
- 2026-02-24
AI Technical Summary
Existing file-level recovery methods suffer from poor flexibility, can only recover disk-formatted backup data, cannot be effectively stored on object storage, do not support incremental backup data recovery, and are difficult to recover across systems and disk file systems.
By generating a virtual file system directory, the mapping relationship between virtual disk files and target backup data is determined. The virtual file system is used to intercept operations and redirect read operations, supporting the mounting methods of the backup server and the target machine, and restoring the target files.
It achieves flexibility and applicability in file-level data recovery, supports cross-system and cross-disk file system recovery, saves storage space, and supports full and incremental backup data recovery.
Smart Images

Figure CN121560643A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data protection technology, and in particular to a file-level data recovery method, apparatus, device, storage medium, and program product. Background Technology
[0002] Data backup is the process of copying the original storage medium to another location to prevent data loss or corruption. Disks are the primary form of data storage, and disk backup is the main method of data backup. Backup data saved after disk backup can exist in various formats, such as sparse file format, qcow2 disk format, etc.
[0003] Since the amount of data on a disk can be enormous, in some scenarios, only a portion of the files need to be recovered after disk failure, rather than the entire disk. File-level recovery technology is typically needed to address this issue. File-level recovery directly accesses the backup data, mounts it, and without transferring any data, views the entire disk's folder and file list, selects the files to be recovered, and restores them to a specified location on the target machine.
[0004] However, the existing file-level recovery methods have many limitations, specifically: (1) Existing file-level recovery methods usually depend on the format of the backup data and can only recover backup data in disk format. Disk format data usually occupies a large amount of storage space and cannot be effectively stored on remote storage such as object storage; (2) Existing file-level recovery methods usually only recover full backup data and do not support the recovery of incremental backup data; (3) Existing file-level recovery methods are difficult to perform cross-system recovery and cross-disk file system recovery. Summary of the Invention
[0005] This invention provides a file-level data recovery method, apparatus, device, storage medium, and program product to solve the problem of poor flexibility in file-level data recovery, remove many limitations of existing file-level data recovery methods, and improve the applicability of file-level data recovery.
[0006] According to one aspect of the present invention, a file-level data recovery method is provided, the method being performed by a backup service, the method comprising:
[0007] Obtain target backup data information, generate a virtual file system directory based on the target backup data information, and generate virtual disk files under the virtual file system directory; the target backup data information is used to describe the storage location and access method of the target backup data;
[0008] The virtual file system is started based on the virtual file system directory, so that the virtual file system can intercept operations on the virtual file system directory;
[0009] Determine the mapping relationship between virtual disk files in the virtual file system directory and disk data in the target backup data, and generate a target configuration file based on the mapping relationship, which is stored in the virtual file system directory. This allows the virtual file system to intercept the target configuration file, parse it, generate the mapping relationship in the virtual file system, and redirect read operations on the virtual disk files to read operations on the target backup data.
[0010] Based on the virtual disk files in the virtual file system directory, the target files in the target backup data are restored using a tool that matches the mounting method; the mounting method includes the backup server mounting method and the target machine mounting method.
[0011] According to another aspect of the present invention, a file-level data recovery apparatus is provided, the apparatus being configured in a backup service, the apparatus comprising:
[0012] The virtual file system directory generation module is used to obtain target backup data information, generate a virtual file system directory based on the target backup data information, and generate virtual disk files under the virtual file system directory; the target backup data information is used to describe the storage location and access method of the target backup data;
[0013] The virtual file system startup module is used to start the virtual file system based on the virtual file system directory, so that the virtual file system can intercept the operation of the virtual file system directory.
[0014] The configuration file generation module is used to determine the mapping relationship between virtual disk files in the virtual file system directory and disk data in the target backup data, and generate a target configuration file according to the mapping relationship, which is stored in the virtual file system directory so that the virtual file system can intercept the target configuration file, parse the target configuration file, generate the mapping relationship in the virtual file system, and redirect read operations on the virtual disk file to read operations on the target backup data.
[0015] The target file recovery module is used to recover target files in the target backup data based on the virtual disk files in the virtual file system directory and by using a tool that matches the mounting method; the mounting method includes the backup server mounting method and the target machine mounting method.
[0016] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0017] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the file-level data recovery method according to any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the file-level data recovery method according to any embodiment of the present invention.
[0019] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the file-level data recovery method described in any embodiment of the present invention.
[0020] The technical solution of this invention involves acquiring target backup data information, generating a virtual file system directory based on the target backup data information, and generating virtual disk files within the virtual file system directory. The target backup data information describes the storage location and access method of the target backup data. The virtual file system is started based on the virtual file system directory, enabling it to intercept all operations within the directory. A mapping relationship between the virtual disk files and the target backup data is determined, and a target configuration file is generated and stored in the virtual file system directory based on this mapping relationship. This allows the virtual file system to intercept write operations on the target configuration file and parse it, generating the mapping relationship within the virtual file system. This redirects read operations on the virtual disk files to read operations on the target backup data. Based on the virtual disk files in the virtual file system directory, target files in the target backup data are recovered using a tool that matches the mounting method. The mounting method includes backup server mounting and target machine mounting. This technical solution solves the problem of poor flexibility in file-level data recovery, removes many limitations of existing file-level data recovery methods, and improves the applicability of file-level data recovery.
[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a flowchart of a file-level data recovery method provided in Embodiment 1 of the present invention;
[0024] Figure 2 This is a flowchart of a file-level data recovery method provided in Embodiment 2 of the present invention;
[0025] Figure 3 This is a diagram illustrating the file recovery process using the backup server mounting method;
[0026] Figure 4 This is a flowchart of a file-level data recovery method provided in Embodiment 3 of the present invention;
[0027] Figure 5 This is a diagram illustrating the file recovery process based on the target machine's mounting method.
[0028] Figure 6 This is a schematic diagram of a file-level data recovery device according to Embodiment 4 of the present invention;
[0029] Figure 7 This is a schematic diagram of the structure of an electronic device that implements the file-level data recovery method of this invention. Detailed Implementation
[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be used interchangeably where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices. The acquisition, storage, use, and processing of data in the technical solutions of this application all comply with the relevant provisions of national laws and regulations.
[0032] Example 1
[0033] Figure 1 This is a flowchart illustrating a file-level data recovery method according to Embodiment 1 of the present invention. This embodiment is applicable to data protection scenarios, particularly file-level data recovery. The method can be executed by a file-level data recovery device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:
[0034] S110. Obtain target backup data information, generate a virtual file system directory based on the target backup data information, and generate a virtual disk file in the virtual file system directory; the target backup data information is used to describe the storage location and access method of the target backup data.
[0035] This solution can be executed by a backup service, which can be a server or service cluster that backs up the original data of virtual machines or physical machines. The backup service can store the backup data of virtual machines or physical machines. The backup service can obtain information such as the storage location and access method of the target backup data, and generate a virtual file system directory based on the target backup data information.
[0036] Specifically, the target backup data information can be the metadata of the target backup data, including information such as the configuration of the virtual machine or physical machine, the backup time, and the backup type. The configuration of the virtual machine or physical machine can include configuration information such as the processor, memory, disk, and network of the virtual machine or physical machine. The backup type can include full backup and incremental backup. Incremental backup backs up the changed data from the last backup to the current backup. To perform data recovery operations, it depends on the previous backup data.
[0037] Access to the target backup data can include local disk access and remote storage access. The backup service can install a Unix-like file system. The virtual file system directory can be a fuse directory. FUSE (Filesystem in Userspace) is a Linux userspace file system framework that allows developers to implement file systems in user space without modifying kernel code. It supports mapping network resources, such as the Secure Shell (SSH) protocol, to a local file system, enabling communication with user-space daemons through kernel modules. Understandably, the virtual disk files under the virtual file system directory correspond one-to-one with the files in the target backup data, and the size of the virtual disk files is the same as the size of the target backup data files.
[0038] S120. Start the virtual file system based on the virtual file system directory so that the virtual file system can intercept operations on the virtual file system directory.
[0039] The backup service can launch a virtual file system based on a virtual file system directory, allowing the virtual file system to access all read and write operations of the virtual file system directory, thereby enabling data recovery. Specifically, the virtual file system can be VPfuse (Virtual Private Fuse), a virtual file system implementation based on fuse technology, primarily used to build secure and isolated file access channels in user space.
[0040] S130. Determine the mapping relationship between the virtual disk file in the virtual file system directory and the disk data in the target backup data, and generate a target configuration file according to the mapping relationship, and store it in the virtual file system directory, so that the virtual file system can intercept the target configuration file, parse the target configuration file, generate the mapping relationship in the virtual file system, and redirect the read operation of the virtual disk file to the read operation of the target backup data.
[0041] The backup service maps virtual disk files in the virtual file system directory to disk data in the target backup data, generating a target configuration file, such as a JSON file, which is saved in the fuse directory. VPfuse can intercept write operations to the target configuration file, obtaining its contents—that is, the mapping relationship between virtual disk files in the virtual file system directory and disk data in the target backup data. VPfuse can parse the target configuration file, load disk block data, and redirect read operations on disk block data to read operations on the target backup data, thereby reading the actual data on the disk.
[0042] In this solution, under full data recovery mode, the disk block data can be valid disk block data; under incremental data recovery mode, the disk block data can be changed disk block data. It should be noted that disk blocks store disk data, which differs from the original disk format. Data within a disk block is stored contiguously, and there is no invalid data.
[0043] S140. Based on the virtual disk files in the virtual file system directory, restore the target file in the target backup data using a tool that matches the mounting method; the mounting method includes the backup server mounting method and the target machine mounting method.
[0044] The backup service can identify the mount method used in this data recovery and, based on the virtual disk files in the virtual file system directory and the tool matching the mount method, restore the target files in the target backup data. The mount method includes the backup server mount method and the target machine mount method.
[0045] The technical solution of this invention involves acquiring target backup data information, generating a virtual file system directory based on the target backup data information, and generating virtual disk files within the virtual file system directory. The target backup data information describes the storage location and access method of the target backup data. The virtual file system is started based on the virtual file system directory, enabling it to intercept all operations within the directory. A mapping relationship is determined between the virtual disk files within the virtual file system directory and the disk data in the target backup data. A target configuration file is generated based on this mapping relationship and stored in the virtual file system directory, allowing the virtual file system to intercept and parse the target configuration file. The mapping relationship is then generated within the virtual file system, redirecting read operations on the virtual disk files to read operations on the target backup data. Finally, based on the virtual disk files within the virtual file system directory, a tool matching the mounting method is used to recover the target files in the target backup data. The mounting methods include backup server mounting and target machine mounting. This technical solution solves the problem of poor flexibility in file-level data recovery, removes many limitations of existing file-level data recovery methods, and improves the applicability of file-level data recovery.
[0046] Example 2
[0047] Figure 2 This is a flowchart of a file-level data recovery method provided in Embodiment 2 of the present invention. This embodiment is based on the above embodiment and refines the target file recovery process using a backup server mounting method. Figure 2 As shown, the method includes:
[0048] S210. Obtain target backup data information, generate a virtual file system directory and a mount directory based on the target backup data information, and generate a virtual disk file under the virtual file system directory; the target backup data information is used to describe the storage location and access method of the target backup data.
[0049] In this solution, the mounting method is the backup server mounting method. The backup service needs to pre-install two tools. The first tool is a virtual machine disk access tool, such as libguestfs. libguestfs is a set of tools for accessing and modifying virtual machine disk images, allowing users to perform various operations on the virtual machine's disk files without starting the virtual machine, such as viewing, editing, and converting disk formats. To recognize the NTFS file system under the Windows operating system, the backup service can install the tool ntfs-3g. ntfs-3g is an open-source tool that supports read and write operations on the NTFS file system in operating systems such as Linux, FreeBSD, Mac OSX, NetBSD, and Haiku. The second tool is a file transfer tool based on the SSH protocol, such as scp. scp (Secure Copy Protocol) is a secure file transfer tool based on the SSH protocol, used for encrypted transfer of files and directories between local and remote hosts or different remote hosts.
[0050] After obtaining the target backup data, the backup service can generate a virtual file system directory and a mount directory based on the target backup data, and generate virtual disk files under the virtual file system directory. The mount directory is the entry directory in the file system used to connect storage devices. By mounting, the top-level directory of the device's file system is associated with an empty directory in the existing directory tree, so that accessing the directory is equivalent to accessing the device content.
[0051] S220. Start the virtual file system based on the virtual file system directory so that the virtual file system can intercept operations on the virtual file system directory.
[0052] S230. Determine the mapping relationship between the virtual disk file in the virtual file system directory and the disk data in the target backup data, and generate a target configuration file according to the mapping relationship, and store it in the virtual file system directory, so that the virtual file system can intercept the target configuration file, parse the target configuration file, generate the mapping relationship in the virtual file system, and redirect the read operation of the virtual disk file to the read operation of the target backup data.
[0053] S240. Based on the virtual disk file in the virtual file system directory, analyze the virtual disk file using a first tool, identify the partitions of the virtual disk file, and mount them; the first tool is a virtual machine disk access tool.
[0054] The backup service can use virtual disk files in the virtual file system directory as parameters, analyze the data in the block device through the virt-filesystem function in libguestfs, obtain the partition list of the block device, and use the guestmount function in libguestfs to mount each partition to a subdirectory of the mount directory in read-only mode. Each subdirectory can correspond to a disk partition.
[0055] The backup service provides users with a visual interface terminal, through which users can browse each subdirectory, select the target file to be restored, the target device to which the target file should be restored, and the target directory of the target device.
[0056] S250: Obtain the target file, target device, and target directory; use a second tool to transfer the target file to the target directory of the target device to restore the target file; the second tool is a file transfer tool.
[0057] The backup service can obtain the target file, target device, and target directory from the user terminal, and then use a second tool to transfer the target file to the target directory on the target device, thereby realizing the recovery of the target file.
[0058] This solution enables file-level data recovery by mounting a backup server, which improves the efficiency and flexibility of file-level data recovery.
[0059] In a specific example, there are two disks in the virtual machine or physical machine, namely disk 1 and disk 2. Disk 1 has 2 partitions and disk 2 has 1 partition. Figure 3 This diagram illustrates the file recovery process using a backup server mounting method. `backup` is a self-developed tool for backing up block devices; it can back up disk data from virtual machines or physical machines to the backup service's storage device. `recoverclient` is a self-developed client tool for sending files, and `recoverserver` is a self-developed server tool for receiving files.
[0060] The target file recovery process using the backup server mount method can be represented as follows:
[0061] Step 1: The user terminal selects the backup point and its dependent backup points, and sends the target backup data information to the backup service;
[0062] Step 2: The backup service analyzes the backup data and generates a fuse directory, virtual disk files under the fuse directory, and mount directories;
[0063] Step 3: Start VPfuse using the fuse directory so that all read and write operations on the fuse directory will be intercepted by VPfuse;
[0064] Step 4: The backup service maps the virtual disk file name and the disk backup data file of each backup point to a JSON file with a special name, and saves it in the fuse directory.
[0065] Step 5: VPfuse intercepted the write operation of a JSON file with a special name in the fuse directory, obtained the data, and parsed it;
[0066] Step 6: vpfuse loads the disk data file and the corresponding changed block file, so that each virtual disk read operation can be redirected to the read operation of the corresponding disk data file under the target backup data, and the actual data on the disk is read;
[0067] Step 7: The backup server uses all virtual disk files as parameters and the virt-filesystem tool in libguestfs to analyze the contents of the block device files and obtain the partition list;
[0068] Step 8: Using all virtual disk files as parameters, use the `guestmount` function in the `libguestfs` tool to mount each partition obtained in the previous step in read-only mode to a subdirectory of the mount directory. Each subdirectory corresponds to one disk partition.
[0069] Step 9: Browse each subdirectory on the user terminal, select the target file to be restored, and select the target device and target directory to restore to. Send the target file, target device and target directory to the backup service.
[0070] Step 10: The backup service uses the recoverclient or scp tool to transfer the target file to the target directory on the target device.
[0071] This solution uses a compact format to save disk backup data, ensuring that only valid data is saved continuously without wasting space. It supports file-level recovery of both full and incremental backup data, and cross-operating system file-level recovery. It can restore files from a Windows system to a Linux system, and vice versa. It also supports file-level recovery across disk file systems, such as LVM and NTFS.
[0072] Example 3
[0073] Figure 4 This is a flowchart of a file-level data recovery method provided in Embodiment 3 of the present invention. This embodiment is based on the above embodiments and refines the target file recovery process for the target machine mounting method. Figure 4 As shown, the method includes:
[0074] S310. Obtain target backup data information, generate a virtual file system directory based on the target backup data information, and generate a virtual disk file in the virtual file system directory; the target backup data information is used to describe the storage location and access method of the target backup data.
[0075] S320. Start the virtual file system based on the virtual file system directory so that the virtual file system can intercept operations on the virtual file system directory.
[0076] S330. Determine the mapping relationship between the virtual disk file in the virtual file system directory and the disk data in the target backup data, and generate a target configuration file according to the mapping relationship, and store it in the virtual file system directory, so that the virtual file system can intercept the target configuration file, parse the target configuration file, generate the mapping relationship in the virtual file system, and redirect the read operation of the virtual disk file to the read operation of the target backup data.
[0077] S340. Using a third tool, the virtual disk files under the virtual file system directory are mapped to the loopback device in read-only mode. Using a fourth tool, the loopback device is exported so that the target device can obtain the loopback device and restore the target file based on the loopback device. The third tool is a tool for managing the loopback device. The fourth tool is a network-based block-level storage tool used to encapsulate a preset protocol in network transmission data packets to achieve local mapping of remote storage resources.
[0078] In this solution, the process of the target device acquiring the loopback device and restoring the target file based on the loopback device includes:
[0079] The target device acquires the loopback device, identifies the partition of the loopback device, performs a read operation on the loopback device, and redirects the read operation to the target backup data in order to restore the target file in the target backup data.
[0080] In this solution, the mounting method is the target machine mounting method. The backup service requires the pre-installation of a third-party tool and a fourth-party tool. The third-party tool is a tool for managing loopback devices, such as losetup. Lossetup is a core tool in Linux systems used to manage loopback devices, which can virtualize files as block devices and support mounting, encryption, and partitioning operations. A loopback device is a type of virtual block device in Linux that allows files (such as image files) to be mounted and manipulated as block devices, and is commonly used in scenarios such as file system testing, encrypted storage, and virtual disks. The fourth-party tool is a network-based block-level storage tool used to encapsulate preset protocols in network transmission data packets to achieve local mapping of remote storage resources, such as iSCSI. Specifically, the backup service needs to install the iSCSI target, and the target device needs to install the iSCSI initiator.
[0081] In this system, the iSCSI Initiator is the initiating end, a software or hardware device installed on the client or host, used to initiate access requests to the iSCSI Target. The iSCSI Target is the destination end, the device or server providing storage resources, receiving requests from the iSCSI Initiator and providing access to the storage device. The iSCSI Initiator is responsible for initiating access requests to remote storage resources over an IP network, encapsulating local SCSI commands into TCP / IP packets, and communicating with the iSCSI Target via standard Ethernet to achieve localized mapping of remote storage. It should be noted that the operating system of the target device must be the same as the operating system of the device where the disk resides.
[0082] The backup service can use the losetup tool to map virtual disk files under the virtual file system directory to a loopback device in read-only mode. The loopback device is then exported via iSCSI Target for use by the target device. The target device can discover the loopback device exported by the backup service through the iSCSI Initiator, automatically identify the partitions of the mounted device, and read operations on the mounted device can be redirected by the backup service's VPfuse to read the target backup data, thereby reading the actual data on the disk to restore the target files.
[0083] In a specific example, there are two disks in the virtual machine or physical machine, namely disk 1 and disk 2. Disk 1 has 2 partitions and disk 2 has 1 partition. Figure 5 This is a diagram illustrating the file recovery process using the target machine's mounting method. Backup is a self-developed tool for backing up block devices. Backup can back up disk data from virtual machines or physical machines to the storage device of the backup service.
[0084] The target file recovery process using the target machine mount method can be represented as follows:
[0085] Step 1: The user terminal selects the backup point and its dependent backup points, and sends the target backup data information to the backup service;
[0086] Step 2: The backup service analyzes the backup data and generates a fuse directory, virtual disk files under the fuse directory, and mount directories;
[0087] Step 3: Start VPfuse using the fuse directory so that all read and write operations on the fuse directory will be intercepted by VPfuse;
[0088] Step 4: The backup service maps the virtual disk file name and the disk backup data file of each backup point to a JSON file with a special name, and saves it in the fuse directory.
[0089] Step 5: VPfuse intercepted the write operation of a JSON file with a special name in the fuse directory, obtained the data, and parsed it;
[0090] Step 6: vpfuse loads the disk data file and the corresponding changed block file, so that each virtual disk read operation can be redirected to the read operation of the corresponding disk data file under the target backup data, and the actual data on the disk is read;
[0091] Step 7: The backup service uses the system tool losetup to map all virtual disk files to the loop device in read-only mode;
[0092] Step 8: The backup service uses the iSCSI target tool to export the loop device for use by remote target devices;
[0093] Step 9: The target device uses the iSCSI initiator to discover the devices exported by the backup service and automatically identifies the partitions of the mounted devices;
[0094] Step 10: The target device mounts and identifies the partition and automatically recognizes the file system to restore the target files.
[0095] This solution can restore disk backup data stored on remote storage. Through the collaboration of independent control machines, control machine services, and backup services, it is conducive to achieving a highly scalable and high-performance data protection system, enabling rapid and diversified use of backup data.
[0096] Example 4
[0097] Figure 6This is a schematic diagram of a file-level data recovery device provided in Embodiment 4 of the present invention. The device is configured in a backup service, such as... Figure 6 As shown, the device includes:
[0098] The virtual file system directory generation module 410 is used to obtain target backup data information, generate a virtual file system directory based on the target backup data information, and generate virtual disk files under the virtual file system directory; the target backup data information is used to describe the storage location and access method of the target backup data.
[0099] The virtual file system startup module 420 is used to start the virtual file system according to the virtual file system directory, so that the virtual file system can intercept the operation of the virtual file system directory.
[0100] The configuration file generation module 430 is used to determine the mapping relationship between the virtual disk file in the virtual file system directory and the disk data in the target backup data, and generate a target configuration file according to the mapping relationship and store it in the virtual file system directory, so that the virtual file system can intercept the target configuration file, parse the target configuration file, generate the mapping relationship in the virtual file system, and redirect the read operation of the virtual disk file to the read operation of the target backup data.
[0101] The target file recovery module 440 is used to recover target files in the target backup data based on the virtual disk files in the virtual file system directory and by using a tool that matches the mounting method; the mounting method includes the backup server mounting method and the target machine mounting method.
[0102] In this solution, the device further includes:
[0103] The mount directory generation module is used to generate a mount directory based on the target backup data information after obtaining the target backup data information.
[0104] The target file recovery module 440 is specifically used for:
[0105] If the mounting method is a backup server mounting method, then based on the virtual disk files in the virtual file system directory, the first tool is used to analyze the virtual disk files, identify the partitions of the virtual disk files, and mount them; the first tool is a virtual machine disk access tool.
[0106] The target file, target device, and target directory are obtained. The target file is then transferred to the target directory on the target device using a second tool to recover the target file. The second tool is a file transfer tool.
[0107] Optionally, the target file recovery module 440 is further configured to:
[0108] If the mounting method is the target machine mounting method, then the virtual disk files under the virtual file system directory are mapped to the loopback device in read-only mode using a third tool, and the loopback device is exported using a fourth tool so that the target device can obtain the loopback device and restore the target file based on the loopback device; the third tool is a tool for managing the loopback device; the fourth tool is a network-based block-level storage tool used to encapsulate a preset protocol in network transmission data packets to achieve local mapping of remote storage resources.
[0109] In one feasible solution, the process of the target device acquiring the loopback device and restoring the target file based on the loopback device includes:
[0110] The target device acquires the loopback device, identifies the partition of the loopback device, performs a read operation on the loopback device, and redirects the read operation to the target backup data in order to restore the target file in the target backup data.
[0111] Based on the aforementioned scheme, the virtual file system directory is the fuse directory, the first tool is libguestfs, and the second tool is a file transfer tool based on the SSH protocol.
[0112] Optionally, the third tool is losetup, and the fourth tool is iSCSI.
[0113] The file-level data recovery device provided in this embodiment of the invention can execute the file-level data recovery method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.
[0114] Example 4
[0115] Figure 7 A schematic diagram of an electronic device 510 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0116] like Figure 7As shown, the electronic device 510 includes at least one processor 511 and a memory, such as a read-only memory (ROM) 512 or a random access memory (RAM) 513, communicatively connected to the at least one processor 511. The memory stores computer programs executable by the at least one processor. The processor 511 can perform various appropriate actions and processes based on the computer program stored in the ROM 512 or loaded from storage unit 518 into the RAM 513. The RAM 513 may also store various programs and data required for the operation of the electronic device 510. The processor 511, ROM 512, and RAM 513 are interconnected via a bus 514. An input / output (I / O) interface 515 is also connected to the bus 514.
[0117] Multiple components in electronic device 510 are connected to I / O interface 515, including: input unit 516, such as keyboard, mouse, etc.; output unit 517, such as various types of displays, speakers, etc.; storage unit 518, such as disk, optical disk, etc.; and communication unit 519, such as network card, modem, wireless transceiver, etc. Communication unit 519 allows electronic device 510 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0118] Processor 511 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 511 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 511 performs the various methods and processes described above, such as file-level data recovery methods.
[0119] In some embodiments, the file-level data recovery method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 518. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 510 via ROM 512 and / or communication unit 519. When the computer program is loaded into RAM 513 and executed by processor 511, one or more steps of the file-level data recovery method described above may be performed. Alternatively, in other embodiments, processor 511 may be configured to perform the file-level data recovery method by any other suitable means (e.g., by means of firmware).
[0120] Various embodiments 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-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0121] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable file-level data recovery device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0122] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0123] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device 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 provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, 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 sound input, voice input, or tactile input).
[0124] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0125] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0126] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0127] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A file-level data recovery method, characterized in that, The method is executed by a backup service, and the method includes: Obtain target backup data information, generate a virtual file system directory based on the target backup data information, and generate virtual disk files under the virtual file system directory; the target backup data information is used to describe the storage location and access method of the target backup data; The virtual file system is started based on the virtual file system directory, so that the virtual file system can intercept operations on the virtual file system directory; Determine the mapping relationship between virtual disk files in the virtual file system directory and disk data in the target backup data, and generate a target configuration file based on the mapping relationship, which is stored in the virtual file system directory. This allows the virtual file system to intercept the target configuration file, parse it, generate the mapping relationship in the virtual file system, and redirect read operations on the virtual disk files to read operations on the target backup data. Based on the virtual disk files in the virtual file system directory, the target files in the target backup data are restored using a tool that matches the mounting method; the mounting method includes the backup server mounting method and the target machine mounting method.
2. The method according to claim 1, characterized in that, After obtaining the target backup data information, the method further includes: Generate a mount directory based on the target backup data information; The tool, which restores the target file in the target backup data based on the virtual disk file system directory and the matching of the mount method, includes: If the mounting method is a backup server mounting method, then based on the virtual disk files in the virtual file system directory, the first tool is used to analyze the virtual disk files, identify the partitions of the virtual disk files, and mount them; the first tool is a virtual machine disk access tool. The target file, target device, and target directory are obtained. The target file is then transferred to the target directory on the target device using a second tool to recover the target file. The second tool is a file transfer tool.
3. The method according to claim 1, characterized in that, The tool, which restores the target file in the target backup data based on the virtual disk file system directory and the matching of the mount method, includes: If the mounting method is the target machine mounting method, then the virtual disk files under the virtual file system directory are mapped to the loopback device in read-only mode using a third tool, and the loopback device is exported using a fourth tool so that the target device can obtain the loopback device and restore the target file based on the loopback device; the third tool is a tool for managing the loopback device; the fourth tool is a network-based block-level storage tool used to encapsulate a preset protocol in network transmission data packets to achieve local mapping of remote storage resources.
4. The method according to claim 1, characterized in that, The process of the target device acquiring the loopback device and restoring the target file based on the loopback device includes: The target device acquires the loopback device, identifies the partition of the loopback device, performs a read operation on the loopback device, and redirects the read operation to the target backup data in order to restore the target file in the target backup data.
5. The method according to claim 2, characterized in that, The virtual file system directory is the fuse directory, the first tool is libguestfs, and the second tool is a file transfer tool based on the SSH protocol.
6. The method according to claim 3, characterized in that, The third tool is losetup, and the fourth tool is iSCSI.
7. A file-level data recovery device, characterized in that, The device is configured for a backup service, and the device includes: The virtual file system directory generation module is used to obtain target backup data information, generate a virtual file system directory based on the target backup data information, and generate virtual disk files under the virtual file system directory; the target backup data information is used to describe the storage location and access method of the target backup data; The virtual file system startup module is used to start the virtual file system based on the virtual file system directory, so that the virtual file system can intercept the operation of the virtual file system directory. The configuration file generation module is used to determine the mapping relationship between virtual disk files in the virtual file system directory and disk data in the target backup data, and generate a target configuration file according to the mapping relationship, which is stored in the virtual file system directory so that the virtual file system can intercept the target configuration file, parse the target configuration file, generate the mapping relationship in the virtual file system, and redirect read operations on the virtual disk file to read operations on the target backup data. The target file recovery module is used to recover target files in the target backup data based on the virtual disk files in the virtual file system directory and by using a tool that matches the mounting method; the mounting method includes the backup server mounting method and the target machine mounting method.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the file-level data recovery method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the file-level data recovery method of any one of claims 1-6.
10. A computer program product comprising a computer program that, when executed by a processor, implements the file-level data recovery method according to any one of claims 1-6.