Search

CN-112860479-B - Method for storing data and cloud data center

CN112860479BCN 112860479 BCN112860479 BCN 112860479BCN-112860479-B

Abstract

A method of storing data and a cloud data center. The embodiment of the application provides a method for realizing data conversion in a cloud data center and a backup server, which can shorten the conversion time of backup data objects and reduce the storage cost of users in the cloud data center when a cloud disk of a virtual machine is created. The method comprises the steps that a backup server receives a read request sent by a block storage server, the read request comprises a URL address of a virtual mirror image object to be read in the backup server and an address range of target data in the virtual mirror image object to be read, an address mapping bitmap and a storage path of backup data in a backup copy corresponding to the virtual mirror image object to be read are obtained according to the URL address of the virtual mirror image object to be read in the backup server, the target data is obtained from storage equipment according to the address range of the target data and the address mapping bitmap and the storage path of the backup data in the backup copy, and the target data is sent to the block storage server. The application is suitable for the technical field of storage.

Inventors

  • ZHANG LEI
  • FU GAODING

Assignees

  • 华为技术有限公司

Dates

Publication Date
20260512
Application Date
20161226

Claims (19)

  1. 1. A method of storing data in a cloud data center comprising a storage device and a backup server for performing backup related tasks, characterized in that, The storage device stores a data object; when receiving a backup request, the backup server creates a virtual mirror image object of a source object, wherein the virtual mirror image object is presented in an interface mode of object storage, the virtual mirror image object comprises a metadata object and does not comprise a data object, and the metadata object points to the data object in the storage equipment; Wherein, the The cloud data center further comprises a block storage server, and the method further comprises: The backup server receives a read request sent by the block storage server, wherein the read request comprises a URL address of a virtual mirror image object to be read in the backup server and an address range of target data in the virtual mirror image object to be read; the backup server obtains the target data from the storage device according to the address range of the target data, the address mapping bitmap of the backup data in the backup copy and the storage path, and the backup server sends the target data to the block storage server.
  2. 2. The method of claim 1, wherein the cloud data center further comprises a mirror server, the method further comprising: the backup server creates a URL address of the virtual mirror object; the backup server sends the URL address to the mirror image server; the mirror server stores the URL address.
  3. 3. The method of claim 2, further comprising, before the backup server receives the read request sent by the block storage server: the backup server obtains the identification of the backup copy; the backup server queries a local database according to the identification of the backup copy to acquire a storage path of metadata in the backup copy; The backup server acquires the metadata from the storage device according to the storage path of the metadata; the backup server creates the virtual mirror image object to be read according to the metadata; and the backup server sends the URL address of the created virtual mirror image object to a mirror image server.
  4. 4. The method of claim 1, wherein the backup server obtains an address mapping bitmap and a storage path of backup data in a backup copy corresponding to the virtual mirror object to be read according to the URL address of the virtual mirror object to be read in the backup server, and the method comprises: The backup server determines the identification of the virtual mirror image object to be read according to the URL address of the virtual mirror image object to be read in the backup server; The backup server obtains metadata in the pre-stored virtual mirror image object to be read according to the identification of the virtual mirror image object to be read, wherein the metadata comprise a storage path of an address mapping bitmap of backup data in a backup copy corresponding to the virtual mirror image object to be read and a storage path of the backup data in the backup copy; And the backup server acquires the address mapping bitmap of the backup data in the backup copy from the storage device according to the storage path of the address mapping bitmap of the backup data in the backup copy.
  5. 5. The method of claim 3, wherein the backup server obtains an address mapping bitmap and a storage path of backup data in a backup copy corresponding to the virtual mirror object to be read according to the URL address of the virtual mirror object to be read in the backup server, and the method comprises: The backup server determines the identification of the virtual mirror image object to be read according to the URL address of the virtual mirror image object to be read in the backup server; The backup server obtains metadata in the pre-stored virtual mirror image object to be read according to the identification of the virtual mirror image object to be read, wherein the metadata comprise a storage path of an address mapping bitmap of backup data in a backup copy corresponding to the virtual mirror image object to be read and a storage path of the backup data in the backup copy; And the backup server acquires the address mapping bitmap of the backup data in the backup copy from the storage device according to the storage path of the address mapping bitmap of the backup data in the backup copy.
  6. 6. The method according to claim 1 or 3, wherein the backup server obtains an address mapping bitmap and a storage path of backup data in a backup copy corresponding to the virtual mirror object to be read according to the URL address of the virtual mirror object to be read in the backup server, and the method comprises: The backup server determines the identification of the virtual mirror image object to be read according to the URL address of the virtual mirror image object to be read in the backup server; And the backup server acquires an address mapping bitmap and a storage path of backup data in a backup copy corresponding to the virtual mirror image object to be read, which are stored in advance, according to the identification of the virtual mirror image object to be read.
  7. 7. The method of claim 1, wherein the backup server obtaining the target data from the storage device according to an address range of the target data, an address mapping bitmap of the backup data in the backup copy, and a storage path, comprising: The backup server obtains backup data to be read from the storage device according to the address range of the target data, the address mapping bitmap of the backup data in the backup copy and the storage path; and the backup server acquires the target data according to the backup data to be read and the address range of the target data.
  8. 8. The method of claim 7, wherein the backup server obtaining backup data to be read from the storage device according to the address range of the target data, the address mapping bitmap of the backup data in the backup copy, and the storage path, comprises: The backup server determines backup data to be read according to the address range of the target data and the address mapping bitmap of the backup data in the backup copy, and then obtains the storage path of the backup data to be read in the storage device according to the address mapping bitmap and the storage path of the backup data in the backup copy; the backup server creates a data reading request for the backup data to be read according to the storage path of the backup data to be read in the storage device, wherein the data reading request comprises the storage path of the backup data to be read in the storage device; the backup server sends the data reading request to the storage device; And the backup server receives the backup data to be read, which is sent by the storage device.
  9. 9. The method of claim 1, wherein the backup server obtaining the target data from the storage device according to an address range of the target data, an address mapping bitmap of the backup data in the backup copy, and a storage path, comprising: if the address range of the target data is not greater than the address range of the backup data object in the backup copy, the backup server determines backup data to be read according to the address range of the target data and the address mapping bitmap of the backup data in the backup copy, and then obtains the storage path of the backup data to be read in the storage device according to the address mapping bitmap and the storage path of the backup data in the backup copy; The backup server creates a data read request for the backup data to be read according to the storage path of the backup data to be read in the storage device, wherein the data read request comprises the storage path of the backup data to be read in the storage device and the address range of the target data; the backup server sends the data reading request to the storage device; and the backup server receives the target data sent by the storage device.
  10. 10. The cloud data center is characterized by comprising a storage device and a backup server for executing backup related tasks; The storage device is used for storing data objects; The backup server is used for creating a virtual mirror image object of a source object when receiving a backup request, wherein the virtual mirror image object is presented in an interface mode of object storage, the virtual mirror image object comprises a metadata object and does not comprise a data object, and the metadata object points to the data object in the storage device; wherein the cloud data center further comprises a block storage server; The backup server is further configured to receive a read request sent by the block storage server, where the read request includes a URL address of a virtual mirror object to be read in the backup server and an address range of target data in the virtual mirror object to be read; The method comprises the steps of obtaining an address mapping bitmap and a storage path of backup data in a backup copy corresponding to a virtual mirror image object to be read according to a URL address of the virtual mirror image object to be read in the backup server, obtaining the target data from the storage device according to an address range of the target data, the address mapping bitmap and the storage path of the backup data in the backup copy, and sending the target data to the block storage server by the backup server.
  11. 11. The cloud data center of claim 10, wherein said cloud data center further comprises a mirror server; the backup server is also used for creating the URL address of the virtual mirror image object and sending the URL address to the mirror image server; the mirror server is used for storing the URL address.
  12. 12. The cloud data center of claim 10, wherein said backup server is further configured to: Before the receiving block storage server sends a read request, acquiring an identification of the backup copy; inquiring a local database according to the identification of the backup copy to acquire a storage path of metadata in the backup copy; acquiring the metadata from the storage device according to the storage path of the metadata; creating the virtual mirror image object to be read according to the metadata; and sending the URL address of the created virtual mirror object to a mirror server.
  13. 13. The cloud data center of claim 10, wherein, The backup server is specifically configured to determine an identifier of the virtual mirror object to be read according to a URL address of the virtual mirror object to be read in the backup server, obtain metadata in the virtual mirror object to be read stored in advance according to the identifier of the virtual mirror object to be read, where the metadata includes a storage path of an address mapping bitmap of backup data in a backup copy corresponding to the virtual mirror object to be read and a storage path of backup data in the backup copy, and obtain the address mapping bitmap of backup data in the backup copy from the storage device according to the storage path of the address mapping bitmap of backup data in the backup copy.
  14. 14. The cloud data center of claim 12, wherein, The backup server is specifically configured to determine an identifier of the virtual mirror object to be read according to a URL address of the virtual mirror object to be read in the backup server, obtain metadata in the virtual mirror object to be read stored in advance according to the identifier of the virtual mirror object to be read, where the metadata includes a storage path of an address mapping bitmap of backup data in a backup copy corresponding to the virtual mirror object to be read and a storage path of backup data in the backup copy, and obtain the address mapping bitmap of backup data in the backup copy from the storage device according to the storage path of the address mapping bitmap of backup data in the backup copy.
  15. 15. The cloud data center according to claim 12 or 10, wherein, The backup server is specifically configured to determine, according to the URL address of the virtual mirror object to be read in the backup server, an identifier of the virtual mirror object to be read, and obtain, according to the identifier of the virtual mirror object to be read, an address mapping bitmap and a storage path of backup data in a backup copy corresponding to the virtual mirror object to be read, where the address mapping bitmap and the storage path are stored in advance.
  16. 16. The cloud data center of claim 11, wherein; the block storage server is used for inquiring the URL address of the created virtual mirror image object from the mirror image server and sending the read request to the backup server; The block storage server is further configured to receive the target data sent by the backup server, and create a cloud disk of the virtual machine according to the target data.
  17. 17. A backup server, comprising: A processor, a memory, a bus, and a communication interface; The memory is used to store computer-executable instructions that, The processor is connected to the memory via the bus, and when the backup server is running, the processor executes the computer-executable instructions stored in the memory to cause the backup server to perform the method performed by the backup server according to any one of claims 1 to 9.
  18. 18. A computer storage medium storing computer software instructions for use by a backup server, comprising a program designed to perform the method performed by the backup server of any one of claims 1 to 9.
  19. 19. A computer program product comprising instructions which, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9 performed by a backup server.

Description

Method for storing data and cloud data center Technical Field The present application relates to the field of storage technologies, and in particular, to a method for storing data in a cloud data center and a cloud data center. Background In the current hybrid cloud backup, data of a Virtual Machine (VM) or a physical Machine (PHYSICAL MACHINE, PM) of a data center under the cloud is backed up to the local or the local in a volume unit, and then is copied to a low-cost storage device in the cloud data center remotely, and is restored into the Virtual Machine (may also be called as a cloud host) of the cloud data center through a backup server in the cloud data center, so that the purposes of disaster recovery and data backup are achieved. The backup data generated by one backup is called a backup copy, and the backup copy comprises a plurality of backup data objects. An object is a basic unit of Data storage in the object storage technology, and one object is a combination of Data of a file and a set of attribute information (metadata ). When the backup software backs up the data of the VM/PM in the form of an object to the storage device, the data is stored in the form of a backup copy, and the format type which can be registered by the cloud data center is the data format of the mirror image object, so that the backup server needs to create the mirror image object which can be registered by the cloud data center and corresponds to the backup copy in the storage device based on the backup copy. The mirror image refers to a mirror image in a cloud data center, and corresponds to English as image. A mirror image object refers to an object in a cloud data center that is compatible by the cloud data center that can be used to create virtual machines and disks of virtual machines. However, in the process of creating the mirror image object in the storage device of the cloud data center, on one hand, since the backup server needs to read the backup copy from the storage device and then issue a write operation to the storage device to form the mirror image object, before the cloud disk of the virtual machine is created, a lot of time is consumed due to a lot of Input-Output (IO), and on the other hand, since creating the mirror image object in the storage device consumes the storage space of the user in the storage device, the storage cost of the user in the cloud data center is increased. Disclosure of Invention The embodiment of the application provides a method for realizing data conversion in a cloud data center and a backup server, which shortens the conversion time of backup data objects and reduces the storage cost of a user in the cloud data center when a cloud disk of a virtual machine is created. In order to achieve the above purpose, the embodiment of the present application provides the following technical solutions: The method comprises the steps of receiving a read request sent by the block storage server, wherein the read request comprises a URL address of a virtual mirror image object to be read in the backup server and an address range of target data in the virtual mirror image object to be read, obtaining an address mapping bitmap and a storage path of backup data in a backup copy corresponding to the virtual mirror image object to be read according to the URL address of the virtual mirror image object to be read in the backup server, and obtaining the target data from the storage device by the backup server according to the address range of the target data, the address mapping bitmap and the storage path of the backup data in the backup copy. According to the method for realizing data conversion in the cloud data center, on the one hand, in the embodiment of the application, the backup server virtualizes a virtual mirror image object instead of generating a real mirror image object in the storage device, so that the storage space of a user in the storage device can be saved, and the storage cost of the user in the cloud data center is reduced. On the other hand, in the embodiment of the application, the block storage device can directly read the backup data in the storage device through the backup server, instead of the backup server firstly reading the backup copy from the storage device, then issuing the write operation to the storage device to form the mirror image object, and then reading the backup data from the mirror image object by the block storage device, so that when the cloud disk of the virtual machine is created, the read IO and the write IO consumed by generating the real mirror image object can be eliminated, and the conversion time of the backup data object is shortened. In one possible design, before the backup server receives the read request sent by the block storage server, the method further comprises the steps that the backup server obtains an identifier of the backup copy, the backup server queries a local database according to the identifier of the backup copy to obtain