CN113505026A - Method, device and equipment for verifying backup data and storage medium - Google Patents

Method, device and equipment for verifying backup data and storage medium Download PDF

Info

Publication number
CN113505026A
CN113505026A CN202111059011.3A CN202111059011A CN113505026A CN 113505026 A CN113505026 A CN 113505026A CN 202111059011 A CN202111059011 A CN 202111059011A CN 113505026 A CN113505026 A CN 113505026A
Authority
CN
China
Prior art keywords
data
backup
virtual machine
disk
verification
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
CN202111059011.3A
Other languages
Chinese (zh)
Other versions
CN113505026B (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.)
Shenzhen Clerware Technology Co ltd
Original Assignee
Shenzhen Clerware Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Clerware Technology Co ltd filed Critical Shenzhen Clerware Technology Co ltd
Priority to CN202111059011.3A priority Critical patent/CN113505026B/en
Publication of CN113505026A publication Critical patent/CN113505026A/en
Application granted granted Critical
Publication of CN113505026B publication Critical patent/CN113505026B/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/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Landscapes

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

Abstract

The invention discloses a method, a device, equipment and a storage medium for verifying backup data. The method comprises the following steps: when a target virtual machine performs data backup, generating a backup point of the target virtual machine; acquiring disk information of a target virtual machine, and generating a virtual disk according to the disk information and backup point data; acquiring hardware configuration information of the target virtual machine, and creating a verification virtual machine according to the hardware configuration information and the virtual disk; and carrying out data accuracy verification on the backup point according to the verification virtual machine. According to the invention, when the target virtual machine performs data backup, the backup point of the target virtual machine is generated, and then the data accuracy verification is performed on the backup point of the target virtual machine. Compared with the existing mode of verifying the validity of the data after the data backup is finished, the mode disclosed by the invention can find the defects of the backup data as soon as possible, so that the data inspection is more flexible and efficient, the time is shortened, and the timeliness of the data inspection is improved.

Description

Method, device and equipment for verifying backup data and storage medium
Technical Field
The present invention relates to the field of data backup technologies, and in particular, to a method, an apparatus, a device, and a storage medium for verifying backup data.
Background
In the existing data backup method, the accuracy of backup data can be verified only after the data backup is finished, if the backup data has problems, the backup and the data verification can be performed again, which wastes time, especially when massive data backup is performed. If the backed-up data has problems, the problems can be found only by verifying the backed-up data after the data is backed-up, and the backup and the data verification can be carried out again only, so that the backup period is too long.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a method, a device, equipment and a storage medium for verifying backup data, and aims to solve the technical problems of long backup period and low efficiency possibly caused by verifying the accuracy of the backup data after the data backup is finished in the prior art.
To achieve the above object, the present invention provides a method for verifying backup data, comprising the steps of:
when a target virtual machine performs data backup, generating a backup point of the target virtual machine;
acquiring disk information of a target virtual machine, and generating a virtual disk according to the disk information and the backup point;
acquiring hardware configuration information of the target virtual machine, and creating a verification virtual machine according to the hardware configuration information and the virtual disk;
and carrying out data accuracy verification on the backup point according to the verification virtual machine.
Optionally, the step of verifying the data accuracy of the backup point according to the verification virtual machine includes:
starting a preset service system through the verification virtual machine;
acquiring a read request generated by the preset service system, and judging whether a data block corresponding to the read request executes write-in operation or not;
when the data block does not execute the writing operation, judging whether the data block executes the backup operation or not;
and when the data block executes backup operation, reading data corresponding to the data block from the backup point according to the virtual disk, and performing data accuracy verification on the read data through the preset service system.
Optionally, after the step of starting the preset service system by the verification virtual machine, the method further includes:
when a write request generated by the preset service system is received, writing data corresponding to the write request into a preset offset position of a temporary file;
a write operation is performed in the bitmap file at the location where the preset offset position is identified;
correspondingly, after the step of obtaining the read request generated by the preset service system and judging whether the data block corresponding to the read request has performed the write operation, the method further includes:
and when the data block corresponding to the reading request is subjected to writing operation, reading the data corresponding to the data block from the temporary file, and performing data accuracy verification on the read data through the preset service system.
Optionally, before the step of writing the data corresponding to the write request to the preset offset position of the temporary file when the write request generated by the preset service system is received, the method further includes:
generating a corresponding temporary file for the virtual disk according to the disk information and the data, wherein the temporary file is used for writing temporary data;
and creating a bitmap file, wherein the bitmap file is used for recording the data storage information in the temporary file.
Optionally, after the step of determining whether the data block performs the backup operation when the data block has not performed the write operation, the method further includes:
when the data block does not execute backup operation, judging whether the data corresponding to the data block is data to be backed up;
and calling a backup interface of a virtualization platform to backup the data corresponding to the data block to the backup point when the data corresponding to the data block is the data to be backed up.
Optionally, before the step of obtaining the disk information of the target virtual machine and generating the virtual disk according to the disk information and the backup point, the method further includes:
acquiring the number of disks and the size of the disks of a target virtual machine according to the hardware configuration information of the target virtual machine;
the step of obtaining the disk information of the target virtual machine and generating the virtual disk according to the disk information and the backup point comprises the following steps:
and generating a virtual disk through a virtual disk driver according to the number of disks and the size of the disks.
Optionally, after the step of obtaining the hardware configuration information of the target virtual machine and creating a verification virtual machine according to the hardware configuration information and the virtual disk, the method further includes:
reading the data in the backup point through the virtual disk to obtain the disk type and the disk partition information;
organizing the data in the backup point into a volume according to the disk type and the disk partition information, and mounting a file system on the volume to identify the type of an operating system;
and injecting a virtual disk controller driver into the operating system according to the type of the operating system, and starting the operating system of the verification virtual machine.
In addition, to achieve the above object, the present invention further provides an apparatus for verifying backup data, the apparatus comprising:
the backup point generating module is used for generating a backup point of the target virtual machine when the target virtual machine performs data backup;
the virtual disk generation module is used for acquiring disk information of a target virtual machine and generating a virtual disk according to the disk information and the backup point;
the verification virtual machine creating module is used for acquiring the hardware configuration information of the target virtual machine and creating a verification virtual machine according to the hardware configuration information and the virtual disk;
and the backup verification module is used for verifying the data accuracy of the backup point according to the verification virtual machine.
In addition, to achieve the above object, the present invention further provides an apparatus for verifying backup data, the apparatus comprising: a memory, a processor and a program for verifying backup data stored on said memory and executable on said processor, said program for verifying backup data being configured to implement the steps of the method for verifying backup data as described above.
Furthermore, to achieve the above object, the present invention further proposes a storage medium having stored thereon a program for verifying backup data, which when executed by a processor implements the steps of the method for verifying backup data as described above.
When a target virtual machine performs data backup, generating a backup point of the target virtual machine; acquiring disk information of a target virtual machine, and generating a virtual disk according to the disk information and the backup point; acquiring hardware configuration information of the target virtual machine, and creating a verification virtual machine according to the hardware configuration information and the virtual disk; and carrying out data accuracy verification on the backup point according to the verification virtual machine. According to the invention, when the target virtual machine performs data backup, the backup point of the target virtual machine is generated, and then the data accuracy verification is performed on the backup point of the target virtual machine. Compared with the existing mode of verifying the validity of the data after the data backup is finished, the mode disclosed by the invention can find the defects of the backup data as soon as possible, so that the data inspection is more flexible and efficient, the time is shortened, and the timeliness of the data inspection is improved.
Drawings
Fig. 1 is a schematic structural diagram of an apparatus for verifying backup data in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a method for verifying backup data according to the present invention;
FIG. 3 is a flowchart illustrating a method for verifying backup data according to a second embodiment of the present invention;
FIG. 4 is a block diagram of a first embodiment of an apparatus for verifying backup data according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a device for verifying backup data in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the apparatus for verifying backup data may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in FIG. 1 does not constitute a limitation on the means for verifying the backup data, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a program for verifying backup data.
In the apparatus for verifying backup data shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 of the device for verifying backup data according to the present invention may be provided in the device for verifying backup data, and the device for verifying backup data calls the program for verifying backup data stored in the memory 1005 through the processor 1001 and performs the method for verifying backup data according to the embodiment of the present invention.
Based on the above device for verifying backup data, an embodiment of the present invention provides a method for verifying backup data, and referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of the method for verifying backup data according to the present invention.
In this embodiment, the method for verifying the backup data includes the following steps:
step S10: when the target virtual machine performs data backup, generating a backup point of the target virtual machine.
It should be noted that the execution subject of the embodiment may be a computing service device with data processing, network communication and program running functions, such as a mobile phone, a tablet computer, a personal computer, etc., or an electronic device or a backup server capable of implementing the above functions. The present embodiment and the following embodiments will be described below by taking the backup server as an example.
It should be noted that the target virtual machine may be a virtual machine that provides backup data during data backup, where the backup data includes operating system data and other service data that need to be backed up. Before the data backup operation is executed, an interface of a virtualization platform is called to snapshot a disk of a target virtual machine. After the snapshot is taken, the backup server can call a backup interface of the virtualization platform to read the data of the disk snapshot and save the data to form a backup point. In order to optimize the backup operation, the backup server may also exclude data on some disks and some partitions according to the backup policy configuration of the user, that is, data of some disks and some areas in the backup policy configuration of the user does not need to be backed up, or may set the backup type to be incremental backup, that is, only data newly added to the current disk from the last backup operation is backed up.
In a specific implementation, when the target virtual machine performs data backup, before performing a data backup operation, an interface of the virtualization platform is called to snapshot all disks of the target virtual machine. If the backup is a complete backup, the data in the disk snapshot is all the data on the disk of the target virtual machine at the moment of snapshot; if the backup is incremental backup, the data of the disk snapshot is the data of the disk which has changed at the time of the disk snapshot which was backed up last time and the current snapshot. After the snapshot is taken, the backup server can call a backup interface of the virtualization platform to read the data of the disk snapshot and save the data to form a backup point.
Step S20: and acquiring the disk information of the target virtual machine, and generating a virtual disk according to the disk information and the backup point.
It should be noted that the disk information of the target virtual machine may be information such as the number of disks of the target virtual machine and the size of each disk, and may be obtained by calling a programming interface of the virtualization platform. The virtual disk may be a virtual disk generated by the backup server according to the backup point data, the number of the virtual disks and the size of each disk are consistent with the disk of the target virtual machine, and the data on the virtual disk is the data corresponding to the disk at the moment when the disk of the target virtual machine takes a snapshot, that is, the data stored in the backup point on the backup server. If some areas of the subsequent virtual disk are written, the data of the corresponding data block is the data in the temporary file.
Further, in order to improve the efficiency of verifying the backup data, before the step S20, the method further includes: acquiring the number of disks and the size of the disks of a target virtual machine according to the hardware configuration information of the target virtual machine;
the step S20 includes: and generating a virtual disk through a virtual disk driver according to the number of disks and the size of the disks.
It should be noted that, the generating of the virtual disks by the virtual disk driver according to the number of the disks and the size of the disks may be generating virtual disks with the same number according to the number of the disks, and the size of the generated virtual disks is the same as the size of the disks on the target virtual machine, for example, the disk information and the data indicate that there are 2 disks in the target virtual machine, the sizes are 500G and 1000G, and the backup server may notify the virtual disk driver to create 2 virtual disks, and the sizes are also 500G and 1000G, respectively.
Step S30: and acquiring the hardware configuration information of the target virtual machine, and creating a verification virtual machine according to the hardware configuration information and the virtual disk.
It should be noted that the hardware configuration information may be information such as the number of network cards, the number of disks, the size of each disk, the type of connected peripheral devices and firmware of the target virtual machine. The creating of the verification virtual machine according to the hardware configuration information may be creating a verification virtual machine on the backup server according to the hardware configuration information and the virtual disk, and starting an operating system and a service system of the verification virtual machine (the operating system and the service system of the verification virtual machine, that is, the operating system and the service system on the target virtual machine) to perform data accuracy verification on the backup point.
In specific implementation, the backup server obtains the hardware configuration information of the target virtual machine by calling a programming interface of the virtualization platform, and creates a verification virtual machine on the backup server according to the hardware configuration information and the virtual disk.
Further, in order to enable the created verification virtual machine to start normally, after the step S30, the method further includes the steps of: reading the data in the backup point through the virtual disk to obtain the disk type and the disk partition information; organizing the data in the backup point into a volume according to the disk type and the disk partition information, and mounting a file system on the volume to identify the type of an operating system; and injecting a virtual disk controller driver into the operating system according to the type of the operating system, and starting the operating system of the verification virtual machine. The operating system of the verification virtual machine can be normally started by injecting a virtual disk controller driver into the operating system.
It should be understood that a partition is a portion of a physical disk that acts as a physically separate unit. A partition is typically referred to as a main partition or an extended partition. A volume is a series of contiguous storage areas on a disk, and a drive number (windows system) or mount point (linux system) may be assigned to the volume by specifying the organization of the stored data via a file system (e.g., FAT, NTFS, XFS, EXT). A disk includes multiple volumes, and a volume may span multiple disks.
It should be noted that the disk partition information may be partition information that organizes data in the backup point into a virtual disk. The data in the backup point is organized into a volume, which can be different ways according to the type of the disk partition. And further mounting the file system on the volume to identify the type of the operating system in the backup point, namely the type of the operating system on the target virtual machine, and injecting a virtual disk controller driver into the operating system according to the type of the operating system, so that the operating system of the verification virtual machine can be normally started.
It should be noted that, the method for identifying the operating system type may be: if the volume on the disk uses an ntfs file system, and directories such as Windows, Program Files, and programData exist in the root directory of the file system, the backed-up system can be considered as a Windows system; if file systems such as ext, xfs, btrfs, etc. are used, and directories such as boot, etc. are stored in the root directory of the file system, the backed-up system can be considered as a linux system. Other types of operating systems are similar in principle, and the embodiment is not described here.
In a specific implementation, after the virtual disk controller driver is injected, the file system on the volume may be unloaded, and then the operating system of the verification virtual machine and the service system in the operating system are started to perform backup data verification.
Step S40: and carrying out data accuracy verification on the backup point according to the verification virtual machine.
It should be noted that, the performing data accuracy verification on the backup point according to the verification virtual machine may be starting a preset verification program on the verification virtual machine and executing the verification program, where when the verification program is executed, the verification program may call the data in the backup point to perform a series of service logic processing operations, and after the service processing is performed on the data in the backup point, if no error reporting information occurs, the data in the backup point is considered to be valid data, that is, the backup data is correct, and no abnormality occurs in the backup process. For example, if an oracle database service system runs on the target virtual machine, when the backup data is verified, the oracle database can be started in the operating system of the verification virtual machine and all the data can be queried, and if all the data can be successfully queried and the database has no error, the backup data is considered to be correct. The preset verification program may be an original service system (e.g., an oracle database) of the target virtual machine, or may also be a preset program for verifying the accuracy of the backup data, which is not limited herein.
In this embodiment, when a target virtual machine performs data backup, a backup point of the target virtual machine is generated; acquiring disk information of a target virtual machine, and generating a virtual disk according to the disk information and the backup point; acquiring hardware configuration information of the target virtual machine, and creating a verification virtual machine according to the hardware configuration information and the virtual disk; and carrying out data accuracy verification on the backup point according to the verification virtual machine. According to the invention, when the target virtual machine performs data backup, the backup point of the target virtual machine is generated, and then the data accuracy verification is performed on the backup point of the target virtual machine. Compared with the existing mode of verifying the validity of the data after the data backup is completed, the mode of the embodiment can find the defects of the backup data as soon as possible, so that the data inspection is more flexible and efficient, the time is shortened, and the timeliness of the data inspection is improved.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for verifying backup data according to a second embodiment of the present invention.
Based on the first embodiment described above, in the present embodiment, the step S40 includes:
step S401: and starting a preset service system through the verification virtual machine.
It should be noted that the preset service system includes an operating system and a service system in the operating system, the service system may be a service system in the backup point, or may also be a preset service system capable of verifying the accuracy of backup data, and the preset service system may read data in the backup point, so as to verify the validity of the data in the backup point according to a processing logic in the service system. The preset service system may also be a system having the above-mentioned verification function, and this embodiment is not limited herein.
Further, in order not to affect the data in the backup point, after the step S401, the method further includes the steps of:
step S4011: when a write request generated by the preset service system is received, writing data corresponding to the write request into a preset offset position of a temporary file;
step S4012: a write operation is performed in the bitmap file at the location where the preset offset position is identified;
correspondingly, after the step of obtaining the read request generated by the preset service system and judging whether the data block corresponding to the read request has performed the write operation, the method further includes: and when the data block corresponding to the reading request is subjected to writing operation, reading the data corresponding to the data block from the temporary file, and verifying the accuracy of the read data through the preset service system.
It should be noted that the temporary file may be a file for storing data corresponding to the write request, or may be a sparse file, that is, the temporary file does not occupy space when being created, and only when writing data, the file system allocates space for the written data content. Therefore, no space is taken up in the file system as long as data has not been written, regardless of how large a sparse file is created. In addition, a bitmap file is created to identify the location of data written to the temporary file. The preset offset position is an offset position for verifying that a service system (including an operating system and a file system) of the virtual machine performs write operation on the virtual disk, and when the service system of the virtual machine performs write operation on disk equipment of the virtual machine, the write request is captured by the virtualization engine and finally converted into the write operation at the offset position corresponding to the virtual disk. The virtual disk driver writes the data into the temporary file, the specific offset position is the offset position of the virtual disk for executing the writing operation, and then the writing operation is executed at the position in the temporary file identified in the bitmap file, so that all the written data of the virtual disk cannot influence the data in the backup point. For example, suppose that the service system of the virtual machine is verified to write one data block to the disk device of the virtual machine, the block size is 512 bytes, and the write offset position is 0x 100000. The write request would be captured by the virtualization engine and translated to a write operation at an offset of 0x100000 to the virtual disk, also 512 bytes in size. When the virtual disk drive receives the write request, it writes the block data to 0x100000 of the temporary file (i.e. data block 2048, 0x100000/512= 2048), and then marks the 2048 th block of the temporary file in the bitmap file and performs the write operation.
Further, before the step S4011, the method further includes the step of: generating a corresponding temporary file for the virtual disk according to the disk information and the data, wherein the temporary file is used for writing temporary data; and creating a bitmap file, wherein the bitmap file is used for recording the data storage information in the temporary file. The virtual disks correspond to the temporary files and the bitmap files one by one, namely, one virtual disk corresponds to one temporary file and one bitmap file.
Step S402: and acquiring a read request generated by the preset service system, and judging whether a data block corresponding to the read request executes write-in operation or not.
It should be noted that the read request may be a read request for data in the backup point, or may be a read request for data that is not in the backup point and is generated when the business system runs. For the generated data not belonging to the backup point, in order to make the data not affect the data in the backup point, the data may be stored to other places, for example, a temporary file is established to store the data, and if the data block corresponding to the read request performs the write operation, the data corresponding to the read request may be determined to be the data in the temporary file.
Step S403: and when the data block does not execute the writing operation, judging whether the data block executes the backup operation or not.
It should be noted that whether the data block performs the backup operation refers to: and whether the corresponding data in the target virtual machine is read back through the backup interface or not is stored in the backup point.
Further, in order to verify the validity of the backup data, after step S403, the method further includes: when the data block does not execute backup operation, judging whether the data corresponding to the data block is data to be backed up; and calling a backup interface of a virtualization platform to backup the data corresponding to the data block to the backup point when the data corresponding to the data block is the data to be backed up.
It should be noted that the data to be backed up may be data in the target virtual machine.
It should be understood that when the data block has not performed the write operation, the data block may be in the backup point, or may belong to an exclusion area for data backup, that is, a disk area not requiring backup, or may be in the target virtual machine when the data block is verified, and the data block has not been read back from the target virtual machine and is saved in the backup point, so that it is necessary to determine whether the data block has performed the backup operation. The data block may be retrieved from the backup point only when the data block performs a backup operation.
Step S404: and when the data block executes backup operation, reading data corresponding to the data block from the backup point according to the virtual disk, and performing data accuracy verification on the read data through the preset service system.
It should be noted that the performing of the backup verification on the read data by the preset service system may be verifying the read data by a verification program in the preset service system, and when the verification program is not abnormal, such as an error prompt, the backup data is determined to be valid data, and the backup process is normal.
In specific implementation, after a preset service system is started, data in a backup point is read through a virtual disk, when a virtual disk driver receives a read request, whether a data block corresponding to the read request executes a write operation is judged, if the write operation is executed, the data block is read from a temporary file, and then the data block is returned to an application program, namely the preset service system; if the write-in operation is not executed, then judging whether the data block has executed the backup operation, if the backup operation is executed, directly reading out the corresponding data from the backup point, and returning the data to the application program; if the backup operation is not executed, then judging whether the data of the data block needs to be backed up (for example, if the area belongs to the exclusion area, the backup is not needed), if the backup is not needed, directly returning the null data, namely, the returned data are all 0, otherwise, calling a backup interface of the virtualization platform, backing up the data of the area back, writing the data into a backup point, identifying that the data of the area has executed the backup operation, and simultaneously returning the backed-up data to the application program.
In this embodiment, a preset service system is started through the verification virtual machine; acquiring a read request generated by the preset service system, and judging whether a data block corresponding to the read request executes write-in operation or not; when the data block does not execute the writing operation, judging whether the data block executes the backup operation or not; and when the data block executes backup operation, reading data corresponding to the data block from the backup point according to the virtual disk, and performing data accuracy verification on the read data through the preset service system. The above method of the embodiment can find the defects of the backup data as early as possible, so that the data inspection method is more flexible and efficient, the time is shortened, and the timeliness of the data inspection is improved.
Referring to fig. 4, fig. 4 is a block diagram illustrating a first embodiment of an apparatus for verifying backup data according to the present invention.
As shown in fig. 4, an apparatus for verifying backup data according to an embodiment of the present invention includes:
a backup point generating module 10, configured to generate a backup point of a target virtual machine when the target virtual machine performs data backup;
a virtual disk generation module 20, configured to obtain disk information of a target virtual machine, and generate a virtual disk according to the disk information and the backup point;
a verification virtual machine creation module 30, configured to obtain hardware configuration information of the target virtual machine, and create a verification virtual machine according to the hardware configuration information and the virtual disk;
and the backup verification module 40 is configured to perform data accuracy verification on the backup point according to the verification virtual machine.
In this embodiment, when a target virtual machine performs data backup, a backup point of the target virtual machine is generated; acquiring disk information of a target virtual machine, and generating a virtual disk according to the disk information and the backup point; acquiring hardware configuration information of the target virtual machine, and creating a verification virtual machine according to the hardware configuration information and the virtual disk; and carrying out data accuracy verification on the backup point according to the verification virtual machine. According to the invention, when the target virtual machine performs data backup, the backup point of the target virtual machine is generated, and then the data accuracy verification is performed on the backup point of the target virtual machine. Compared with the existing mode of verifying the validity of the data after the data backup is completed, the mode of the embodiment can find the defects of the backup data as soon as possible, so that the data inspection is more flexible and efficient, the time is shortened, and the timeliness of the data inspection is improved.
It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.
In addition, the technical details that are not described in detail in this embodiment may refer to the parameter operation method provided in any embodiment of the present invention, and are not described herein again.
Based on the first embodiment of the device for verifying backup data of the present invention, a second embodiment of the device for verifying backup data of the present invention is provided.
In this embodiment, the backup verification module 40 is further configured to start a preset service system through the verification virtual machine; acquiring a read request generated by the preset service system, and judging whether a data block corresponding to the read request executes write-in operation or not; when the data block does not execute the writing operation, judging whether the data block executes the backup operation or not; and when the data block executes backup operation, reading data corresponding to the data block from the backup point according to the virtual disk, and performing data accuracy verification on the read data through the preset service system.
Further, the backup verification module 40 is further configured to, when receiving a write request generated by the preset service system, write data corresponding to the write request to a preset offset position of a temporary file; a write operation is performed in the bitmap file at the location where the preset offset position is identified; correspondingly, the obtaining of the read request generated by the preset service system and the determining whether the data block corresponding to the read request has performed the write operation includes: and when the data block corresponding to the reading request is subjected to writing operation, reading the data corresponding to the data block from the temporary file, and performing data accuracy verification on the read data through the preset service system.
Further, the backup verification module 40 is further configured to generate a corresponding temporary file for the virtual disk according to the disk information and the data, where the temporary file is used to write temporary data; and creating a bitmap file, wherein the bitmap file is used for recording the data storage information in the temporary file.
Further, the backup verification module 40 is further configured to, when the data block does not perform a backup operation, determine whether data corresponding to the data block is to-be-backed up data; and calling a backup interface of a virtualization platform to backup the data corresponding to the data block to the backup point when the data corresponding to the data block is the data to be backed up.
Further, the virtual disk generation module 20 is further configured to obtain the number of disks and the size of the disks of the target virtual machine according to the hardware configuration information of the target virtual machine; the step of obtaining the disk information of the target virtual machine and generating the virtual disk according to the disk information and the backup point comprises the following steps: and generating a virtual disk through a virtual disk driver according to the number of disks and the size of the disks.
Further, the verification virtual machine creating module 30 is further configured to read data in the backup point through the virtual disk, and obtain a disk type and disk partition information; organizing the data in the backup point into a volume according to the disk type and the disk partition information, and mounting a file system on the volume to identify the type of an operating system; and injecting a virtual disk controller driver into the operating system according to the type of the operating system, and starting the operating system of the verification virtual machine.
Other embodiments or specific implementation manners of the apparatus for verifying backup data according to the present invention may refer to the above method embodiments, and are not described herein again.
Furthermore, an embodiment of the present invention further provides a storage medium, where a program for verifying backup data is stored, and when executed by a processor, the program for verifying backup data implements the steps of the method for verifying backup data as described above.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., a rom/ram, a magnetic disk, an optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method of validating backup data, the method comprising the steps of:
when a target virtual machine performs data backup, generating a backup point of the target virtual machine;
acquiring disk information of a target virtual machine, and generating a virtual disk according to the disk information and the backup point;
acquiring hardware configuration information of the target virtual machine, and creating a verification virtual machine according to the hardware configuration information and the virtual disk;
and carrying out data accuracy verification on the backup point according to the verification virtual machine.
2. The method of validating backup data as claimed in claim 1, wherein the step of performing data accuracy validation on the backup point according to the validation virtual machine comprises:
starting a preset service system through the verification virtual machine;
acquiring a read request generated by the preset service system, and judging whether a data block corresponding to the read request executes write-in operation or not;
when the data block does not execute the writing operation, judging whether the data block executes the backup operation or not;
and when the data block executes backup operation, reading data corresponding to the data block from the backup point according to the virtual disk, and performing data accuracy verification on the read data through the preset service system.
3. The method for validating backup data as claimed in claim 2, wherein after the step of starting the preset business system by the validation virtual machine, further comprising:
when a write request generated by the preset service system is received, writing data corresponding to the write request into a preset offset position of a temporary file;
a write operation is performed in the bitmap file at the location where the preset offset position is identified;
correspondingly, after the step of obtaining the read request generated by the preset service system and judging whether the data block corresponding to the read request has performed the write operation, the method further includes:
and when the data block corresponding to the reading request is subjected to writing operation, reading the data corresponding to the data block from the temporary file, and performing data accuracy verification on the read data through the preset service system.
4. The method for verifying backup data according to claim 3, wherein before the step of writing data corresponding to the write request to a preset offset position of a temporary file when receiving the write request generated by the preset service system, the method further comprises:
generating a corresponding temporary file for the virtual disk according to the disk information and the data, wherein the temporary file is used for writing temporary data;
and creating a bitmap file, wherein the bitmap file is used for recording the data storage information in the temporary file.
5. The method for verifying backup data as claimed in claim 2, wherein after the step of determining whether the data block has performed the backup operation when the data block has not performed the write operation, further comprising:
when the data block does not execute backup operation, judging whether the data corresponding to the data block is data to be backed up;
and calling a backup interface of a virtualization platform to backup the data corresponding to the data block to the backup point when the data corresponding to the data block is the data to be backed up.
6. The method for verifying backup data according to any one of claims 1 to 5, wherein before the step of obtaining disk information of a target virtual machine and generating a virtual disk according to the disk information and the backup point, the method further comprises:
acquiring the number of disks and the size of the disks of a target virtual machine according to the hardware configuration information of the target virtual machine;
the step of obtaining the disk information of the target virtual machine and generating the virtual disk according to the disk information and the backup point comprises the following steps:
and generating a virtual disk through a virtual disk driver according to the number of disks and the size of the disks.
7. The method for validating backup data according to any one of claims 1-5, wherein after the step of obtaining hardware configuration information of the target virtual machine and creating a validation virtual machine according to the hardware configuration information and the virtual disk, further comprising:
reading the data in the backup point through the virtual disk to obtain the disk type and the disk partition information;
organizing the data in the backup point into a volume according to the disk type and the disk partition information, and mounting a file system on the volume to identify the type of an operating system;
and injecting a virtual disk controller driver into the operating system according to the type of the operating system, and starting the operating system of the verification virtual machine.
8. An apparatus for verifying backup data, the apparatus comprising:
the backup point generating module is used for generating a backup point of the target virtual machine when the target virtual machine performs data backup;
the virtual disk generation module is used for acquiring disk information of a target virtual machine and generating a virtual disk according to the disk information and the backup point;
the verification virtual machine creating module is used for acquiring the hardware configuration information of the target virtual machine and creating a verification virtual machine according to the hardware configuration information and the virtual disk;
and the backup verification module is used for verifying the data accuracy of the backup point according to the verification virtual machine.
9. An apparatus for verifying backup data, the apparatus comprising: memory, processor and a program of verifying backup data stored on said memory and executable on said processor, said program of verifying backup data being configured to implement the steps of the method of verifying backup data according to any of claims 1 to 7.
10. A storage medium having stored thereon a program for verifying backup data, the program for verifying backup data, when executed by a processor, implementing the steps of the method for verifying backup data according to any one of claims 1 to 7.
CN202111059011.3A 2021-09-10 2021-09-10 Method, device and equipment for verifying backup data and storage medium Active CN113505026B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111059011.3A CN113505026B (en) 2021-09-10 2021-09-10 Method, device and equipment for verifying backup data and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111059011.3A CN113505026B (en) 2021-09-10 2021-09-10 Method, device and equipment for verifying backup data and storage medium

Publications (2)

Publication Number Publication Date
CN113505026A true CN113505026A (en) 2021-10-15
CN113505026B CN113505026B (en) 2021-12-24

Family

ID=78016549

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111059011.3A Active CN113505026B (en) 2021-09-10 2021-09-10 Method, device and equipment for verifying backup data and storage medium

Country Status (1)

Country Link
CN (1) CN113505026B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114706661A (en) * 2022-05-31 2022-07-05 武汉四通信息服务有限公司 Disaster recovery backup method and system for virtual machine, computer equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102207897A (en) * 2011-07-11 2011-10-05 成都易我科技开发有限责任公司 Incremental backup method
US8572337B1 (en) * 2009-12-14 2013-10-29 Symantec Corporation Systems and methods for performing live backups
US20130346709A1 (en) * 2012-06-21 2013-12-26 Ca, Inc. Data recovery using conversion of backup to virtual disk
CN106294021A (en) * 2016-08-13 2017-01-04 南京叱咤信息科技有限公司 A kind of method of data in magnetic disk incremental backup
CN110597662A (en) * 2019-09-11 2019-12-20 深圳市科力锐科技有限公司 Backup data automatic verification method and device, user equipment and storage medium
CN110941515A (en) * 2019-12-04 2020-03-31 深圳市科力锐科技有限公司 Host backup reconstruction method, device, server and storage medium
CN111580929A (en) * 2020-05-07 2020-08-25 上海英方软件股份有限公司 Validity verification system and method based on virtual machine protection data
CN111581028A (en) * 2020-05-12 2020-08-25 上海英方软件股份有限公司 Data block-based method and system for rapid data backup and consistency verification
CN112256492A (en) * 2020-12-22 2021-01-22 深圳市科力锐科技有限公司 Block device backup method, device and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8572337B1 (en) * 2009-12-14 2013-10-29 Symantec Corporation Systems and methods for performing live backups
CN102207897A (en) * 2011-07-11 2011-10-05 成都易我科技开发有限责任公司 Incremental backup method
US20130346709A1 (en) * 2012-06-21 2013-12-26 Ca, Inc. Data recovery using conversion of backup to virtual disk
CN106294021A (en) * 2016-08-13 2017-01-04 南京叱咤信息科技有限公司 A kind of method of data in magnetic disk incremental backup
CN110597662A (en) * 2019-09-11 2019-12-20 深圳市科力锐科技有限公司 Backup data automatic verification method and device, user equipment and storage medium
CN110941515A (en) * 2019-12-04 2020-03-31 深圳市科力锐科技有限公司 Host backup reconstruction method, device, server and storage medium
CN111580929A (en) * 2020-05-07 2020-08-25 上海英方软件股份有限公司 Validity verification system and method based on virtual machine protection data
CN111581028A (en) * 2020-05-12 2020-08-25 上海英方软件股份有限公司 Data block-based method and system for rapid data backup and consistency verification
CN112256492A (en) * 2020-12-22 2021-01-22 深圳市科力锐科技有限公司 Block device backup method, device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114706661A (en) * 2022-05-31 2022-07-05 武汉四通信息服务有限公司 Disaster recovery backup method and system for virtual machine, computer equipment and storage medium

Also Published As

Publication number Publication date
CN113505026B (en) 2021-12-24

Similar Documents

Publication Publication Date Title
CN103150231B (en) The method of computer booting and computer system
CN113835644B (en) Complete machine migration method, device, equipment and storage medium
CN110908865A (en) Memory leakage monitoring method and device and electronic equipment
CN106843947B (en) Method and device for processing code defects
CN112650658A (en) Application program exception recording and reproduction method, device and storage medium
CN113505026B (en) Method, device and equipment for verifying backup data and storage medium
CN110597662B (en) Backup data automatic verification method and device, user equipment and storage medium
CN114780019A (en) Electronic device management method and device, electronic device and storage medium
CN108228611B (en) Document information copying method and device
CN114816772B (en) Debugging method, debugging system and computing device for application running based on compatible layer
CN112463042B (en) Data volume import data verification method, device, terminal and storage medium
CN112506786B (en) Regression testing method and regression testing device
CN111737223B (en) File copying method, device, equipment and storage medium
CN114756624A (en) Data processing method, device and equipment for full-scale nodes and storage medium
CN110018968B (en) Data reading method, electronic equipment and computer storage medium
CN113791941A (en) Method for automatically testing stability of OpenStack cluster and application
CN113590388B (en) UBOOT-based SPL rollback method and device, storage medium and terminal
CN112165512B (en) File release method and device, terminal equipment and storage medium
CN115688203A (en) Mobile storage medium management and control method, device, equipment and readable storage medium
CN115658169A (en) Controller starting method, device, equipment and medium
CN111309560A (en) Method and device for rapidly collecting SSD information during system downtime
CN116301654A (en) Data migration method, device, electronic equipment and storage medium
CN117215602A (en) Method, device, computer equipment and storage medium for updating drive program
CN114218191A (en) System function migration method and device, computer equipment and storage medium
CN118193337A (en) Data transfer method and device

Legal Events

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