Backup data recovery method and computing device
By monitoring the changes in the restored backup data, and using incremental data recovery to restore the backup data to be restored when the restored backup data is available, the problems of high resource consumption and low efficiency in the existing technology are solved, and efficient backup data recovery is achieved.
Patent Information
- Application Number
- CN202210912494.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-30
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2042-07-30
AI Technical Summary
Existing technologies, when restoring backup data, employ a full data recovery method, which results in high resource consumption and low recovery efficiency.
By monitoring whether the restored backup data has changed, and when the restored backup data is available, incremental data recovery is used to restore the backup data to be restored, including restoring incremental backup data that differs between the restored backup data and the backup data to be restored.
It significantly reduces the computing resources and time costs required to restore backup data, and improves the efficiency of data restoration.
Smart Images

Figure CN115421969B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data backup and recovery, and in particular, to a backup data recovery method and a computing device. BACKGROUND
[0002] Currently, full data backup and incremental data backup are usually used for data backup. Full data backup refers to backup of all data, and incremental data backup refers to backup of differential data generated based on previous backup data. For example, on the first day, full data backup is used for backup, and on the second day, differential data generated based on the full data of the first day is backed up, that is, incremental data backup is used for backup. By combining full data backup and incremental data backup, the computing resources and time cost for backup data can be reduced. However, when restoring backup data, full data recovery is usually used to restore all backup data. For example, when restoring the backup data of the first day, full data is restored, and when restoring the backup data of the second day, the full data of the first day and the incremental data of the second day are restored to obtain all data of the second day. There is no suitable way to reduce the resources occupied when restoring backup data, resulting in low efficiency of restoring backup data. SUMMARY
[0003] Embodiments of the present application provide a backup data recovery method and a computing device, which are used to reduce the resources occupied when restoring data and improve the efficiency of restoring data.
[0004] To achieve the above object, the embodiments of the present application provide the following technical solutions.
[0005] In a first aspect, a backup data recovery method is provided, comprising: obtaining an identifier of backup data to be restored; when it is determined that the backup data to be restored is incremental backup data, obtaining restored backup data according to the identifier of the backup data to be restored; wherein the restored backup data and the backup data to be restored are backup data obtained based on the same full backup data, and the backup time of the restored backup data is earlier than the backup time of the backup data to be restored; when it is determined that the restored backup data has not been changed, restoring the backup data to be restored in an incremental data recovery manner; wherein the incremental data recovery manner refers to a manner of restoring the backup data to be restored based on differential incremental backup data between the backup data to be restored and the restored backup data.
[0006] Currently, full data recovery mode is adopted for backup data recovery, and in the process of recovering backup data, more resources are occupied and the recovery efficiency is low. To this end, the backup data recovery method provided in the application is adopted, when the backup data to be recovered is incremental backup data, whether the recovered backup data has changed is listened to to determine whether the recovered backup data is available, and in the case that the recovered backup data is available, the incremental backup data is recovered, so as to greatly reduce the resources occupied when recovering backup data and improve the efficiency of recovering data.
[0007] In a possible implementation, in the case that it is determined that the recovered backup data has not been changed, the backup data to be recovered is recovered in the incremental data recovery mode, including: reading the differential incremental backup data between the recovered backup data and the backup data to be recovered according to the identifier of the recovered backup data and the identifier of the backup data to be recovered; and recovering the backup data to be recovered according to the differential incremental backup data and the recovered backup data.
[0008] In this possible implementation, a specific implementation of recovering the backup data to be recovered in the incremental data recovery mode is provided, wherein the differential incremental backup data is determined and recovered, and then the required backup data is obtained in combination with the recovered backup data. Compared with the mode of recovering all data, the computing resources and time cost occupied when recovering data are greatly saved.
[0009] In a possible implementation, the method further includes: after recovering the recovered backup data, when the recovered backup data is changed, recording the data change state of the recovered backup data as changed; and when the recovered backup data is not changed, recording the data change state of the recovered backup data as unchanged; and after obtaining the recovered backup data, the method further includes: determining whether the recovered backup data has changed based on the data change state of the recovered backup data.
[0010] In this possible implementation, a specific implementation of recording the data change state of the recovered backup data is provided, and the implementability of the scheme is improved.
[0011] In a possible implementation, the method further includes: after recovering the recovered backup data, when the recovered backup data is changed, recording the data change state of the recovered backup data; and when the recovered backup data is not changed, not recording the data change state of the recovered backup data; and after obtaining the recovered backup data, the method further includes: determining whether the recovered backup data has changed based on whether the data change state of the recovered backup data is recorded.
[0012] In the possible implementation, the method for recording the data change state of the restored backup data is provided, and the practicability of the scheme is improved.
[0013] In a possible implementation, before determining whether the restored backup data is changed, the method further includes: replacing an operating system file system function with a MyWrite file system function, the MyWrite file system function being used for recording the data change state of the restored backup data.
[0014] In the possible implementation, the method for recording the data change state of the restored backup data is provided, and the practicability of the scheme is improved.
[0015] In a possible implementation, after the identifier of the backup data to be restored is obtained, the method further includes: if the identifier of the backup data to be restored is an incremental backup identifier, determining that the backup data to be restored is incremental backup data.
[0016] In the possible implementation, the method for determining the backup data type of the backup data to be restored according to the identifier of the backup data to be restored is provided, and the practicability of the scheme is improved.
[0017] In a possible implementation, the identifier of the backup data to be restored includes a full backup data serial number and an incremental backup data serial number; if the identifier of the backup data to be restored is an incremental backup identifier, determining that the backup data to be restored is incremental backup data includes: if the incremental backup data identifier includes the incremental backup data serial number, determining that the backup data to be restored is incremental backup data.
[0018] In the possible implementation, the method for determining the backup data type of the backup data to be restored according to the identifier of the backup data to be restored is provided, and the practicability of the scheme is improved.
[0019] In a possible implementation, the method further includes: when the backup data to be restored is full backup data, restoring the backup data to be restored in a full data restoration manner; the full data restoration manner refers to performing data restoration on all data in the backup data to be restored.
[0020] In the possible implementation, the full data restoration manner is provided when the backup data to be restored is full backup data, and the integrity of the scheme is improved.
[0021] In a possible implementation, the method further includes: in a case where it is determined that the restored backup data has changed, restoring the backup data to be restored in a full data restoration manner; the full data restoration manner refers to performing data restoration on all data in the backup data to be restored.
[0022] In this possible implementation, the restoration manner of the backup data to be restored when the restored backup data has changed is provided, which helps to improve the completeness of the scheme.
[0023] In a second aspect, a computing device is provided, including functional units for performing any of the methods provided in the first aspect, and the actions performed by each functional unit are implemented by hardware or corresponding software executed by hardware. For example, the computing device can include an obtaining unit and a processing unit; the obtaining unit is configured to obtain an identifier of backup data to be restored; the obtaining unit is further configured to, in a case where it is determined that the backup data to be restored is incremental backup data, obtain, according to the identifier of the backup data to be restored, restored backup data; the restored backup data and the backup data to be restored are backup data obtained based on the same full backup data, and the backup time of the restored backup data is earlier than the backup time of the backup data to be restored; the processing unit is configured to, in a case where it is determined that the restored backup data has not changed, restore the backup data to be restored in an incremental data restoration manner; the incremental backup data restoration manner refers to a manner of restoring the backup data to be restored based on a difference between the backup data to be restored and the restored backup data.
[0024] In a third aspect, a computing device is provided, including a processor and a memory. The processor is connected with the memory, and the memory is configured to store computer execution instructions, and the processor executes the computer execution instructions stored in the memory, so as to implement any of the methods provided in the first aspect.
[0025] In a fourth aspect, a chip is provided, including a processor and an interface circuit; the interface circuit is configured to receive code instructions and transmit the code instructions to the processor; the processor is configured to run the code instructions to execute any of the methods provided in the first aspect.
[0026] In a fifth aspect, a computer readable storage medium is provided, including computer execution instructions, when the computer execution instructions are run on a computer, causing the computer to execute any of the methods provided in the first aspect.
[0027] In a sixth aspect, a computer program product is provided, including computer execution instructions, when the computer execution instructions are run on a computer, causing the computer to execute any of the methods provided in the first aspect.
[0028] The technical effects brought by any implementation manner of the second aspect to the sixth aspect can refer to the technical effects brought by the corresponding implementation manner in the first aspect, which will not be described here again. BRIEF DESCRIPTION OF DRAWINGS
[0029] Figure 1 A schematic diagram of a data backup and recovery scenario is shown.
[0030] Figure 2 A schematic diagram of a hardware structure of a computing device provided by an embodiment of the present application is shown.
[0031] Figure 3 A schematic diagram of a differential incremental data backup method provided by an embodiment of the present application is shown.
[0032] Figure 4 A flowchart of a backup data recovery method provided by an embodiment of the present application is shown.
[0033] Figure 5 A schematic diagram of an operating system provided by an embodiment of the present application is shown.
[0034] Figure 6 A schematic diagram of an incremental backup data recovery method provided by an embodiment of the present application is shown.
[0035] Figure 7 A schematic diagram of a cumulative incremental data backup method provided by an embodiment of the present application is shown.
[0036] Figure 8 A flowchart of a backup data recovery method provided by an embodiment of the present application is shown.
[0037] Figure 9 A schematic diagram of a computing device provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0038] In the description of the present application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this document is only a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can mean that A exists alone, A and B exist together, and B exists alone. In addition, "at least one" means one or more, and "multiple" means two or more. "First", "second", etc. do not limit the quantity and execution order, and "first", "second", etc. also do not necessarily mean different.
[0039] It should be noted that, in this application, the terms "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0040] Currently, data backup and recovery can be applied to, for example... Figure 1 The scenario depicted includes a production system and a backup system. The production system, which can be understood as the user's host, is used to meet the user's data processing needs. The backup system periodically replicates data from the production system. When the production system fails, it can restore the backup data to the user, preventing data loss. Additionally, when the backup system possesses the data processing capabilities of the production system, it can also serve as a replacement production system, allowing users to read or write backup data when the production system is unavailable. The production system includes computing and storage devices. The processing devices access and process data stored in the storage devices. These processing devices execute user-specified tasks for applications using computer instructions stored in the operating system; this process includes data processing for the application. A backup agent acts as a communication module between the backup and production systems. It identifies information in the production system and replicates data to the backup system, enabling interaction between them. The backup system also includes computing and storage devices to process and store backup data.
[0041] This application does not limit the specific form of the computing device. For example, the computing device can be a terminal device or a network device. The terminal device can be referred to as: terminal, user equipment (UE), mobile device, user terminal, wireless communication device, etc. Specifically, the terminal device can be a mobile phone, augmented reality (AR) device, virtual reality (VR) device, tablet computer, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc. The network device can be a server, etc. The server can be a single physical or logical server, or two or more physical or logical servers sharing different responsibilities and cooperating to achieve the various functions of the server.
[0042] In a possible implementation, the production system and the backup system can communicate through a network. Optionally, the communication network is a wired network or a wireless network.
[0043] Optionally, the wireless network or the wired network uses standard communication techniques and / or protocols. The network is typically the Internet, but can also be any network, including, but not limited to, a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network, or any combination thereof. In some embodiments, techniques and / or formats including hyper text mark-up language (HTML), extensible markup language (XML), etc. are used to represent data exchanged over the network. In addition, conventional encryption technologies such as secure socket layer (SSL), transport layer security (TLS), virtual private network (VPN), internet protocol security (IPsec), etc. can be used to encrypt all or some links. In other embodiments, custom and / or proprietary data communication techniques can be used instead of or in addition to the above-described data communication techniques.
[0044] Embodiments of the present application provide a backup data recovery method, which can be applied to a computing device. Embodiments of the present application do not make any limitation on the specific form of the computing device. For example, the computing device can be a terminal device. The terminal device can also be referred to as a terminal, a user equipment (UE), a terminal device, a user terminal, a wireless communication device, a user agent, a user device, etc. The terminal device can be a mobile phone, an augmented reality (AR) device, a virtual reality (VR) device, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc.
[0045] It can be understood that the computing device can be a device corresponding to the production system or the backup system, or a device corresponding to the integrated production system and the backup system, or a device capable of obtaining the backup data corresponding to the backup system.
[0046] In the present application, the structure of the computing device can be as shown in Figure 2 As shown in Figure 2 , a hardware structure schematic diagram of a computing device 20 provided by an embodiment of the present application is shown. The computing device 20 can be used to implement the functions of the computing device described above.
[0047] Figure 2 The computing device 20 shown in the figure can include a processor 201, a memory 202, a communication interface 203 and a bus 204. The processor 201, the memory 202 and the communication interface 203 can be connected through the bus 204.
[0048] The processor 201 is the control center of the computing device 20, and can be a general central processing unit (CPU), or other general-purpose processors, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0049] As an example, the processor 201 can include one or more CPUs, such as the CPU 0 and the CPU 1 shown in Figure 2 .
[0050] The memory 202 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a magnetic disk storage medium or other magnetic storage devices, or any other medium capable of carrying or storing desired program codes in the form of instructions or data structures and accessible by a computer, but not limited to this.
[0051] In a possible implementation, the memory 202 can exist independently of the processor 201. The memory 202 can be connected to the processor 201 through the bus 204, and used to store data, instructions or program codes. When the processor 201 invokes and executes the instructions or program codes stored in the memory 202, the backup data recovery method provided by the embodiment of the present application can be implemented.
[0052] In another possible implementation, the memory 202 can also be integrated with the processor 201.
[0053] The communication interface 203 is configured to connect the computing device 20 to other devices through a communication network, which can be an Ethernet, a radio access network (RAN), a wireless local area network (WLAN), or the like. The communication interface 203 can include a receiving unit configured to receive data, and a sending unit configured to send data.
[0054] The bus 204 can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, Figure 2 In the figure, only one thick line is used to represent the bus, but it does not mean that there is only one bus or only one type of bus.
[0055] It should be noted that Figure 2 The structure shown in the figure does not constitute a limitation on the computing device 20, except Figure 2 In addition to the components shown, the computing device 20 can include more or less components, or combine some components, or different arrangement of components.
[0056] Currently, in order to save resources when backing up data, an incremental data backup mode is proposed, which backs up the difference data generated based on the backup data. Among them, there are two ways of differential incremental data backup and cumulative incremental data backup. The following will describe the technical solutions provided by the embodiments of the present application in combination with the drawings.
[0057] As Figure 3As shown, it is a schematic diagram of a differential incremental data backup mode. The differential incremental data backup mode refers to backup of differential data generated based on previous backup data. For example, on the first day, full data backup mode is used to backup all data; on the second day, differential incremental data backup mode is used to backup differential data generated based on all data on the first day; on the third day, differential incremental data backup mode is used to backup differential data generated based on all data on the second day; on the fourth day, differential incremental data backup mode is used to backup differential data generated based on all data on the third day; on the fifth day, full data backup mode is used to backup all data.
[0058] Among them, the backup data of the first day and the fifth day is full backup data, and the backup data of the second day, the third day and the fourth day is incremental backup data. Full backup data refers to all data, and incremental backup data refers to differential data generated based on already backed up data. The full backup data and the incremental backup data are types of backup data, and correspond one-to-one to backup modes, that is, full data backup mode is used to obtain full backup data, and incremental data backup mode is used to obtain incremental backup data.
[0059] It can be understood that the incremental backup data of the second day, the third day and the fourth day does not represent all data of the second day, the third day and the fourth day. That is, if all data of the second day is to be obtained, the full backup data of the first day and the incremental backup data of the second day are needed to be restored, and all data of the second day is obtained according to the restored full backup data and the incremental backup data of the second day; similarly, if all data of the third day is to be obtained, the full backup data of the first day, the incremental backup data of the second day and the incremental backup data of the third day are needed to be restored, and all data of the third day is obtained according to the restored full backup data, the incremental backup data of the second day and the incremental backup data of the third day.
[0060] It can be understood that backup of differential data is helpful to realize data backup with less computing resources and time cost, thereby greatly improving the efficiency of backup data.
[0061] Among them, the above-mentioned first day, second day and the like time information represent backup time. For example, the first day can be understood as the time of starting backup, the second day to the fourth day can be understood as the backup time of differential data generated for backup data, and the fifth day can be understood as the time of complete backup of data, such as weekends. Assuming that the full data backup time is a backup period, then by periodically performing full data backup and using differential incremental data backup within the period, it is helpful to improve the efficiency of backup data while ensuring the accuracy of backup data.
[0062] For the backup data obtained by the above difference incremental data backup mode, currently, when restoring the backup data, a full data recovery mode is usually adopted, such as the recovery action performed when obtaining all data of the second day and the third day as described above. However, this kind of recovery mode is relatively cumbersome, and the recovery process occupies more computing resources and time cost. In this regard, the present application provides a backup data recovery method, which determines whether the restored backup data is available by listening to whether the restored backup data has changed, and in the case that the restored backup data is available, restores the incremental backup data, thereby greatly reducing the resources occupied when restoring the backup data.
[0063] As shown in Figure 4 Fig. 1 is a flowchart of a backup data recovery method provided by an embodiment of the present application. The method comprises the following steps:
[0064] S401, obtaining an identifier of backup data to be restored.
[0065] It can be understood that the method provided by the present application is used to restore backup data, and when the computing device can obtain the backup data and has the ability to restore the backup data, the method provided by the embodiment of the present application can be executed. Therefore, when the production system or the backup system restores the backup data, the method provided by the embodiment of the present application can be executed. Alternatively, when the device integrating the production system and the backup system restores the backup data, the method provided by the embodiment of the present application can be executed. Alternatively, when other devices restore the backup data, for example, when the processing device of the production system and / or the backup system fails, the other devices can realize the restoration of the backup data by executing the method provided by the embodiment of the present application on the premise of obtaining the backup data. The present application does not make any limitation in this regard.
[0066] Among them, the backup data to be restored refers to the target data required by the user. The identifier of the backup data to be restored is used to indicate the target data.
[0067] In a possible implementation, the identifier of the backup data to be restored comprises a full backup data serial number and an incremental backup data serial number. For example, as shown in Table 1 below, an example of the information indicated by the identifier of a kind of backup data.
[0068] Table 1
[0069] Backup mode Identification Full backup data serial number Incremental backup data serial number Full data backup mode 1 1 \ Incremental data backup mode 1.1 1 1 Incremental data backup mode 1.2 1 2 Incremental data backup mode 1.3 1 3 Full data backup mode 2 2 \ … … … …
[0070] In Table 1, the identifier indicates a unique backup data, which has a corresponding full backup data sequence number and an incremental backup data sequence number. As shown in Table 1, the identifier is in the form of a sequence number X.Y, where X is a full backup sequence number, indicating the sequence number of the full backup data. Y is an incremental backup sequence number, indicating the sequence number of the incremental backup data based on the full backup data X. Both X and Y are natural numbers greater than zero. For example, the identifier of the backup data of the first day is 1, according to which the backup mode of the backup data is a full data backup mode; the identifier of the backup data of the second day is 1.1, according to which the backup mode of the backup data is an incremental data backup mode, and the identifier of the incremental backup data is 1.1, and the identifier of the corresponding full backup data is 1, that is, the backup data of the first day is used as a basis to perform backup in the incremental data backup mode.
[0071] It can be understood that the sequence number has a corresponding relationship with the backup time of the backup data, for example, the backup data is represented according to the sequence number from small to large, each backup data corresponds to a respective backup time, and the backup time corresponding to the backup data with a smaller sequence number is earlier, and the backup time corresponding to the backup data with a larger sequence number is later. The above-mentioned sequence number representation of the backup data helps to improve the efficiency of the user positioning the required backup data and facilitates searching.
[0072] In addition, in the above example, the identifier of the full backup data is carried before the identifier of the incremental backup data, which helps the computing device to determine the full backup data corresponding to the incremental backup data. For example, the backup data with the identifier 1.1 is used to indicate the first incremental backup data based on the full backup data 1, and the backup data with the identifier 1.2 is used to indicate the second incremental backup data based on the full backup data 1.
[0073] It can be understood that when the identifier of the to-be-restored backup data does not contain the incremental backup data sequence number, it indicates that the to-be-restored backup data is full backup data. In another possible implementation, the incremental backup data sequence number can be zero, which is used to indicate that the to-be-restored backup data is full backup data.
[0074] It should be noted that the above-mentioned sequence number form is only an example as the identifier of the backup data, and the backup data can also be identified according to an alphabetical sequence or other forms, which is not limited by the embodiments of the application.
[0075] S402, when it is determined that the to-be-restored backup data is incremental backup data, obtaining the restored backup data according to the identifier of the to-be-restored backup data.
[0076] The recovered backup data and the backup data to be recovered are backup data obtained based on the same full backup data, and the backup time of the recovered backup data is earlier than the backup time of the backup data to be recovered.
[0077] Optionally, the computing device determines whether the backup data to be recovered is incremental backup data according to the identifier of the backup data to be recovered. The identifier of the backup data to be recovered is as described in step S401. When the incremental backup sequence number of the backup data to be recovered exists, it indicates that the backup data to be recovered is incremental backup data. Similarly, if the above condition is not met, it indicates that the backup data to be recovered is full backup data.
[0078] It can be understood that when the backup data to be recovered is full backup data, the computing device recovers the backup data to be recovered in a full data recovery mode. The full data recovery mode refers to data recovery on all data in the backup data to be recovered. For example, the correspondence between the backup data and the identifier shown in Table 1. When the identifier of the backup data to be recovered is 1 or 2, the computing device determines that the backup data to be recovered is full backup data, and recovers the backup data to be recovered in the full data recovery mode.
[0079] Optionally, the computing device obtains the recovered backup data according to the full backup sequence number and the incremental backup sequence number in the identifier of the backup data to be recovered. The recovered backup data is determined in the identifier mode in step S401. Specifically, the first recovered backup data set with the same full backup sequence number is determined according to the full backup sequence number of the backup data to be recovered. Then, the incremental backup data sequence number corresponding to the recovered backup data with the incremental backup data sequence number smaller than the incremental backup data sequence number of the backup data to be recovered is determined as the second recovered backup data set according to the incremental backup data sequence number of each backup data in the first recovered backup data set. Any one of the recovered backup data in the second recovered backup data set can be used for the backup data recovery method provided in the present application.
[0080] Optionally, the computing device determines the recovered backup data closest to the incremental backup data sequence number of the backup data to be recovered based on the incremental backup data sequence number of each backup data in the second recovered backup data set, and uses the recovered backup data as the target recovered backup data for subsequent recovery of the backup data to be recovered. For example, when the identifier of the backup data to be recovered is 1.2, if it is determined that the recovered backup data set with the same full backup sequence number includes {1, 1.1}, and the latest recovered backup data is 1.1 according to the incremental sequence number 2 of the backup data to be recovered.
[0081] It can be understood that the embodiments of the present application adopt the way of recovering incremental backup data to save the resources for recovering data. When the backup time of the full backup data on which the incremental backup data is based is closer to the backup time of the backup data to be recovered, the incremental backup data to be recovered is less, the resources occupied by the recovery of the backup data are less, and the efficiency of the recovery of the backup data is higher.
[0082] S403, in the case where it is determined that the recovered backup data has not been changed, recovering the backup data to be recovered in the incremental data recovery mode; wherein the incremental data recovery mode is based on the difference incremental backup data between the backup data to be recovered and the recovered backup data, and the mode of recovering the backup data to be recovered.
[0083] Optionally, before performing step S403, the computing device judges whether the recovered backup data has been changed. Whether the recovered backup data has been changed refers to whether the recovered backup data has been changed after being recovered. If the recovered backup data has not been changed, it means that the recovered data is consistent with the backup data before recovery. If the recovered backup data has been changed, it means that the recovered data has been changed and is inconsistent with the backup data before recovery.
[0084] Optionally, whether the recovered backup data has been changed can be recorded in the following way after the recovered backup data is recovered.
[0085] In the first possible implementation, when the recovered backup data has been changed, the computing device records the data change state of the recovered backup data as changed; and when the recovered backup data has not been changed, the computing device records the data change state of the recovered backup data as unchanged.
[0086] In the second possible implementation, when the recovered backup data has been changed, the computing device records the data change state of the recovered backup data; and when the recovered backup data has not been changed, the computing device does not record the data change state of the recovered backup data.
[0087] Based on the first possible implementation, after the computing device obtains the recovered backup data, it determines whether the recovered backup data has been changed based on the data change state of the recovered backup data. The data change state includes changed or unchanged.
[0088] Based on the second possible implementation, after the computing device obtains the recovered backup data, it determines whether the recovered backup data has been changed based on whether the data change state of the recovered backup data is recorded.
[0089] For example, the data change state is indicated by "1" and "0" respectively, where 1 indicates that the restored backup data has changed, and 0 indicates that the restored backup data has not changed. After the restored backup data is restored, the data change state is recorded as 0, and if a change occurs, the data change state is updated to 1. Alternatively, when the data changes, the data change state is recorded, and when the data does not change, the data change state is not recorded.
[0090] Optionally, if the restored backup data changes, the full data recovery mode is used for the backup data to be restored.
[0091] It can be understood that if the restored backup data changes, it means that the restored backup data has changed relative to the backup data before restoration, and therefore, the backup data to be restored cannot be obtained based on the restored backup data and the incremental backup data. The computing device obtains the required backup data by using the full data recovery mode.
[0092] Optionally, if the restored backup data does not change, the incremental data recovery mode is used for the backup data to be restored.
[0093] Optionally, the recording of whether the restored backup data changes can be achieved by the following method: before determining whether the restored backup data changes, the computing device replaces the operating system file system function with a MyWrite file system function, which is used to record the data change state of the restored backup data.
[0094] The MyWrite file system function has the data write function, and can also listen to whether the written data changes the restored backup data, compared with the write file system function in the Linux operating system. Figure 5 As shown in FIG. 6, by modifying the operating system LD_PRELOAD environment variable, replacing the preloaded library database mode definition language (DDL) library file address in the portable operating system interface (POSIX) in the original operating system, and replacing the write file system function with the MyWrite file system function.
[0095] It is understandable that the above method is used to monitor whether the restored backup data has undergone data changes and to decide whether to record the data change status, so that the computing device can determine the recovery method of the backup data to be restored based on the data change status of the restored backup data.
[0096] like Figure 6 The diagram shown illustrates an incremental data recovery method. Step S403 described above is applied to... Figure 5 A detailed explanation is provided below for example.
[0097] In one possible implementation, the backup data to be restored is the incremental backup data 1.2 from the third day, and the computing device obtains the restored backup data as the full backup data 1 from the first day. In this case, the restored backup data satisfies the condition that its backup time is earlier than the backup time of the backup data to be restored, and both are backup data obtained from the same full backup data. When the computing device uses incremental data recovery, it restores the backup data to be restored by restoring the incremental backup data that differs between full backup data 1 and incremental backup data 1.2. The incremental backup data that differs between full backup data 1 and incremental backup data 1.2 includes incremental backup data 1.1 and incremental backup data 1.2.
[0098] In another possible implementation, the backup data to be restored is the incremental backup data 1.2 from the third day. The computing device obtains the restored backup data from the second day, which includes the full backup data 1 and the incremental backup data 1.1. In this case, the restored backup data meets the condition that its backup time is earlier than the backup time of the backup data to be restored, and both are backup data obtained from the same full backup data. When the computing device uses the incremental data recovery method, it restores the backup data to be restored by restoring the incremental backup data that differs between incremental backup data 1.1 and incremental backup data 1.2. The incremental backup data that differs between full backup data 1 and incremental backup data 1.2 includes incremental backup data 1.2.
[0099] By using the above method, when the backup data to be restored is incremental backup data, the system monitors whether the restored backup data has changed to determine whether the restored backup data is available. If the restored backup data is available, the incremental backup data is restored, thereby significantly reducing the resources used when restoring backup data and improving the efficiency of data restoration.
[0100] like Figure 7The diagram illustrates a cumulative incremental data backup method. This method involves accumulating the differences from the previous full backup before performing a new backup. For example, on day one, a full backup is used to back up all data. On day two, a cumulative incremental backup is used to back up the differences from day one's data. On day three, the same method is used again to accumulate these differences before performing a new backup. The accumulated differences on day three include those from day two and day three. To retrieve data from day three, it's necessary to restore both the full data from day one and the accumulated differences from day one.
[0101] It's understandable that the backup data on the first day is a full backup, while the backup data on the second and third days is cumulative incremental backup data. This cumulative incremental backup data refers to the difference data generated based on the full backup data; it's a special type of incremental backup data. The cumulative incremental data backup method can be understood as a special type of differential incremental data backup method.
[0102] Among them, such as Figure 7 As shown, to retrieve all data from the second day, you need to restore the full backup data from the first day and the cumulative incremental backup data from the second day. Similarly, to retrieve all data from the third day, you need to restore the full backup data from the first day and the cumulative incremental backup data from the third day.
[0103] Understandably, backing up accumulated differential data, compared to backing up all data, helps to complete data backup with less computing resources and time cost, thereby significantly improving the efficiency of data backup.
[0104] Accordingly, when the computing device determines that the backup data to be restored is incremental backup data, it can determine whether the full backup data corresponding to the full backup data sequence number of the backup data to be restored is already restored backup data. If such restored backup data exists, the corresponding cumulative incremental backup data can be restored based on the incremental backup data sequence number of the backup data to be restored. Then, the restored backup data to be restored can be obtained through the cumulative incremental backup data and the restored backup data.
[0105] Compared to using cumulative incremental backup for all data, using full backup recovery when restoring backup data helps reduce the amount of backup data to be restored, thereby improving the efficiency of backup data recovery.
[0106] In summary, such as Figure 8As shown, a complete flowchart of a backup data recovery method provided by an embodiment of the present application is shown. It includes steps S801-S809.
[0107] S801, obtaining an identifier of backup data to be recovered.
[0108] The same as step S401.
[0109] S802, determining whether the backup data to be recovered is full backup data.
[0110] Optionally, the computing device determines whether the backup data to be recovered is full backup data according to the identifier of the backup data to be recovered.
[0111] If yes, step S803 is performed; if no, step S808 is performed, and the recovery is performed in a full data recovery mode.
[0112] S803, determining whether there is recovered backup data.
[0113] Specifically, the recovered backup data is determined according to step S402.
[0114] If yes, step S804 is continuously performed; if no, step S808 is performed.
[0115] S804, determining whether data change is performed.
[0116] Optionally, whether the recovered backup data has data change is determined according to a data change state of the recovered backup data.
[0117] If yes, step S808 is performed; if no, step S805 is performed.
[0118] S805, obtaining the recovered backup data.
[0119] Specifically, the recovered backup data is determined according to step S403.
[0120] S806, calculating a minimum backup data set to be recovered.
[0121] When the backup mode is a differential incremental data backup mode, the minimum backup data set can be determined according to a set of differential incremental backup data between the recovered backup data and the identifier of the backup data to be recovered. When the backup mode is a cumulative incremental data backup mode, the minimum backup data set can be determined according to the cumulative incremental data corresponding to the backup data to be recovered.
[0122] The minimum backup data set can be determined as the closest backup data to the backup data to be recovered in the incremental backup data sequence number smaller than the backup data to be recovered as the recovered backup data in step S805, and the difference data between the recovered backup data and the backup data to be recovered is the minimum backup data set.
[0123] S807, the computing device recovers in an incremental data recovery mode.
[0124] Specifically, the computing device recovers the minimum backup data set, and recovers the backup data to be recovered according to the recovered backup data and the minimum backup data set.
[0125] S809, the computing device resets the data change state.
[0126] The resetting of the data change state means updating the current recovered backup data, and accordingly, the data change state is also updated. For example, in the case of Figure 3 , the identifier of the backup data to be recovered is 1.1, the identifier of the recovered backup data is 1, and if the data change state of the recovered backup data is indicated as 1 or 0, the data change state of the backup data with identifier 1 is indicated; after the backup data with identifier 1.1 is recovered, the current recovered backup data should be updated to 1.1, and its data change state should also be updated, for example, reset to -1, which is different from the above-mentioned data change state indicating data change or no change.
[0127] The backup data recovery method provided by the above steps S801-S809 helps the user to determine the specific recovery mode according to the different states of the backup data, and in the case where the recovered backup data is available, the minimum backup data set is determined to recover the required backup data with as high efficiency as possible in less time and computing resources.
[0128] The above mainly introduces the scheme of the embodiments of the present application from the method aspect. It can be understood that the backup data recovery device contains at least one of the corresponding hardware structure and software module for implementing each function in order to implement the above functions. Those skilled in the art should easily realize that the units and algorithm steps of each example described in connection with the embodiments disclosed in the present application can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0129] The embodiments of the present application can divide the functional units of the backup data recovery apparatus (such as a computing device) according to the above method examples. For example, each functional unit can be divided according to each function, or two or more functions can be integrated in one processing unit. The integrated unit can be realized in the form of hardware or software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical function division. In actual implementation, there can be another division manner.
[0130] In the case of dividing each functional module according to each function, Figure 9 A possible structure schematic diagram of the computing device involved in the above embodiments is shown. As shown in Figure 9 The computing device 90 includes an obtaining unit 901 and a processing unit 902.
[0131] The obtaining unit 901 is configured to obtain the identifier of the backup data to be recovered. For example, steps S401 and S801.
[0132] The obtaining unit 901 is further configured to, when it is determined that the backup data to be recovered is incremental backup data, obtain the recovered backup data according to the identifier of the backup data to be recovered; wherein the recovered backup data and the backup data to be recovered are backup data obtained based on the same full backup data, and the backup time of the recovered backup data is earlier than the backup time of the backup data to be recovered. For example, steps S402 and S805.
[0133] The processing unit 902 is configured to, when it is determined that the recovered backup data has not been changed, recover the backup data to be recovered in an incremental data recovery manner; wherein the incremental backup data recovery manner refers to a manner of recovering the backup data to be recovered based on the difference incremental backup data between the backup data to be recovered and the recovered backup data. For example, steps S403 and S807.
[0134] In one example, the processing unit 902 is specifically configured to: read the difference incremental backup data between the recovered backup data and the backup data to be recovered according to the identifier of the recovered backup data and the identifier of the backup data to be recovered; and recover the backup data to be recovered according to the difference incremental backup data and the recovered backup data.
[0135] In one example, the processing unit 902 is further configured to: after recovering the recovered backup data, when the recovered backup data is changed, record the data change state of the recovered backup data as changed; when the recovered backup data is not changed, record the data change state of the recovered backup data as unchanged; and determine whether the recovered backup data is changed based on the data change state of the recovered backup data.
[0136] In an example, the processing unit 902 is further configured to: after the restored backup data is recovered, record a data change state of the restored backup data when the restored backup data is changed; not record the data change state of the restored backup data when the restored backup data is not changed; and determine whether the restored backup data is changed based on whether the data change state of the restored backup data is recorded.
[0137] In an example, the processing unit 902 is further configured to replace an operating system write file system function with a MyWrite write file system function, the MyWrite write file system function being configured to record the data change state of the restored backup data.
[0138] In an example, the processing unit 902 is further configured to determine that the backup data to be restored is incremental backup data if an identifier of the backup data to be restored is an incremental backup identifier.
[0139] In an example, the identifier of the backup data to be restored includes a full backup data serial number and an incremental backup data serial number, and the processing unit 902 is specifically configured to determine that the backup data to be restored is incremental backup data if the incremental backup data identifier includes the incremental backup data serial number.
[0140] In an example, the processing unit 902 is further configured to restore the backup data to be restored in a full data restoration mode when the backup data to be restored is full backup data, where the full data restoration mode refers to data restoration on all data in the backup data to be restored.
[0141] In an example, the processing unit 902 is further configured to restore the backup data to be restored in a full data restoration mode when it is determined that the restored backup data is changed, where the full data restoration mode refers to data restoration on all data in the backup data to be restored.
[0142] The above method embodiments involve all related content of each step, which can be referred to the function description of the corresponding function module, and will not be repeated here.
[0143] Of course, the computing device provided by the embodiments of the present application includes but is not limited to the above-mentioned units, for example: the computing device can also include a storage unit 903.
[0144] The storage unit 903 can be used to store the program code and data of the computing device.
[0145] The acquisition unit 901 in the computing device 90 can correspondingly execute the functions of the receiving unit in the communication interface 203, and the processing unit 902 can correspondingly execute the functions of the processor 201 in the communication interface 203. Figure 2 The acquisition unit 901 in the computing device 90 can correspondingly execute the functions of the receiving unit in the communication interface 203, and the processing unit 902 can correspondingly execute the functions of the processor 201 in the communication interface 203. Figure 2 The acquisition unit 901 in the computing device 90 can correspondingly execute the functions of the receiving unit in the communication interface 203, and the processing unit 902 can correspondingly execute the functions of the processor 201 in the communication interface 203.
[0146] The embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program. When the computer program runs on a computer, the computer program causes the computer to execute the method executed by any one of the computing devices provided in the above.
[0147] The explanation and beneficial effects of the related content in any one of the computer readable storage media provided in the above can refer to the corresponding embodiment described above, and will not be repeated here.
[0148] The embodiment of the present application further provides a chip. The chip integrates a control circuit and one or more ports for realizing the functions of the computing device described above. Optionally, the functions supported by the chip can refer to the above, and will not be repeated here. Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by a program instructing related hardware. The program can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a random access memory, etc. The processing unit or the processor mentioned above can be a central processing unit, a general-purpose processor, an application specific integrated circuit (ASIC), a digital signal processor (DSP), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
[0149] The embodiments of the present application further provide a computer program product containing instructions, which, when executed on a computer, cause the computer to perform any of the above-mentioned embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiments of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or include one or more data storage devices such as servers, data centers, etc. that can be integrated with the medium. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as an SSD), etc.
[0150] It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided by the embodiments of the present application, such as but not limited to the above-mentioned memory, computer-readable storage medium and communication chip, etc., are all non-volatile (non-transitory).
[0151] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device containing one or more servers, data centers, etc., that can be integrated with the medium. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks, SSDs).
[0152] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, the disclosure, and the appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0153] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.
Claims
1. A method for restoring backup data, characterized in that, include: Obtain the identifier of the backup data to be restored; When it is determined that the backup data to be restored is incremental backup data, the restored backup data is obtained according to the identifier of the backup data to be restored; wherein, the restored backup data and the backup data to be restored are backup data obtained based on the same full backup data, and the backup time of the restored backup data is earlier than the backup time of the backup data to be restored; Determine whether the restored backup data has been modified. If it is determined that the restored backup data has not been modified, restore the backup data to be restored according to the incremental data restoration method. The incremental backup data restoration method refers to the method of restoring the backup data to be restored based on the incremental backup data difference between the backup data to be restored and the restored backup data.
2. The method according to claim 1, characterized in that, The step of restoring the backup data to be restored according to the incremental data recovery method, when it is determined that the restored backup data has not been modified, includes: Based on the identifiers of the restored backup data and the backup data to be restored, read the incremental backup data showing the difference between the restored backup data and the backup data to be restored. The backup data to be restored is restored based on the differential incremental backup data and the restored backup data.
3. The method according to claim 1 or 2, characterized in that, The method further includes: After restoring the restored backup data, when the restored backup data undergoes data changes, the data change status of the restored backup data is recorded as changed; when the restored backup data does not undergo data changes, the data change status of the restored backup data is recorded as unchanged. After acquiring the restored backup data, the method further includes: Based on the data change status of the restored backup data, determine whether the restored backup data has been changed.
4. The method according to claim 1 or 2, characterized in that, The method further includes: After restoring the restored backup data, when the restored backup data undergoes data changes, the data change status of the restored backup data is recorded; when the restored backup data does not undergo data changes, the data change status of the restored backup data is not recorded. After acquiring the restored backup data, the method further includes: Based on whether the data change status of the restored backup data is recorded, it is determined whether the restored backup data has been changed.
5. The method according to claim 3 or 4, characterized in that, Before determining whether the restored backup data has been modified, the method further includes: The MyWrite file system write function is used to replace the operating system's file system write function. The MyWrite file system write function is used to record the data change status of the restored backup data.
6. The method according to any one of claims 1-5, characterized in that, After obtaining the identifier of the backup data to be restored, the method further includes: If the identifier of the backup data to be restored is an incremental backup data identifier, then the backup data to be restored is determined to be the incremental backup data.
7. The method according to claim 6, characterized in that, The identifiers of the backup data to be restored include the full backup data sequence number and the incremental backup data sequence number; If the identifier of the backup data to be restored is an incremental backup data identifier, determining that the backup data to be restored is the incremental backup data includes: If the incremental backup data identifier includes the incremental backup data sequence number, then the backup data to be restored is determined to be the incremental backup data.
8. The method according to any one of claims 1-7, characterized in that, The method further includes: When it is determined that the backup data to be restored is a full backup, the backup data to be restored is restored according to the full data restoration method; wherein, the full data restoration method refers to restoring all data in the backup data to be restored.
9. The method according to any one of claims 1-8, characterized in that, The method further includes: If it is determined that the restored backup data has undergone data changes, the backup data to be restored shall be restored in accordance with the full data recovery method; wherein, the full data recovery method refers to restoring all data in the backup data to be restored.
10. A computing device, characterized in that, It includes a memory and a processor; the memory is used to store program code; the processor is used to invoke the program code to perform the method as described in any one of claims 1-9.
Citation Information
Patent Citations
Method and system for recovering failure data in database
CN105373448A
Method and apparatus for incremental recovery of data
CN106681862A