Data backup method and device, storage medium, and electronic device
By creating expressions in the storage server and setting the IO operation logo, data backup is directly in the target storage volume, the problem of data backup resources in the existing technology is solved, and low resources and efficient data backup effects are achieved.
Patent Information
- Application Number
- CN202411307879.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-09-19
AI Technical Summary
The prior art has problems with resource waste when performing data backups, especially in the case of multiple storage volumes, where additional target volumes and bitmaps create additional input/output effects on storage volumes.
By creating a snapshot in the storage server, the data block in the target storage volume is set to set the IO operation identification when the input/output IO operation is set to avoid creating the additional target volume and bitmap, and the data backup is directly in the target storage volume.
The effect of low resources and low -cost data, avoiding waste of resources, and improving the efficiency and security of data backup.
Smart Images

Figure CN118819967B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the computer field, and specifically, to a data backup method and device, a storage medium, and an electronic device. Background Art
[0002] Cloud backup is a point-in-time data protection technology that transfers the data of the storage volume in the storage device to the public cloud or private cloud for backup. When the local storage device fails, the data can be downloaded from the cloud to the local to achieve data recovery and avoid data loss. At present, cloud backup is mostly achieved through snapshot technology, but traditional snapshot technology requires creating an additional target volume for the storage volume and managing the copy of the snapshot data through a bitmap. Therefore, the more storage volumes used for cloud backup, the more additional target volumes are created, the more bitmaps are created, and the greater the impact of the copy operation on the input / output (IO) of the storage volume, there are problems of occupying space and wasting resources. Summary of the invention
[0003] The embodiments of the present application provide a data backup method and device, a storage medium, and an electronic device to at least solve the problem of resource waste when performing data backup in the related art.
[0004] According to an embodiment of the present application, a data backup method is provided, which is applied to a storage server, wherein the storage server is connected to a cloud server and a host server respectively, wherein the storage server includes a storage pool, wherein the storage pool includes multiple storage volumes, and wherein the method includes: receiving a first data backup request sent by the host server; creating a first snapshot upon determining that the first data backup request is for requesting a data backup operation to be performed on data in a target storage volume, wherein the target storage volume is any one of the multiple storage volumes, and the first snapshot is used to indicate that an IO operation identifier is set for a data block in the target storage volume when an input / output IO operation is performed; 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, wherein the first target data block is at least one data block in the target storage volume, and the target IO operation identifier of the first target data block is the same as the first snapshot identifier; performing the data backup operation on the first target data to back up the first target data to the cloud server.
[0005] In an exemplary embodiment, when it is determined that the first data backup request is for requesting to perform a data backup operation on the data in the target storage volume, before creating the first snapshot, the method further includes: performing a mapping operation on the target storage volume to map the target storage volume to the host server, wherein the mapping operation includes: sending the 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 includes the following information: identification information of the target storage volume, address information of the first target data block, data information on which the IO operation is to be performed, and the IO operation identifier; responding to the IO operation request, 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 identifier of the first target data block.
[0006] In an exemplary embodiment, in response to the above-mentioned first IO operation request, after performing the above-mentioned IO operation on the above-mentioned first target data block using the above-mentioned information included in the above-mentioned first IO operation request and recording the above-mentioned target IO operation identifier of the above-mentioned first target data block, the above-mentioned method also includes: when it is determined that the above-mentioned IO operation performed on the above-mentioned first target data block is an initial IO operation, updating the first usage field of the above-mentioned first target data block to obtain a first target usage field, wherein the above-mentioned first usage field is set before receiving the IO operation request sent by the above-mentioned host server, and the field value of the above-mentioned first usage field is used to identify whether deletion of data in the above-mentioned first target data block is allowed.
[0007] In an exemplary embodiment, when it is determined that the first data backup request is for requesting to perform a data backup operation on data in the target storage volume, creating a first snapshot includes: sending a snapshot instruction to the host server to instruct the host server to perform the following operations: in response to the snapshot instruction, setting the first snapshot identifier to the second IO operation request, and sending the second IO operation request to the target storage volume; in response to the second IO operation request, after performing the second IO operation in the first target data block, determining the IO operation identifier based on the first snapshot identifier, and setting the IO operation identifier to the first target data block to create the first snapshot.
[0008] In an exemplary embodiment, in response to the first data backup request, the first target data is read from the first target data block based on the first snapshot identifier of the first snapshot, including: receiving data acquisition indication information sent by the target storage volume; in a case where the data acquisition indication information includes the first indication information, in response to the first data backup request, searching from the target storage volume for an IO operation identifier that matches the first snapshot identifier to determine the first target data block, wherein 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.
[0009] In an exemplary embodiment, after receiving the data acquisition indication information sent by the above-mentioned target storage volume, the above-mentioned method also includes: in a case where the above-mentioned data acquisition indication information includes second indication information, in response to the above-mentioned first data backup request, searching the above-mentioned target storage volume for an IO operation identifier that matches the above-mentioned first snapshot identifier to determine the above-mentioned first target data block, wherein the above-mentioned second indication information is used to indicate that reading all the data included in the above-mentioned first target data block is allowed; and reading all the above-mentioned data from the above-mentioned first target data block to obtain the above-mentioned first target data.
[0010] In an exemplary embodiment, the first target data is read from the first target data block based on the first snapshot identifier of the first snapshot, including: in a case where the first data backup request is the first backup request, based on the initial snapshot identifier of the first snapshot, traversing the target storage volume, determining all data blocks included in the target storage volume that perform the IO operation as the first target data blocks, wherein the initial snapshot identifier is a snapshot identifier 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 read instruction.
[0011] In an exemplary embodiment, in response to the first data backup request, the first target data is read from the first target data block based on the first snapshot identifier of the first snapshot, including: in the case where the first data backup request is other backup requests, based on the first snapshot identifier, traversing the target storage volume, searching the target storage volume for an IO operation identifier that matches the first snapshot identifier 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.
[0012] In an exemplary embodiment, the data backup operation is performed on the first target data to back up the first target data to the cloud server, including: calling a data backup interface in the cloud server, wherein the data backup interface only allows the transmission of the first target data read from the first target data block; uploading the first target data to the cloud server through the data backup interface to back up the first target data in the cloud server.
[0013] In an exemplary embodiment, after performing the data backup operation on the first target data to back up the first target data to the cloud server, the method further includes: updating the 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 performs the IO operation, and the field value of the second usage field is used to identify whether deletion of the data in the first target data block is allowed; when the field value of the second target usage field is the target field value, deleting the first target data to release storage space of the first target data block.
[0014] In an exemplary embodiment, the storage server also includes a data deletion service. After performing the data backup operation on the first target data to back up the first target data to the cloud server, the method further includes: traversing the target storage volume to search for the second target data from the target storage volume, wherein the second target data is the data in the target storage volume that has not been backed up to the cloud server; and calling the data deletion service to perform a deletion operation on the second target data through the data deletion service.
[0015] According to another embodiment of the present application, a data backup device is provided, which is applied to a storage server, wherein the storage server is connected to a cloud server and a host server respectively, wherein the storage server includes a storage pool, wherein the storage pool includes multiple storage volumes, and wherein the device includes: a first receiving module, which is used to receive a first data backup request sent by the host server; a first creating module, which is used to create a first snapshot when it is determined that the first data backup request is used to request to perform a data backup operation on data in a target storage volume, wherein the target storage volume is any storage volume among the multiple storage volumes, and the first snapshot is used to indicate that an IO operation identifier is set for a data block in the target storage volume when an input / output IO operation is performed; a first responding module, which is used 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, wherein the first target data block is at least one data block in the target storage volume, and the target IO operation identifier of the first target data block is the same as the first snapshot identifier; and a first backup module, which is used to perform the data backup operation on the first target data to back up the first target data to the cloud server.
[0016] In an exemplary embodiment, the device further includes: a first mapping module, which is used to perform a mapping operation on the target storage volume before creating the first snapshot when it is determined that the first data backup request is for requesting to perform a data backup operation on the data in the target storage volume, so as to map the target storage volume to the host server, wherein the mapping operation includes: sending the 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; a second receiving module, which is used to receive a first IO operation request sent by the host server, wherein the first IO operation request includes the following information: identification information of the target storage volume, address information of the first target data block, data information of the IO operation to be performed, and the IO operation identifier; a second response module, which is used to respond to the IO operation request, perform the IO operation on the first target data block using the information included in the first IO operation request, and record the target IO operation identifier of the first target data block.
[0017] In an exemplary embodiment, the above-mentioned device also includes: a first update module, which is used to respond to the above-mentioned first IO operation request, perform the above-mentioned IO operation on the above-mentioned first target data block using the above-mentioned information included in the above-mentioned first IO operation request, and record the above-mentioned target IO operation identifier of the above-mentioned first target data block, and then, when it is determined that the above-mentioned IO operation performed on the above-mentioned first target data block is an initial IO operation, update the first usage field of the above-mentioned first target data block to obtain the first target usage field, wherein the above-mentioned first usage field is set before receiving the IO operation request sent by the above-mentioned host server, and the field value of the above-mentioned first usage field is used to identify whether deletion of data in the above-mentioned first target data block is allowed.
[0018] In an exemplary embodiment, the first creation module includes: a first sending submodule, used to send a snapshot instruction to the host server to instruct the host server to perform the following operations: in response to the snapshot instruction, set the first snapshot identifier to the second IO operation request, and send the second IO operation request to the target storage volume; a first responding submodule, used to respond to the second IO operation request, after performing the second IO operation in the first target data block, determine the IO operation identifier based on the first snapshot identifier, and set the IO operation identifier to the first target data block to create the first snapshot.
[0019] In an exemplary embodiment, the above-mentioned first response module includes: a first receiving submodule, used to receive the data acquisition indication information sent by the above-mentioned target storage volume; a second response submodule, used to respond to the above-mentioned first data backup request when the above-mentioned data acquisition indication information includes the first indication information, and search the above-mentioned target storage volume for an IO operation identifier that matches the above-mentioned first snapshot identifier to determine the above-mentioned first target data block, wherein the above-mentioned first indication information is used to indicate that only incremental data is allowed to be read from the above-mentioned first target data block; a first reading submodule, used to read the above-mentioned incremental data from the above-mentioned first target data block to obtain the above-mentioned first target data.
[0020] In an exemplary embodiment, the first response module further includes: a third response submodule, which is used to respond to the first data backup request after the target storage volume sends the data acquisition indication information, and in the case where the data acquisition indication information includes the second indication information, searches the target storage volume for an IO operation identifier that matches the first snapshot identifier to determine the first target data block, wherein the second indication information is used to indicate that reading all the data included in the first target data block is allowed; and a second reading submodule, which is used to read all the data from the first target data block to obtain the first target data.
[0021] In an exemplary embodiment, the first response module includes: a first traversal submodule, which is used to traverse the target storage volume based on the initial snapshot identifier of the first snapshot when the first data backup request is the first backup request, and determine all data blocks included in the target storage volume that perform the IO operation as the first target data blocks, wherein the initial snapshot identifier is the snapshot identifier sent to the host server for the first time; send a first read instruction to the first target data block; and a second receiving submodule, which is used to receive the first target data sent by the first target data block in response to the first read instruction.
[0022] In an exemplary embodiment, the above-mentioned first response module includes: a second traversal sub-module, which is used to traverse the above-mentioned target storage volume based on the above-mentioned first snapshot identifier when the above-mentioned first data backup request is other backup requests, and search the above-mentioned target storage volume for an IO operation identifier that matches the above-mentioned first snapshot identifier to determine the above-mentioned first target data block; send a second read instruction to the above-mentioned first target data block; and a third receiving sub-module, which is used to receive the above-mentioned first target data sent by the above-mentioned first target data block in response to the above-mentioned second read instruction.
[0023] In an exemplary embodiment, the above-mentioned first backup module includes: a first calling sub-module, used to call the data backup interface in the above-mentioned cloud server, wherein the above-mentioned data backup interface only allows the transmission of the above-mentioned first target data read from the above-mentioned first target data block; a first uploading sub-module, used to upload the above-mentioned first target data to the above-mentioned cloud server through the above-mentioned data backup interface to back up the above-mentioned first target data in the above-mentioned cloud server.
[0024] In an exemplary embodiment, the above-mentioned device also includes: a second update module, which is used to perform the above-mentioned data backup operation on the above-mentioned first target data, so as to update the second usage field of the above-mentioned first target data block after backing up the above-mentioned first target data to the above-mentioned cloud server to obtain the second target usage field, wherein the above-mentioned second usage field is set when the above-mentioned first target data block performs the above-mentioned IO operation, and the field value of the above-mentioned second usage field is used to identify whether the data in the above-mentioned first target data block is allowed to be deleted; a first deletion module, which is used to delete the above-mentioned first target data when the field value of the above-mentioned second target usage field is the target field value to release the storage space of the above-mentioned first target data block.
[0025] In an exemplary embodiment, the storage server also includes a data deletion service, and the device also includes: a second traversal module, used to perform the data backup operation on the first target data, so as to traverse the target storage volume after backing up the first target data to the cloud server, and search for the second target data from the target storage volume, wherein the second target data is the data in the target storage volume that has not been backed up to the cloud server; and a first calling module, used to call the data deletion service to perform a deletion operation on the second target data through the data deletion service.
[0026] According to another embodiment of the present application, a storage server is also provided, wherein the storage server is connected to a cloud server and a host server respectively, wherein the storage server includes a storage pool, wherein the storage pool includes multiple storage volumes, wherein the storage server is configured to execute the steps of any one of the above method embodiments during operation.
[0027] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.
[0028] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0029] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0030] Through the present application, when it is determined that the first data backup request is for requesting to perform a data backup operation on the data in the target storage volume, a first snapshot is created to instruct the data block in the target storage volume to set an IO operation identifier when performing an input / output IO operation; in response to the first data backup request, the first target data block is searched from the target storage volume based on the first snapshot identifier of the first snapshot, and the first target data in the first target data block is read, and the target IO operation identifier of the first target data block is the same as the first snapshot identifier; finally, a data backup operation is performed on the first target data, and the first target data is backed up to the cloud server. Due to the present application, when performing cloud backup of the target storage volume, the generation of snapshot relationship to which each IO operation belongs is recorded by setting the IO operation identifier, and there is no need to create an additional target volume for the snapshot. All data exists inside the target storage volume. Therefore, the problem of resource waste in the related technology when performing data backup can be solved, and the effect of performing data backup with low resources and low cost can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a hardware structure block diagram of a server device of a data backup method according to an embodiment of the present application;
[0032] Figure 2 is a flow chart of a data backup method according to an embodiment of the present application;
[0033] Figure 3 is an architectural diagram of a data backup method according to a specific embodiment of the present application;
[0034] Figure 4 is a flow chart of a data backup method according to a specific embodiment of the present application;
[0035] Figure 5 It is a structural block diagram of a data backup device according to an embodiment of the present application. DETAILED DESCRIPTION
[0036] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0037] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0038] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a data backup method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0039] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a method for controlling the operation of a disk array RAID card in an embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to a server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0040] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0041] In this embodiment, a data backup method is provided, which is applied to a storage server, the storage server is connected to a cloud server and a host server respectively, the storage server includes a storage pool, and the storage pool includes multiple storage volumes. Figure 2 is a flow chart of a data backup method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0042] Step S202, receiving a first data backup request sent by a host server;
[0043] Step S204, in the case where 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, creating a first snapshot, wherein the target storage volume is any storage volume among a plurality of storage volumes, and the first snapshot is used to indicate that an IO operation flag is set for a data block in the target storage volume when an input / output IO operation is performed;
[0044] Optionally, the storage server is used to store data in the 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, and the data blocks are used to store data.
[0045] Optionally, the IO operation identifier is used to record which generation of snapshots the IO operation belongs to. For example, for storage volume A, when the first snapshot is not created, the IO operation identifiers of all IO operations received by storage volume A are 0. After the first snapshot is created for the first time, the snapshot is the 0th generation snapshot, and its corresponding data is the data in all data blocks in storage volume A with an IO operation identifier of 0. After the snapshot is created, the IO operation identifiers of all IO operations received by storage volume A will increase by 1 and become 1. After the first snapshot is created for the second time, the snapshot is the 1st generation snapshot, and its corresponding data is the data in all data blocks in storage volume A with an IO operation identifier of 1. After the snapshot is created, the IO operation identifiers of all IO operations received by storage volume A will increase by 1 and become 2.
[0046] Step S206, 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, wherein 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;
[0047] Step S208: performing a data backup operation on the first target data to back up the first target data to the cloud server.
[0048] Optionally, in the above data backup method, a typical application scenario can be envisioned, 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 actual application: The host server is an internal server of the enterprise, which is used to run key business applications. The storage server manages a large number of storage volumes for storing business data. The cloud server is a remote storage facility used by the enterprise for backup and disaster recovery. The enterprise needs to regularly back up key business data to prevent data loss or to be able to quickly recover in the event of a system failure. 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 and creates a first snapshot for a specific target storage volume. The storage server reads the first target data blocks that match the snapshot identifier from the target storage volume according to the first snapshot identifier of the first snapshot. These first target data blocks may include first target data of files, database records or other key information. Finally, the storage server sends the read first target data to the cloud server for backup.
[0049] Through the present application, when it is determined that the first data backup request is for requesting to perform a data backup operation on the data in the target storage volume, a first snapshot is created to instruct the data block in the target storage volume to set an IO operation identifier when performing an input / output IO operation; in response to the first data backup request, the first target data block is searched from the target storage volume based on the first snapshot identifier of the first snapshot, and the first target data in the first target data block is read, and the target IO operation identifier of the first target data block is the same as the first snapshot identifier; finally, a data backup operation is performed on the first target data, and the first target data is backed up to the cloud server. Due to the present application, when performing cloud backup of the target storage volume, the generation of snapshot relationship to which each IO operation belongs is recorded by setting the IO operation identifier, and there is no need to create an additional target volume for the snapshot. All data exists inside the target storage volume. Therefore, the problem of resource waste in the related technology when performing data backup can be solved, and the effect of performing data backup with low resources and low cost can be achieved.
[0050] In an exemplary embodiment, when it is determined that the first data backup request is for requesting to perform a data backup operation on the data in the target storage volume, before creating the first snapshot, the method further includes: performing a mapping operation on the target storage volume to map the target storage volume to the host server, wherein the mapping operation includes: sending the 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 includes the following information: identification information of the target storage volume, address information of the first target data block, data information on which the IO operation is to be performed, and the IO operation identifier; responding to the IO operation request, 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 identifier of the first target data block.
[0051] Optionally, the identification information of the storage volume is used to inform the storage server in which storage volume the data is stored. For example, the identification information of the storage volume is lun_id, which is used to indicate that the storage server data is stored in the storage volume with the identification information lun_id. The address information of the data block is used to specify the location of the data in the storage volume. For example, the address information of the data block is lba, which is used to indicate that the data is stored at the location of the storage volume 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 is used to indicate the length of the data bytes of the IO operation. Figure 3As shown, it is assumed that there is a host server (for example, 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 this logical unit number to the host server. After the host server receives the logical unit number, it establishes a link with the target storage volume according to the logical unit number, and configures the storage access path on the host server. For example, in Linux, you may need to create a device file (such as ` / dev / sdX`) to represent this target storage volume. After establishing a link with the target storage volume, the host server sends a first IO operation request to the volume management module in the storage server. Through the target storage volume identification information in the first IO operation request - target storage volume A, the address information of the first target data block - 0x1000, and the data information of the IO operation to be performed - write 8 bytes of data, the storage server is informed to write 8 bytes of data to the first target data block A with an address of `0x1000` on the target storage volume A in the storage pool, and then the snapshot module in the storage server records the target IO operation identification 0 of the first target data block A of the target storage volume A.
[0052] This embodiment achieves the purpose of ensuring the smooth progress of the data backup operation and improving the performance of the storage host server and the security of the data by performing a mapping operation and processing an IO operation request before data backup.
[0053] In an exemplary embodiment, in response to the above-mentioned first IO operation request, after performing the above-mentioned IO operation on the above-mentioned first target data block using the above-mentioned information included in the above-mentioned first IO operation request and recording the above-mentioned target IO operation identifier of the above-mentioned first target data block, the above-mentioned method also includes: when it is determined that the above-mentioned IO operation performed on the above-mentioned first target data block is an initial IO operation, updating the first usage field of the above-mentioned first target data block to obtain a first target usage field, wherein the above-mentioned first usage field is set before receiving the IO operation request sent by the above-mentioned host server, and the field value of the above-mentioned first usage field is used to identify whether deletion of data in the above-mentioned first target data block is allowed.
[0054] Alternatively, if Figure 3As shown, the cloud backup module in the storage server maintains a first usage field use_status for each data block in each storage volume, which is used to indicate whether the data in the database still needs to be stored in the 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 can be set to 2. After the data in the first target data block is backed up to the cloud server, the value of the first usage field is reduced by 1; in addition, when the host server writes data to the first target data block for the first time, the value of the first usage field is reduced by 1. When the value is reduced to 0, it indicates that the cloud backup task and the host server IO operation no longer use the data of the first target data block. At this time, the cloud backup module will notify the data deletion service to delete the data in the first target database.
[0055] This embodiment achieves the purpose of timely deleting useless data during the cloud backup process by setting the first usage field to mark the usage of the data block, thereby not occupying additional storage space for a long time and releasing the storage space.
[0056] In an exemplary embodiment, when it is determined that the first data backup request is for requesting to perform a data backup operation on data in the target storage volume, creating a first snapshot includes: sending a snapshot instruction to the host server to instruct the host server to perform the following operations: in response to the snapshot instruction, setting the first snapshot identifier to the second IO operation request, and sending the second IO operation request to the target storage volume; in response to the second IO operation request, after performing the second IO operation in the first target data block, determining the IO operation identifier based on the first snapshot identifier, and setting the IO operation identifier to the first target data block to create the first snapshot.
[0057] Optionally, assuming that a cloud backup is to be performed on the target storage volume A, before the first cloud backup is performed, 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. The IO operation identifiers of all IO operations received by the target storage volume A are 0. When performing a cloud backup, the first snapshot is created for the first time. This snapshot is the 0th generation snapshot, and its corresponding data is the data block data with an IO operation identifier of 0 in the target storage volume A. After the snapshot is created, the IO operation identifiers of all IO operations received by the target storage volume A will increase by 1 and become 1. After the first snapshot is created for the second time, this snapshot is the 1st generation snapshot, and its corresponding data is the data block data with an IO operation identifier of 1 in the target storage volume A. After the snapshot is created, the IO operation identifiers of all IO operations received by the target storage volume A will increase by 1 and become 2.
[0058] This embodiment provides a flexible data backup strategy by creating snapshots. Compared with traditional full backup, the snapshot technology reduces the demand for storage resources and achieves the purpose of data backup with low resource consumption.
[0059] In an exemplary embodiment, in response to the first data backup request, the first target data is read from the first target data block based on the first snapshot identifier of the first snapshot, including: receiving data acquisition indication information sent by the target storage volume; in a case where the data acquisition indication information includes the first indication information, in response to the first data backup request, searching from the target storage volume for an IO operation identifier that matches the first snapshot identifier to determine the first target data block, wherein 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.
[0060] Optionally, the backup can be a full backup or an incremental backup, and the first target data obtained can be incremental data or full data. Specifically, the data acquisition indication information force_this_gen can be used to determine whether the acquired data is incremental data or full data. If the value is true, the acquired data is incremental data. For example, suppose that the target storage volume A is to be backed up by the cloud for the third time. The target storage volume A includes data block A that has performed three IO operations (the first one is before the first cloud backup, and the second and third ones are after the first cloud backup), and data block B that has performed IO operations after the first cloud backup. Since data block A has performed three IO operations, the IO operation identifier of the first IO operation is 0, the IO operation identifier of the second IO operation is 1, and the IO operation identifier of the third IO operation is 2. The IO operation identifier of data block B is 1. Since this is the third cloud backup, the first snapshot identifier of the target storage volume A is 2. Figure 3 As shown, before the snapshot module obtains the data in the target storage volume A from the storage pool, it receives the data acquisition indication information force_this_gen including the first indication information true, and the snapshot module traverses the IO operation identifier of each data block in the target storage volume to find the first target data block A with the IO operation identifier of 2, and then the snapshot module reads the first target data (incremental data) of the third IO operation of the first target data block A from the storage pool.
[0061] This embodiment sets data acquisition indication information to indicate whether to acquire incremental data or full data, thereby achieving the purpose of backing up only the data that has changed since the last backup (i.e., incremental data) instead of re-backing up all data, thereby significantly reducing the required storage space.
[0062] In an exemplary embodiment, after receiving the data acquisition indication information sent by the above-mentioned target storage volume, the above-mentioned method also includes: in a case where the above-mentioned data acquisition indication information includes second indication information, in response to the above-mentioned first data backup request, searching the above-mentioned target storage volume for an IO operation identifier that matches the above-mentioned first snapshot identifier to determine the above-mentioned first target data block, wherein the above-mentioned second indication information is used to indicate that reading all the data included in the above-mentioned first target data block is allowed; and reading all the above-mentioned data from the above-mentioned first target data block to obtain the above-mentioned first target data.
[0063] Optionally, the backup can be a full backup or an incremental backup, and the first target data obtained can be incremental data or full data. Specifically, the data acquisition indication information force_this_gen can be used to determine whether the acquired data is incremental data or full data. If the value is false, the acquired data is full data. For example, suppose that the target storage volume A is to be backed up by the cloud for the third time. The target storage volume A includes data block A that has performed three IO operations (the first one is before the first cloud backup, and the second and third ones are after the first cloud backup), and data block B that has performed IO operations after the first cloud backup. Since data block A has performed three IO operations, the IO operation identifier of the first IO operation is 0, the IO operation identifier of the second IO operation is 1, and the IO operation identifier of the third IO operation is 2. The IO operation identifier of data block B is 1. Since this is the third cloud backup, the first snapshot identifier of the target storage volume A is 2. Figure 3 As shown, before the snapshot module obtains the data in the target storage volume A from the storage pool, it receives the data acquisition indication information force_this_gen including the first indication information false, and the snapshot module traverses the IO operation identifier of each data block in the target storage volume to find the first target data block A with the IO operation identifier of 2, and then the snapshot module 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 of the first IO operation of the first target data block A (full input data) from the storage pool in sequence.
[0064] This embodiment achieves the purpose of backing up the full amount of data by setting data acquisition indication information to indicate whether to acquire incremental data or full amount of data.
[0065] In an exemplary embodiment, the first target data is read from the first target data block based on the first snapshot identifier of the first snapshot, including: in a case where the first data backup request is the first backup request, based on the initial snapshot identifier of the first snapshot, traversing the target storage volume, determining all data blocks included in the target storage volume that perform the IO operation as the first target data blocks, wherein the initial snapshot identifier is a snapshot identifier 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 read instruction.
[0066] Optionally, assuming that the target storage volume A is to be backed up for the first time in the cloud, the target storage volume A includes data block A that has performed IO operations and data block B that has not performed IO operations. Since data block A has performed IO operations, the IO operation identifier is 0, and data block B has not performed IO operations, so there is no IO operation identifier. Since this is the first cloud backup, the initial snapshot identifier of the target storage volume A is 0. Based on the initial snapshot identifier 0, the cloud backup module in the storage server sends a traversal instruction to the snapshot module in the storage server. The snapshot module traverses the IO operation identifiers of each data block in the target storage volume to find the first target data block A with an IO operation identifier of 0. Then, the snapshot module sends a first read instruction to the first target data block A, obtains 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.
[0067] This embodiment provides a flexible data backup strategy by acquiring backup data based on snapshot identifiers, and achieves the purpose of performing data backup with low resource consumption compared with traditional full backup.
[0068] In an exemplary embodiment, in response to the first data backup request, the first target data is read from the first target data block based on the first snapshot identifier of the first snapshot, including: in the case where the first data backup request is other backup requests, based on the first snapshot identifier, traversing the target storage volume, searching the target storage volume for an IO operation identifier that matches the first snapshot identifier 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.
[0069] Optionally, assuming that the target storage volume A is to be backed up for the second time in the cloud, the target storage volume A includes a data block A that has been subjected to two IO operations (the first one before the first cloud backup, and the second one after the first cloud backup), and a data block B that has been subjected to an IO operation after the first cloud backup. Since the data block A has been subjected to two IO operations, the IO operation identifier of the first IO operation is 0, the IO operation identifier of the second IO operation is 1, and the IO operation identifier of the data block B is 1. Since it is the second cloud backup, the first snapshot identifier of the target storage volume A is 1. Based on the first snapshot identifier 1, the cloud backup module in the storage server sends a traversal instruction to the snapshot module in the storage server. The snapshot module traverses the IO operation identifier of each data block in the target storage volume to find the first target data block A and the first target data block B with the IO operation identifier 1. Then, the snapshot module sends a second read instruction to the first target data block A and the first target data block B, obtains the first target data of the second IO operation of the first target data block A and the first target data of the first IO operation of the first target data block B from the storage pool, and sends the data to the cloud backup module in the storage server.
[0070] This embodiment provides a flexible data backup strategy by creating snapshots, thereby achieving the purpose of performing data backup with low resource consumption.
[0071] In an exemplary embodiment, the data backup operation is performed on the first target data to back up the first target data to the cloud server, including: calling a data backup interface in the cloud server, wherein the data backup interface only allows the transmission of the first target data read from the first target data block; uploading the first target data to the cloud server through the data backup interface to back up the first target data in the cloud server.
[0072] Alternatively, if Figure 3 As shown, after the cloud backup module obtains the first target data, it backs up the first target data to the cloud server by calling the data backup interface provided by the cloud server. This embodiment achieves the purpose of ensuring the security of data during transmission by calling the data backup interface in the cloud server.
[0073] In an exemplary embodiment, after performing the data backup operation on the first target data to back up the first target data to the cloud server, the method further includes: updating the 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 performs the IO operation, and the field value of the second usage field is used to identify whether deletion of the data in the first target data block is allowed; when the field value of the second target usage field is the target field value, deleting the first target data to release storage space of the first target data block.
[0074] Alternatively, if Figure 3 As shown, the cloud backup module in the storage server maintains a second usage field use_status for each data block in each storage volume, which is used to indicate whether the data in the database still needs to be stored in the 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 to the first target data block for the first time, the value of the first usage field is reduced by 1 to obtain a value of 1 for the second usage field. After the data in the first target data block is backed up to the cloud server, the value of the second usage field is reduced by 1. The second usage field becomes 0, indicating that the cloud backup task and the host server IO operation no longer use the data of the first target data block A. At this time, the cloud backup module will notify the data recovery service to delete the data in the first target data block A. This embodiment achieves the purpose of timely deleting useless data during the cloud backup process by setting the first usage field to mark the usage of the data block, and will not occupy additional storage space for a long time, thereby releasing storage space.
[0075] In an exemplary embodiment, the storage server also includes a data deletion service. After performing the data backup operation on the first target data to back up the first target data to the cloud server, the method further includes: traversing the target storage volume to search for the second target data from the target storage volume, wherein the second target data is the data in the target storage volume that has not been backed up to the cloud server; and calling the data deletion service to perform a deletion operation on the second target data through the data deletion service.
[0076] Optionally, to prevent the storage server from having data that has not been backed up to other devices by creating the first snapshot, after the cloud backup, the target storage volume is promptly searched for data that has been backed up to other devices, and the expired data is deleted. For example, assuming that the target storage volume A includes the first target data A backed up in the cloud server and the second target data B backed up in the backup server, after backing up the first target data A to the cloud server, the storage server traverses the target storage volume and finds the second target data B that has not been backed up to the cloud server but has been backed up to the backup server, and the storage service calls the data deletion service to delete the second target data B. This embodiment frees up storage space by deleting data that has not been backed up to the cloud server but has been backed up to other servers, thereby optimizing the use of storage resources and reducing storage costs.
[0077] The present application is described below in conjunction with specific embodiments:
[0078] In this specific embodiment, Figure 4 is a flow chart of a data backup method according to a specific embodiment of the present application, such as Figure 4 As shown, the specific steps include:
[0079] S402, assuming that the logical unit number (LUN) of the target storage volume A is 1234, such as Figure 3 As shown, first, the volume management module in the storage server sends the logical unit number to the host server. After the host server receives the logical unit number, it establishes a link with the target storage volume according to the logical unit number and configures the 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 the volume management module in the storage server. Through the identification information of the target storage volume in the first IO operation request - the target storage volume A, the address information of the first target data block - 0x1000 and - 0x2000, and the data information of the IO operation to be performed - write 8 bytes and write 4 bytes of data, the storage server is informed to write 8 bytes of data to the first target data block A with address 0x1000 and write 4 bytes of data to the first target data block B with address 0x2000 on the target storage volume A in the storage pool. Then the snapshot module in the storage server records the target IO operation identification 0 of the first target data block A of the target storage volume A and the target IO operation identification 0 of the first target data block B. Then the cloud backup module in the storage server updates the first usage field of the first target data block A from 2 to 1 to obtain the first target usage field, and updates the first usage field of the first target data block B from 2 to 1 to obtain the first target usage field. Start cloud backup;
[0080] S404, such as Figure 3As shown, the cloud backup module responds to the first data backup request directly triggered by the host server or the user, and creates a first snapshot identifier of the target storage volume A through the snapshot module. Since it is the first cloud backup, the first snapshot identifier is 0.
[0081] In this process, the storage server receives the first IO operation request sent by the host server again, and informs the storage server to write 1 byte of data to the first target data block A with the address `0x1000` on the target storage volume A in the storage pool through the identification information of the target storage volume in the first IO operation request - the target storage volume A, the address information of the first target data block - 0x1000, and the data information of the IO operation to be performed - write 1 byte of data, and then the snapshot module in the storage server records the target IO operation identification 1 and the first usage field 1 of the first target data block A of the target storage volume A;
[0082] S406, before the snapshot module obtains the data in the target storage volume A from the storage pool again, after receiving the data acquisition indication information force_this_gen including the first indication information true, the snapshot module traverses the IO operation identifier of each data block in the target storage volume to find the first target data block A and the second target data block B with the IO operation identifier of 0, and then reads the first target data in the first target data blocks A and B from the storage pool in sequence. And the first target data is sent to the cloud backup module.
[0083] In this process, the cloud backup module responds again to the first data backup request directly triggered by the host server or user, and creates the first snapshot identifier of the target storage volume A through the snapshot module. Since it is the second cloud backup, the first snapshot identifier is 1. The snapshot module traverses the IO operation identifier of each data block in the target storage volume to find the first target data block A with the IO operation identifier 1, and then the snapshot module reads the first target data of the second IO operation in the first target data block A from the storage pool. And the first target data is sent to the cloud backup module;
[0084] S408, the cloud backup module backs up the first target data to the cloud server, updates the second usage field of the first target data block A and the second target data block B from 1 to 0 to obtain the second target usage field, 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 to reclaim the storage space;
[0085] S410, end the cloud backup.
[0086] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0087] In this embodiment, a data backup device is also provided, which is applied to a system on a chip and a storage server. The storage server is connected to a cloud server and a host server respectively. The storage server includes a storage pool, and the storage pool includes multiple storage volumes. The device is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0088] Figure 5 is a structural block diagram of a data backup device according to an embodiment of the present application, such as Figure 5 As shown, the device comprises:
[0089] A first receiving module 502, configured to receive a first data backup request sent by the host server;
[0090] A first creation module 504 is used to create a first snapshot when it is determined that the first data backup request is for requesting to perform a data backup operation on the data in the target storage volume, wherein the target storage volume is any storage volume among the plurality of storage volumes, and the first snapshot is used to indicate that the data blocks in the target storage volume set an IO operation flag when performing an input / output IO operation;
[0091] A first response module 506 is 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, wherein 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;
[0092] The first backup module 508 is used to perform the data backup operation on the first target data to back up the first target data to the cloud server.
[0093] In an exemplary embodiment, the device further includes: a first mapping module, which is used to perform a mapping operation on the target storage volume before creating the first snapshot when it is determined that the first data backup request is for requesting to perform a data backup operation on the data in the target storage volume, so as to map the target storage volume to the host server, wherein the mapping operation includes: sending the 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; a second receiving module, which is used to receive a first IO operation request sent by the host server, wherein the first IO operation request includes the following information: identification information of the target storage volume, address information of the first target data block, data information of the IO operation to be performed, and the IO operation identifier; a second response module, which is used to respond to the IO operation request, perform the IO operation on the first target data block using the information included in the first IO operation request, and record the target IO operation identifier of the first target data block.
[0094] In an exemplary embodiment, the above-mentioned device also includes: a first update module, which is used to respond to the above-mentioned first IO operation request, perform the above-mentioned IO operation on the above-mentioned first target data block using the above-mentioned information included in the above-mentioned first IO operation request, and record the above-mentioned target IO operation identifier of the above-mentioned first target data block, and then, when it is determined that the above-mentioned IO operation performed on the above-mentioned first target data block is an initial IO operation, update the first usage field of the above-mentioned first target data block to obtain the first target usage field, wherein the above-mentioned first usage field is set before receiving the IO operation request sent by the above-mentioned host server, and the field value of the above-mentioned first usage field is used to identify whether deletion of data in the above-mentioned first target data block is allowed.
[0095] In an exemplary embodiment, the first creation module includes: a first sending submodule, used to send a snapshot instruction to the host server to instruct the host server to perform the following operations: in response to the snapshot instruction, set the first snapshot identifier to the second IO operation request, and send the second IO operation request to the target storage volume; a first responding submodule, used to respond to the second IO operation request, after performing the second IO operation in the first target data block, determine the IO operation identifier based on the first snapshot identifier, and set the IO operation identifier to the first target data block to create the first snapshot.
[0096] In an exemplary embodiment, the above-mentioned first response module includes: a first receiving submodule, used to receive the data acquisition indication information sent by the above-mentioned target storage volume; a second response submodule, used to respond to the above-mentioned first data backup request when the above-mentioned data acquisition indication information includes the first indication information, and search the above-mentioned target storage volume for an IO operation identifier that matches the above-mentioned first snapshot identifier to determine the above-mentioned first target data block, wherein the above-mentioned first indication information is used to indicate that only incremental data is allowed to be read from the above-mentioned first target data block; a first reading submodule, used to read the above-mentioned incremental data from the above-mentioned first target data block to obtain the above-mentioned first target data.
[0097] In an exemplary embodiment, the first response module further includes: a third response submodule, which is used to respond to the first data backup request after the target storage volume sends the data acquisition indication information, and in the case where the data acquisition indication information includes the second indication information, searches the target storage volume for an IO operation identifier that matches the first snapshot identifier to determine the first target data block, wherein the second indication information is used to indicate that reading all the data included in the first target data block is allowed; and a second reading submodule, which is used to read all the data from the first target data block to obtain the first target data.
[0098] In an exemplary embodiment, the first response module includes: a first traversal submodule, which is used to traverse the target storage volume based on the initial snapshot identifier of the first snapshot when the first data backup request is the first backup request, and determine all data blocks included in the target storage volume that perform the IO operation as the first target data blocks, wherein the initial snapshot identifier is the snapshot identifier sent to the host server for the first time; send a first read instruction to the first target data block; and a second receiving submodule, which is used to receive the first target data sent by the first target data block in response to the first read instruction.
[0099] In an exemplary embodiment, the above-mentioned first response module includes: a second traversal sub-module, which is used to traverse the above-mentioned target storage volume based on the above-mentioned first snapshot identifier when the above-mentioned first data backup request is other backup requests, and search the above-mentioned target storage volume for an IO operation identifier that matches the above-mentioned first snapshot identifier to determine the above-mentioned first target data block; send a second read instruction to the above-mentioned first target data block; and a third receiving sub-module, which is used to receive the above-mentioned first target data sent by the above-mentioned first target data block in response to the above-mentioned second read instruction.
[0100] In an exemplary embodiment, the above-mentioned first backup module includes: a first calling sub-module, used to call the data backup interface in the above-mentioned cloud server, wherein the above-mentioned data backup interface only allows the transmission of the above-mentioned first target data read from the above-mentioned first target data block; a first uploading sub-module, used to upload the above-mentioned first target data to the above-mentioned cloud server through the above-mentioned data backup interface to back up the above-mentioned first target data in the above-mentioned cloud server.
[0101] In an exemplary embodiment, the above-mentioned device also includes: a second update module, which is used to perform the above-mentioned data backup operation on the above-mentioned first target data, so as to update the second usage field of the above-mentioned first target data block after backing up the above-mentioned first target data to the above-mentioned cloud server to obtain the second target usage field, wherein the above-mentioned second usage field is set when the above-mentioned first target data block performs the above-mentioned IO operation, and the field value of the above-mentioned second usage field is used to identify whether the data in the above-mentioned first target data block is allowed to be deleted; a first deletion module, which is used to delete the above-mentioned first target data when the field value of the above-mentioned second target usage field is the target field value to release the storage space of the above-mentioned first target data block.
[0102] In an exemplary embodiment, the storage server also includes a data deletion service, and the device also includes: a second traversal module, used to perform the data backup operation on the first target data, so as to traverse the target storage volume after backing up the first target data to the cloud server, and search for the second target data from the target storage volume, wherein the second target data is the data in the target storage volume that has not been backed up to the cloud server; and a first calling module, used to call the data deletion service to perform a deletion operation on the second target data through the data deletion service.
[0103] According to another embodiment of the present application, a storage server is also provided, wherein the storage server is connected to a cloud server and a host server respectively, wherein the storage server includes a storage pool, wherein the storage pool includes multiple storage volumes, wherein the storage server is configured to execute the steps of any one of the above method embodiments during operation.
[0104] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.
[0105] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0106] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0107] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0108] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0109] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0110] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0111] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0112] The embodiments of the present application also provide a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the above method embodiments.
[0113] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0114] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0115] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A data backup method, characterized in that: Applied to a storage server, the storage server is connected to a cloud server and a host server respectively, the storage server includes a storage pool, the storage pool includes a plurality of storage volumes, the method includes: receiving a first data backup request sent by the host server; In the case where 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, creating a first snapshot, wherein the target storage volume is any storage volume among the plurality of storage volumes, and the first snapshot is used to indicate that an IO operation identifier is set when an input / output IO operation is performed on a data block in the target storage volume, and the IO operation identifier is used to identify the first snapshot to which the IO operation belongs; In response to the first data backup request, first target data is read 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 the same as the first snapshot identifier, the first snapshot identifier is used to describe the number of times the target storage volume receives the first data backup request and creates 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; The data backup operation is performed on the first target data to back up the first target data to the cloud server.
2. The method according to claim 1, characterized in that In the case where it is determined that the first data backup request is for requesting to perform a data backup operation on the data in the target storage volume, before creating the first snapshot, the method further includes: Performing a mapping operation on the target storage volume to map the target storage volume to the host server, wherein 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; Receive a first IO operation request sent by the host server, wherein the first IO operation request includes the following information: identification information of the target storage volume, address information of the first target data block, data information of the IO operation to be performed, and the IO operation identifier; In response to the first IO operation request, the IO operation is performed on the first target data block using the information included in the first IO operation request, and the target IO operation identifier of the first target data block is recorded.
3. The method according to claim 2, characterized in that 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 identifier of the first target data block, the method further includes: When it is determined that the IO operation performed on the first target data block is an initial IO operation, the first usage field of the first target data block is updated to obtain a first target usage field, wherein the first usage field is set before receiving the IO operation request sent by the host server, and the field value of the first usage field is used to identify whether deletion of data in the first target data block is allowed.
4. The method according to claim 1, characterized in that: In a case where it is determined that the first data backup request is for requesting to perform a data backup operation on data in the target storage volume, creating a first snapshot includes: Sending a snapshot instruction to the host server to instruct the host server to perform the following operations: in response to the snapshot instruction, setting the first snapshot identifier to a second IO operation request, and sending the second IO operation request to the target storage volume; In response to the second IO operation request, after performing the second IO operation in the first target data block, the IO operation identifier is determined based on the first snapshot identifier, and the IO operation identifier is set to the first target data block to create the first snapshot.
5. The method according to claim 1, characterized in that 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: Receiving data acquisition instruction information sent by the target storage volume; In a case where the data acquisition indication information includes first indication information, in response to the first data backup request, searching the target storage volume for an IO operation identifier that matches the first snapshot identifier to determine the first target data block, wherein the first indication information is used to indicate that only incremental data is allowed to be read from the first target data block; The incremental data is read from the first target data block to obtain the first target data.
6. The method according to claim 5, characterized in that After receiving the data acquisition instruction information sent by the target storage volume, the method further includes: In a case where the data acquisition indication information includes second indication information, in response to the first data backup request, searching the target storage volume for an IO operation identifier that matches the first snapshot identifier to determine the first target data block, wherein the second indication information is used to indicate that reading all data included in the first target data block is allowed; The entire data is read from the first target data block to obtain the first target data.
7. The method according to claim 1 or 5, characterized in that: 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: In the case where the first data backup request is the first backup request, based on the initial snapshot identifier of the first snapshot, traversing the target storage volume, determining all data blocks included in the target storage volume and performing the IO operation as the first target data blocks, wherein the initial snapshot identifier is a snapshot identifier sent to the host server for the first time; Sending a first read instruction to the first target data block; The first target data sent by the first target data block in response to the first read instruction is received.
8. The method according to claim 1 or 5, characterized in that: 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: In the case where the first data backup request is another backup request, based on the first snapshot identifier, traversing the target storage volume, searching the target storage volume for an IO operation identifier that matches the first snapshot identifier, so as to determine the first target data block; Sending a second read instruction to the first target data block; Receive the first target data sent by the first target data block in response to the second read instruction.
9. The method according to claim 1, characterized in that: Performing the data backup operation on the first target data to back up the first target data to the cloud server includes: Calling 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; The first target data is uploaded to the cloud server through the data backup interface to back up the first target data in the cloud server.
10. The method according to claim 1, characterized in that After performing the data backup operation on the first target data to back up 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, wherein 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 deletion of data in the first target data block is allowed; When the field value of the second target usage field is the target field value, the first target data is deleted to release the storage space of the first target data block.
11. The method according to claim 1, characterized in that: The storage server also includes a data deletion service. After performing the data backup operation on the first target data to back up 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, wherein the second target data is data in the target storage volume that is not backed up to the cloud server; The data deletion service is called to perform a deletion operation on the second target data through the data deletion service.
12. A data backup device, characterized in that: Applied to a storage server, the storage server is connected to a cloud server and a host server respectively, the storage server includes a storage pool, the storage pool includes a plurality of storage volumes, and the device includes: A first receiving module, configured to receive a first data backup request sent by the host server; a first creation 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, wherein the target storage volume is any storage volume among the plurality of storage volumes, and the first snapshot is used to indicate that an IO operation identifier is set when an input / output IO operation is performed on a data block in the target storage volume, and the IO operation identifier is used 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, 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 the same as the first snapshot identifier, the first snapshot identifier is used to describe the number of times the target storage volume receives the first data backup request and creates 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; The first backup module is used to perform the data backup operation on the first target data to back up the first target data to the cloud server.
13. A storage server, characterized in that: The storage server is connected to the cloud server and the host server respectively, and the storage server includes a storage pool, and the storage pool includes multiple storage volumes, wherein the storage server is used to execute the steps of the method described in any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 11 when executed by a processor.
15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Data processing method and device
CN113297007A
Snapshot creation method, computing device and storage medium
CN114328018A