[go: up one dir, main page]

CN118819967B - Data backup method and device, storage medium, and electronic device - Google Patents

Data backup method and device, storage medium, and electronic device Download PDF

Info

Publication number
CN118819967B
CN118819967B CN202411307879.4A CN202411307879A CN118819967B CN 118819967 B CN118819967 B CN 118819967B CN 202411307879 A CN202411307879 A CN 202411307879A CN 118819967 B CN118819967 B CN 118819967B
Authority
CN
China
Prior art keywords
target
data
snapshot
target data
data block
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.)
Active
Application number
CN202411307879.4A
Other languages
Chinese (zh)
Other versions
CN118819967A (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.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent 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 Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202411307879.4A priority Critical patent/CN118819967B/en
Publication of CN118819967A publication Critical patent/CN118819967A/en
Application granted granted Critical
Publication of CN118819967B publication Critical patent/CN118819967B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Landscapes

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

Abstract

本申请实施例提供了一种数据备份方法及装置、存储介质、电子设备,该方法包括:接收通过主机服务器发送的第一数据备份请求;在确定第一数据备份请求是用于请求对目标存储卷中的数据执行数据备份操作的情况下,创建第一快照;响应第一备份请求,基于第一快照的第一快照标识从第一目标数据块中读取第一目标数据;对第一目标数据执行数据备份操作,以将第一目标数据备份至云服务器中。通过本申请,可以解决相关技术中在进行数据备份时,造成资源浪费的问题,实现了低资源、低耗费进行数据备份的效果。

The embodiment of the present application provides a data backup method and device, a storage medium, and an electronic device, the method comprising: receiving a first data backup request sent by a host server; creating a first snapshot when determining that the first data backup request is for requesting a data backup operation to be performed on data in a target storage volume; responding to the first backup request, reading the first target data from the first target data block based on the first snapshot identifier of the first snapshot; performing a data backup operation on the first target data to back up the first target data to a cloud server. Through the present application, the problem of waste of resources in the related art when performing data backup can be solved, and the effect of performing data backup with low resources and low cost can be achieved.

Description

Data backup method and device, storage medium and electronic equipment
Technical Field
The embodiment of the application relates to the field of computers, in particular to a data backup method and device, a storage medium and electronic equipment.
Background
Cloud backup is a data protection technology based on a time point, and data of storage volumes in storage equipment are transmitted to public cloud or private cloud for backup. When the local storage device fails, the data can be downloaded from the cloud to the local, so that the recovery of the data is realized, and the data loss is avoided. Currently, cloud backup is mostly implemented through snapshot technology, but conventional snapshot technology requires creating an additional target volume for a storage volume and managing copies of snapshot data through bitmaps. Therefore, when the more storage volumes are backed up by the cloud, the more target volumes are additionally created, the more bitmaps are created, the greater the influence of the copy operation on Input/Output (IO) of the storage volumes is, and there are problems of occupying space and wasting resources.
Disclosure of Invention
The embodiment of the application provides a data backup method and device, a storage medium and electronic equipment, which at least solve the problem of resource waste caused by data backup in the related art.
According to one embodiment of the application, a data backup method is provided, and the method is applied to a storage server, wherein the storage server is respectively connected with a cloud server and a host server, the storage server comprises a storage pool, the storage pool comprises a plurality of storage volumes, the method comprises the steps of receiving a first data backup request sent by the host server, creating a first snapshot when the first data backup request is determined to be used for requesting to execute data backup operation on data in a target storage volume, the target storage volume is any one of the storage volumes, the first snapshot is used for indicating data blocks in the target storage volume to set IO operation identifiers when input/output IO operation is executed, responding to the first data backup request, reading first target data from first target data blocks based on the first snapshot identifiers of the first snapshot, the first target data blocks are at least one data block in the target storage volume, the first snapshot identifiers of the first target data blocks are identical to the first target data blocks in the first target storage volume, and the first IO operation identifier is executed on the cloud server.
In an exemplary embodiment, before the first snapshot is created, the method further includes performing a mapping operation on the target storage volume to map the target storage volume to the host server, where the mapping operation includes sending a logical unit number of the target storage volume to the host server and instructing the host server to establish a connection with the target storage volume based on the logical unit number to allow the host server to access the target storage volume, receiving a first IO operation request sent by the host server, where the first IO operation request includes information including identification information of the target storage volume, address information of a first target data block, data information of the IO operation to be performed, and the IO operation identification, responding to the IO operation request, using the information included in the first operation request to establish a connection with the target storage volume to allow the host server to access the target storage volume, and receiving the first IO operation request including the identification information of the first target data block and performing the IO operation of the first target data block.
In an exemplary embodiment, after performing the IO operation on the first target data block by using the information included in the first IO operation request and recording the target IO operation identifier of the first target data block in response to the first IO operation request, the method further includes updating, in a case where it is determined that the IO operation performed on the first target data block is an initial IO operation, a first usage field of the first target data block to obtain a first target usage field, where the first usage field is set before receiving the IO operation request sent by the host server, and a field value of the first usage field is used to identify whether deletion of data in the first target data block is allowed.
In one exemplary embodiment, in the case that the first data backup request is determined to be for requesting to perform a data backup operation on data in a target storage volume, creating a first snapshot includes sending a snapshot instruction to the host server to instruct the host server to set the first snapshot identification to a second IO operation request and send the second IO operation request to the target storage volume in response to the snapshot instruction, determining the IO operation identification based on the first snapshot identification after performing the second IO operation in the first target data block in response to the second IO operation request, and setting the IO operation identification to the first target data block to create the first snapshot.
In an exemplary embodiment, reading first target data from a first target data block based on a first snapshot identifier of the first snapshot in response to the first data backup request includes receiving data acquisition indication information sent by the target storage volume, and in the case that the data acquisition indication information includes first indication information, searching, in response to the first data backup request, for an IO operation identifier matching the first snapshot identifier from the target storage volume to determine the first target data block, where the first indication information is used to indicate that only incremental data is allowed to be read from the first target data block, and reading the incremental data from the first target data block to obtain the first target data.
In an exemplary embodiment, after receiving the data acquisition indication information sent by the target storage volume, the method further includes, in response to the first data backup request, searching, in the target storage volume, an IO operation identifier matching the first snapshot identifier to determine the first target data block, where the second indication information is used to indicate that reading of all data included in the first target data block is allowed, and reading all data from the first target data block to obtain the first target data.
In an exemplary embodiment, reading first target data from a first target data block based on a first snapshot identification of the first snapshot includes traversing the target storage volume based on an initial snapshot identification of the first snapshot, determining data blocks included in the target storage volume that perform the IO operation as the first target data block, where the initial snapshot identification is a snapshot identification sent to the host server for the first time, sending a first read command to the first target data block, and receiving the first target data sent by the first target data block in response to the first read command.
In an exemplary embodiment, in response to the first data backup request, reading first target data from a first target data block based on a first snapshot identifier of the first snapshot includes traversing the target storage volume based on the first snapshot identifier to determine the first target data block, searching the IO operation identifier matching the first snapshot identifier from the target storage volume to determine the first target data block, sending a second read instruction to the first target data block, and receiving the first target data sent by the first target data block in response to the second read instruction.
In one exemplary embodiment, performing the data backup operation on the first target data to backup the first target data to the cloud server includes invoking a data backup interface in the cloud server, wherein the data backup interface only allows transmission of the first target data read from the first target data block, and uploading the first target data to the cloud server through the data backup interface to backup the first target data in the cloud server.
In an exemplary embodiment, after performing the data backup operation on the first target data to backup the first target data to the cloud server, the method further includes updating a second usage field of the first target data block to obtain a second target usage field, where the second usage field is set when the first target data block performs the IO operation, a field value of the second usage field is used to identify whether to allow deletion of data in the first target data block, and deleting the first target data to release a storage space of the first target data block if the field value of the second target usage field is a target field value.
In an exemplary embodiment, the storage server further includes a data deletion service, and after the data backup operation is performed on the first target data to backup the first target data to the cloud server, the method further includes traversing the target storage volume, searching for second target data from the target storage volume, where the second target data is data that is not backed up to the cloud server in the target storage volume, and invoking the data deletion service to perform a deletion operation on the second target data through the data deletion service.
According to another embodiment of the present application, a data backup device is provided, and the data backup device is applied to a storage server, where the storage server is respectively connected to a cloud server and a host server, the storage server includes a storage pool, the storage pool includes a plurality of storage volumes, the device includes a first receiving module configured to receive a first data backup request sent by the host server, a first creating module configured to create a first snapshot when determining that the first data backup request is for requesting to perform a data backup operation on data in a target storage volume, where the target storage volume is any one of the plurality of storage volumes, the first snapshot is configured to instruct a data block in the target storage volume to set an IO operation identifier when performing an input/output IO operation, and a first response module configured to read, in response to the first data backup request, first target data from a first target data block based on the first snapshot first backup identifier, where the first target data block is the first target data block in the target storage volume, and the target data block in the target storage volume is at least one of the target storage volume, and the first backup identifier is used to perform the same as the first data in the target storage volume.
In an exemplary embodiment, the device further comprises a first mapping module, configured to perform a mapping operation on the target storage volume to map the target storage volume to the host server before creating the first snapshot, where the mapping operation includes sending a logical unit number of the target storage volume to the host server and instructing the host server to establish a connection with the target storage volume based on the logical unit number to allow the host server to access the target storage volume, and a second receiving module, configured to receive a first IO operation request sent by the host server, where the first IO operation request includes identification information of the target storage volume, address information of a first target data block, data information of the IO operation to be performed, and the IO operation identifier, and a second response module, configured to record the first IO operation request for the target data block and perform the IO operation on the target data block using the first IO operation block included in the first IO operation request.
In an exemplary embodiment, the apparatus further includes a first update module, configured to respond to the first IO operation request, perform the IO operation on the first target data block using the information included in the first IO operation request, record the target IO operation identifier of the first target data block, and update, after determining that the IO operation performed on the first target data block is an initial IO operation, a first usage field of the first target data block to obtain a first target usage field, where a field value of the first usage field is set before receiving the IO operation request sent by the host server, where the field value of the first usage field is used to identify whether to allow deletion of data in the first target data block.
In an exemplary embodiment, the first creation module includes a first sending submodule, configured to send a snapshot instruction to the host server to instruct the host server to set the first snapshot identifier to a second IO operation request and send the second IO operation request to the target storage volume, and a first response submodule, configured to determine the IO operation identifier based on the first snapshot identifier after the second IO operation is performed in the first target data block and set the IO operation identifier to the first target data block to create the first snapshot in response to the second IO operation request.
In an exemplary embodiment, the first response module includes a first receiving sub-module configured to receive data acquisition indication information sent by the target storage volume, a second response sub-module configured to, in response to the first data backup request when the data acquisition indication information includes first indication information, search for an IO operation identifier matching the first snapshot identifier from the target storage volume to determine the first target data block, where the first indication information is configured to indicate that only incremental data is allowed to be read from the first target data block, and a first reading sub-module configured to read the incremental data from the first target data block to obtain the first target data.
In an exemplary embodiment, the first response module further includes a third response sub-module, configured to, after the data acquisition indication information sent by the target storage volume includes second indication information, search, in response to the first data backup request, an IO operation identifier that matches the first snapshot identifier from the target storage volume to determine the first target data block, where the second indication information is used to indicate that reading of all data included in the first target data block is allowed, and a second reading sub-module, configured to read all data from the first target data block, and obtain the first target data.
In an exemplary embodiment, the first response module includes a first traversing sub-module configured to traverse the target storage volume based on an initial snapshot identifier of the first snapshot, and determine data blocks included in the target storage volume that perform the IO operation as the first target data blocks, where the initial snapshot identifier is a snapshot identifier sent to the host server for the first time, send a first read command to the first target data blocks, and a second receiving sub-module configured to receive the first target data sent by the first target data blocks in response to the first read command.
In an exemplary embodiment, the first response module includes a second traversing sub-module configured to traverse the target storage volume based on the first snapshot identifier to find an IO operation identifier matching the first snapshot identifier from the target storage volume to determine the first target data block, send a second read instruction to the first target data block, and a third receiving sub-module configured to receive the first target data sent by the first target data block in response to the second read instruction, where the first data backup request is another backup request.
In an exemplary embodiment, the first backup module includes a first calling sub-module configured to call a data backup interface in the cloud server, where the data backup interface only allows transmission of the first target data read from the first target data block, and a first uploading sub-module configured to upload the first target data to the cloud server through the data backup interface to backup the first target data in the cloud server.
In an exemplary embodiment, the device further includes a second updating module configured to perform the data backup operation on the first target data, so as to update a second usage field of the first target data block after the first target data is backed up to the cloud server, to obtain a second target usage field, where the second usage field is set when the first target data block performs the IO operation, and a field value of the second usage field is used to identify whether to allow deletion of data in the first target data block, and a first deleting module configured to delete the first target data when a field value of the second target usage field is a target field value, so as to release a storage space of the first target data block.
In an exemplary embodiment, the storage server further includes a data deletion service, and the apparatus further includes a second traversing module configured to perform the data backup operation on the first target data, so as to traverse the target storage volume after the first target data is backed up to the cloud server, and find second target data from the target storage volume, where the second target data is data that is not backed up to the cloud server in the target storage volume, and a first calling module configured to call the data deletion service, so as to perform a deletion operation on the second target data through the data deletion service.
According to yet another embodiment of the present application, there is further provided a storage server, where the storage server is connected to a cloud server and a host server, respectively, and where the storage server includes a storage pool, where the storage pool includes a plurality of storage volumes, where the storage server is configured to perform the steps in any of the method embodiments described above at runtime.
According to a further embodiment of the present application, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the application, there is also provided an electronic device comprising a memory having stored therein a computer program, and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
According to a further embodiment of the application, there is also provided a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the method embodiments described above.
According to the method and the device for the data backup, under the condition that the first data backup request is used for requesting to execute data backup operation on data in the target storage volume, the first snapshot is created, the data blocks in the target storage volume are indicated to set IO operation identifiers when input/output IO operation is executed, the first target data blocks are searched from the target storage volume based on the first snapshot identifiers of the first snapshot in response to the first data backup request, first target data in the first target data blocks are read, the target IO operation identifiers of the first target data blocks are identical to the first snapshot identifiers, and finally data backup operation is executed on the first target data, and the first target data are backed up to the cloud server. According to the application, when cloud backup is carried out on the target storage volume, the IO operation identification is set to record which generation of snapshot relation each IO operation belongs to, and the target volume for the snapshot is not required to be additionally created, and all data exist in the target storage volume, so that the problem of resource waste in the related technology when data backup is carried out can be solved, and the effect of carrying out the data backup with low resource and low consumption is realized.
Drawings
Fig. 1 is a hardware block diagram of a server device of a data backup method according to an embodiment of the present application;
FIG. 2 is a flow chart of a data backup method according to an embodiment of the present application;
FIG. 3 is a block diagram of a data backup method according to an embodiment of the present application;
FIG. 4 is a flow chart of a method of data backup in accordance with an embodiment of the present application;
fig. 5 is a block diagram of a data backup apparatus according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in detail below with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be executed in a server apparatus or similar computing device. Taking the example of running on a server device, fig. 1 is a block diagram of a hardware structure of a server device of a data backup method according to an embodiment of the present application. As shown in fig. 1, the server device may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU, a programmable logic device FPGA, or the like processing means) and a memory 104 for storing data, wherein the server device may further include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those of ordinary skill in the art that the architecture shown in fig. 1 is merely illustrative and is not intended to limit the architecture of the server apparatus described above. For example, the server device may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a method for controlling the operation of a RAID card of a disk array in an embodiment of the present application, and the processor 102 executes the computer program stored in the memory 104, thereby performing various functional applications and data processing, that is, implementing the method described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located with respect to the processor 102, which may be connected to the server device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of a server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as a NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
In this embodiment, a data backup method is provided, which is applied to a storage server, where the storage server is connected to a cloud server and a host server, the storage server includes a storage pool, and the storage pool includes a plurality of storage volumes, and fig. 2 is a flowchart of a data backup method according to an embodiment of the present application, as shown in fig. 2, and the flowchart includes the following steps:
Step S202, receiving a first data backup request sent by a host server;
Step S204, in the case that the first data backup request is determined to be used for requesting to execute the data backup operation on the data in the target storage volume, creating a first snapshot, wherein the target storage volume is any one of a plurality of storage volumes, and the first snapshot is used for indicating that the data block in the target storage volume is provided with an IO operation identifier when the input/output IO operation is executed;
Optionally, the storage server is configured to store data in a host server, and there is an IO operation between the host server and the storage server. The storage volume includes one or more data blocks therein, the data blocks for storing data.
Optionally, the IO operation identification is used to record which generation of snapshot the IO operation belongs to. For example, for storage volume a, when the first snapshot is not created, the IO operation identifier of all the IO operations received by storage volume a is 0. After the first snapshot is created for the first time, the snapshot is the 0 th generation snapshot, the corresponding data is the data in the data block with all IO operation identifiers of 0 in the storage volume A, and after the snapshot is created, the IO operation identifiers of all IO operations received by the storage volume A are added with 1 and become 1. After the first snapshot is created for the second time, the snapshot is the 1 st generation snapshot, the corresponding data is the data block data with all IO operation identifiers of 1 in the storage volume A, and after the snapshot is created, the IO operation identifiers of all IO operations received by the storage volume A are added with 1 and become 2.
Step S206, responding to a first data backup request, and reading first target data from a first target data block based on a first snapshot identification of the first snapshot, wherein the first target data block is at least one data block in a target storage volume, and a target IO operation identification of the first target data block is the same as the first snapshot identification;
In step S208, a data backup operation is performed on the first target data, so as to backup the first target data to the cloud server.
Alternatively, in the above data backup method, a typical application scenario may be envisaged, which involves an enterprise-level IT infrastructure, including a storage server, a cloud server, and a host server. The following is a detailed description of the method in practical application, in which the host server is an internal server of the enterprise for running critical business applications. The storage server manages a large number of storage volumes for storing traffic data. Cloud servers are remote storage facilities used by businesses for backup and disaster recovery. Enterprises need to regularly backup key business data to prevent data loss or to enable quick recovery when a system failure occurs. The host server sends a first data backup request to the storage server at a predetermined time or under a specific trigger condition. After receiving the first data backup request, the storage server determines the purpose of the first data backup request, creates a first snapshot for the specific target storage volume, and reads, from the target storage volume, first target data blocks matched with the snapshot identifier according to the first snapshot identifier of the first snapshot, wherein the first target data blocks may include first target data of files, database records or other key information. And finally, the storage server sends the read first target data to the cloud server for backup.
According to the method and the device for the data backup, under the condition that the first data backup request is used for requesting to execute data backup operation on data in the target storage volume, the first snapshot is created, the data blocks in the target storage volume are indicated to set IO operation identifiers when input/output IO operation is executed, the first target data blocks are searched from the target storage volume based on the first snapshot identifiers of the first snapshot in response to the first data backup request, first target data in the first target data blocks are read, the target IO operation identifiers of the first target data blocks are identical to the first snapshot identifiers, and finally data backup operation is executed on the first target data, and the first target data are backed up to the cloud server. According to the application, when cloud backup is carried out on the target storage volume, the IO operation identification is set to record which generation of snapshot relation each IO operation belongs to, and the target volume for the snapshot is not required to be additionally created, and all data exist in the target storage volume, so that the problem of resource waste in the related technology when data backup is carried out can be solved, and the effect of carrying out the data backup with low resource and low consumption is realized.
In an exemplary embodiment, before the first snapshot is created, the method further includes performing a mapping operation on the target storage volume to map the target storage volume to the host server, where the mapping operation includes sending a logical unit number of the target storage volume to the host server and instructing the host server to establish a connection with the target storage volume based on the logical unit number to allow the host server to access the target storage volume, receiving a first IO operation request sent by the host server, where the first IO operation request includes information including identification information of the target storage volume, address information of a first target data block, data information of the IO operation to be performed, and the IO operation identification, responding to the IO operation request, using the information included in the first operation request to establish a connection with the target storage volume to allow the host server to access the target storage volume, and receiving the first IO operation request including the identification information of the first target data block and performing the IO operation of the first target data block.
Alternatively, the identification information of the storage volume is used to inform the storage server of in which storage volume the data is stored, for example, the identification information of the storage volume is lun_id, which indicates that the data of the storage server is stored in the storage volume whose identification information is lun_id. The address information of the data block is used to specify where the data is stored on the storage volume, e.g., the address information of the data block is lba, which indicates where the data is stored on the storage volume at the address lba. The data information of the IO operation is used to specify the number of data bytes of the IO operation, for example, length, which is used to represent the length of the number of data bytes of the IO operation. As shown in FIG. 3, assuming a host server (e.g., a physical server or virtual machine running a Windows or Linux operating system) that needs to be linked to a storage volume for data read and write operations, including assuming that the Logical Unit Number (LUN) of the target storage volume is 1234, first, the volume management module in the storage server sends the logical unit number to the host server, after receiving the logical unit number, the host server establishes a link with the target storage volume according to the logical unit number, and configures a storage access path on the host server, e.g., in Linux, it may be necessary to create a device file (e.g., '/dev/sdX') to represent the target storage volume. After establishing a link with a target storage volume, the host server sends a first IO operation request to a volume management module in the storage server, informs the storage server that 8 bytes of data are to be written into a first target data block A with an address of '0 x 1000' on the target storage volume A in a storage pool by means of identification information of the target storage volume in the first IO operation request, address information of a first target data block-0 x1000, data information of IO operation to be executed and writing 8 bytes of data into the first target data block A, and then records a target IO operation identification 0 of the first target data block A of the target storage volume A by a snapshot module in the storage server.
The mapping operation and the IO operation request processing are performed before the data backup, so that the purpose of ensuring the smooth performance of the data backup operation and improving the performance of the storage host server and the safety of the data is achieved.
In an exemplary embodiment, after performing the IO operation on the first target data block by using the information included in the first IO operation request and recording the target IO operation identifier of the first target data block in response to the first IO operation request, the method further includes updating, in a case where it is determined that the IO operation performed on the first target data block is an initial IO operation, a first usage field of the first target data block to obtain a first target usage field, where the first usage field is set before receiving the IO operation request sent by the host server, and a field value of the first usage field is used to identify whether deletion of data in the first target data block is allowed.
Optionally, as shown in fig. 3, the cloud backup module in the storage server maintains a first usage field use_status for each data block in each storage volume, to indicate whether the data block in the database needs to be stored in a storage pool in the storage server, and deletes redundant data in the storage pool according to the first usage field. For example, the initial value of the first usage field may be set to 2, and the value of the first usage field is reduced by 1 when the data in the first target data block is backed up to the cloud server, and the value of the first usage field is reduced by 1 when the host server writes the data in the first target data block for the first time, and when the value is reduced to 0, it indicates that the cloud backup task and the IO operation of the host server no longer use the data of the first target data block, and at this time, the cloud backup module notifies the data deletion service to delete the data in the first target database.
According to the embodiment, the purpose of timely deleting useless data in the cloud backup process without occupying extra storage space for a long time and releasing the storage space is achieved by setting the service condition of the first use field marking data block.
In one exemplary embodiment, in the case that the first data backup request is determined to be for requesting to perform a data backup operation on data in a target storage volume, creating a first snapshot includes sending a snapshot instruction to the host server to instruct the host server to set the first snapshot identification to a second IO operation request and send the second IO operation request to the target storage volume in response to the snapshot instruction, determining the IO operation identification based on the first snapshot identification after performing the second IO operation in the first target data block in response to the second IO operation request, and setting the IO operation identification to the first target data block to create the first snapshot.
Optionally, assuming that cloud backup is to be performed on the target storage volume a, before performing first cloud backup, the storage server sends a snapshot instruction to the host server, and the host server sets the first snapshot identifier 0 in the IO operation request, where the IO operation identifiers of all the IO operations received by the target storage volume a are all 0. When cloud backup is performed, a first snapshot is created for the first time, the snapshot is a 0 th generation snapshot, corresponding data is data block data with all IO operation identifiers of 0 in the target storage volume A, and after the snapshot creation is completed, IO operation identifiers of all IO operations received by the target storage volume A are added with 1 and become 1. After the first snapshot is created for the second time, the snapshot is the 1 st generation snapshot, the corresponding data is the data block data with all IO operation identifiers of 1 in the target storage volume A, and after the snapshot is created, the IO operation identifiers of all IO operations received by the target storage volume A are added with 1 and become 2.
By creating the snapshot, the embodiment provides a flexible data backup strategy, and compared with the traditional full-volume backup, the snapshot technology reduces the requirement on storage resources and achieves the purpose of carrying out data backup with low resource consumption.
In an exemplary embodiment, reading first target data from a first target data block based on a first snapshot identifier of the first snapshot in response to the first data backup request includes receiving data acquisition indication information sent by the target storage volume, and in the case that the data acquisition indication information includes first indication information, searching, in response to the first data backup request, for an IO operation identifier matching the first snapshot identifier from the target storage volume to determine the first target data block, where the first indication information is used to indicate that only incremental data is allowed to be read from the first target data block, and reading the incremental data from the first target data block to obtain the first target data.
Optionally, the backup may be full-scale backup, or may be incremental backup, and the obtained first target data may be incremental data, or may be full-scale data, specifically, whether the obtained first target data is the incremental data or the full-scale data may be determined through the data obtaining indication information force_this_gen, and if the value is true, the obtained first target data is the incremental data. For example, assume that a third cloud backup is to be performed on a target storage volume a, where a data block a in which three IO operations are performed (first before the first cloud backup, second and third after the first cloud backup) is included, and a data block B in which an IO operation is performed after the first cloud backup. Since the data block a has performed three IO operations, the IO operation of the first IO operation is identified as 0, the IO operation of the second IO operation is identified as 1, the IO operation of the third IO operation is identified as 2, and the IO operation of the data block B is identified as 1. Because of the third cloud backup, the first snapshot identifier of the target storage volume a is 2, as shown in fig. 3, before the snapshot module acquires the data in the target storage volume a from the storage pool, the snapshot module receives the data acquisition indication information force_this_gen, which includes the first indication information true, and the snapshot module searches through the IO operation identifier of each data block in the target storage volume, and reads the first target data (incremental data) of the first IO operation of the first target data block a from the storage pool, where the IO operation identifier is the first target data block a of 2.
According to the embodiment, the data acquisition indication information is set to indicate whether the incremental data or the full data is acquired, so that the purpose of only backing up the data which changes since the last backup (namely the incremental data) instead of backing up the full data again and greatly reducing the required storage space is achieved.
In an exemplary embodiment, after receiving the data acquisition indication information sent by the target storage volume, the method further includes, in response to the first data backup request, searching, in the target storage volume, an IO operation identifier matching the first snapshot identifier to determine the first target data block, where the second indication information is used to indicate that reading of all data included in the first target data block is allowed, and reading all data from the first target data block to obtain the first target data.
Optionally, the backup may be full-scale backup, or may be incremental backup, and the obtained first target data may be incremental data, or may be full-scale data, specifically, whether the obtained first target data is the incremental data or the full-scale data may be determined through the data obtaining indication information force_this_gen, and if the obtained first target data is false, the obtained first target data is the full-scale data. For example, assume that a third cloud backup is to be performed on a target storage volume a, where a data block a in which three IO operations are performed (first before the first cloud backup, second and third after the first cloud backup) is included, and a data block B in which an IO operation is performed after the first cloud backup. Since the data block a has performed three IO operations, the IO operation of the first IO operation is identified as 0, the IO operation of the second IO operation is identified as 1, the IO operation of the third IO operation is identified as 2, and the IO operation of the data block B is identified as 1. Because of the third cloud backup, the first snapshot identifier of the target storage volume a is 2, as shown in fig. 3, before the snapshot module acquires the data in the target storage volume a from the storage pool, the snapshot module receives the data acquisition indication information force_this_gen and includes the first indication information false, the snapshot module searches through the IO operation identifier of each data block in the target storage volume, the first target data block a with the IO operation identifier of 2, and then the snapshot module sequentially reads the first target data of the third IO operation of the first target data block a, the first target data of the second IO operation of the first target data block a, and the first target data (full-volume data) of the first IO operation of the first target data block a from the storage pool.
According to the embodiment, the data acquisition indication information is set to indicate whether incremental data or full data is acquired, so that the purpose of backing up the full data is achieved.
In an exemplary embodiment, reading first target data from a first target data block based on a first snapshot identification of the first snapshot includes traversing the target storage volume based on an initial snapshot identification of the first snapshot, determining data blocks included in the target storage volume that perform the IO operation as the first target data block, where the initial snapshot identification is a snapshot identification sent to the host server for the first time, sending a first read command to the first target data block, and receiving the first target data sent by the first target data block in response to the first read command.
Optionally, assuming that the target storage volume a is to be subjected to the first cloud backup, the target storage volume a includes a data block a in which an IO operation is performed, a data block B in which an IO operation is not performed, and the IO operation identifier is 0 because the data block a is in the IO operation, and the data block B is not in the IO operation identifier. Because the initial snapshot identification of the target storage volume A is 0, the cloud backup module in the storage server sends a traversing instruction to the snapshot module in the storage server based on the initial snapshot identification 0, the snapshot module traverses the IO operation identification of each data block in the target storage volume to find a first target data block A with the IO operation identification of 0, then the snapshot module sends a first reading instruction to the first target data block A, acquires the first target data of the first target data block A from the storage pool, and sends the data to the cloud backup module in the storage server.
According to the embodiment, the backup data is acquired based on the snapshot identification, so that a flexible data backup strategy is provided, and compared with the traditional full-scale backup, the purpose of carrying out data backup with low resource consumption is achieved.
In an exemplary embodiment, in response to the first data backup request, reading first target data from a first target data block based on a first snapshot identifier of the first snapshot includes traversing the target storage volume based on the first snapshot identifier to determine the first target data block, searching the IO operation identifier matching the first snapshot identifier from the target storage volume to determine the first target data block, sending a second read instruction to the first target data block, and receiving the first target data sent by the first target data block in response to the second read instruction.
Alternatively, assuming that the target storage volume a is to be subjected to the second cloud backup, the target storage volume a includes a data block a in which the IO operation is performed twice (the first time before the first cloud backup and the second time after the first cloud backup), a data block B in which the IO operation is performed after the first cloud backup, and since the data block a is performed twice, the IO operation of the first IO operation is identified as 0, the IO operation of the second IO operation is identified as 1, and the IO operation of the data block B is identified as 1. Because the cloud backup is performed for the second time, the first snapshot identifier of the target storage volume A is 1, the cloud backup module in the storage server sends a traversing instruction to the snapshot module in the storage server based on the first snapshot identifier 1, the snapshot module traverses the IO operation identifier of each data block in the target storage volume for searching, the first target data block A and the first target data block B with the IO operation identifier of 1, then the snapshot module sends a second reading instruction to the first target data block A and the first target data block B, obtains first target data of the first target data block A for the second IO operation and first target data of the first target data block B for the first IO operation from the storage pool, and sends the data to the cloud backup module in the storage server.
By creating the snapshot, the embodiment provides a flexible data backup strategy, and achieves the purpose of carrying out data backup with low resource consumption.
In one exemplary embodiment, performing the data backup operation on the first target data to backup the first target data to the cloud server includes invoking a data backup interface in the cloud server, wherein the data backup interface only allows transmission of the first target data read from the first target data block, and uploading the first target data to the cloud server through the data backup interface to backup the first target data in the cloud server.
Optionally, as shown in fig. 3, after the cloud backup module obtains the first target data, the cloud backup module backs up the first target data to the cloud server by calling a data backup interface provided by the cloud server. The embodiment achieves the aim of ensuring the safety of data in the transmission process by calling the data backup interface in the cloud server.
In an exemplary embodiment, after performing the data backup operation on the first target data to backup the first target data to the cloud server, the method further includes updating a second usage field of the first target data block to obtain a second target usage field, where the second usage field is set when the first target data block performs the IO operation, a field value of the second usage field is used to identify whether to allow deletion of data in the first target data block, and deleting the first target data to release a storage space of the first target data block if the field value of the second target usage field is a target field value.
Optionally, as shown in fig. 3, the cloud backup module in the storage server maintains a second usage field use_status for each data block in each storage volume, to indicate whether the data block in the database needs to be stored in a storage pool in the storage server, and deletes redundant data in the storage pool according to the second usage field. For example, the initial value of the first usage field of the first target data block a is 2, when the host server writes data in the first target data block for the first time, the value of the first usage field is subtracted by 1 to obtain the value of the second usage field is 1, when the data in the first target data block is backed up to the cloud server, the value of the second usage field is subtracted by 1, and the second usage field becomes 0 to indicate that the cloud backup task and the IO operation of the host server no longer use the data of the first target data block a, and at this time, the cloud backup module notifies the data reclamation service to delete the data in the first target data block a. According to the embodiment, the purpose of timely deleting useless data in the cloud backup process without occupying extra storage space for a long time and releasing the storage space is achieved by setting the service condition of the first use field marking data block.
In an exemplary embodiment, the storage server further includes a data deletion service, and after the data backup operation is performed on the first target data to backup the first target data to the cloud server, the method further includes traversing the target storage volume, searching for second target data from the target storage volume, where the second target data is data that is not backed up to the cloud server in the target storage volume, and invoking the data deletion service to perform a deletion operation on the second target data through the data deletion service.
Optionally, the storage server is prevented from having data which is backed up to other devices without creating the first snapshot, so that after cloud backup, the data backed up to other devices in the target storage volume is searched in time, and the expired data is deleted. For example, assuming that the target storage volume a includes first target data a backed up in the cloud server and second target data B backed up to the backup server, after the first target data a is backed up to the cloud server, the storage server traverses the target storage volume, finds second target data B that is not backed up to the cloud server but is backed up to the backup server, and the storage service invokes the data deletion service to delete the second target data B. According to the embodiment, the data which is not backed up to the cloud server but is backed up to other servers is deleted, so that the storage space is released, and the purposes of optimizing the use of storage resources and reducing the storage cost are achieved.
The application is illustrated below with reference to specific examples:
in this embodiment, fig. 4 is a flowchart of a data backup method according to an embodiment of the present application, as shown in fig. 4, specifically including the following steps:
S402, assuming that the Logical Unit Number (LUN) of the target storage volume a is 1234, as shown in fig. 3, the volume management module in the storage server first sends the logical unit number to the host server, and after receiving the logical unit number, the host server establishes a link with the target storage volume according to the logical unit number, and configures a storage access path on the host server. After establishing a link with the target storage volume a, the host server sends a first IO operation request to a volume management module in the storage server, informs the storage server that 8 bytes of data are to be written into a first target data block a with an address of '0x 1000' on the target storage volume a in a storage pool and 4 bytes of data are to be written into the first target data block B with an address of '0x 1000' through identification information of the target storage volume in the first IO operation request, address information of the first target data block, namely-0 x1000 and-0 x2000, of the target storage volume a, and data of the first target data block B is written into the first target data block B, then a snapshot module in the storage server records a target IO operation identification 0 of the first target data block a of the target storage volume a and a target IO operation identification 0 of the first target data block B, and then a cloud backup module in the storage server updates a first usage field of the first target data block a from 2 to 1, and a first usage field of the first target data block B from 2 to 1 is obtained. Starting cloud backup;
in S404, as shown in fig. 3, the cloud backup module responds to the first data backup request directly triggered by the host server or the user, and creates the first snapshot identifier of the target storage volume a through the snapshot module, and the first snapshot identifier is 0 because the cloud backup is performed for the first time.
In the process, the storage server receives a first IO operation request sent by the host server again, informs the storage server that 1 byte of data is to be written into a first target data block A with an address of '0 x 1000' on a target storage volume A in a storage pool by means of identification information of a target storage volume in the first IO operation request, address information of a first target data block-0 x1000, data information of IO operation to be executed and data written in 1 byte, and then records a target IO operation identification 1 and a first use field 1 of the first target data block A of the target storage volume A by a snapshot module in the storage server;
S406, before the snapshot module acquires the data in the target storage volume A from the storage pool, the snapshot module receives the data acquisition indication information force_this_gen including the first indication information true, and traverses the IO operation identifier of each data block in the target storage volume to find out the first target data block A and the second target data block B with the IO operation identifier of 0, and then the snapshot module sequentially reads the first target data in the first target data block A, B from the storage pool. And uploading the first target data to a cloud backup module.
In the process, the cloud backup module responds to a first data backup request directly triggered by a host server or a user again, a first snapshot identifier of the target storage volume A is created through the snapshot module, the first snapshot identifier is 1 because of carrying out cloud backup for the second time, the snapshot module traverses the IO operation identifier of each data block in the target storage volume to find a first target data block A with the IO operation identifier of 1, and then the snapshot module reads first target data of the second IO operation in the first target data block A from the storage pool. The first target data is uploaded to a cloud backup module;
s408, the cloud backup module backs up the first target data to the cloud server, updates the second usage fields of the first target data block A and the second target data block B from 1 to 0 to obtain the second target usage fields, and notifies the data deletion service to delete the first target data in the first target data block A and the second target data block B in the storage pool, and recovers the storage space;
and S410, ending cloud backup.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiment also provides a data backup device, which is applied to a system on chip and applied to a storage server, wherein the storage server is respectively connected with a cloud server and a host server, the storage server comprises a storage pool, and the storage pool comprises a plurality of storage volumes. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 5 is a block diagram of a data backup apparatus according to an embodiment of the present application, as shown in fig. 5, the apparatus includes:
a first receiving module 502, configured to receive a first data backup request sent by the host server;
A first creating module 504, configured to create a first snapshot, where the first data backup request is determined to be for requesting to perform a data backup operation on data in a target storage volume, and the target storage volume is any one of the storage volumes, and the first snapshot is used to instruct a data block in the target storage volume to set an IO operation identifier when performing an input/output IO operation;
a first response module 506, configured to respond to the first data backup request, and read first target data from a first target data block based on a first snapshot identifier of the first snapshot, where the first target data block is at least one data block in the target storage volume, and a target IO operation identifier of the first target data block is the same as the first snapshot identifier;
and the first backup module 508 is configured to perform the data backup operation on the first target data, so as to backup the first target data to the cloud server.
In an exemplary embodiment, the device further comprises a first mapping module, configured to perform a mapping operation on the target storage volume to map the target storage volume to the host server before creating the first snapshot, where the mapping operation includes sending a logical unit number of the target storage volume to the host server and instructing the host server to establish a connection with the target storage volume based on the logical unit number to allow the host server to access the target storage volume, and a second receiving module, configured to receive a first IO operation request sent by the host server, where the first IO operation request includes identification information of the target storage volume, address information of a first target data block, data information of the IO operation to be performed, and the IO operation identifier, and a second response module, configured to record the first IO operation request for the target data block and perform the IO operation on the target data block using the first IO operation block included in the first IO operation request.
In an exemplary embodiment, the apparatus further includes a first update module, configured to respond to the first IO operation request, perform the IO operation on the first target data block using the information included in the first IO operation request, record the target IO operation identifier of the first target data block, and update, after determining that the IO operation performed on the first target data block is an initial IO operation, a first usage field of the first target data block to obtain a first target usage field, where a field value of the first usage field is set before receiving the IO operation request sent by the host server, where the field value of the first usage field is used to identify whether to allow deletion of data in the first target data block.
In an exemplary embodiment, the first creation module includes a first sending submodule, configured to send a snapshot instruction to the host server to instruct the host server to set the first snapshot identifier to a second IO operation request and send the second IO operation request to the target storage volume, and a first response submodule, configured to determine the IO operation identifier based on the first snapshot identifier after the second IO operation is performed in the first target data block and set the IO operation identifier to the first target data block to create the first snapshot in response to the second IO operation request.
In an exemplary embodiment, the first response module includes a first receiving sub-module configured to receive data acquisition indication information sent by the target storage volume, a second response sub-module configured to, in response to the first data backup request when the data acquisition indication information includes first indication information, search for an IO operation identifier matching the first snapshot identifier from the target storage volume to determine the first target data block, where the first indication information is configured to indicate that only incremental data is allowed to be read from the first target data block, and a first reading sub-module configured to read the incremental data from the first target data block to obtain the first target data.
In an exemplary embodiment, the first response module further includes a third response sub-module, configured to, after the data acquisition indication information sent by the target storage volume includes second indication information, search, in response to the first data backup request, an IO operation identifier that matches the first snapshot identifier from the target storage volume to determine the first target data block, where the second indication information is used to indicate that reading of all data included in the first target data block is allowed, and a second reading sub-module, configured to read all data from the first target data block, and obtain the first target data.
In an exemplary embodiment, the first response module includes a first traversing sub-module configured to traverse the target storage volume based on an initial snapshot identifier of the first snapshot, and determine data blocks included in the target storage volume that perform the IO operation as the first target data blocks, where the initial snapshot identifier is a snapshot identifier sent to the host server for the first time, send a first read command to the first target data blocks, and a second receiving sub-module configured to receive the first target data sent by the first target data blocks in response to the first read command.
In an exemplary embodiment, the first response module includes a second traversing sub-module configured to traverse the target storage volume based on the first snapshot identifier to find an IO operation identifier matching the first snapshot identifier from the target storage volume to determine the first target data block, send a second read instruction to the first target data block, and a third receiving sub-module configured to receive the first target data sent by the first target data block in response to the second read instruction, where the first data backup request is another backup request.
In an exemplary embodiment, the first backup module includes a first calling sub-module configured to call a data backup interface in the cloud server, where the data backup interface only allows transmission of the first target data read from the first target data block, and a first uploading sub-module configured to upload the first target data to the cloud server through the data backup interface to backup the first target data in the cloud server.
In an exemplary embodiment, the device further includes a second updating module configured to perform the data backup operation on the first target data, so as to update a second usage field of the first target data block after the first target data is backed up to the cloud server, to obtain a second target usage field, where the second usage field is set when the first target data block performs the IO operation, and a field value of the second usage field is used to identify whether to allow deletion of data in the first target data block, and a first deleting module configured to delete the first target data when a field value of the second target usage field is a target field value, so as to release a storage space of the first target data block.
In an exemplary embodiment, the storage server further includes a data deletion service, and the apparatus further includes a second traversing module configured to perform the data backup operation on the first target data, so as to traverse the target storage volume after the first target data is backed up to the cloud server, and find second target data from the target storage volume, where the second target data is data that is not backed up to the cloud server in the target storage volume, and a first calling module configured to call the data deletion service, so as to perform a deletion operation on the second target data through the data deletion service.
According to yet another embodiment of the present application, there is further provided a storage server, where the storage server is connected to a cloud server and a host server, respectively, and where the storage server includes a storage pool, where the storage pool includes a plurality of storage volumes, where the storage server is configured to perform the steps in any of the method embodiments described above at runtime.
According to a further embodiment of the present application, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
It should be noted that each of the above modules may be implemented by software or hardware, and the latter may be implemented by, but not limited to, the above modules all being located in the same processor, or each of the above modules being located in different processors in any combination.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
In an exemplary embodiment, the computer readable storage medium may include, but is not limited to, a U disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, etc. various media in which a computer program may be stored.
An embodiment of the application also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In an exemplary embodiment, the electronic device may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Embodiments of the application also provide a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the method embodiments described above.
Embodiments of the present application also provide another computer program product comprising a non-volatile computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of any of the method embodiments described above.
Embodiments of the present application also provide a computer program comprising computer instructions stored on a computer-readable storage medium, a processor of a computer device reading the computer instructions from the computer-readable storage medium, and a burial executing the computer instructions to cause the computer device to perform the steps of any of the method embodiments described above.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application should be included in the protection scope of the present application.

Claims (15)

1. The data backup method is characterized by being applied to a storage server, wherein the storage server is respectively connected with a cloud server and a host server, the storage server comprises a storage pool, the storage pool comprises a plurality of storage volumes, and the method comprises the following steps:
Receiving a first data backup request sent by the host server;
Creating a first snapshot in case that the first data backup request is used for requesting to execute a data backup operation on data in a target storage volume, wherein the target storage volume is any one of a plurality of storage volumes, the first snapshot is used for indicating a data block in the target storage volume to set an IO operation identifier when an input/output IO operation is executed, and the IO operation identifier is used for identifying the first snapshot to which the IO operation belongs;
Reading first target data from a first target data block based on a first snapshot identifier of the first snapshot, wherein the first target data block is at least one data block in the target storage volume, a target IO operation identifier of the first target data block is identical to the first snapshot identifier, the first snapshot identifier is used for describing that the target storage volume receives the first data backup request, the number of times of creating the first snapshot, and the target IO operation identifier is used for identifying the first snapshot to which the IO operation of the first target data block belongs;
and executing the data backup operation on the first target data so as to backup the first target data into the cloud server.
2. The method of claim 1, wherein, in the event that the first data backup request is determined to be for requesting a data backup operation to be performed on data in a target storage volume, prior to creating the first snapshot, the method further comprises:
performing a mapping operation on the target storage volume to map the target storage volume to the host server, wherein the mapping operation comprises sending a logical unit number of the target storage volume to the host server and instructing the host server to establish a connection with the target storage volume based on the logical unit number to allow the host server to access the target storage volume;
Receiving a first IO operation request sent by the host server, wherein the first IO operation request comprises the following information, namely the identification information of the target storage volume, the address information of the first target data block, the data information of the IO operation to be executed and the IO operation identifier;
And responding to the first IO operation request, executing the IO operation on the first target data block by utilizing the information included in the first IO operation request, and recording the target IO operation identification of the first target data block.
3. The method of claim 2, wherein in response to the first IO operation request, after performing the IO operation on the first target data block using the information included in the first IO operation request and recording the target IO operation identification of the first target data block, the method further comprises:
And under the condition that the IO operation executed on the first target data block is an initial IO operation, updating a first use field of the first target data block to obtain a first target use field, wherein the first use field is set before receiving an IO operation request sent by the host server, and a field value of the first use field is used for identifying whether to allow deleting data in the first target data block.
4. The method of claim 1, wherein creating the first snapshot in the event that the first data backup request is determined to be for requesting a data backup operation to be performed on data in the target storage volume comprises:
sending a snapshot instruction to the host server to instruct the host server to perform the following operations: responding to the snapshot instruction, setting the first snapshot identification into a second IO operation request, and sending the second IO operation request to the target storage volume;
And responding to the second IO operation request, determining the IO operation identification based on the first snapshot identification after the second IO operation is executed in the first target data block, and setting the IO operation identification into the first target data block so as to create the first snapshot.
5. The method of claim 1, wherein in response to the first data backup request, reading first target data from a first target data block based on a first snapshot identification of the first snapshot comprises:
Receiving data acquisition indication information sent by the target storage volume;
in the case that the data acquisition indication information comprises first indication information, responding to the first data backup request, and searching an IO operation identifier matched with the first snapshot identifier from the target storage volume to determine the first target data block, wherein the first indication information is used for indicating that only incremental data is allowed to be read from the first target data block;
And reading the incremental data from the first target data block to obtain the first target data.
6. The method of claim 5, wherein after receiving the data acquisition indication information sent by the target storage volume, the method further comprises:
searching an IO operation identifier matched with the first snapshot identifier from the target storage volume in response to the first data backup request under the condition that second indication information is included in the data acquisition indication information so as to determine the first target data block, wherein the second indication information is used for indicating that reading of all data included in the first target data block is allowed;
And reading all the data from the first target data block to obtain the first target data.
7. The method of claim 1 or 5, wherein, in response to the first data backup request, reading first target data from a first target data block based on a first snapshot identification of the first snapshot, comprises:
traversing the target storage volume based on an initial snapshot identification of the first snapshot under the condition that the first data backup request is a first backup request, and determining data blocks for executing the IO operation, which are included in the target storage volume, as the first target data blocks, wherein the initial snapshot identification is a snapshot identification sent to the host server for the first time;
sending a first read instruction to the first target data block;
and receiving the first target data sent by the first target data block in response to the first reading instruction.
8. The method of claim 1 or 5, wherein, in response to the first data backup request, reading first target data from a first target data block based on a first snapshot identification of the first snapshot, comprises:
Traversing the target storage volume based on the first snapshot identification under the condition that the first data backup request is other backup requests, and searching an IO operation identification matched with the first snapshot identification from the target storage volume to determine the first target data block;
Sending a second read instruction to the first target data block;
And receiving the first target data sent by the first target data block in response to the second reading instruction.
9. The method of claim 1, wherein performing the data backup operation on the first target data to backup the first target data into the cloud server comprises:
invoking a data backup interface in the cloud server, wherein the data backup interface only allows transmission of the first target data read from the first target data block;
and uploading the first target data to the cloud server through the data backup interface so as to backup the first target data in the cloud server.
10. The method of claim 1, wherein after performing the data backup operation on the first target data to backup the first target data into the cloud server, the method further comprises:
updating a second usage field of the first target data block to obtain a second target usage field, wherein the second usage field is set when the first target data block executes the IO operation, and a field value of the second usage field is used for identifying whether to allow deleting the data in the first target data block;
and deleting the first target data to release the storage space of the first target data block under the condition that the field value of the second target use field is a target field value.
11. The method of claim 1, wherein the storage server further comprises a data deletion service, wherein after performing the data backup operation on the first target data to backup the first target data to the cloud server, the method further comprises:
traversing the target storage volume, and searching second target data from the target storage volume, wherein the second target data is data which is not backed up to the cloud server in the target storage volume;
and calling the data deleting service to execute deleting operation on the second target data through the data deleting service.
12. A data backup device, applied to a storage server, where the storage server is connected to a cloud server and a host server, the storage server includes a storage pool, and the storage pool includes a plurality of storage volumes, and the device includes:
The first receiving module is used for receiving a first data backup request sent by the host server;
A first creating module, configured to create a first snapshot if it is determined that the first data backup request is for requesting to perform a data backup operation on data in a target storage volume, where the target storage volume is any one of a plurality of storage volumes, and the first snapshot is configured to instruct a data block in the target storage volume to set an IO operation identifier when performing an input/output IO operation, and the IO operation identifier is configured to identify the first snapshot to which the IO operation belongs;
a first response module, configured to respond to the first data backup request, and read first target data from a first target data block based on a first snapshot identifier of the first snapshot, where the first target data block is at least one data block in the target storage volume, a target IO operation identifier of the first target data block is the same as the first snapshot identifier, the first snapshot identifier is used to describe that the target storage volume receives the first data backup request, and create a number of times of the first snapshot, and the target IO operation identifier is used to identify the first snapshot to which the IO operation of the first target data block belongs;
and the first backup module is used for executing the data backup operation on the first target data so as to backup the first target data to the cloud server.
13. A storage server, wherein the storage server is connected to a cloud server and a host server, respectively, and the storage server includes a storage pool, and the storage pool includes a plurality of storage volumes, and the storage server is configured to perform the steps of the method as claimed in any one of claims 1 to 11.
14. A computer readable storage medium, characterized in that a computer program is stored in the computer readable storage medium, wherein the computer program, when being executed by a processor, implements the steps of the method according to any of the claims 1 to 11.
15. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any one of claims 1 to 11 when the computer program is executed.
CN202411307879.4A 2024-09-19 2024-09-19 Data backup method and device, storage medium, and electronic device Active CN118819967B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411307879.4A CN118819967B (en) 2024-09-19 2024-09-19 Data backup method and device, storage medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411307879.4A CN118819967B (en) 2024-09-19 2024-09-19 Data backup method and device, storage medium, and electronic device

Publications (2)

Publication Number Publication Date
CN118819967A CN118819967A (en) 2024-10-22
CN118819967B true CN118819967B (en) 2025-01-28

Family

ID=93079178

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411307879.4A Active CN118819967B (en) 2024-09-19 2024-09-19 Data backup method and device, storage medium, and electronic device

Country Status (1)

Country Link
CN (1) CN118819967B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297007A (en) * 2021-02-08 2021-08-24 阿里巴巴集团控股有限公司 Data processing method and device
CN114328018A (en) * 2021-12-28 2022-04-12 阿里巴巴(中国)有限公司 Snapshot creating method, computing device and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115344428A (en) * 2022-08-12 2022-11-15 广州鼎甲计算机科技有限公司 Data processing method, data processing apparatus, computer device, storage medium, and program product
CN118244984A (en) * 2024-03-27 2024-06-25 苏州元脑智能科技有限公司 Snapshot implementation method and device, electronic equipment and medium
CN118152189A (en) * 2024-03-29 2024-06-07 济南浪潮数据技术有限公司 Volume data backup method, device, electronic device and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297007A (en) * 2021-02-08 2021-08-24 阿里巴巴集团控股有限公司 Data processing method and device
CN114328018A (en) * 2021-12-28 2022-04-12 阿里巴巴(中国)有限公司 Snapshot creating method, computing device and storage medium

Also Published As

Publication number Publication date
CN118819967A (en) 2024-10-22

Similar Documents

Publication Publication Date Title
US12197758B2 (en) Distributed object replication architecture
US11010240B2 (en) Tracking status and restarting distributed replication
US11327799B2 (en) Dynamic allocation of worker nodes for distributed replication
US11349915B2 (en) Distributed replication and deduplication of an object from a source site to a destination site
CN103473277B (en) The Snapshot Method and device of file system
US11397538B2 (en) Data migration method and apparatus
US20120150930A1 (en) Cloud storage and method for managing the same
US10620871B1 (en) Storage scheme for a distributed storage system
CN112035062B (en) Migration method of local storage of cloud computing, computer equipment and storage medium
CN107133132B (en) Data sending method, data receiving method and storage device
US9817719B2 (en) Efficient Flashcopy backup and mount, clone, or restore collision avoidance using dynamic volume allocation with reuse and from a shared resource pool
US20070101097A1 (en) Method of inheriting information identifying virtual volume and storage system using the same
CN110659259A (en) Database migration method, server and computer storage medium
JP2003330782A (en) Computer system
US20150286429A1 (en) Efficient flashcopy backup and mount, clone, or restore collision avoidance using dynamic volume allocation with reuse
CN109324931B (en) The method of realizing vmware mount recovery in the data deduplication system
CN115729463A (en) Method, system and related device for data migration
CN118819967B (en) Data backup method and device, storage medium, and electronic device
US20150286430A1 (en) Efficient flashcopy backup and mount, clone, or restore collision avoidance using dynamic volume allocation from a shared resource pool
US11188248B2 (en) System and method to achieve an uninterrupted file level backup using a pass-through snapshot engine
CN117149094B (en) Method and device for determining data area state, disk array and storage system
US20210248108A1 (en) Asynchronous data synchronization and reconciliation
CN110704249A (en) Method, device and system for ensuring application consistency
US10848405B2 (en) Reporting progress of operation executing on unreachable host
CN114722261A (en) A resource processing method, device, electronic device and storage medium

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