Data backup method, data recovery method, electronic device, medium, and program product

By removing the mapping between the target logical address and physical address and recording a backup table in the dual-active volume storage technology, the problem of difficulty in recovering data after it has been infected with a virus is solved, enabling fast and accurate data recovery and improving the disaster recovery and backup capabilities of the storage system.

WO2026066302A1PCT designated stage Publication Date: 2026-04-02INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2026-04-02

AI Technical Summary

Technical Problem

Existing dual-active volume storage technology is difficult to recover data after it has been infected with a virus, with long recovery points (RPO) and recovery times (RTO), and cannot effectively prevent data from being corrupted across multiple storage devices.

Method used

By decoupling the mapping between the target logical address and the first physical address during the data writing process, establishing a mapping between the target logical address and the second physical address, and writing the target data to the second physical address, while simultaneously recording the mapping between the target logical address and the first physical address in the backup table, the accuracy of data backup and recovery is ensured.

Benefits of technology

While maintaining low RPO and RTO, the difficulty of data recovery is reduced, the disaster recovery and backup capabilities of the dual active volume storage are enhanced, and the speed and accuracy of data recovery are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025102573_02042026_PF_FP_ABST
    Figure CN2025102573_02042026_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of storage. Specifically disclosed are a data backup method, a data recovery method, an electronic device, a medium, and a program product. The data backup method comprises: acquiring a target logical address allocated to target data to be written into a storage device, and a first physical address, currently corresponding to the target logical address, in the storage device; releasing a correspondence between the target logical address and the first physical address, and creating a correspondence between the target logical address and a second physical address in the storage device, wherein the first physical address is different from the second physical address; writing said target data at the second physical address; and if the target logical address is not found in a backup table, writing the correspondence between the target logical address and the first physical address into the backup table. The data recovery capability of a storage device can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Data backup method, recovery method, electronic device, medium and program product

[0001] Cross-reference to related applications

[0002] This application claims priority to the Chinese patent application No. 202411367307.5, filed on September 29, 2024, and entitled “Data backup method, recovery method, electronic device, medium and program product”, the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0003] The present disclosure relates to the technical field of storage, in particular to a data backup method, a recovery method, an electronic device, a medium and a program product. BACKGROUND

[0004] The storage dual-active volume technology refers to that in a storage system, two or more groups of storage devices are simultaneously operated, and the storage devices are mutually production and backup. When one of the storage devices fails, the service can be switched to the other storage device. In this way, the service interruption or data loss caused by the failure of a single storage device can be avoided, and the storage system has good disaster recovery capability.

[0005] However, this storage technology also has some problems, that is, when the data saved in one of the storage devices is implanted with a virus, the data with the virus will also cover the data in the other storage devices at the same time, so that the data in multiple storage devices is destroyed, and the data recovery is difficult. SUMMARY

[0006] In one aspect, the present disclosure provides a data backup method, the method comprising:

[0007] obtaining a target logical address allocated for target data to be written into a storage device, and a first physical address in the storage device currently corresponding to the target logical address;

[0008] releasing the correspondence between the target logical address and the first physical address, and creating a correspondence between the target logical address and a second physical address in the storage device, wherein the first physical address and the second physical address are different;

[0009] writing the target data into the second physical address; and

[0010] in response to not finding the target logical address in the backup table, writing the correspondence between the target logical address and the first physical address into the backup table.

[0011] In one aspect, the present disclosure provides a data recovery method, the method comprising:

[0012] In response to receiving the data recovery instruction for the storage device, a backup table of the storage device is acquired, the backup table being obtained based on the data backup method as above;

[0013] A corresponding relationship between the target logical address and a first physical address in the storage device is found from the backup table;

[0014] A second physical address in the storage device to which the target logical address currently corresponds is determined; and

[0015] Data at the first physical address is used to overwrite data at the second physical address.

[0016] Another aspect of the present disclosure also provides an electronic device, the electronic device comprising a processor and a memory, the memory being configured to store computer readable instructions, the computer readable instructions being configured to be executed by the processor to implement the method as above.

[0017] Another aspect of the present disclosure also provides a non-volatile computer readable storage medium, the non-volatile computer readable storage medium being configured to store computer readable instructions, the computer readable instructions being configured to be executed by a processor to implement the method as above.

[0018] Another aspect of the present disclosure also provides a computer readable instruction product, the computer readable instruction product comprising computer readable instructions, the computer readable instructions being configured to be executed by a processor to implement the method as above. BRIEF DESCRIPTION OF DRAWINGS

[0019] The features and advantages of the present disclosure will be more clearly understood from the following detailed description taken in conjunction with the accompanying drawings, which are schematic and should not be understood as limiting the present disclosure, in which:

[0020] FIG. 1 shows a schematic diagram of a module for storing dual-active volumes according to one or more embodiments of the present disclosure;

[0021] FIG. 2 shows a flowchart of a data backup method according to one or more embodiments of the present disclosure;

[0022] FIG. 3 shows a schematic diagram of data storage according to one or more embodiments of the present disclosure;

[0023] FIG. 4 shows a schematic diagram of data storage according to another one or more embodiments of the present disclosure;

[0024] FIG. 5 shows a schematic diagram of a corresponding relationship between a target logical address and a physical address obtained after updating FIG. 4;

[0025] FIG. 6 shows a schematic diagram of a plurality of preset time points according to one or more embodiments of the present disclosure;

[0026] FIG. 7 shows a schematic diagram of the backup tables corresponding to the current day and the new day according to one or more embodiments of the present disclosure;

[0027] FIG. 8 shows a schematic diagram of the backup tables corresponding to the current day and the new day according to one or more embodiments of the present disclosure;

[0028] FIG. 9 shows a flowchart of a data recovery method according to one or more embodiments of the present disclosure;

[0029] FIG. 10 shows a schematic diagram of an electronic device according to one or more embodiments of the present disclosure. DETAILED DESCRIPTION

[0030] For the purpose of making the objects, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure. Based on the embodiments of the present disclosure, any other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present disclosure.

[0031] With reference to FIG. 1, a schematic diagram of a module for storing dual-active volumes is provided according to one embodiment of the present disclosure. In FIG. 1, the dual-active volumes can include a primary volume, a secondary volume, a primary volume change volume and a secondary volume change volume, and each volume can have a corresponding storage device. These storage devices are used to save the data written in the corresponding volume.

[0032] The primary volume and the secondary volume can be two data centers separated in geography. By using the storage virtualization and data mirroring across data centers and in combination with the application cluster in the upper layer, the primary volume and the secondary volume can be simultaneously in a running state and in a synchronous replication relationship. The so-called synchronous replication means that the data between the primary volume and the secondary volume can be synchronized in real time. For example, if the data in the primary volume is changed at 10:02, the change will be synchronized to the secondary volume in real time. In this way, the data in the primary volume and the secondary volume is ensured to be real-time identical, so that when one of the primary volume and the secondary volume fails, the service can be switched to the other volume, thereby greatly improving the disaster recovery backup capability of the storage.

[0033] The primary volume and the primary volume change volume can form a bidirectional snapshot relationship, and the secondary volume and the secondary volume change volume can form a bidirectional snapshot relationship. The so-called bidirectional snapshot means that one of the volumes can save the data of the other volume at a certain time point. For example, the primary volume change volume can take a snapshot of the primary volume at 10:00, so that the data in the primary volume change volume is fixed as the data of the primary volume at 10:00. In this way, based on the primary volume change volume and the secondary volume change volume, the data in the primary volume and the secondary volume can be backed up according to the specified time point.

[0034] It should be noted that the bidirectional snapshot relationship between the primary volume and the primary volume change volume, and the bidirectional snapshot relationship between the secondary volume and the secondary volume change volume, can be different from the real-time data synchronization relationship between the primary volume and the secondary volume. For example, after the primary volume change volume takes a snapshot of the primary volume at 10:00, the data in the primary volume change volume is fixed as the data of the primary volume at 10:00. If the data in the primary volume changes at 10:02, this change can not be synchronized in real time to the primary volume change volume, but needs to be synchronized in real time to the secondary volume.

[0035] Based on the above description, the business host can install application programs that need to read and write data. When these application programs need to store data (i.e., when writing data to the storage device), the data can be first written to the primary volume, and then through the synchronization and replication relationship between the primary volume and the secondary volume, the data written to the primary volume can be synchronized to the secondary volume. Based on the bidirectional snapshot relationship between the primary volume and the primary volume change volume, and the bidirectional snapshot relationship between the secondary volume and the secondary volume change volume, at a specific time point, the data written to the primary volume can be synchronized to the primary volume change volume and the secondary volume change volume.

[0036] The storage dual-active volume shown in FIG. 1 can have many advantages, specifically, the RPO (Recovery Point Objective, data recovery point target) and the RTO (Recovery Time Objective, recovery time target) can be small. Among them, the RPO can represent the amount of data loss when the storage device fails. The RTO can represent the shortest time required from the occurrence of the storage device failure to the recovery to normal. In actual application, the RPO of the storage dual-active volume shown in FIG. 1 can be equal to 0 or close to 0, and the RTO can also be a relatively small value.

[0037] However, this storage dual-active volume also has some problems, that is, in the case that the data written to the primary volume is infected with a virus (such as a ransomware), through synchronization and replication, bidirectional snapshot, etc., these data with viruses will also be overwritten to the secondary volume, the primary volume change volume and the secondary volume change volume at the same time, thereby causing the data in all volumes to be destroyed. In this way, on the one hand, the storage dual-active volume can no longer play a role in disaster recovery backup; on the other hand, since the data in all volumes is destroyed, the data recovery time will also be relatively long (i.e., the RTO will also increase accordingly), and the data recovery difficulty is relatively high, and the data loss amount will also increase accordingly (i.e., the RPO will also increase accordingly).

[0038] In view of this, the present disclosure provides a data backup method, which can reduce the difficulty of data recovery and enhance the disaster recovery backup capability of the storage dual-active volume while ensuring small RPO and RTO. The data backup method can be applied to the secondary volume in FIG. 1. Specifically, the data backup method of the present disclosure can be executed simultaneously in the process of synchronizing the data in the primary volume to the secondary volume. For reference, FIG. 2 provides a flowchart of the data backup method according to an embodiment of the present disclosure. In FIG. 2, the data backup method includes the following steps:

[0039] In step S201, a target logical address allocated for target data to be written into a storage device is obtained, and a first physical address in the storage device corresponding to the target logical address at present is obtained.

[0040] Specifically, the logical address can also be referred to as a virtual address, which is an address used in the process of running an application program. The physical address can also be referred to as a real address or a binary address, which is an actual address in the storage device and is used to uniquely identify each storage unit in the storage device. In simple terms, each storage unit in the storage device can have a corresponding physical address. Writing data into a certain physical address in the storage device is equivalent to writing data into the storage unit corresponding to the physical address.

[0041] The logical address and the physical address can have a corresponding relationship (also referred to as a mapping relationship). For example, in the case of non-continuous physical addresses, these physical addresses can be mapped to continuous logical addresses, so that the storage space perceived by the application program can be a continuous storage space. Of course, non-continuous physical addresses can also be mapped to non-continuous logical addresses. The mapping relationship between the logical address and the physical address can be determined according to actual needs.

[0042] Based on the above description of the logical address and the physical address, the write instruction for the target data issued by the application program in the business host can include the target logical address allocated for the target data, and then based on the corresponding relationship between the logical address and the physical address, the first physical address in the storage device corresponding to the target logical address at present can be determined.

[0043] It should be noted that for the application programs in the business host, the application programs can only perceive the logical address and not perceive the physical address. For example, after the application program issues the write instruction for the target data, the application program perceives that the target data is written into the target logical address (i.e. as long as the target data can be accessed through the target logical address later), and the application program can not perceive which physical address the target logical address corresponds to.

[0044] In step S202, the correspondence between the target logical address and the first physical address is removed, and a correspondence between the target logical address and a second physical address in the storage device is created, wherein the first physical address and the second physical address are different.

[0045] Referring to FIG. 3, a schematic diagram of data storage provided by an embodiment of the present disclosure is shown. In this embodiment, before receiving a write instruction for target data issued by an application in a service host, the first physical address currently corresponding to the target logical address can be empty or can already store other data. For example, in FIG. 3, before receiving the write instruction for target data, the first physical address currently corresponding to the target logical address can already store entity data of file a. Since the application in the service host is not aware of the physical address, it is aware that the entity data of file a is already stored at the target logical address. For business needs or other reasons, the application in the service host can issue a write instruction for target data to request that the entity data of file a originally stored at the target logical address be changed to target data. The data backup method in the present disclosure is to backup the data before change at the target logical address (i.e., backup the entity data of file a) before the data is changed, so that when the target data written to the target logical address has a problem (e.g., is infected with a virus), the data at the target logical address can be restored to the data before change based on the backup data before change through rollback or other operations.

[0046] Specifically, referring to FIG. 3, the correspondence between the target logical address and the first physical address can be removed, and a correspondence between the target logical address and a second physical address can be created. In this way, the data at the first physical address can be left unchanged, the data at the first physical address can be used as backup data at the target logical address, and the target data can be saved at the second physical address. Since the physical address corresponding to the target logical address is changed to the second physical address, the application in the service host accesses the target data through the target logical address. That is, for the application in the service host, it is equivalent to successfully changing the data saved at the target logical address.

[0047] The second physical address can be a physical address that is not corresponding to any other logical address. In this way, when writing target data to the second physical address, the data saved at other logical addresses is not changed.

[0048] Further, since the data at the target logical address is changed, the first physical address is only used to save the backup data of the target logical address, and the first physical address does not have a substantial corresponding relationship with the target logical address. However, the first physical address at this time cannot be established with a corresponding relationship with other logical addresses. Therefore, the first physical address can be marked after the corresponding relationship between the target logical address and the first physical address is released, to represent that the first physical address cannot be used to establish a corresponding relationship with other logical addresses. In this way, the problem of losing backup data at the target logical address is prevented.

[0049] Step S203, write the target data to the second physical address.

[0050] For details, please refer to the related description of step S202, which will not be repeated here.

[0051] Step S204, in the case where the target logical address is not found in the backup table, write the corresponding relationship between the target logical address and the first physical address into the backup table.

[0052] Specifically, in combination with reference to FIG. 3, after the corresponding relationship between the target logical address and the first physical address is written into the backup table, the data (such as the entity data of file a in FIG. 3) originally saved at the target logical address before being changed can be found based on the corresponding relationship in the backup table. In this way, in the case where the written target data has a problem, the data saved at the target logical address can be quickly rolled back to the data before being changed.

[0053] It should be noted that in the backup table shown in FIG. 3, only one corresponding relationship between the target logical address and the first physical address is exemplarily listed, but it can be understood that in actual application, the backup table can include multiple groups of different corresponding relationships between the target logical address and the first physical address.

[0054] In summary, in the technical scheme of some embodiments of the present disclosure, after the target logical address allocated for the target data and the first physical address corresponding to the target logical address are obtained, the physical address corresponding to the target logical address is modified from the first physical address to the second physical address, the target data is written to the second physical address, and the corresponding relationship between the target logical address and the first physical address is saved in the backup table. In this way, in addition to successfully modifying the data at the target logical address, the data saved at the target logical address can be quickly rolled back based on the corresponding relationship in the backup table, thereby greatly reducing the difficulty of data recovery.

[0055] In addition, the corresponding relationship between the target logical address and the third physical address is written into the backup table, and the changed data at the target logical address is searched based on the corresponding relationship in the backup table. The process can be relatively simple, and thus the RTO can be relatively small during the data recovery process. In addition, the complete data before the change at the target logical address is saved through the first physical address, and thus the RPO can be equal to 0. In this way, the data recovery difficulty is reduced while the RPO and the RTO are relatively small.

[0056] In some embodiments, when the target logical address is found in the backup table, the method of the present disclosure can further include:

[0057] In some embodiments, the method of the present disclosure can further include:

[0058] Specifically, when the corresponding relationship between the target logical address and the third physical address is saved in the backup table, it indicates that the data saved at the target logical address has been changed for multiple times, and the data at the first physical address is not the original data saved at the target logical address. In this way, when the rollback operation is performed, the data at the target logical address cannot be rolled back to the data at the first physical address, and thus the corresponding relationship between the target logical address and the first physical address does not need to be written into the backup table.

[0059] For the convenience of understanding, referring to FIG. 4, a schematic diagram of data storage is provided according to another embodiment of the present disclosure. In FIG. 4, it is assumed that the target logical address is initially corresponding to the third physical address, and the original data saved at the target logical address is the entity data of the file b. When the data at the target logical address is changed for the first time by the application program in the business host, the entity data of the file b can be changed to the entity data of the file a. In the process of the first change, the corresponding relationship between the target logical address and the third physical address is released, and the corresponding relationship between the target logical address and the first physical address is created. Meanwhile, the corresponding relationship between the target logical address and the third physical address is written into the backup table. After the first change, the data at the target logical address can be changed for the second time by the application program in the business host due to business needs or other reasons. In the process of the second change, the corresponding relationship between the target logical address and the first physical address is released, and the corresponding relationship between the target logical address and the second physical address is created. Meanwhile, since the corresponding relationship between the target logical address and the third physical address is saved in the backup table, and the data at the first physical address is not the original data saved at the target logical address, the corresponding relationship between the target logical address and the first physical address does not need to be written into the backup table.

[0060] In the above embodiment, by interrupting the operation of writing the correspondence between the target logical address and the first physical address into the backup table, the problem that the physical address corresponding to the target logical address is overwritten multiple times in the backup table, and thus the data rollback is inaccurate, can be avoided.

[0061] In some embodiments, in the case of interrupting the operation of writing the correspondence between the target logical address and the first physical address into the backup table, the method of the present disclosure can further include:

[0062] recycling the first physical address, wherein the recycled first physical address is allowed to be used to establish a correspondence with other logical addresses except the target logical address.

[0063] Specifically, referring to FIG. 5, a schematic diagram of the correspondence between the target logical address and the physical address obtained after updating FIG. 4 is shown. Based on the description related to FIG. 4, after the correspondence between the target logical address and the second physical address is created and the correspondence between the target logical address and the first physical address is removed, the correspondence between the target logical address and the third physical address is saved in the backup table, and the target logical address actually corresponds to the second physical address, i.e., the first physical address is equivalent to having no relationship with the target logical address. In this case, the first physical address can be recycled and used to establish a correspondence with other logical addresses.

[0064] In the above embodiment, by recycling the first physical address in time, the waste of storage space of the storage device can be reduced.

[0065] In some embodiments, the number of backup tables can be multiple, each backup table has a corresponding preset time point, and the backup table can be used to record the correspondence between each target logical address and the first physical address obtained from the corresponding preset time point.

[0066] Specifically, referring to FIG. 6, a schematic diagram of multiple preset time points provided by an embodiment of the present disclosure is shown. The multiple preset time points can exemplarily include the same target time point in the current day and the continuous N days before the current day, the target time point in the mth day of each week, the target time point in the nth day of each month, etc. In this embodiment, the target time point is 00:00. The value of k is an integer less than or equal to N-1, and the value of N is an integer greater than 0. The values of m and n are integers greater than 0.

[0067] For example, as shown in FIG. 6, the preset time points can include 00:00 of the current day, 00:00 of the first day before the current day, 00:00 of the second day before the current day, 00:00 of Monday of the current week, and 00:00 of the first day of the current month. Backup table 1 is used to record the correspondence between each target logical address and the first physical address acquired from 00:00 of the current day; backup table 2 is used to record the correspondence between each target logical address and the first physical address acquired from 00:00 of the first day before the current day, and so on. As an example, it can be known that the data in different backup tables can have some overlap, for example, backup table 1 and backup table 2 both include the correspondence between each target logical address and the first physical address acquired from 00:00 of the current day, but backup table 2 also includes the correspondence between each target logical address and the first physical address acquired from 00:00 of the first day before the current day to 00:00 of the current day.

[0068] By setting multiple backup tables, the appropriate backup table can be selected to roll back the data at the target logical address according to the actual needs, which can improve the accuracy of data rollback and minimize the amount of data rollback. For example, when it is found that data carrying a virus is written into the storage device on the second day before the current day, data rollback can be performed based on the backup table 3 corresponding to 00:00 of the second day before the current day; when it is found that data carrying a virus is written into the storage device on the current day, data rollback can be performed based on the backup table 1 corresponding to 00:00 of the current day.

[0069] Based on the above description, the correspondence between the target logical address and the first physical address written into the backup table can include:

[0070] In the case where the current time point is located after each preset time point, the correspondence between the target logical address and the first physical address acquired at the current time point is written into the backup table corresponding to each preset time point, respectively.

[0071] For example, as shown in FIG. 6, the correspondence between the target logical address and the first physical address determined at the current time point is written into backup tables 1-6, respectively.

[0072] In this way, the accuracy and integrity of the data in each backup table can be ensured.

[0073] In some embodiments, considering that writing data into multiple different backup tables each time will affect the speed of writing data, the correspondence between the target logical address and the first physical address determined at the current time point is written into the backup table corresponding to each preset time point, respectively, which can include:

[0074] The correspondence between the target logical address and the first physical address is written into the target backup table corresponding to the preset time point closest to the current time point;

[0075] Every preset time length, the corresponding relationship newly written in the target backup table is synchronized to other backup tables except the target backup table.

[0076] For example, in FIG. 6, the backup table 1 is the target backup table corresponding to the preset time point closest to the current time point. After determining the corresponding relationship between the target logical address and the first physical address at the current time point, the corresponding relationship can be written into the backup table 1 only. Then, every preset time length, the backup table 1 is compared with each of the other backup tables, and the corresponding relationship existing in the backup table 1 but not existing in the other backup tables is written into the other backup tables. In this way, the data synchronization between the backup table 1 and the other backup tables is achieved.

[0077] Specifically, when synchronizing the data in the target backup table to the other backup tables, the operation can be performed in the background at a regular time, so that the impact on the business can be reduced.

[0078] In some embodiments, when the target time point of the first day after the current day is reached, the method of the present disclosure can further include:

[0079] Taking the first day after the current day as a new current day, a new blank backup table is created as the backup table corresponding to the target time point of the new current day;

[0080] The backup table corresponding to the target time point of the current day is copied as the backup table corresponding to the target time point of the first day before the current day, and the backup table corresponding to the target time point of the kth day before the current day is copied as the backup table corresponding to the target time point of the (k+1)th day before the current day.

[0081] For ease of understanding, it is assumed that k is 1 and the target time point is 00:00. In combination with FIG. 7, a schematic diagram of each backup table corresponding to the current day and the new current day is provided according to an embodiment of the present disclosure. In FIG. 7, it is assumed that September 16 is the current day, and September 17 is the first day after the current day, i.e., the new current day. For September 16, the backup table corresponding to September 16 00:00 is the backup table 1 corresponding to the current day 00:00, the backup table corresponding to September 15 00:00 is the backup table 2 corresponding to the first day before the current day 00:00, and the backup table corresponding to September 14 00:00 is the backup table 3 corresponding to the second day before the current day 00:00. However, for September 17, the backup table corresponding to September 16 00:00 should be the backup table 2 corresponding to the first day before the new current day 00:00, and the backup table corresponding to September 15 00:00 should be the backup table 3 corresponding to the second day before the new current day 00:00. At the same time, the backup table corresponding to the new current day 00:00 does not exist, so a new blank backup table needs to be created as the backup table corresponding to the new current day 00:00.

[0082] In the above embodiment, the backup table generation speed can be greatly improved by means of backup table replication. In the replicated backup table, the correspondence between the target logical address and the first physical address recorded before the target time point of the new day has been included. Thus, the data processing amount can be greatly reduced.

[0083] Further, when the target time point of the new day is reached, the method of the present disclosure can further include:

[0084] deleting the backup table corresponding to the target time in the Nth day before the current day.

[0085] Continuing to refer to FIG. 7. Assuming that N is 2. Then in FIG. 7, the backup table corresponding to the target time in the Nth day before the current day is the backup table 3 corresponding to 00:00 on September 14. In simple terms, for the new day September 17, 00:00 on September 14 is not the preset time point, so the backup table 3 corresponding to 00:00 on September 14 can be deleted.

[0086] By timely deleting the invalid backup table, the data storage amount can be reduced.

[0087] In some embodiments, when the target time point of the new day is reached, the method of the present disclosure can further include:

[0088] When the preset time point includes the target time point of the mth day of each week, if the current day is the mth day of the current week, the backup table corresponding to the target time point of the current day is replicated as the backup table corresponding to the target time point of the mth day of the current week.

[0089] For example, assuming that m and n are 1. In combination with FIG. 8, a schematic diagram of each backup table corresponding to the current day and the new day provided by another embodiment of the present disclosure is provided. In FIG. 8, it is assumed that September 16 is the current day, September 17 is the new day, and the current day is the first day of the current week. Then, when the backup table is replicated, the backup table 1 corresponding to 00:00 on September 14 can be replicated as the backup table 4 corresponding to 00:00 on the first day of the current week. Thus, on the basis of the backup table 4, the correspondence between the target logical address and the first physical address obtained from 00:00 on the first day of the current week can be continuously recorded.

[0090] Similarly, when the preset time point includes the target time point of the n th day of each month, if the current day is the n th day of the current month, the backup table corresponding to the target time point of the current day is replicated as the backup table corresponding to the target time point of the n th day of the current month.

[0091] Thus, by means of backup table replication, the data processing amount can be greatly reduced.

[0092] Corresponding to the data backup method, the present disclosure also provides a data recovery method. The data recovery method can apply the auxiliary volume, the primary volume, the primary volume change volume and the auxiliary volume change volume in FIG. 1. In combination with FIG. 9, a flowchart of the data recovery method provided by an embodiment of the present disclosure is shown. In FIG. 9, the data recovery method includes the following steps:

[0093] In step S901, in response to receiving a data recovery instruction for the storage device, a backup table of the storage device is obtained, and the backup table is obtained based on the above-mentioned data backup method.

[0094] In step S902, the correspondence between the target logical address and the first physical address in the storage device is found from the backup table.

[0095] In step S903, the second physical address in the storage device to which the target logical address currently corresponds is determined.

[0096] In step S904, the data at the first physical address is used to overwrite the data at the second physical address.

[0097] Specifically, the above-mentioned steps S901-S904 can be the inverse process of steps S201-S204 in FIG. 2, and the related principles are not described here.

[0098] In the technical solution of some embodiments of the present disclosure, after obtaining the target logical address allocated for the target data and the first physical address corresponding to the target logical address, the physical address corresponding to the target logical address is modified from the first physical address to the second physical address, the target data is written to the second physical address, and the correspondence between the target logical address and the first physical address is saved in the backup table. In this way, in addition to being able to successfully modify the data at the target logical address, when the storage device fails (for example, when the data in the storage device is implanted with a virus), the original data stored at the target logical address can be found in time based on the correspondence between the target logical address and the first physical address in the backup table, and then the data at the target logical address can be rolled back and recovered based on the original data, greatly reducing the difficulty of data recovery.

[0099] In some embodiments, as in the above-mentioned backup method, the number of backup tables is multiple, each backup table has a respective preset time point, and the backup table is used to record the correspondence between each target logical address and the first physical address obtained from the corresponding preset time point. The above-mentioned obtaining the backup table of the storage device can also include:

[0100] Extracting the first preset time point from the data recovery instruction to which the data in the storage device is to be recovered;

[0101] The first backup table corresponding to the first preset time point is obtained as the backup table.

[0102] Specifically, in some embodiments, the data recovery instruction can include a time point at which the storage device fails (such as a time point at which the storage device is infected by a virus), and based on the time point, a first preset time point to which data in the storage device is to be restored can be determined. For example, assuming that the preset time points include 00:00 of the current day, 00:00 of the first day before the current day, 00:00 of the second day before the current day, 00:00 of the first day of the current week, and 00:00 of the first day of the current month, and the time point at which the storage device fails is 12:30 of the second day before the current day, then the first preset time point to which the data in the storage device is to be restored can be determined as 00:00 of the second day before the current day. In this way, the first backup table corresponding to 00:00 of the second day before the current day can be obtained as the backup table, and the data in the storage device can be restored to 00:00 of the second day before the current day based on the first backup table corresponding to 00:00 of the second day before the current day. In this way, the problem of data loss caused by the data being implanted with a ransomware virus and the like can be effectively avoided.

[0103] In other embodiments, the first preset time point in the data recovery instruction can be manually specified. For example, a maintenance personnel of the storage device can input the first preset time point through a parameter configuration interface or the like according to actual needs. In this case, the first preset time point can be the same as the preset time point corresponding to a specific backup table. For example, the maintenance personnel can determine that the data in the storage device needs to be restored to 00:00 of the first day of the current week according to actual needs, and then can input the date of the first day of the current week and specify the time point as 00:00 through the configuration interface or the like. In this way, the data in the storage device can be rolled back and restored based on the first backup table corresponding to 00:00 of the first day of the current week.

[0104] In the above embodiments, the maintenance personnel can specify the first preset time point to which the data in the storage device is to be restored through the data recovery instruction according to actual needs, and the adaptability of the scheme is better.

[0105] Further, based on the above description of the data backup method, in some embodiments, the correspondence between the target logical address and the first physical address is written into the target backup table corresponding to the preset time point closest to the current time point, and the data newly written in the target backup table is synchronized to other backup tables except the target backup table every preset time length. Since the data in the target backup table is synchronized to other backup tables in a timing manner (not in real time), part of the data in the target backup table may not be completely synchronized to other backup tables. This leads to the problem that when data rollback or recovery operations are performed based on other backup tables except the target backup table, the data in these other backup tables may not be complete data, and thus part of the data that has not been completely synchronized between backup tables will be missed during data rollback. Therefore, the accuracy of data rollback is reduced.

[0106] In view of this, in some embodiments, if there is a second preset time point after the first preset time point, the method of the present disclosure can further include:

[0107] obtaining a second backup table corresponding to the second preset time point;

[0108] merging the first backup table and the second backup table, and taking the merged backup table as the obtained backup table.

[0109] Specifically, if there is a second preset time point after the first preset time point, it means that the first backup table corresponding to the first preset time point is not the target backup table corresponding to the preset time point closest to the current time point, and thus the data in the first backup table has the risk of being incomplete. In view of this, the second backup table corresponding to the second preset time point can be merged with the first backup table corresponding to the first preset time point, and data rollback can be performed based on the merged backup table.

[0110] In this way, the accuracy of data rollback can be ensured.

[0111] Further, considering that the target backup table corresponding to the preset time point closest to the current time point synchronizes data to each of the other backup tables respectively, in the case where there are multiple second preset time points after the first preset time point, the first backup table corresponding to the first preset time point actually has data differences (i.e., there is no such problem with other backup tables) with the above-mentioned target backup table that has not been synchronized. Therefore, only the target backup table corresponding to the preset time point closest to the current time point can be taken as the second backup table, and the merging of the first backup table and the second backup table can be completed. In this way, the data processing amount caused by data merging can be greatly reduced.

[0112] For example, assuming that the first preset time point is 00:00 point of the next day before the current day, after the first preset time point, there are two second preset time points, i.e., 00:00 point of the first day before the current day and 00:00 point of the current day. In this case, the second backup table corresponding to the 00:00 point of the first day before the current day can be ignored, the second backup table corresponding to the 00:00 point of the current day is merged with the first backup table corresponding to the 00:00 point of the next day before the current day, and the data in the storage device is rolled back based on the merged backup table.

[0113] Specifically, the merging of the second backup table and the first backup table can be as follows: traversing each target logical address in the first backup table. For any target logical address obtained by traversal, it can be found whether the target logical address exists in the second backup table. If the second backup table includes the target logical address, it is skipped without processing. If the second backup table does not include the target logical address, the correspondence between the target logical address and the first physical address in the first backup table can be copied to the first backup table. In this way, the merging of the first backup table and the second backup table is completed.

[0114] In some embodiments, as shown in FIG. 1, the storage device includes a primary volume and a secondary volume that can be used to store data, and the backup table can be generated when data is written to the secondary volume. The above-mentioned use of the data at the first physical address to overwrite the data at the second physical address can include:

[0115] using the data at the first physical address of the secondary volume to overwrite the data at the second physical address of the secondary volume;

[0116] determining a fourth physical address in the primary volume corresponding to the second physical address;

[0117] using the data at the first physical address of the secondary volume to overwrite the data at the fourth physical address of the primary volume.

[0118] In this way, the data rollback and recovery of different volumes in the storage dual-active volume can be completed. Specifically, for the storage dual-active volume, the specific operation of rollback can be as follows:

[0119] 1) modifying the dual-active relationship in the storage dual-active volume to an idle state, i.e., the primary volume and the secondary volume can both receive data;

[0120] 2) traversing all target logical addresses in the backup table, updating the data at the first physical address corresponding to the target logical address to the dual-active volume;

[0121] 3) restarting the dual-active relationship and synchronizing the secondary volume data to the primary volume;

[0122] 4) pulling up the business with the recovered data.

[0123] In the technical solution of the present disclosure, most data operations can be performed in the background at a fixed time, such as copying between backup tables, data synchronization between backup tables, and the like. In this way, the impact on the business can be reduced.

[0124] To this end, the related description of the method of the present disclosure is completed.

[0125] Referring to FIG. 10, a schematic diagram of an electronic device according to an embodiment of the present disclosure is provided. The electronic device includes a processor and a memory. The memory is configured to store computer-readable instructions. When the computer-readable instructions are executed by the processor, the method described above is implemented.

[0126] The processor can be a central processing unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, or combinations thereof.

[0127] The memory, as a non-transitory computer-readable storage medium, can be configured to store non-transitory software programs, non-transitory computer-executable programs and modules, such as program instructions / modules corresponding to the method in the embodiments of the present disclosure. The processor executes various functions and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory, i.e., implements the method in the method embodiments described above.

[0128] The memory can include a program storage area and a data storage area. The program storage area can store an operating system and at least one application required by a function. The data storage area can store data created by the processor and the like. In addition, the memory can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory remotely disposed relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0129] The present disclosure also provides a computer-readable storage medium for storing computer-readable instructions. When the computer-readable instructions are executed by the processor, the method described above is implemented.

[0130] While the method of the present disclosure is described in connection with the preferred embodiments, modifications and variations can be specific to the skilled person in the art without departing from the spirit and scope of the present disclosure, such modifications and variations being within the scope of the appended claims.

Claims

1. A data backup method characterized by, The method comprises: obtaining a target logical address allocated for target data to be written into a storage device, and a first physical address in the storage device currently corresponding to the target logical address; canceling the correspondence between the target logical address and the first physical address, and creating a correspondence between the target logical address and a second physical address in the storage device, wherein the first physical address and the second physical address are different; writing the target data into the second physical address; and in response to not finding the target logical address in a backup table, writing the correspondence between the target logical address and the first physical address into the backup table.

2. The method of claim 1, wherein, in response to finding the target logical address in the backup table, the method further comprises: determining whether the backup table has saved a correspondence between the target logical address and a third physical address in the storage device, and in response to the backup table having saved the correspondence between the target logical address and the third physical address in the storage device, interrupting the operation of writing the correspondence between the target logical address and the first physical address into the backup table.

3. The method of claim 2, wherein, in response to interrupting the writing of the correspondence between the target logical address and the first physical address into the backup table, the method further comprises: recycling the first physical address, wherein the recycled first physical address is allowed to be used to establish a correspondence with a logical address other than the target logical address.

4. The method of claim 1, wherein, The number of backup tables is multiple, each of the backup tables has a respective preset time point, and each of the backup tables is used to record the correspondence between each of the target logical addresses and the first physical address obtained from the respective preset time point; the writing of the correspondence between the target logical address and the first physical address into the backup table comprises: in response to a current time point being after each of the preset time points, writing the correspondence between the target logical address and the first physical address obtained at the current time point into each of the backup tables corresponding to the respective preset time points.

5. The method of claim 4, wherein, the writing of the correspondence between the target logical address and the first physical address obtained at the current time point into each of the backup tables corresponding to the respective preset time points comprises: writing the correspondence between the target logical address and the first physical address into a target backup table corresponding to a preset time point closest to the current time point; and every preset time interval, synchronizing the correspondence newly written into the target backup table to other backup tables except the target backup table.

6. The method of claim 4, wherein, The preset time points include the same target time point in the current day and the N consecutive days before the current day; in response to reaching the target time point on the first day after the current day, the method further comprises: taking the first day after the current day as a new current day, creating a new blank backup table as a backup table corresponding to the target time point in the new current day; and copying the backup table corresponding to the target time point in the current day as the backup table corresponding to the target time point in the first day before the new day, and copying the backup table corresponding to the target time point in the kth day before the current day as the backup table corresponding to the target time point in the (k+1)th day before the new day; wherein the value of k is an integer less than or equal to N-1, and the value of N is an integer greater than 0.

7. The method of claim 6, wherein, In response to reaching the target time point in the new day, the method further comprises: deleting the backup table corresponding to the target time point in the Nth day before the current day.

8. The method of claim 6, wherein, The preset time points further include the target time point in the mth day of each week, and / or the target time point in the nth day of each month. In response to reaching the target time point in the new day, the method comprises: In response to the preset time points including the target time point in the mth day of each week, and in response to the current day being the mth day of the current week, copying the backup table corresponding to the target time point in the current day as the backup table corresponding to the target time point in the mth day of the current week; and In response to the preset time points including the target time point in the nth day of each month, and in response to the current day being the nth day of the current month, copying the backup table corresponding to the target time point in the current day as the backup table corresponding to the target time point in the nth day of the current month. wherein the values of m and n are integers greater than 0.

9. The method of claim 1, wherein, The target logical address allocated to the target data to be written into the storage device and the first physical address in the storage device currently corresponding to the target logical address comprise: obtaining the target logical address allocated to the target data from a write instruction of the target data issued by an application program of a service host; and determining the first physical address in the storage device currently corresponding to the target logical address based on a mapping relationship between logical addresses and physical addresses.

10. The method of claim 9, wherein, The first physical address currently corresponding to the target logical address is empty or stores other data than the target data; The second physical address is a physical address in the storage device that does not correspond to any logical address.

11. The method of claim 5, wherein, The method comprises: comparing the target backup table newly written with other backup tables except the target backup table every preset time length to determine the correspondence relationship existing in the target backup table but not existing in the other backup tables; and synchronizing the correspondence relationship existing in the target backup table but not existing in the other backup tables to the other backup tables.

12. A data recovery method, characterized by, The method comprises: in response to receiving a data recovery instruction for the storage device, obtaining a backup table of the storage device, the backup table being obtained based on the data backup method of any one of claims 1 to 11; finding the correspondence relationship between the target logical address and the first physical address in the storage device from the backup table; determining the second physical address in the storage device currently corresponding to the target logical address; and cover data at the second physical address with data at the first physical address.

13. The method of claim 12, wherein, The number of the backup tables is plural, each of the backup tables has a respective preset time point, and each of the backup tables is used to record a correspondence between each of the target logical addresses and the first physical address acquired from the respective preset time point; The method further includes: extracting a first preset time point to which data in the storage device is to be restored from the data recovery instruction; and taking a first backup table corresponding to the first preset time point as the acquired backup table.

14. The method of claim 13, wherein, If there is a second preset time point after the first preset time point, the method further includes: acquiring a second backup table corresponding to the second preset time point; and merging the first backup table and the second backup table, and taking the merged backup table as the acquired backup table.

15. The method of any one of claims 12 to 14, wherein, The storage device includes a main volume and an auxiliary volume for storing data, and the backup table is generated when data is written into the auxiliary volume; The method further includes: covering data at the second physical address of the auxiliary volume with data at the first physical address of the auxiliary volume; determining a fourth physical address in the main volume corresponding to the second physical address; and covering data at the fourth physical address of the main volume with data at the first physical address of the auxiliary volume.

16. The method of claim 13, wherein, The data recovery instruction includes a time point at which the storage device fails, and the extracting of the first preset time point to which data in the storage device is to be restored from the data recovery instruction includes: extracting the time point at which the storage device fails from the data recovery instruction, and determining the first preset time point to which data in the storage device is to be restored according to the time point at which the storage device fails.

17. The method of claim 14, wherein, The second preset time point is plural, and the acquiring of the second backup table corresponding to the second preset time point includes: acquiring a target backup table corresponding to a second preset time point closest to a current time point as the second backup table.

18. A non-transitory computer readable storage medium, comprising: The non-volatile computer-readable storage medium is used to store computer-readable instructions, and the computer-readable instructions are executed by a processor to implement the method of any one of claims 1 to 11 or the method of any one of claims 12 to 17.

19. An electronic device, comprising: The electronic device includes a processor and a memory, and the memory is used to store computer-readable instructions, and the computer-readable instructions are executed by the processor to implement the method of any one of claims 1 to 11 or the method of any one of claims 12 to 17.

20. A computer readable instruction product comprising computer readable instructions, characterized in that, The computer-readable instructions are executed by a processor to implement the method of any one of claims 1 to 11 or the method of any one of claims 12 to 17.

Citation Information

Patent Citations

  • Data processing method and apparatus

    CN103761190A

  • Logical sector mapping in a flash storage array

    CN105786408A

  • Data backup method, data recovery method, electronic equipment, medium and program product

    CN118897759A

  • Storage control system and storage control method

    US20060248297A1

  • Processor and method for altering address translation

    US20070255924A1