Data backup method and device, storage medium and electronic equipment
By adjusting the read voltage in memory, determining the current sub-region and obtaining a bitmap, and comparing bits to determine the data slices that need to be backed up, the problem of low backup efficiency of virtual machines is solved and efficient data backup is achieved.
Patent Information
- Application Number
- CN202411845547.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-21
AI Technical Summary
In existing cloud computing technology, virtual machine backup efficiency is low, resulting in high backup failure rate and re-copying of all data, reducing backup efficiency.
By adjusting the read voltage in memory, determining that the current sub-region is the area where the last backup was not completed, obtaining the current bitmap and the target bitmap, comparing the bit bits to determine the data slice that needs to be backed up, and backing it up to the target storage location.
Improve the efficiency of data backup, and only re-backups were made for the part that failed the last backup, reducing the process of duplicate copying of data and improving the backup success rate.
Smart Images

Figure CN119668944A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the computer field, and specifically, to a data backup method and device, a storage medium, and an electronic device. Background Art
[0002] With the development of cloud computing technology, more and more users are using cloud office services. Virtual machines are the most basic operating entities in the cloud computing environment. They are lightweight, cross-platform, and dynamically configured. They can run in the form of software on physical machines. Virtual machine backup technology is a key technology in cloud computing.
[0003] However, in the existing cloud computing technology, the backup of virtual machines is achieved through snapshot technology. By comparing the data between two snapshots, when the comparison result shows that the data between the two snapshots is inconsistent, all the compared data is written to the backup storage pool to achieve incremental data backup. However, this technology requires a full copy of the compared data. In the data copying process, due to the large amount of data to be copied, the probability of backup failure is high. Every time a backup failure occurs, all the data needs to be re-copied at the next backup, which leads to low efficiency of virtual machine data backup. In other words, there is a problem of low efficiency in the virtual machine backup process in the related technology.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a data backup method and device, a storage medium, and an electronic device to at least solve the problem of low efficiency in the virtual machine backup process in the related art.
[0006] According to an embodiment of the present application, a method for adjusting a read voltage in a memory is provided, comprising: in a process of backing up first data in a first storage area to a second storage area, determining a current sub-area from a plurality of second sub-areas in the second storage area, wherein the current sub-area is a storage sub-area for which a previous backup operation has not been completed; obtaining a current bitmap matching the current sub-area and a target bitmap matching a target sub-area, wherein the target sub-area is a storage sub-area in the first storage area corresponding to the current sub-area, the current bitmap and the target bitmap include a plurality of bits, and the bits are used to indicate an update status of a data slice in the storage sub-area; determining at least one target data slice from a plurality of data slices stored in the target sub-area according to a comparison result between the current bitmap and the target bitmap; and backing up the target data slice to a target storage position in the current sub-area.
[0007] According to another aspect of an embodiment of the present application, a data backup device is also provided, comprising: a first determination unit: in the process of backing up first data in a first storage area to a second storage area, determining a current sub-area from multiple second sub-areas in the second storage area, wherein the current sub-area is a storage sub-area for which the last backup operation has not been completed; a bitmap acquisition unit: acquiring a current bitmap matching the current sub-area, and a target bitmap matching a target sub-area, wherein the target sub-area is a storage sub-area in the first storage area corresponding to the current sub-area, the current bitmap and the target bitmap include multiple bits, and the bits are used to indicate the update status of a data slice in the storage sub-area; a second determination unit: determining at least one target data slice from the multiple data slices stored in the target sub-area according to a comparison result between the current bitmap and the target bitmap; a backup unit: backing up the target data slice to a target storage position in the current sub-area.
[0008] Optionally, the data backup device also includes: a third determination unit, which, before determining at least one target data slice from the multiple data slices in the target sub-area based on the comparison result between the current bitmap and the target bitmap, also includes: performing a bitwise exclusive OR operation on the current bitmap and the target bitmap to obtain a reference bitmap; determining at least one bit in the reference bitmap whose numerical value is the first value as at least one target bit; and determining the data slice in the storage sub-area indicated by at least one target bit as the target data slice.
[0009] Optionally, the above-mentioned first determination unit includes: an acquisition module, used to obtain backup indication information configured for each of the multiple second sub-areas; a determination module, used to determine at least one of the second sub-areas whose backup indication information is the second value as the current sub-area, wherein the second sub-area whose backup indication information is the second value is the storage sub-area for which the last backup operation was not completed, and the second sub-area whose backup indication information is the third value is the storage sub-area for which the last backup operation was completed.
[0010] Optionally, the above-mentioned data backup device also includes: an update unit, used to: divide the second storage area into multiple second sub-areas, and determine the bitmap objects respectively configured for the multiple second sub-areas; when data update occurs to at least one first data slice in the first storage area, obtain the first bitmap of the first storage sub-area used to store at least one first data slice; according to the bit position whose value in the first bitmap is the first value, back up at least one first data slice in the first storage sub-area to the second storage sub-area, respectively, wherein the second storage sub-area is a storage sub-area matching the first storage sub-area; obtain a second bitmap matching the second storage area, and update the value of at least one of the bits in the second bitmap according to the backed up first data slice.
[0011] Optionally, the update unit is also used to: configure the backup indication information of the second storage sub-area to a second value when the backup operation of at least one of the first data slices updated in the first storage area has not been completed; and configure the backup indication information of the second storage sub-area to a third value when the backup operation of at least one of the first data slices updated in the first storage area has been completed.
[0012] Optionally, the update unit is also used to: when the second data slice in the second storage area is updated to the first data slice according to the backup operation, set the bit in the second bitmap that matches the second data slice to a fourth value; when the third data slice in the second storage area is not updated, set the bit in the second bitmap that matches the third data slice to a fifth value.
[0013] Optionally, the above-mentioned data backup device also includes a clearing unit, which is used to: when the first data in the first storage area is backed up to the second storage area, clear the first bitmap set matching the first storage area, and clear the second bitmap set matching the second storage area.
[0014] According to another aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for adjusting the read voltage in the memory as described above.
[0015] According to another aspect of the embodiments of the present application, there is further provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the data backup method through the computer program.
[0016] Through the present application, first, in the process of backing up the first data in the first storage area to the second storage area, the current sub-area is determined from the multiple second sub-areas in the second storage area, and then the current bitmap matching the current sub-area and the target bitmap matching the target sub-area are obtained. Further, according to the comparison result between the current bitmap and the target bitmap, at least one target data slice can be determined from the multiple data slices stored in the target sub-area. Among them, the current sub-area is the storage sub-area for which the last backup operation has not been completed; the target sub-area is the storage sub-area corresponding to the current sub-area in the first storage area, the current bitmap and the target bitmap include multiple bits, and the bits are used to indicate the update status of the data slices in the storage sub-area. Furthermore, through the present application, only the part that failed to be backed up last time can be re-backed up, which improves the efficiency of data backup, thereby solving the problem of low efficiency in the process of virtual machine backup in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 It is a hardware structure block diagram of a server device of a data backup method according to an embodiment of the present application;
[0019] Figure 2 is a flow chart of a data backup method according to an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of a data backup method according to an embodiment of the present application;
[0021] Figure 4 is a schematic diagram of another data backup method according to an embodiment of the present application;
[0022] Figure 5 is a flow chart of another data backup method according to an embodiment of the present application;
[0023] Figure 6 is a structural schematic diagram of a data backup device according to an embodiment of the present application;
[0024] Figure 7It is a structural schematic diagram of a data backup electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0027] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a data backup method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0028] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a method for adjusting a read voltage in a memory in an embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to a server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0029] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0030] As an optional implementation, Figure 2 As shown, the above data backup method includes:
[0031] S202, in the process of backing up the first data in the first storage area to the second storage area, determining a current sub-area from a plurality of second sub-areas in the second storage area, wherein the current sub-area is a storage sub-area for which the last backup operation has not been completed;
[0032] S204, obtaining a current bitmap matching the current sub-region and a target bitmap matching the target sub-region, wherein the target sub-region is a storage sub-region in the first storage region corresponding to the current sub-region, and the current bitmap and the target bitmap include a plurality of bits, and the bits are used to indicate an update status of a data slice in the storage sub-region;
[0033] S204, determining at least one target data slice from a plurality of data slices stored in the target sub-region according to a comparison result between the current bitmap and the target bitmap;
[0034] S206: Back up the target data slice to the target storage location in the current sub-area.
[0035] It should be noted that the first storage area is a storage area for storing the current virtual machine data, the second storage area is an area for storing the current virtual machine backup data, and the second virtual area includes multiple second sub-areas, each of which is responsible for storing a part of the backup data.
[0036] It is understandable that in the process of backing up virtual machine data, it cannot be guaranteed that every backup can be completed successfully. When a backup fails, it is necessary to back up again. The backup can be done at the next backup time point preset by the system, and the part that failed in this backup can be backed up again. It can also be done after the current backup fails, and the retransmission phase is started, and the backup is performed again during the retransmission phase.
[0037] For example, when the second backup is performed at the next backup time point preset by the system, the part that failed to be backed up this time is backed up again. First, the second sub-area where the data backup was not completed in the case of backup failure is recorded, and then the next backup time point preset by the system is waited for. When the data changes in the first storage area, the data backup operation is triggered, and the backup time point preset by the system is reached. And further, the second sub-area that needs to receive the backup data is confirmed, and the second sub-area where the data backup was not completed last time is compared with the second sub-area where the data backup is required this time. If the second sub-area where the backup operation was not completed last time is the second sub-area where the backup operation is required this time, then after the backup of the data to the second sub-area is completed, it is not necessary to determine the second sub-area as the current sub-area. If the second sub-area where the backup operation was not completed last time is not the second sub-area where the backup operation is required this time, the second sub-area where the data backup was not completed last time is determined as the current sub-area.
[0038] The following is a further example. For example, data needs to be backed up to the second sub-areas A and B this time. When the backup fails, the second sub-areas A and B have not completed the data backup. At this time, the second sub-area A and the second sub-area B are recorded. When the data in the first storage area changes again, the data backup is started again. If the data changed in the first storage area at this time is the data in the sub-area corresponding to the second sub-areas B and C in the first storage area, the data needs to be backed up to the second sub-areas B and C. When the last backup failed, the second sub-areas that did not complete the data backup were the second sub-areas A and B, and then the second sub-area A is determined as the current sub-area.
[0039] For another example, the retransmission operation of the data that failed to be backed up is to start the retransmission phase after the current backup fails, and perform another backup in the retransmission phase. It can be understood that the operation of retransmitting the data that failed to be backed up is itself a data backup operation, so the next backup operation after the failed backup operation is the data retransmission operation. For example, for example, the data needs to be backed up to the second sub-areas A and B this time. When the backup fails this time, the second sub-areas A and B have not completed the data backup. At this time, the data retransmission phase is entered, and the second sub-areas A and B are determined as the current sub-areas.
[0040] As an optional implementation, in the above step S202, in the process of backing up the first data in the first storage area to the second storage area, determining the current sub-area from the plurality of second sub-areas in the second storage area includes:
[0041] S202-1, obtaining backup indication information configured for each of the plurality of second sub-areas;
[0042] S202-2, determine at least one second sub-region whose backup indication information is the second value as the current sub-region, wherein the second sub-region whose backup indication information is the second value is the storage sub-region where the last backup operation was not completed, and the second sub-region whose backup indication information is the third value is the storage sub-region where the last backup operation was completed.
[0043] It can be understood that each of the above-mentioned second sub-areas corresponds to a backup indication information, and the above-mentioned backup indication information is used to describe the backup status of the corresponding second sub-area. When the above-mentioned second backup indication information is a second value, it indicates that the backup operation of the second sub-area has not been completed. When the above-mentioned second backup indication information is a third value, it indicates that the backup operation of the second sub-area has been completed.
[0044] For example, in an optional implementation, a value of 1 indicates that the corresponding second sub-region has completed backup, and a value of 2 indicates that the corresponding second sub-region has not completed backup. In this case, executing the above step S202-2 will obtain backup indication information corresponding to multiple second sub-regions, and then executing the above step S202-2, and determining the second sub-region corresponding to the value of 1 of the backup indication information as the above current sub-region.
[0045] After determining the current sub-region, execute step S204 to obtain a current bitmap matching the current sub-region and a target bitmap matching the target sub-region. It should be noted that the first storage area includes multiple storage sub-regions, and each storage sub-region in the first storage area corresponds to a second sub-region in the second storage area. The backup operation in the step S202 is specifically to back up the data in the storage sub-region in the first storage area to the corresponding second sub-region in the second storage area.
[0046] In the first storage area, the storage sub-area corresponding to the current sub-area in the second storage area is the target sub-area. Each current sub-area and each target sub-area respectively corresponds to a bitmap, which is composed of multiple bits and is used to indicate the update status of the data slice in the storage sub-area.
[0047] Specifically, for the target sub-region, in the corresponding target bitmap, a bit with a value of 1 indicates that the data corresponding to the bit has changed and needs to be backed up, and a bit with a value of 0 indicates that the data corresponding to the bit has not changed and does not need to be backed up. For the current sub-region, in the corresponding current bitmap, a bit with a value of 1 indicates that the data corresponding to the bit has been backed up, and a bit with a value of 0 indicates that the data corresponding to the bit has not been backed up.
[0048] Optionally, the bit lengths of the target bitmap and the current bitmap may be consistent or inconsistent, and it is understandable that the length of the current bitmap will not exceed the length of the target bitmap. In the case where the bit lengths of the target bitmap and the current bitmap are consistent, a bit with a value of 1 in the current bitmap indicates that the data corresponding to the bit has been backed up, and a bit with a value of 0 indicates that the data corresponding to the bit has not been backed up.
[0049] In the case where the bit lengths of the target bitmap and the current bitmap are inconsistent, the bits in the current bitmap with a value of 1 indicate that the data corresponding to the bit has been backed up, the bits with a value of 0 indicate that the data corresponding to the bit does not need to be backed up, and the missing bits indicate that it has not been determined whether the data corresponding to the bit needs to be backed up. For example, as an optional implementation, the target bitmap obtained by executing step S204 is "1, 0, 0, 1", indicating that the data slices in the storage sub-area corresponding to the first and last bits of the bitmap have changed, and the data corresponding to the first and last bits need to be backed up, while the current bitmap obtained is "1, 0", indicating that the data slice corresponding to the first bit in the target bitmap has been backed up, and the data slice corresponding to the second bit does not need to be backed up. Compared with the target bitmap, the missing third and last bits indicate that it has not yet been determined whether the data corresponding to the third and last bits in the target bitmap need to be backed up.
[0050] Further, after obtaining the current bitmap and the target bitmap, the above step S206 is executed, and based on the comparison result between the current bitmap and the target bitmap, at least one target data slice is determined from the multiple data slices stored in the target sub-area; it should be noted that, in the case that the bit lengths of the above target bitmap and the current bitmap are inconsistent, the current bitmap needs to be patched to make the lengths of the current bitmap consistent with those of the target bitmap, and the above-mentioned padding method can specifically be padding with zero values. For example, as an optional implementation, the target bitmap obtained by executing the above step S204 is "1, 0, 0, 1", and the current bitmap obtained is "1, 0", and the current bitmap "1, 0" is padded with zero values to obtain the current bitmap "1, 0, 0, 0" after padding.
[0051] Optionally, the comparison result in step S206 may be obtained by an XOR operation. For example, the following steps are performed to obtain the comparison result and determine the target data slice:
[0052] S1, perform bitwise XOR operation on the current bitmap and the target bitmap to obtain a reference bitmap;
[0053] S2, determining at least one bit whose value in the reference bitmap is the first value as at least one target bit;
[0054] S3: Determine a data slice in the storage sub-region indicated by at least one target bit as a target data slice.
[0055] It can be understood that the first value is used to indicate that the corresponding bits in the current bitmap and the target bitmap in the XOR result are different. For example, a bit with a value of 1 in the numerical reference bitmap indicates that the corresponding bits in the current bitmap and the target bitmap are different, and a bit with a value of 0 indicates that the corresponding bits in the current bitmap and the target bitmap are the same.
[0056] As an optional implementation, for example, a bitwise XOR operation is performed on the target bitmap of "1, 0, 0, 1" and the current bitmap of "1, 0, 0, 0", and a comparison result (reference bitmap) of "0, 0, 0, 1" is obtained, indicating that the data slice corresponding to the fourth bit in the target bitmap needs to be backed up but the backup operation to the second storage area has not been completed, and the fourth bit in the reference bitmap "0, 0, 0, 1" is used as the target bit, and then the data slice corresponding to the fourth bit corresponding to the target bit in the target bitmap is determined as the above-mentioned target data slice.
[0057] As an optional implementation, before determining at least one target data slice from multiple data slices stored in the target sub-area based on the comparison results between the current bitmap and the target bitmap, the value of the corresponding bit in the current bitmap can also be determined based on the padding status of the current bitmap, and further determine whether further data backup is needed. For example, when the target bitmap obtained by executing the above step S204 is "1, 0, 0, 0", and the current bitmap obtained is "1, 0", it is necessary to fill the third and last bits of the current bitmap, and in the above target bitmap "1, 0, 0, 0", the values of the third and last bits are 0, which means that the data slices corresponding to the third and last bits of the target bitmap have not changed, and no data transmission is required. Therefore, there is no need to further determine the comparison result between the current bitmap and the target bitmap, and determine at least one target data slice from the multiple data slices stored in the target sub-area based on the above comparison result. Through this implementation, the value of the corresponding bit in the current bitmap is determined according to the filling situation of the current bitmap. When the corresponding bits are all 0, it is determined that there is no need to continue data backup. Therefore, there is no need to execute the above step S206 to determine at least one target data slice to be backed up, thereby improving the efficiency of the data backup process.
[0058] After at least one target data slice is determined in step S206, step S208 is continued to be executed to back up the target data slice to the target storage location in the current sub-area to complete the continued backup of the target data slice that needs to be backed up but has not been backed up.
[0059] Through the above implementation of the present application, first, in the process of backing up the first data in the first storage area to the second storage area, the current sub-area is determined from the multiple second sub-areas in the second storage area, and then the current bitmap matching the current sub-area and the target bitmap matching the target sub-area are obtained. Further, based on the comparison result of the current bitmap and the target bitmap, at least one target data slice can be determined from the multiple data slices stored in the target sub-area. Among them, the current sub-area is the storage sub-area for which the last backup operation has not been completed; the target sub-area is the storage sub-area corresponding to the current sub-area in the first storage area, and the current bitmap and the target bitmap include multiple bits, which are used to indicate the update status of the data slice in the storage sub-area. Further, through the present application, only the part that failed to be backed up last time can be re-backed up, which improves the efficiency of data backup, thereby solving the problem of low efficiency in the process of virtual machine backup in the related technology.
[0060] In an optional implementation, in the process of backing up the first data in the first storage area to the second storage area, before determining the current sub-area from the plurality of second sub-areas in the second storage area, the method further includes:
[0061] S1, dividing the second storage area into a plurality of second sub-areas, and determining bitmap objects respectively configured for the plurality of second sub-areas;
[0062] S2, when data update occurs on at least one first data slice in the first storage area, obtaining a first bitmap of the first storage sub-area for storing at least one first data slice;
[0063] S3, backing up at least one first data slice in the first storage sub-region to a second storage sub-region according to the bit having the first value in the first bitmap, wherein the second storage sub-region is a storage sub-region matching the first storage sub-region;
[0064] S4, obtaining a second bitmap matching the second storage area, and updating a value of at least one bit in the second bitmap according to the backed-up first data slice.
[0065] Optionally, in the above step S1, the second storage area is divided into a plurality of second sub-areas, and bitmap objects respectively configured for the plurality of second sub-areas are determined. It should be noted that the above second sub-areas are used to store data in the corresponding storage sub-areas in the first storage area, and the number of bits of the bitmap object of a second sub-area that has not yet stored backup data can be 0. After the backup is performed or it is determined that the data indicated by the corresponding bit of the target bitmap does not need to be backed up, the corresponding bit of the bitmap object of the second sub-area is generated.
[0066] Optionally, in the above step S1, in the process of dividing the second storage area into a plurality of second sub-areas, the division method may be an average distribution, or a dynamic division according to the amount of updated data.
[0067] As an optional implementation, for example, when the division method is equal distribution, the second storage area is divided into two or other numbers of second sub-areas with the same size.
[0068] For another example, when the division method is dynamic division, the minimum storage unit in the first storage area where data changes occur is determined, and multiple second storage sub-areas are determined for the areas corresponding to the multiple minimum storage units in the second storage area. For example, in the first storage area, each minimum storage unit is regarded as a sub-area, multiple minimum storage units corresponding to the multiple minimum storage units in the second storage area where data changes occur are determined as corresponding second storage sub-areas, and other minimum data storage units in the second storage area are regarded as a second storage sub-area as a whole, and then in the process of backing up data, only the bitmap of the minimum storage unit where data changes occur needs to be generated, which reduces the system index burden.
[0069] It should be noted that in the above step S2, the above first bitmap is used to describe the data transformation of the corresponding first storage sub-area. For example, a bit with a value of 0 represents that the corresponding data slice has not changed, and a value of 1 represents that the corresponding data slice has changed.
[0070] Furthermore, the data slice to be backed up can be determined according to the values of the bits of the first bitmap obtained in step S2. For example, the data slice with a value of 1 in the first bitmap is determined as the first data slice to be backed up. Further, the first data slice is backed up, and after the backup is completed, the value of the corresponding bit in the second bitmap is updated to 1.
[0071] As an optional implementation, the above step S4, obtaining a second bitmap matching the second storage area, and updating the value of at least one bit in the second bitmap according to the backed-up first data slice, also includes at least one of the following:
[0072] S4-1, when the second data slice in the second storage area is updated to the first data slice according to the backup operation, setting the bit in the second bitmap that matches the second data slice to a fourth value;
[0073] S4-2, when the third data slice in the second storage area is not updated, setting the bit in the second bitmap that matches the third data slice to a fifth value.
[0074] It should be noted that when executing the above steps S4-1 to S4-2, the value of the first bitmap of the first storage sub-area will be determined. For example, the first bitmap corresponding to the current first storage sub-area is "0, 1, 0, 0". When no backup is performed, the corresponding bitmap object of the second sub-area has not yet generated a second bitmap including specific bits. When backing up data, each bit in the first bitmap "0, 1" is judged. First, the first bit is judged to be 0, indicating that the data slice corresponding to the bit has not changed. Therefore, there is no need to perform a backup of the data slice, and then step S4-2 can be executed. When the third data slice in the second storage area has not been updated, the bit in the second bitmap that matches the third data slice is set to the fifth value. It can be understood that at this time, the first bit in the second bitmap is set to the value 0, and the second bitmap is "0". Then, the second bit of the first bitmap is judged, and the second bit is 1, indicating that the value of the data slice corresponding to the bit has changed. Therefore, the changed data slice needs to be backed up, and if the backup is successful, the second bit in the second bitmap is set to the value 1, that is, in the above step S4-1, when the second data slice in the second storage area is updated to the first data slice according to the backup operation, the bit in the second bitmap that matches the second data slice is set to the fourth value. It can be understood that at this time, the second bitmap is updated to "0, 1".
[0075] Through the above implementation of the present application, the second storage area is first divided into multiple second sub-areas, and the bitmap objects respectively configured for the multiple second sub-areas are determined. Then, when data is updated in at least one first data slice in the first storage area, the first bitmap of the first storage sub-area for storing at least one first data slice is obtained. After that, according to the bit with the first value in the first bitmap, at least one first data slice in the first storage sub-area is backed up to the second storage sub-area. Finally, a second bitmap matching the second storage area is obtained, and the value of at least one bit in the second bitmap is updated according to the backed up first data slice, thereby realizing the marking of the current backup status of each second sub-area of the second storage area for storing backup data.
[0076] In an optional implementation, when data update occurs to at least one first data slice in the first storage area, after obtaining the first bitmap of the first storage sub-area for storing at least one first data slice, the method further includes:
[0077] S1, when the backup operation of at least one first data slice updated in the first storage area has not been completed, the backup indication information of the second storage sub-area is configured as a second value;
[0078] S2: When the backup operation of at least one first data slice updated in the first storage area has been completed, the backup indication information of the second storage sub-area is configured as a third value.
[0079] It can be understood that the above steps S1 to S2 are used to mark the completion status of the backup of the second storage sub-area. For example, when a second storage sub-area completes data backup, the above step S2 is executed to configure the backup indication information of the second storage sub-area to the value "1", which is used to indicate that the second storage sub-area has completed the data backup at this time. In the case where a second area has not completed the data backup, the above step S1 is executed to configure the backup indication information of the second storage sub-area to the value "0", which is used to indicate that the second storage sub-area has not completed the data backup at this time.
[0080] It should be noted that the second storage sub-area sets the value of the backup indication information to 1 when the backup is completed and to 0 when the backup is not completed. This is only an example. The second storage sub-area may also set the value of the backup indication information to 0 when the backup is completed and to 1 when the backup is not completed. No specific limitation is made here.
[0081] Through the above implementation of the present application, when the backup operation of at least one first data slice updated in the first storage area has not been completed, the backup indication information of the second storage sub-area is configured as the second value. When the backup operation of at least one first data slice updated in the first storage area has been completed, the backup indication information of the second storage sub-area is configured as the third value, so that in the case of data backup failure, only the data slice in the first storage sub-area corresponding to the second storage sub-area with the backup information of the second value needs to be bitmap compared and the retransmission data slice is determined, without the need to perform bitmap comparison on the bitmaps of all first storage sub-areas and the corresponding second storage sub-areas, thereby improving the efficiency of retransmission of failed backup data.
[0082] In an optional implementation manner, after backing up the target data slice to the target storage location in the current sub-area, the method further includes:
[0083] S1, when the first data in the first storage area is backed up to the second storage area, clearing the first bitmap set matching the first storage area, and clearing the second bitmap set matching the second storage area.
[0084] Through the above-mentioned implementation of the present application, when the first data in the first storage area is backed up to the second storage area, multiple first bitmaps matching the first storage area and multiple second bitmaps matching the second storage area are cleared, thereby reducing the storage overhead for saving the bitmap.
[0085] Figure 3 Schematic diagram of a data backup method according to an embodiment of the present application. Figure 3 As shown in Figure (a), Figure 3 The virtual machine source disk file 331 in the figure (a) is the file of the virtual machine currently used by the user, including two parts, one part is the disk file 312, and the other part is the to-be-backed bitmap 302 corresponding to the disk file 312, which is used to manage the disk file 312. Further, each bit of the to-be-backed bitmap 302 corresponds to a data in the disk file 312. Specifically, the bit with a value of 1 represents that the corresponding data has changed, and the bit with a value of 0 represents that the corresponding bit has not changed. When backing up data, step S302 is executed to back up according to the bitmap information, that is, the data corresponding to the bit with a value of 1 in the to-be-backed bitmap 302 is backed up to the disk file 314, and the backed up bitmap 304 corresponding to the disk file 314 will record the backup information. Specifically, when the data to be backed up in the disk file 312 has been backed up in the disk file 314, the corresponding bit position in the backed up bitmap 304 is set to 1. When it is confirmed that the value of the bit of the to-be-backed bitmap 302 is 0, the value of the corresponding bit in the backed up bitmap 304 is set to 0. If only part of the backup data in the disk file 312 is backed up, the corresponding bits of the unbacked-up data in the backed-up bitmap 304 are filled with 0.
[0086] The following is an example. For example, if the to-be-backed-up bitmap 302 corresponding to the disk file 312 is "010", step S302 is executed to perform backup according to the bitmap information. First, it is determined that the first bit of the to-be-backed-up bitmap 302 is "0", and at this time, the first bit is added to the backed-up bitmap 304 and set to "0". At this time, the backed-up bitmap 304 is "0". After that, it is determined that the second bit of the to-be-backed-up bitmap 302 is "1", and the data corresponding to the second bit of the to-be-backed-up bitmap 302 is backed up to the disk file 314. After the backup is completed, the next bit is added to the backed-up bitmap 304 and the value is set to 1. At this time, it is determined that the backed-up bitmap 304 is "01". After that, it is determined that the third bit of the to-be-backed-up bitmap 302 is "0", and at this time, a bit is added to the backed-up bitmap 304 and set to "0". At this time, the backed-up bitmap 304 is "010". At this time, the bitmap 302 to be backed up has completed all bit confirmations and the backup of all data to be backed up. At this time, step S304 is executed to determine the value of the bitmap backup information according to the backup result, specifically, the value of the bitmap backup information is set to 1 to indicate that the backup is completed. It should be noted that the value of the bitmap backup information is 0 by default, and the value of the bitmap backup information will not be set to 1 when the data backup fails.
[0087] It should be noted that in step S304, the value of the bitmap backup information is determined according to the backup result. The bitmap backup information defaults to 0 and is modified to 1 after the backup is successful. This is only an example. The bitmap backup information may also default to 1 and be modified to 0 after the data backup is successful. No specific limitation is made here. The following example continues with the case where the bitmap backup information defaults to 0 and is modified to 1 after the backup is successful.
[0088] If the amount of bitmap data is large, backing up with one bitmap file is inefficient. In this case, you can divide the bitmap file into multiple blocks. Figure 3 The to-be-backed-up bitmap 302 in FIG. (a) is divided into a plurality of sub-bitmaps, as shown in FIG. Figure 3 As shown in Figure (b), Figure 3 The to-be-backed-up bitmap 342 and the to-be-backed-up bitmap 352 in (b) are sub-bitmaps after division, and thus in the process of data backup, the to-be-backed-up bitmap 342 has a corresponding backup end bitmap (backed up bitmap 362). The to-be-backed-up bitmap 352 has a corresponding backup end bitmap (backed up bitmap 372).
[0089] Assumptions Figure 3 In (b) of the figure, the bitmap 342 to be backed up is "010", and the bitmap 352 to be backed up is "000". At this time, it is determined that the data corresponding to the second bit in the bitmap 402 to be backed up has changed. At this time, the data corresponding to the second bit in the bitmap 402 to be backed up is copied to the storage area of the backup end. At the same time, it is determined that the data corresponding to other bits in the bitmap 402 to be backed up and the data corresponding to all bits of the bitmap 412 to be backed up have not changed and do not need to be backed up. At this time, the backed up bitmap file 422 can be determined as "010", and the backed up bitmap 432 can be determined as "000". At the same time, step S304 is executed to determine the value of the bitmap backup information according to the backup result. Specifically, the values of the backup information of the backed up bitmap 432 and the backed up bitmap 422 are both determined to be 1.
[0090] Figure 4 FIG. 1 is a schematic diagram of another data backup method according to an embodiment of the present application. Figure 4 As shown, in the case of data backup failure, execute Figure 4 In step S402, the value of the bitmap backup information is obtained. For example, in the case of data backup failure, the data corresponding to the to-be-backed-up bitmap 402 are all backed up successfully, and the obtained bitmap backup information corresponding to the backed-up bitmap 422 is a value of 1, while the data corresponding to the to-be-backed-up bitmap 412 are not backed up successfully, and the obtained bitmap backup information corresponding to the backed-up bitmap 432 is a value of 0.
[0091] Figure 5 1 is a flow chart of another data backup method according to an embodiment of the present application. Figure 5 Describe a complete data backup process.
[0092] S502, dividing into a plurality of bitmap blocks;
[0093] Specifically, a bitmap block may be divided into two sub-bitmap blocks through the above step S502, for example Figure 3 The to-be-backed-up bitmap 302 in FIG. (a) is divided into Figure 3 The to-be-backed-up bitmap 402 and the to-be-backed-up bitmap 412 in FIG.
[0094] S504, copying the data to the corresponding second storage sub-area;
[0095] That is Figure 5 In step S520 , the value of the bitmap backup information is determined to be 1. Specifically, the values of the backup information of the backed up bitmap 432 and the backed up bitmap 422 are both determined to be 1.
[0096] If data backup fails, that is, the result of the determination in step S506 is yes, in this case, step S507 is executed to determine the bitmap blocks whose backup indication information is 0, for example Figure 4 If the data corresponding to the to-be-backed-up bitmap 402 in the backup bitmap 402 are all backed up successfully, the backup indication information corresponding to the backed-up bitmap 422 is a value of 1, and the data corresponding to the to-be-backed-up bitmap 412 is not backed up successfully, the backup indication information corresponding to the backed-up bitmap 432 is a value of 0. At this time, the bitmap block determined is Figure 4 The to-be-backed-up bitmap 412 in .
[0097] Assuming that when the data backup fails, only the confirmation of the first two bits of the to-be-backed-up bitmap 412 being the value 0 is completed, then the backed-up bitmap 432 is "00" at this time, and it is further confirmed that the value of the unconfirmed bit in the to-be-backed-up bitmap 412 is 0. At this time, it means that although the data backup process has failed, all the data to be backed up has been backed up. At this time, there is no need to continue the data backup operation, and the data backup is ended at this time.
[0098] For another example, assuming that when data backup fails, the backed-up bitmap 412 has completed all bit confirmations, while the backed-up bitmap 402 has only completed the confirmation of the first bit as value 0, then the backed-up bitmap 422 is "0" at this time, and further confirmation corresponds to the unconfirmed part of the backed-up bitmap 402 as "10", and there is a value 1, which indicates that data that needs to be backed up has not been backed up. At this time, step S508 is executed to calculate the bitmap difference information. Specifically, first, the backed-up bitmap 422 is padded with 0 to make the backed-up bitmap 422 and the backed-up bitmap 402 have the same length. It can be understood that the backed-up bitmap 422 after padded with 0 is "000". Further, the backed-up bitmap 402 and the backed-up bitmap 422 after padded with 0 are XORed to obtain the result "010", indicating that the data corresponding to the second bit of the backed-up bitmap needs to be backed up but has not been successfully backed up. At this time, step S510 is executed to retransmit the data. Specifically, the data corresponding to the second bit of the to-be-backed-up bitmap 402 is backed up again to the storage space corresponding to the second bit in the backed-up bitmap 422 .
[0099] After completing step S510, step S520 is executed to set the value of the bitmap backup information corresponding to the backed up bitmap 422 to 1, indicating that all the to-be-backed-up data corresponding to the to-be-backed-up bitmap 402 have completed data backup.
[0100] Furthermore, in Figure 4 When the disk file 312 in the backup file 332 has been backed up, the backed up bitmap 422 and the backed up bitmap 432 in the backup file 332 are cleared, and only the disk file 314 is retained to reduce storage overhead.
[0101] It can be understood that the above-mentioned step S507, determining the bitmap block whose bitmap backup information is 0, and step S520, determining the value of the bitmap backup information as 1, are both steps under the mechanism that the bitmap backup information defaults to 0 and is modified to 1 after the backup is successful. If the modification mechanism of the bitmap backup information is to default to 1 and be modified to 0 after the backup is successful, then the above-mentioned step 507 should be to determine the bitmap block whose bitmap backup information is 1, and step S520 should be to determine the value of the bitmap backup information as 0.
[0102] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0103] According to another aspect of the embodiment of the present application, a data backup device for implementing the above data backup method is also provided. Figure 6 As shown, the device includes: a first determination unit 602: in the process of backing up the first data in the first storage area to the second storage area, determining the current sub-area from multiple second sub-areas in the second storage area, wherein the current sub-area is a storage sub-area for which the last backup operation has not been completed; a bitmap acquisition unit 604: acquiring a current bitmap matching the current sub-area, and a target bitmap matching the target sub-area, wherein the target sub-area is a storage sub-area in the first storage area corresponding to the current sub-area, and the current bitmap and the target bitmap include multiple bits, and the bits are used to indicate the update status of the data slice in the storage sub-area; a second determination unit 606: determining at least one target data slice from the multiple data slices stored in the target sub-area according to the comparison result of the current bitmap and the target bitmap; a backup unit 608: backing up the target data slice to the target storage position in the current sub-area.
[0104] Optionally, the data backup device also includes: a third determination unit, which, before determining at least one target data slice from the multiple data slices in the target sub-area based on the comparison result between the current bitmap and the target bitmap, also includes: performing a bitwise exclusive OR operation on the current bitmap and the target bitmap to obtain a reference bitmap; determining at least one bit in the reference bitmap whose numerical value is the first value as at least one target bit; and determining the data slice in the storage sub-area indicated by at least one target bit as the target data slice.
[0105] Optionally, the above-mentioned first determination unit 602 includes: an acquisition module, used to obtain backup indication information configured for each of the multiple second sub-regions; a determination module, used to determine at least one of the second sub-regions whose backup indication information is the second value as the current sub-region, wherein the second sub-region whose backup indication information is the second value is the storage sub-region for which the last backup operation was not completed, and the second sub-region whose backup indication information is the third value is the storage sub-region for which the last backup operation was completed.
[0106] Optionally, the above-mentioned data backup device also includes: an update unit, used to: divide the second storage area into multiple second sub-areas, and determine the bitmap objects respectively configured for the multiple second sub-areas; when data update occurs to at least one first data slice in the first storage area, obtain the first bitmap of the first storage sub-area used to store at least one first data slice; according to the bit position whose value in the first bitmap is the first value, back up at least one first data slice in the first storage sub-area to the second storage sub-area, respectively, wherein the second storage sub-area is a storage sub-area matching the first storage sub-area; obtain a second bitmap matching the second storage area, and update the value of at least one of the bits in the second bitmap according to the backed up first data slice.
[0107] Optionally, the update unit is also used to: configure the backup indication information of the second storage sub-area to a second value when the backup operation of at least one of the first data slices updated in the first storage area has not been completed; and configure the backup indication information of the second storage sub-area to a third value when the backup operation of at least one of the first data slices updated in the first storage area has been completed.
[0108] Optionally, the update unit is also used to: when the second data slice in the second storage area is updated to the first data slice according to the backup operation, set the bit in the second bitmap that matches the second data slice to a fourth value; when the third data slice in the second storage area is not updated, set the bit in the second bitmap that matches the third data slice to a fifth value.
[0109] Optionally, the above-mentioned data backup device also includes a clearing unit, which is used to: when the first data in the first storage area is backed up to the second storage area, clear the first bitmap set matching the first storage area, and clear the second bitmap set matching the second storage area.
[0110] According to another aspect of the embodiment of the present application, an electronic device for implementing the above data backup method is also provided. The electronic device may be Figure 1 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a mobile phone or a computer as an example. Figure 7 As shown, the electronic device includes a memory 702 and a processor 704. The memory 702 stores a computer program, and the processor 704 is configured to execute the steps in any of the above method embodiments through the computer program.
[0111] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0112] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0113] S1, in the process of backing up first data in a first storage area to a second storage area, determining a current sub-area from a plurality of second sub-areas in the second storage area, wherein the current sub-area is a storage sub-area for which a previous backup operation has not been completed;
[0114] S2, obtaining a current bitmap matching the current sub-region and a target bitmap matching the target sub-region, wherein the target sub-region is a storage sub-region in the first storage region corresponding to the current sub-region, and the current bitmap and the target bitmap include a plurality of bits, and the bits are used to indicate an update status of a data slice in the storage sub-region;
[0115] S3, determining at least one target data slice from a plurality of data slices stored in the target sub-region according to a comparison result between the current bitmap and the target bitmap;
[0116] S4, backing up the target data slice to the target storage location in the current sub-area.
[0117] Alternatively, a person skilled in the art may understand that: Figure 7 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MlD), a PAD, or other terminal devices. Figure 6 The structure of the electronic device is not limited. Figure 6 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 6 Different configurations are shown.
[0118] Among them, the memory 702 can be used to store software programs and modules, such as the program instructions / modules corresponding to the data backup method and device in the embodiments of the present application. The processor 704 executes various functional applications and data processing by running the software programs and modules stored in the memory 702, that is, to implement the above-mentioned method for adjusting the read voltage in the memory. The memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 702 may further include a memory remotely located relative to the processor 704, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 702 can be specifically, but not limited to, used to store information such as page elements and page styles. As an example, such as Figure 7 As shown, the memory 702 may include but is not limited to the first determination unit 602, the bitmap acquisition unit 604, the second determination unit 606 and the backup unit 608 in the data backup device. In addition, it may also include but is not limited to other module units in the data backup device, which will not be repeated in this example.
[0119] Optionally, the transmission device 706 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 706 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 706 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0120] In addition, the electronic device further includes: a display 708 for displaying the target page; and a connection bus 710 for connecting various module components in the electronic device.
[0121] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. The nodes may form a point-to-point network, and any form of computing device, such as a server, terminal or other electronic device, may become a node in the blockchain system by joining the point-to-point network.
[0122] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in the above various optional implementations;
[0123] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0124] S1, in the process of backing up first data in a first storage area to a second storage area, determining a current sub-area from a plurality of second sub-areas in the second storage area, wherein the current sub-area is a storage sub-area for which a previous backup operation has not been completed;
[0125] S2, obtaining a current bitmap matching the current sub-region and a target bitmap matching the target sub-region, wherein the target sub-region is a storage sub-region in the first storage region corresponding to the current sub-region, and the current bitmap and the target bitmap include a plurality of bits, and the bits are used to indicate an update status of a data slice in the storage sub-region;
[0126] S3, determining at least one target data slice from a plurality of data slices stored in the target sub-region according to a comparison result between the current bitmap and the target bitmap;
[0127] S4, backing up the target data slice to the target storage location in the current sub-area.
[0128] Optionally, in the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0129] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0130] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods of each embodiment of the present application.
[0131] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0132] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0133] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0134] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0135] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
[0136] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0137] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0138] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0139] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0140] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0141] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0142] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0143] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.
[0144] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0145] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0146] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A data backup method, characterized in that: include: In the process of backing up the first data in the first storage area to the second storage area, determining a current sub-area from a plurality of second sub-areas in the second storage area, wherein the current sub-area is a storage sub-area for which the last backup operation has not been completed; Acquire a current bitmap matching the current sub-region and a target bitmap matching the target sub-region, wherein the target sub-region is a storage sub-region in the first storage region corresponding to the current sub-region, and the current bitmap and the target bitmap include a plurality of bits, and the bits are used to indicate an update status of a data slice in the storage sub-region; determine at least one target data slice from the plurality of data slices stored in the target sub-region according to a comparison result between the current bitmap and the target bitmap; The target data slice is backed up to a target storage location in the current sub-area.
2. The method according to claim 1, characterized in that Before determining at least one target data slice from the plurality of data slices in the target sub-region according to the comparison result between the current bitmap and the target bitmap, the method further includes: Performing a bitwise exclusive OR operation on the current bitmap and the target bitmap to obtain a reference bitmap; At least one of the bits in the reference bitmap whose value is the first value is determined as at least one target bit; and the data slice in the storage sub-area indicated by each of the at least one target bit is determined as the target data slice.
3. The method according to claim 2, characterized in that In the process of backing up the first data in the first storage area to the second storage area, determining the current sub-area from a plurality of second sub-areas in the second storage area includes: Obtaining backup indication information configured for each of the plurality of second sub-areas; At least one of the second sub-regions whose backup indication information is the second value is respectively determined as the current sub-region, wherein the second sub-region whose backup indication information is the second value is the storage sub-region for which the last backup operation was not completed, and the second sub-region whose backup indication information is the third value is the storage sub-region for which the last backup operation was completed.
4. The method according to any one of claims 1 to 3, characterized in that In the process of backing up the first data in the first storage area to the second storage area, before determining the current sub-area from the plurality of second sub-areas in the second storage area, the method further includes: Dividing the second storage area into a plurality of second sub-areas, and determining bitmap objects respectively configured for the plurality of second sub-areas; When data update occurs to at least one first data slice in the first storage area, obtaining a first bitmap of a first storage sub-area for storing at least one first data slice; According to the bit whose value in the first bitmap is the first value, at least one of the first data slices in the first storage sub-area is backed up to a second storage sub-area, wherein the second storage sub-area is a storage sub-area matching the first storage sub-area; A second bitmap matching the second storage area is obtained, and a value of at least one of the bits in the second bitmap is updated according to the backed-up first data slice.
5. The method according to claim 4, characterized in that In the case where data update occurs to at least one first data slice in the first storage area, after obtaining the first bitmap of the first storage sub-area for storing at least one first data slice, the method further includes: When the backup operation of at least one of the first data slices updated in the first storage area has not been completed, the backup indication information of the second storage sub-area is configured as a second value; In a case where the backup operation has been completed for at least one of the first data slices updated in the first storage area, the backup indication information of the second storage sub-area is configured as a third value.
6. The method according to claim 4, characterized in that The step of obtaining a second bitmap matching the second storage area and updating a value of at least one bit in the second bitmap according to the backed-up first data slice further includes at least one of the following: In a case where the second data slice in the second storage area is updated to the first data slice according to the backup operation, setting the bit in the second bitmap that matches the second data slice to a fourth value; In a case where the third data slice in the second storage area is not updated, the bit in the second bitmap that matches the third data slice is set to a fifth value.
7. The method according to claim 1, characterized in that After backing up the target data slice to the target storage location in the current sub-area, the method further includes: When the first data in the first storage area is backed up to the second storage area, the first bitmap set matching the first storage area is cleared, and the second bitmap set matching the second storage area is cleared.
8. A data backup device, characterized in that: include: A first determining unit: in the process of backing up the first data in the first storage area to the second storage area, determining a current sub-area from a plurality of second sub-areas in the second storage area, wherein the current sub-area is a storage sub-area for which the last backup operation has not been completed; A bitmap acquisition unit: acquires a current bitmap matching the current sub-region and a target bitmap matching the target sub-region, wherein the target sub-region is a storage sub-region in the first storage region corresponding to the current sub-region, and the current bitmap and the target bitmap include a plurality of bits, and the bits are used to indicate an update status of a data slice in the storage sub-region; A second determining unit: determining at least one target data slice from the plurality of data slices stored in the target sub-region according to a comparison result between the current bitmap and the target bitmap; Backup unit: backs up the target data slice to the target storage location in the current sub-area.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Block device backup method and device, equipment and storage medium
CN112256492A
Data backup method, device and apparatus and computer readable storage medium
CN113626261A
Data replication method and device
CN114185712A
Remote data backup method and device
CN118838756A
Data replication snapshots for persistent storage using operation numbers
US9753813B1