Data backup recovery method and device of cloud host

By detecting the status of the target cloud host and creating a backup cloud host in the target cloud server region, the problem that cloud host data backup and recovery can only be performed locally is solved, and rapid backup and recovery in different regions is realized, improving the applicability and flexibility of data recovery sex.

CN119292829APending Publication Date: 2025-01-10WUHAN STONE INFORMATION SERVICE CO LTD

Patent Information

Application Number
CN202411349821.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In the prior art, data backup and recovery of cloud hosts can only be performed locally, resulting in low applicability and the inability to achieve rapid backup and recovery in different regions.

Method used

By detecting whether the target cloud host is shut down abnormally, obtain the current and target cloud server regions where it is located, create a backup cloud host on the target cloud server region based on the backup data set, and restore its data, and run the backup cloud host to realize data in a different region. Backup and restore.

Benefits of technology

It improves the applicability of cloud host data backup and recovery, realizes rapid backup and recovery in other regions, and enhances the flexibility and reliability of data recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292829A_ABST
    Figure CN119292829A_ABST
Patent Text Reader

Abstract

The invention discloses a data backup recovery method and device for a cloud host, and the method comprises the steps: detecting whether a target cloud host is shut down abnormally or not; under the condition that the target cloud host is not shut down abnormally, data of the target cloud host is backed up, and a backup data set is obtained; under the condition that the target cloud host is shut down abnormally, a current cloud server region where the target cloud host is located and a target cloud server region are obtained, the current cloud server region comprises the target cloud host, and the target cloud server region does not comprise the target cloud host; creating a backup cloud host on the target cloud server region based on the backup data set and recovering data of the backup cloud host; and running the backup cloud host. According to the invention, the applicability of data backup recovery of the cloud host can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database technology, and in particular to a method and device for backing up and restoring data of a cloud host. Background Art

[0002] Alibaba Cloud ECS is an IaaS (Infrastructure as a Service) cloud computing service provided by Alibaba Cloud that features excellent performance, stability, reliability, and elastic expansion. By creating consistent snapshots of disks, the snapshot mechanism is used to back up and restore the specified disks. However, currently data backup and recovery can only be based on local backup and recovery, resulting in low applicability of data backup and recovery of cloud hosts. Summary of the invention

[0003] The embodiments of the present application provide a data backup and recovery method and device for a cloud host, which can improve the applicability of data backup and recovery of the cloud host.

[0004] In a first aspect, the data backup and recovery method of the cloud host provided by the present application includes:

[0005] Detecting whether the target cloud host is abnormally shut down;

[0006] In the case that the target cloud host does not shut down abnormally, backing up the data of the target cloud host to obtain a backup data set;

[0007] In the case that the target cloud host is abnormally shut down, obtaining the current cloud server region and the target cloud server region where the target cloud host is located, wherein the current cloud server region includes the target cloud host, and the target cloud server region does not include the target cloud host;

[0008] Creating a backup cloud host on the target cloud server region based on the backup data set and restoring data of the backup cloud host;

[0009] Run the backup cloud host.

[0010] Optionally, when the target cloud host is abnormally shut down, obtaining the current cloud server region and the target cloud server region where the target cloud host is located includes:

[0011] In the event that the target cloud host is abnormally shut down, obtaining the current cloud server region where the target cloud host is located;

[0012] Obtaining the geographical distance between each cloud server region and the current cloud server region;

[0013] Determine the cloud server regions whose regional distance is less than a preset distance value as candidate cloud server regions, and obtain multiple candidate cloud server regions;

[0014] Obtain the number of cloud hosts and average latency of cloud hosts created in each of the candidate cloud server regions;

[0015] Determine the regional priority of the candidate cloud server region based on the regional distance of the candidate cloud server region, the number of cloud hosts, and the average value of cloud host delay, wherein the smaller the regional distance, the greater the regional priority, the greater the number of cloud hosts, the lower the regional priority, and the higher the average value of cloud host delay, the lower the regional priority;

[0016] The candidate cloud server region with the highest region priority is determined as the target cloud server region.

[0017] Optionally, when the target cloud host is not abnormally shut down, backing up the data of the target cloud host to obtain a backup data set includes:

[0018] Acquire snapshot data of the target cloud host according to a preset period to obtain multiple snapshot data;

[0019] Building a mirror file based on the snapshot data to obtain a plurality of mirror files corresponding to the plurality of snapshot data;

[0020] The plurality of mirror files are stored in a local database to obtain a backup data set, wherein the backup data set includes mirror files at a plurality of different backup time points, and the backup time point of the mirror file is the generation time of the snapshot data corresponding to the mirror file.

[0021] Optionally, the step of creating a backup cloud host in the target cloud server region based on the backup data set and restoring data of the backup cloud host includes:

[0022] Obtaining the backup time point of each image file in the backup data set;

[0023] Obtaining the abnormal time when the target cloud host is abnormally shut down;

[0024] Determine a backup recovery time point based on the abnormal time;

[0025] Obtain a target backup time point that matches the backup and restore time point, the target backup time point being the backup time point before the backup and restore time point or the backup time point after the backup and restore time point;

[0026] Obtaining the target image file corresponding to the target backup time point;

[0027] The backup cloud host is created based on the target image file and the data of the backup cloud host is restored.

[0028] Optionally, the creating the backup cloud host based on the target image file and restoring data of the backup cloud host includes:

[0029] Acquire the system parameters and target backup data of the target cloud host from the target image file;

[0030] Building the backup cloud host based on the system parameters of the target cloud host;

[0031] The target backup data is sent to the backup cloud host so that the backup cloud host and the target cloud host have the same system parameters and data.

[0032] Optionally, sending the target backup data to the backup cloud host so that the backup cloud host and the target cloud host have the same system parameters and data includes:

[0033] Splitting the target backup data into multiple sub-backup data;

[0034] Obtaining the maximum allowable recovery time of each of the sub-backup data from when the cloud host is abnormal to when the cloud host is restored to normal;

[0035] Determine the transmission priority of each sub-backup time point based on the maximum recovery allowable time of each sub-backup data, wherein the greater the maximum recovery allowable time of the sub-backup data, the smaller the transmission priority of the sub-backup data;

[0036] Constructing a preset number of data transmission channels with different bandwidths, wherein the data transmission channels are used to transmit data to the backup cloud host;

[0037] Allocate a preset number of the sub-backup data with the highest transmission priority from the highest to the lowest to each of the transmission channels, wherein the higher the transmission priority of the sub-backup data is, the larger the bandwidth of the transmission channel of the sub-backup data is;

[0038] Each of the sub-backup data is sent to the backup cloud host based on each of the transmission channels.

[0039] Optionally, the local database includes a first local cache database and a second local cache database, wherein the read and write speed of the first local cache database is greater than the read and write speed of the second local cache database, and the data storage upper limit of the first local cache database is less than the data storage upper limit of the second local cache database, and the data backup and recovery method of the cloud host includes:

[0040] When the amount of data in the first local cache database is greater than a preset value, part of the image files cached in the first local cache database are transferred to the second local cache database.

[0041] In a second aspect, the data backup and recovery device of the cloud host provided by the present application includes:

[0042] A detection module, used to detect whether the target cloud host is abnormally shut down;

[0043] A backup module, used for backing up the data of the target cloud host to obtain a backup data set when the target cloud host is not abnormally shut down;

[0044] an acquisition module, configured to acquire, when the target cloud host is abnormally shut down, a current cloud server region and a target cloud server region where the target cloud host is located, wherein the current cloud server region includes the target cloud host, and the target cloud server region does not include the target cloud host;

[0045] A recovery module, used to create a backup cloud host on the target cloud server region based on the backup data set and restore data of the backup cloud host;

[0046] The running module is used to run the backup cloud host.

[0047] Optionally, when the target cloud host is abnormally shut down, obtaining the current cloud server region and the target cloud server region where the target cloud host is located includes:

[0048] In the event that the target cloud host is abnormally shut down, obtaining the current cloud server region where the target cloud host is located;

[0049] Obtaining the geographical distance between each cloud server region and the current cloud server region;

[0050] Determine the cloud server regions whose regional distance is less than a preset distance value as candidate cloud server regions, and obtain multiple candidate cloud server regions;

[0051] Obtain the number of cloud hosts and average latency of cloud hosts created in each of the candidate cloud server regions;

[0052] Determine the regional priority of the candidate cloud server region based on the regional distance of the candidate cloud server region, the number of cloud hosts, and the average value of cloud host delay, wherein the smaller the regional distance, the greater the regional priority, the greater the number of cloud hosts, the lower the regional priority, and the higher the average value of cloud host delay, the lower the regional priority;

[0053] The candidate cloud server region with the highest region priority is determined as the target cloud server region.

[0054] Optionally, when the target cloud host is not abnormally shut down, backing up the data of the target cloud host to obtain a backup data set includes:

[0055] Acquire snapshot data of the target cloud host according to a preset period to obtain multiple snapshot data;

[0056] Building a mirror file based on the snapshot data to obtain a plurality of mirror files corresponding to the plurality of snapshot data;

[0057] The plurality of mirror files are stored in a local database to obtain a backup data set, wherein the backup data set includes mirror files at a plurality of different backup time points, and the backup time point of the mirror file is the generation time of the snapshot data corresponding to the mirror file.

[0058] Optionally, the step of creating a backup cloud host in the target cloud server region based on the backup data set and restoring data of the backup cloud host includes:

[0059] Obtaining the backup time point of each image file in the backup data set;

[0060] Obtaining the abnormal time when the target cloud host is abnormally shut down;

[0061] Determine a backup recovery time point based on the abnormal time;

[0062] Obtain a target backup time point that matches the backup and restore time point, the target backup time point being the backup time point before the backup and restore time point or the backup time point after the backup and restore time point;

[0063] Obtaining the target image file corresponding to the target backup time point;

[0064] The backup cloud host is created based on the target image file and the data of the backup cloud host is restored.

[0065] Optionally, the creating the backup cloud host based on the target image file and restoring data of the backup cloud host includes:

[0066] Acquire the system parameters and target backup data of the target cloud host from the target image file;

[0067] Building the backup cloud host based on the system parameters of the target cloud host;

[0068] The target backup data is sent to the backup cloud host so that the backup cloud host and the target cloud host have the same system parameters and data.

[0069] Optionally, sending the target backup data to the backup cloud host so that the backup cloud host and the target cloud host have the same system parameters and data includes:

[0070] Splitting the target backup data into multiple sub-backup data;

[0071] Obtaining the maximum allowable recovery time of each of the sub-backup data from when the cloud host is abnormal to when the cloud host is restored to normal;

[0072] Determine the transmission priority of each sub-backup time point based on the maximum recovery allowable time of each sub-backup data, wherein the greater the maximum recovery allowable time of the sub-backup data, the smaller the transmission priority of the sub-backup data;

[0073] Constructing a preset number of data transmission channels with different bandwidths, wherein the data transmission channels are used to transmit data to the backup cloud host;

[0074] Allocate a preset number of the sub-backup data with the highest transmission priority from the highest to the lowest to each of the transmission channels, wherein the higher the transmission priority of the sub-backup data is, the larger the bandwidth of the transmission channel of the sub-backup data is;

[0075] Each of the sub-backup data is sent to the backup cloud host based on each of the transmission channels.

[0076] Optionally, the local database includes a first local cache database and a second local cache database, wherein the read and write speed of the first local cache database is greater than the read and write speed of the second local cache database, and the data storage upper limit of the first local cache database is less than the data storage upper limit of the second local cache database, and the data backup and recovery method of the cloud host includes:

[0077] When the amount of data in the first local cache database is greater than a preset value, part of the image files cached in the first local cache database are transferred to the second local cache database.

[0078] In a third aspect, the electronic device provided in the present application includes a memory and a processor, the memory stores a computer program, and the processor is used to run the computer program in the memory to implement the steps in the data backup and recovery method of the cloud host provided in the present application.

[0079] In a fourth aspect, the computer-readable storage medium provided in the present application stores a plurality of instructions, which are suitable for loading by a processor to implement the steps in the data backup and recovery method of the cloud host provided in the present application.

[0080] In a fifth aspect, the computer program product provided in the present application includes a computer program or instructions, which, when executed by a processor, implement the steps in the data backup and recovery method of the cloud host provided in the present application.

[0081] In this application, compared with the related art, it is detected whether the target cloud host is shut down abnormally; if the target cloud host is not shut down abnormally, the data of the target cloud host is backed up to obtain a backup data set; if the target cloud host is shut down abnormally, the current cloud server region and the target cloud server region where the target cloud host is located are obtained, wherein the current cloud server region includes the target cloud host, and the target cloud server region does not include the target cloud host; based on the backup data set, a backup cloud host is created on the target cloud server region and the data of the backup cloud host is restored; and the backup cloud host is run. This application can quickly back up and restore data in different regions, which can improve the applicability of data backup and recovery of cloud hosts. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0083] Figure 1 This is a scenario diagram of a data backup and recovery system for a cloud host provided in an embodiment of the present application;

[0084] Figure 2 It is a flowchart of an embodiment of a data backup and recovery method for a cloud host provided by an embodiment of the present application;

[0085] Figure 3 It is a structural diagram of a data backup and recovery device for a cloud host provided in an embodiment of the present application;

[0086] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0087] It should be noted that the principle of the present application is illustrated by implementing it in an appropriate computing environment. The following description is based on the illustrated specific embodiments of the present application, and should not be considered as limiting other specific embodiments of the present application that are not described in detail herein.

[0088] In the following description of the present application, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0089] In the following description of the present application, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0090] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0091] In order to improve the data backup and recovery effect of the cloud host, the embodiments of the present application provide a data backup and recovery method for the cloud host, a data backup and recovery device for the cloud host, an electronic device, a computer-readable storage medium, and a computer program product. The data backup and recovery method for the cloud host can be executed by the data backup and recovery device for the cloud host, or by an electronic device integrated with the data backup and recovery device for the cloud host.

[0092] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0093] Please refer to Figure 1 ,This application also provides a data backup and recovery system for a cloud host, such as Figure 1 As shown, the data backup and recovery system of the cloud host includes an electronic device 100, and the electronic device 100 is integrated with the data backup and recovery device of the cloud host provided by the present application.

[0094] Among them, the electronic device 100 can be any device equipped with a processor and has processing capabilities, such as mobile electronic devices with processors such as smart phones, tablet computers, PDAs, laptops, smart speakers, or fixed electronic devices with processors such as desktop computers, televisions, servers, industrial equipment, etc.

[0095] In addition, if Figure 1As shown, the data backup and recovery system of the cloud host may further include a memory 200 for storing original data, intermediate data, and result data.

[0096] In the embodiment of the present application, the memory may be a cloud memory. Cloud storage is a new concept extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as the storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of storage devices of various types (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.

[0097] At present, the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume. The physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (ID, ID entity). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.

[0098] The process of the storage system allocating physical storage space to a logical volume is as follows: based on the estimated capacity of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of independent redundant disk arrays (RAID, Redundant Array of Independent Disks), the physical storage space is pre-divided into stripes. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.

[0099] It should be noted that Figure 1 The scenario diagram of the data backup and recovery system of the cloud host shown is only an example. The data backup and recovery system and scenario of the cloud host described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. Ordinary technicians in this field can know that with the evolution of the data backup and recovery system of the cloud host and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.

[0100] It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.

[0101] Please refer to Figure 2 , Figure 2 FIG. 1 is a flow chart of an embodiment of a data backup and recovery method for a cloud host provided in an embodiment of the present application. Figure 2 As shown, the process of the data backup and recovery method of the cloud host provided by this application is as follows:

[0102] 201. Detect whether the target cloud host is shut down abnormally.

[0103] Cloud host is an important part of cloud computing in infrastructure application. It is located at the bottom of the pyramid of cloud computing industry chain. Its products are derived from cloud computing platform. The platform integrates the three core elements of Internet application: computing, storage, and network, and provides users with public Internet infrastructure services. Cloud host is a virtualization technology similar to VPS host. VPS uses virtual software, VZ or VM to virtualize multiple parts similar to independent hosts on a host, which can realize single machine multi-user. Each part can have a separate operating system and the management method is the same as the host. Cloud host is a virtualization of multiple parts similar to independent hosts on a group of cluster hosts. Each host in the cluster has a mirror of the cloud host, which greatly improves the security and stability of the virtual host. Unless all the hosts in the cluster have problems, the cloud host will be inaccessible.

[0104] In the embodiment of the present application, the target cloud host is a cloud host on the cloud platform. The cloud platform includes multiple cloud server regions, and each cloud server region is deployed with multiple cloud hosts. The cloud server regions can be divided according to administrative regions or other regions.

[0105] In the embodiment of the present application, each cloud host is determined as a target cloud host in turn.

[0106] 202. When the target cloud host is not abnormally shut down, back up the data of the target cloud host to obtain a backup data set.

[0107] In the embodiment of the present application, when the target cloud host is not abnormally shut down, the data of the target cloud host is backed up to obtain a backup data set, including:

[0108] (1) Obtain snapshot data of the target cloud host according to a preset period to obtain multiple snapshot data.

[0109] Among them, the preset period can be 12 hours, 24 hours, etc., which can be set according to the specific situation.

[0110] (2) Building a mirror file based on the snapshot data to obtain multiple mirror files corresponding to the multiple snapshot data.

[0111] (3) Multiple image files are stored in a local database to obtain a backup data set, where the backup data set includes image files at multiple different backup time points, where the backup time point of the image file is the generation time of the snapshot data corresponding to the image file.

[0112] In the embodiment of the present application, the image file includes system parameters and backup data. The system parameters are used to create a cloud host, and the backup data is used to restore data.

[0113] 203. When the target cloud host is abnormally shut down, obtain the current cloud server region where the target cloud host is located and the target cloud server region.

[0114] The current cloud server region includes the target cloud host, while the target cloud server region does not include the target cloud host.

[0115] In the embodiment of the present application, when the target cloud host is abnormally shut down, obtaining the current cloud server region and the target cloud server region where the target cloud host is located includes:

[0116] (1) When the target cloud host is abnormally shut down, obtain the current cloud server region where the target cloud host is located.

[0117] (2) Obtain the geographical distance between each cloud server region and the current cloud server region.

[0118] In the embodiment of the present application, the geographical distance between each cloud server region and the current cloud server region is preset. For example, the distance between the East China 1 cloud server region and the East China 2 cloud server region is 200 km.

[0119] (3) Cloud server regions whose regional distances are less than a preset distance value are determined as candidate cloud server regions, thereby obtaining a plurality of candidate cloud server regions.

[0120] The preset distance value may be set according to specific circumstances. For example, the preset distance value is 150 km.

[0121] (4) Obtain the number of cloud hosts and the average latency of cloud hosts created in each candidate cloud server region.

[0122] (5) Determine the regional priority of the candidate cloud server region based on the regional distance, number of cloud hosts, and average cloud host latency of the candidate cloud server region.

[0123] The smaller the regional distance, the greater the regional priority; the larger the number of cloud hosts, the lower the regional priority; the higher the average cloud host latency, the lower the regional priority.

[0124] Further, obtain candidate cloud servers

[0125] (6) The candidate cloud server region with the highest regional priority is determined as the target cloud server region.

[0126] 204. Create a backup cloud host in the target cloud server region based on the backup data set and restore the data of the backup cloud host.

[0127] In the embodiment of the present application, creating a backup cloud host in the target cloud server region based on the backup data set and restoring the data of the backup cloud host includes:

[0128] (1) Obtain the backup time point of each image file in the backup data set.

[0129] In the embodiment of the present application, the backup time point is the time point when the snapshot data is generated. Therefore, each backup time point corresponds to a data to be backed up. Each preset period will generate a data to be backed up. For example, the preset period is one hour, and the backup time points are 10 o'clock, 11 o'clock and 12 o'clock respectively.

[0130] (2) Obtain the abnormal time when the target cloud host is abnormally shut down.

[0131] In the embodiment of the present application, the abnormal time is the time point when the abnormality is detected.

[0132] (3) Determine the backup recovery time point based on the abnormal time.

[0133] In the embodiment of the present application, a time point of a preset time before the abnormal time is determined as the backup recovery time point. The preset time can be set according to the specific situation.

[0134] In the embodiment of the present application, the backup and recovery time point can be 10:20, 10:30, etc., which can be set according to the specific situation.

[0135] (4) Obtain a target backup time point that matches the backup recovery time point, where the target backup time point is a backup time point before the backup recovery time point or a backup time point after the backup recovery time point.

[0136] In a specific embodiment, the backup time point closest to the backup recovery time point after the backup recovery time point is determined as the first backup time point, and the backup time point closest to the backup recovery time point before the backup recovery time point is determined as the second backup time point. The first backup time point and the second backup time point are randomly determined as target backup time points that match the backup recovery time points.

[0137] (5) Obtain the target image file corresponding to the target backup time point.

[0138] (6) Create a backup cloud host based on the target image file and restore the data of the backup cloud host.

[0139] In an embodiment of the present application, creating a backup cloud host based on a target image file and restoring data of the backup cloud host include:

[0140] (1) Obtain the system parameters and target backup data of the target cloud host from the target image file.

[0141] (2) Build a backup cloud host based on the system parameters of the target cloud host.

[0142] (3) Send the target backup data to the backup cloud host so that the backup cloud host and the target cloud host have the same system parameters and data.

[0143] In the embodiment of the present application, the target backup data is sent to the backup cloud host so that the backup cloud host and the target cloud host have the same system parameters and data, including:

[0144] (1) Split the target backup data into multiple sub-backup data.

[0145] (2) Obtain the maximum allowable recovery time for each sub-backup data from the time the cloud host is abnormal to the time the cloud host returns to normal.

[0146] In the embodiment of the present application, when the time reaches the maximum allowed recovery time of the sub-backup data, if the sub-backup data has not been restored, a data error will occur, resulting in access failure.

[0147] (3) The transmission priority of each sub-backup time point is determined based on the maximum allowed recovery time of each sub-backup data.

[0148] The longer the maximum allowed recovery time of the sub-backup data is, the lower the transmission priority of the sub-backup data is.

[0149] (4) Construct a preset number of data transmission channels with different bandwidths, where the data transmission channels are used to transmit data to the backup cloud host.

[0150] (5) Allocate a preset number of sub-backup data with the highest transmission priority from the highest to the lowest to each transmission channel.

[0151] The greater the transmission priority of the sub-backup data, the greater the bandwidth of the transmission channel of the sub-backup data.

[0152] (6) Send each sub-backup data to the backup cloud host based on each transmission channel.

[0153] Furthermore, the transmission speed and the amount of untransmitted data of each transmission channel are detected, and the congestion of the transmission channel is determined based on the transmission speed and the amount of untransmitted data of the transmission channel, and the sub-backup data with the highest transmission priority among the sub-backup data that have not entered the transmission channel is transmitted through the transmission channel with the lowest congestion. The higher the transmission speed of the transmission channel, the lower the congestion of the transmission channel, and the larger the amount of untransmitted data of the transmission channel, the higher the congestion of the transmission channel.

[0154] 205. Run the backup cloud host.

[0155] In the embodiment of the present application, multiple historical requests and corresponding historical responses of the target cloud host are obtained. Multiple historical requests are input into the backup cloud host, and current responses corresponding to the multiple historical requests are obtained. It is determined whether the current responses corresponding to the multiple historical requests are consistent with the historical responses corresponding to the multiple historical requests, and the proportion of historical requests whose current responses are consistent with the historical responses is obtained. If the proportion of historical requests whose current responses are consistent with the historical responses is greater than the preset proportion, it is determined that the backup cloud host has recovered to normal, and the backup cloud host is operated.

[0156] Furthermore, the request time of each historical request is obtained, and the multiple historical requests are input into the backup cloud host based on the order of the request time of each historical request to obtain the current responses corresponding to the multiple historical requests.

[0157] In the embodiment of the present application, the local database can be a Redis database, a SQLite database, etc., which is set according to the specific situation.

[0158] Furthermore, in order to reduce the number of mirror files in the local database. In a specific embodiment, the local database includes a first local cache database and a second local cache database, wherein the read and write speed of the first local cache database is greater than the read and write speed of the second local cache database, and the data storage upper limit of the first local cache database is less than the data storage upper limit of the second local cache database. For example, the first local cache database is Redis data, and the second local cache database is an Hbase database. When the amount of data in the first local cache database is greater than a preset value, part of the mirror files cached in the first local cache database are transferred to the second local cache database.

[0159] Correspondingly, obtaining multiple image files corresponding to the target backup time point that matches the backup recovery time point includes: first searching the image file at the target backup time point in the first local cache database, and if the first local cache database does not have the image file at the target backup time point, searching the image file at the target backup time point in the second local cache database. The first local cache database with a higher read and write speed and the second local cache database with a larger storage capacity cooperate with each other to store data, which can improve the speed of finding data.

[0160] Further, the cache time of each image file in the first local cache database is obtained, and the transfer priority of each image file is determined based on the cache time of each image file, wherein the longer the cache time of the image file is, the higher the transfer priority of the image file is. When the data amount of the image file cached in the first local cache database is greater than a preset value, the image file with the highest transfer priority is transferred from the first local cache database to the second local cache database.

[0161] Further, the cache time of each image file in the first local cache database and the number of times each image file is used are obtained, wherein the operation of using the image file is sequentially recorded as a number of times used, and the transfer priority of each image file is determined based on the cache time of each image file and the number of times used, wherein the shorter the cache time of the image file, the higher the transfer priority of the image file, and the shorter the cache time of the number of times used, the higher the transfer priority of the image file. When the data volume of the image file cached in the first local cache database is greater than a preset value, the image file with the highest transfer priority is transferred from the first local cache database to the second local cache database.

[0162] Furthermore, the backup time points of each mirror file in the first local cache database are obtained according to a preset period, and each backup time point is determined as a candidate backup time point, and the backup time point whose time difference with the candidate backup time point is within the preset time range is determined as the neighborhood time point of the candidate backup time point, and the number of neighborhood time points of the candidate backup time point is obtained, and the number of neighborhood time points of each backup time point is obtained. If the candidate backup time point is the backup time point with the largest number of neighborhood time points, the mirror files corresponding to some of the neighborhood time points of the candidate backup time point are transferred from the first local cache database to the second local cache database. The preset time range can be less than 3 hours, etc., which can be set according to the specific situation.

[0163] Furthermore, the image file corresponding to the neighboring time point closest to the target backup time point is transferred from the first local cache database to the second local cache database.

[0164] In order to facilitate better implementation of the data backup and recovery method of the cloud host provided in the embodiment of the present application, the embodiment of the present application also provides a data backup and recovery device of the cloud host based on the data backup and recovery method of the cloud host. The meanings of the terms are the same as those in the data backup and recovery method of the cloud host. For specific implementation details, please refer to the description in the above method embodiment.

[0165] Please refer to Figure 3 , Figure 3A schematic diagram of the structure of a data backup and recovery device for a cloud host provided in an embodiment of the present application, wherein the data backup and recovery device for a cloud host may include:

[0166] The detection module 701 is used to detect whether the target cloud host is abnormally shut down;

[0167] The backup module 702 is used to back up the data of the target cloud host when the target cloud host is not abnormally shut down, and obtain a backup data set;

[0168] The acquisition module 703 is used to acquire the current cloud server region and the target cloud server region where the target cloud host is located when the target cloud host is abnormally shut down, wherein the current cloud server region includes the target cloud host, and the target cloud server region does not include the target cloud host;

[0169] A recovery module 704 is used to create a backup cloud host in the target cloud server region based on the backup data set and restore the data of the backup cloud host;

[0170] The running module 705 is used to run the backup cloud host.

[0171] Optionally, when the target cloud host is abnormally shut down, the current cloud server region and the target cloud server region where the target cloud host is located are obtained, including:

[0172] When the target cloud host is abnormally shut down, obtain the current cloud server region where the target cloud host is located;

[0173] Get the geographical distance between each cloud server region and the current cloud server region;

[0174] Determine cloud server regions whose regional distances are less than a preset distance value as candidate cloud server regions, and obtain multiple candidate cloud server regions;

[0175] Get the number of cloud hosts and average latency of cloud hosts created in each candidate cloud server region;

[0176] The region priority of the candidate cloud server region is determined based on the region distance, number of cloud hosts, and average cloud host latency of the candidate cloud server region. The smaller the region distance, the greater the region priority; the larger the number of cloud hosts, the lower the region priority; the higher the average cloud host latency, the lower the region priority;

[0177] The candidate cloud server region with the highest regional priority is determined as the target cloud server region.

[0178] Optionally, when the target cloud host is not abnormally shut down, the data of the target cloud host is backed up to obtain a backup data set, including:

[0179] Acquire snapshot data of the target cloud host according to a preset period to obtain multiple snapshot data;

[0180] Building a mirror file based on the snapshot data to obtain multiple mirror files corresponding to the multiple snapshot data;

[0181] A plurality of image files are stored in a local database to obtain a backup data set, wherein the backup data set includes image files at a plurality of different backup time points, and the backup time point of the image file is the generation time of the snapshot data corresponding to the image file.

[0182] Optionally, creating a backup cloud host in the target cloud server region based on the backup data set and restoring data of the backup cloud host includes:

[0183] Obtain the backup time point of each image file in the backup data set;

[0184] Get the abnormal time when the target cloud host shuts down abnormally;

[0185] Determine the backup and recovery time point based on the abnormal time;

[0186] Obtain a target backup time point that matches the backup recovery time point, where the target backup time point is a backup time point before the backup recovery time point or a backup time point after the backup recovery time point;

[0187] Get the target image file corresponding to the target backup time point;

[0188] Create a backup cloud host based on the target image file and restore the data of the backup cloud host.

[0189] Optionally, create a backup cloud host based on the target image file and restore the data of the backup cloud host, including:

[0190] Obtain the target cloud host's system parameters and target backup data from the target image file;

[0191] Build a backup cloud host based on the system parameters of the target cloud host;

[0192] The target backup data is sent to the backup cloud host so that the backup cloud host and the target cloud host have the same system parameters and data.

[0193] Optionally, the target backup data is sent to the backup cloud host so that the backup cloud host and the target cloud host have the same system parameters and data, including:

[0194] Split the target backup data into multiple sub-backup data;

[0195] Get the maximum allowed recovery time for each sub-backup data from the cloud host abnormality to the cloud host recovery;

[0196] Determine the transmission priority of each sub-backup time point based on the maximum recovery allowed time of each sub-backup data, wherein the greater the maximum recovery allowed time of the sub-backup data, the smaller the transmission priority of the sub-backup data;

[0197] Constructing a preset number of data transmission channels with different bandwidths, where the data transmission channels are used to transmit data to the backup cloud host;

[0198] Allocate a preset number of sub-backup data with the highest transmission priority from the highest to the lowest to each transmission channel, wherein the higher the transmission priority of the sub-backup data is, the greater the bandwidth of the transmission channel of the sub-backup data is;

[0199] Each sub-backup data is sent to the backup cloud host based on each transmission channel.

[0200] Optionally, the local database includes a first local cache database and a second local cache database, wherein the read and write speed of the first local cache database is greater than the read and write speed of the second local cache database, and the data storage upper limit of the first local cache database is less than the data storage upper limit of the second local cache database. The data backup and recovery method of the cloud host includes:

[0201] When the amount of data in the first local cache database is greater than a preset value, part of the image files cached in the first local cache database are transferred to the second local cache database.

[0202] The specific implementation of each of the above modules can be found in the previous embodiments and will not be described in detail here.

[0203] An embodiment of the present application also provides an electronic device, including a memory and a processor, wherein the processor is used to execute the steps in the data backup and recovery method of the cloud host provided in this embodiment by calling a computer program stored in the memory.

[0204] Please refer to Figure 4 , Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0205] The electronic device may include components such as a processor 101 with one or more processing cores, a memory 102 with one or more computer-readable storage media, a power supply 103, and an input unit 104. Those skilled in the art will appreciate that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0206] The processor 101 is the control center of the electronic device, which uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 102, and calling data stored in the memory 102. Optionally, the processor 101 may include one or more processing cores; optionally, the processor 101 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 101.

[0207] The memory 102 can be used to store software programs and modules. The processor 101 executes various functional applications and data processing by running the software programs and modules stored in the memory 102. The memory 102 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 102 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 102 may also include a memory controller to provide the processor 101 with access to the memory 102.

[0208] The electronic device also includes a power supply 103 for supplying power to each component. Optionally, the power supply 103 can be logically connected to the processor 101 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 103 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0209] The electronic device may further include an input unit 104, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0210] Although not shown, the electronic device may also include a display unit, an image acquisition component, etc., which will not be described in detail here. Specifically in this embodiment, the processor 101 in the electronic device will load the executable code corresponding to one or more computer programs into the memory 102 according to the following instructions, and the processor 101 will execute the steps in the data backup and recovery method of the cloud host provided by the present application, such as:

[0211] Detect whether the target cloud host has been shut down abnormally; if the target cloud host has not been shut down abnormally, back up the data of the target cloud host and obtain a backup data set; if the target cloud host has been shut down abnormally, obtain the current cloud server region and the target cloud server region where the target cloud host is located, wherein the current cloud server region includes the target cloud host and the target cloud server region does not include the target cloud host; create a backup cloud host on the target cloud server region based on the backup data set and restore the data of the backup cloud host; run the backup cloud host.

[0212] It should be noted that the electronic device provided in the embodiment of the present application and the data backup and recovery method of the cloud host in the above embodiment belong to the same concept, and its specific implementation process is detailed in the above related embodiments and will not be repeated here.

[0213] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program stored therein is executed on the processor of the electronic device provided in the embodiment of the present application, the processor of the electronic device executes the steps in the data backup and recovery method of the cloud host provided in the present application. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0214] The present application also provides a computer program product or 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 executes various optional implementations of the above-mentioned cloud host data backup and recovery method.

[0215] The above is a detailed introduction to a data backup and recovery method and device for a cloud host provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0216] It should be noted that when the above embodiments of the present application are applied to specific products or technologies, the relevant data of the user is involved, and the user's permission or consent is required, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant region.

Claims

1. A data backup and recovery method for a cloud host, characterized in that: include: Detecting whether the target cloud host is abnormally shut down; In the case that the target cloud host does not shut down abnormally, backing up the data of the target cloud host to obtain a backup data set; In the case that the target cloud host is abnormally shut down, obtaining the current cloud server region and the target cloud server region where the target cloud host is located, wherein the current cloud server region includes the target cloud host, and the target cloud server region does not include the target cloud host; Creating a backup cloud host on the target cloud server region based on the backup data set and restoring data of the backup cloud host; Run the backup cloud host.

2. The data backup and recovery method of the cloud host according to claim 1, characterized in that: When the target cloud host is abnormally shut down, obtaining the current cloud server region and the target cloud server region where the target cloud host is located includes: In the event that the target cloud host is abnormally shut down, obtaining the current cloud server region where the target cloud host is located; Obtaining the geographical distance between each cloud server region and the current cloud server region; Determine the cloud server regions whose regional distance is less than a preset distance value as candidate cloud server regions, and obtain multiple candidate cloud server regions; Obtain the number of cloud hosts and average latency of cloud hosts created in each of the candidate cloud server regions; Determine the regional priority of the candidate cloud server region based on the regional distance of the candidate cloud server region, the number of cloud hosts, and the average value of cloud host delay, wherein the smaller the regional distance, the greater the regional priority, the greater the number of cloud hosts, the lower the regional priority, and the higher the average value of cloud host delay, the lower the regional priority; The candidate cloud server region with the highest region priority is determined as the target cloud server region.

3. The data backup and recovery method of the cloud host according to claim 2, characterized in that: In the case that the target cloud host does not shut down abnormally, backing up the data of the target cloud host to obtain a backup data set includes: Acquire snapshot data of the target cloud host according to a preset period to obtain multiple snapshot data; Building a mirror file based on the snapshot data to obtain a plurality of mirror files corresponding to the plurality of snapshot data; The plurality of mirror files are stored in a local database to obtain a backup data set, wherein the backup data set includes mirror files at a plurality of different backup time points, and the backup time point of the mirror file is the generation time of the snapshot data corresponding to the mirror file.

4. The data backup and recovery method of the cloud host according to claim 3, characterized in that: The step of creating a backup cloud host in the target cloud server region based on the backup data set and restoring data of the backup cloud host includes: Obtaining the backup time point of each image file in the backup data set; Obtaining the abnormal time when the target cloud host is abnormally shut down; Determine a backup recovery time point based on the abnormal time; Obtain a target backup time point that matches the backup and restore time point, the target backup time point being the backup time point before the backup and restore time point or the backup time point after the backup and restore time point; Obtaining the target image file corresponding to the target backup time point; The backup cloud host is created based on the target image file and the data of the backup cloud host is restored.

5. The data backup and recovery method of the cloud host according to claim 4, characterized in that: The step of creating the backup cloud host based on the target image file and restoring data of the backup cloud host includes: Acquire the system parameters and target backup data of the target cloud host from the target image file; Building the backup cloud host based on the system parameters of the target cloud host; The target backup data is sent to the backup cloud host so that the backup cloud host and the target cloud host have the same system parameters and data.

6. The data backup and recovery method of the cloud host according to claim 5, characterized in that: The sending the target backup data to the backup cloud host so that the backup cloud host and the target cloud host have the same system parameters and data includes: Splitting the target backup data into multiple sub-backup data; Obtaining the maximum allowable recovery time of each of the sub-backup data from when the cloud host is abnormal to when the cloud host is restored to normal; Determine the transmission priority of each sub-backup time point based on the maximum recovery allowable time of each sub-backup data, wherein the greater the maximum recovery allowable time of the sub-backup data, the smaller the transmission priority of the sub-backup data; Constructing a preset number of data transmission channels with different bandwidths, wherein the data transmission channels are used to transmit data to the backup cloud host; Allocate a preset number of the sub-backup data with the highest transmission priority from the highest to the lowest to each of the transmission channels, wherein the greater the transmission priority of the sub-backup data, the greater the bandwidth of the transmission channel of the sub-backup data; Each of the sub-backup data is sent to the backup cloud host based on each of the transmission channels.

7. The data backup and recovery method of the cloud host according to claim 6, characterized in that: The local database includes a first local cache database and a second local cache database, wherein the read and write speed of the first local cache database is greater than the read and write speed of the second local cache database, and the data storage upper limit of the first local cache database is less than the data storage upper limit of the second local cache database, and the data backup and recovery method of the cloud host includes: When the amount of data in the first local cache database is greater than a preset value, part of the image files cached in the first local cache database are transferred to the second local cache database.

8. A data backup and recovery device for a cloud host, characterized in that: include: A detection module, used to detect whether the target cloud host is abnormally shut down; A backup module, used for backing up the data of the target cloud host to obtain a backup data set when the target cloud host is not abnormally shut down; an acquisition module, configured to acquire, when the target cloud host is abnormally shut down, a current cloud server region and a target cloud server region where the target cloud host is located, wherein the current cloud server region includes the target cloud host, and the target cloud server region does not include the target cloud host; A recovery module, used to create a backup cloud host on the target cloud server region based on the backup data set and restore data of the backup cloud host; The running module is used to run the backup cloud host.

9. An electronic device, characterized in that: It comprises a memory and a processor, the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the steps in the data backup and recovery method of the cloud host according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the data backup and recovery method of the cloud host according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Cross-data-center cloud host disaster recovery method and system

    CN109828867A

  • Cross-regional message copying method and system, electronic equipment and readable storage medium

    CN113688111A

  • Cloud cross-regional disaster recovery system

    CN117675533A

  • Unified interface for cloud-based backup and restoration

    US9940203B1

Cited By

  • Cloud host management method and device based on cloud platform, equipment and storage medium

    CN121070695A

  • Cloud host management method and device based on cloud platform, equipment and storage medium

    CN121070695B