Partitioned online backup method, apparatus, device, medium and product
By building an image mapping layer during operating system operation and using a device mapper for block-level backup, the problems of business interruption and data inconsistency caused by traditional partition backup methods are solved, achieving efficient and seamless data replication for online backup.
Patent Information
- Application Number
- CN202610738129.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-26
- Publication Date
- 2026-06-26
AI Technical Summary
Traditional partition backup methods require system shutdown, leading to business interruption, and cannot cope with dynamic changes in partition data, resulting in low efficiency and inability to guarantee data consistency.
By building an image mapping layer during operating system operation and using a device mapper to achieve block-level backup, the data content of the target partition is updated and backed up in real time, ensuring data consistency and business continuity during online backup.
It enables data backup while the partition is online, avoiding business interruption, improving backup efficiency, reducing losses during the backup process, and ensuring data consistency and flexibility.
Smart Images

Figure CN122285391A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data backup technology, and in particular to a partitioned online backup method, apparatus, device, medium, and product. Background Technology
[0002] Operating system disk partition backup is an important means of ensuring data security. Traditional partition backup methods are limited by technical implementation. They require shutting down the original system, booting a live system through a removable storage medium, and then performing a backup operation on the target partition of the original system.
[0003] However, in this offline backup method, the original system cannot start and operate normally during the entire backup period. For business systems that need to run 24 hours a day, this will cause serious business interruption, and the time cost and business loss of the backup are high.
[0004] In addition, traditional offline backup methods can only achieve static data copying and cannot cope with scenarios where partition data changes dynamically. If the original partition data is modified during the backup preparation stage, a full backup needs to be performed again, which is extremely inefficient. Summary of the Invention
[0005] To address the issues of system service interruption and inability to handle dynamic changes in partition data caused by offline partition backup methods, this disclosure provides an online partition backup method, apparatus, device, media, and product to at least solve or mitigate the aforementioned problems. The technical solution of this disclosure is as follows: According to a first aspect of this disclosure, a partition online backup method is provided, the partition online backup method comprising: in response to receiving a backup instruction for a target partition in an online state during the operation of an operating system, associating a backup end for backing up data of the target partition with a mirror mapping layer mapped to the target partition, wherein the mirror mapping layer is constructed by the device mapper of the operating system; and using the mirror mapping layer to perform a block-level backup operation for blocks in the target partition to back up the target partition to the backup end, wherein the block-level backup operation comprises: in response to receiving a real-time read / write operation for a target block in the target partition, using the mirror mapping layer to update the data content of the real-time read / write operation to the target block and back it up to the backup end according to the current backup state of the target block.
[0006] Optionally, the step of using the mirror mapping layer to update the data content of the real-time read / write operation to the target block and back it up to the backup end according to the current backup status of the target block includes: when the target block is in a completed backup state, using the mirror mapping layer to map the data content of the real-time read / write operation to the target block and the backup end; when the target block is in an incomplete backup state, using the mirror mapping layer to map the data content of the real-time read / write operation to the target block.
[0007] Optionally, the step of using the mirror mapping layer to update the data content of the real-time read / write operation to the target block and back it up to the backup end according to the current backup status of the target block includes: when the target block is in a completed backup state, using the mirror mapping layer, the data content is mapped to the target block and the backup end through mirror mapping, so as to update the target block and back it up to the backup end with the data content; when the target block is in an incomplete backup state, depending on whether the target block is the block currently being backed up, the data content of the real-time read / write operation is updated to the target block and backed up to the backup end using the mirror mapping layer.
[0008] Optionally, the step of updating the data content of the real-time read / write operation to the target block and backing it up to the backup end using the mirror mapping layer based on whether the target block is the currently backed-up block includes: caching the data content in response to the target block being the currently backed-up block, and mapping the cached data content to the target block and the backup end using the mirror mapping layer through mirror mapping in response to the target block backup completion, thereby updating the target block and backing it up to the backup end with the data content; and mapping the data content to the target block using the mirror mapping layer through linear mapping in response to the target block not being the currently backed-up block, wherein the data content is backed up to the backup end when the block-level backup of the target block is performed.
[0009] Optionally, for each block, the block-level backup operation includes: performing a read lock on the current block in the mirror mapping layer; writing the read / write data for the current block cached between the mirror mapping layer and the target partition to the current block; backing up the data in the current block to the backup end, and releasing the read lock on the current block.
[0010] Optionally, the online partition backup method further includes: during the block-level backup operation, writing information of the currently backed-up block into the log area of the mirror mapping layer, wherein the information includes the location of the currently backed-up block; and in response to the online backup recovery, continuing the backup operation before the online backup interruption by reading the log area.
[0011] Optionally, the block-level backup operation further includes: updating the backup progress file when each block backup is completed, wherein the backup progress file is used to record the backup progress of the target partition and the backup progress file is stored in a local persistent storage medium.
[0012] Optionally, when the backup instruction is received, the target partition contains existing data.
[0013] Optionally, the online partition backup method further includes: during the block-level backup operation, pausing the block-level backup operation in response to the operating system's operating load exceeding a preset level; and continuing to execute the block-level backup operation in response to the operating system's operating load falling below the preset level.
[0014] According to a second aspect of this disclosure, a partition online backup apparatus is provided, the partition online backup apparatus comprising: a construction unit configured to, in response to receiving a backup instruction for a target partition in an online state during operating system operation, associate a backup endpoint for backing up data of the target partition with a mirror mapping layer mapped to the target partition, wherein the mirror mapping layer is constructed by the device mapper of the operating system; and a backup unit configured to, using the mirror mapping layer, perform a block-level backup operation on blocks in the target partition to back up the target partition to the backup endpoint, wherein, during the execution of the block-level backup operation, the backup unit is configured to, in response to receiving a real-time read / write operation on a target block in the target partition, use the mirror mapping layer to update the data content of the real-time read / write operation to the target block and back it up to the backup endpoint according to the current backup state of the target block.
[0015] According to a third aspect of this disclosure, a computing device is provided, the computing device comprising: a processor; and a memory for storing computer-executable instructions, wherein the computer-executable instructions, when executed by the processor, cause the processor to perform the partition online backup method according to this disclosure.
[0016] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided that, when instructions in the computer-readable storage medium are executed by a processor of a computing device, enables the computing device to perform the partition online backup method according to this disclosure.
[0017] According to a fifth aspect of this disclosure, a computer program product is provided, comprising computer-executable instructions that, when executed by at least one processor, implement the partition online backup method according to this disclosure.
[0018] The technical solution provided in this disclosure brings at least the following beneficial effects: By employing the online partition backup scheme disclosed herein, a mirror mapping layer can be constructed using a device mapper while the target partition is online. By performing block-level backup operations on the blocks in the target partition, the data content of real-time read / write operations can be written to the corresponding blocks based on the current backup status of the blocks using the mirror mapping layer, and backed up to the backup end. In this way, online backup of the target partition can be achieved, and dynamic data writing is allowed without re-performing a full backup of the partition. This avoids business loss during the backup process, improves backup efficiency, and reduces limitations on backup scenarios.
[0019] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0021] Figure 1 This is a schematic flowchart of a partition online backup method according to an exemplary embodiment of the present disclosure.
[0022] Figure 2 This is a schematic diagram of the hierarchical structure of the mirror mapping layer in the system according to an exemplary embodiment of the present disclosure.
[0023] Figures 3A to 3C This is a schematic diagram illustrating the mapping method before and after accessing the backup terminal in the partition online backup method according to an exemplary embodiment of the present disclosure.
[0024] Figure 4 This is a schematic flowchart of block-level backup operations in a partitioned online backup method according to an exemplary embodiment of the present disclosure.
[0025] Figure 5 This is a schematic diagram illustrating the mapping method between the backed-up portion and the unbacked-up portion in an online partition backup method according to an exemplary embodiment of the present disclosure.
[0026] Figure 6 This is a schematic flowchart illustrating an example of single-block data backup in a partitioned online backup method according to an exemplary embodiment of the present disclosure.
[0027] Figure 7 This is a schematic block diagram of a partition online backup apparatus according to an exemplary embodiment of the present disclosure.
[0028] Figure 8 This is a block diagram of a computing device according to exemplary embodiments of the present disclosure. Detailed Implementation
[0029] In order to enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0030] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0031] It should be noted that the phrase "at least one of several items" in this disclosure refers to three parallel cases: "any one of the several items", "a combination of any number of the several items", and "all of the several items". For example, "including at least one of A and B" includes the following three parallel cases: (1) including A; (2) including B; (3) including A and B. Another example is "performing at least one of step one and step two", which means the following three parallel cases: (1) performing step one; (2) performing step two; (3) performing both step one and step two.
[0032] As mentioned earlier, offline partition backup methods suffer from issues such as forced system service interruptions and inability to handle scenarios with dynamic changes in partition data.
[0033] Specifically, most mainstream partition backup technologies rely on offline operation, meaning the target partition must be unmounted and the system must be offline. In practice, the operator must first shut down the system to be backed up, then boot from a USB drive, CD, or other media containing a live operating system. Once in the independent live system environment, backup tools such as dd or Clonezilla are used to perform a full data copy of the original system's partitions. Here, a live system is an independent operating system environment that can be booted from removable storage media without being installed on the local disk; it is commonly used for system maintenance, data backup, and troubleshooting.
[0034] However, such technology is only implemented as simple offline static data reading and writing, without designing a dynamic synchronization mechanism for partitioned data in online scenarios.
[0035] Specifically, during the backup process, the original system becomes unusable, leading to business interruptions. For critical business systems such as finance, government affairs, and e-commerce, this can result in unpredictable economic losses and service impacts. Furthermore, the backup process is cumbersome, requiring manual intervention to shut down the system, start the live system, perform the backup, and restart the original system. This is inefficient and demands a high level of technical skill from the operators. Additionally, if anomalies such as power outages or media failures occur during the backup process, only a full backup can be performed again, lacking a mechanism for resuming interrupted data transfers, resulting in low reliability and efficiency. Moreover, this backup technology only supports static data backup and cannot adapt to scenarios involving real-time reading and writing of original partition data, leaving data consistency unreliable.
[0036] Due to the aforementioned drawbacks, this backup technology may severely impact user experience and business continuity.
[0037] In some backup technologies, online copy backups can also be achieved through file copy-based tools such as timeshift and rsync. However, if there is file reading and writing on the target backup partition during the backup process, the backup data and the source data will be inconsistent.
[0038] Therefore, implementing an online backup solution that can be used normally in partitions and without shutting down the system, and that can solve the data consistency problem of dynamic read and write operations, has become an urgent need to improve the flexibility of system backup and business continuity.
[0039] In view of the above problems, exemplary embodiments of this disclosure provide a partitioned online backup method, a partitioned online backup apparatus, a computing device, a computer-readable storage medium, and a computer program product, which can solve or at least alleviate the above problems.
[0040] In a first aspect of an exemplary embodiment of this disclosure, a method for online partition backup is provided. This method can be applied to backup scenarios of storage media on any computing device. An example implementation scenario of the online partition backup method according to an exemplary embodiment of this disclosure is given below.
[0041] The execution entity of this method can be a computing device with a storage medium. For example, in response to receiving a backup instruction for an online target partition during operating system operation, the computing device associates the backup end for backing up the data of the target partition with a mirror mapping layer mapped to the target partition. The mirror mapping layer is constructed by the operating system's device mapper. Using the mirror mapping layer, block-level backup operations are performed on blocks in the target partition to back up the target partition to the backup end. During the block-level backup operation, in response to receiving real-time read / write operations on target blocks in the target partition, the computing device uses the mirror mapping layer to update the data content of the real-time read / write operations to the target block and back it up to the backup end according to the current backup status of the target block. In embodiments of this disclosure, online partition backup can refer to, for example, a data backup process performed on a target partition while the partition is mounted, the operating system is running normally, and the partition is being used normally, without interrupting any read / write operations on the original target partition during the backup.
[0042] The aforementioned computing device may be, but is not limited to, a desktop computer, laptop computer, tablet computer, personal digital assistant, smartphone, or other device capable of performing component rendering. However, the implementation scenario of the above method is only an example scenario. The method according to the exemplary embodiments of this disclosure can also be applied to other application scenarios. For example, a user may request a backup from a server via a network on a user terminal (e.g., a mobile phone, desktop computer, tablet computer, etc.). The server can perform partition backup by executing the method according to the exemplary embodiments of this disclosure. Here, the server may be a standalone server, a server cluster, a cloud computing platform, or a virtualization center.
[0043] The following description, with reference to the accompanying drawings, illustrates an example of an online partition backup method according to an embodiment of the present disclosure. This method can be executed, for example, by an operating system. Figure 1 As shown, the online partition backup method may include the following steps: In step 110, in response to receiving a backup instruction for an online target partition during operating system operation, the backup end for backing up data of the target partition is associated with a mirror mapping layer mapped to the target partition, wherein the mirror mapping layer is constructed by the operating system's device mapper.
[0044] As an example, the target partition can be any partition of storage media such as a disk. Being online can mean that the target partition is connected to the operating system.
[0045] Furthermore, since the online backup method of the embodiments of this disclosure can determine the specific backup method and mapping method according to the backup status of the blocks in the partition, in the embodiments of this disclosure, when a backup instruction is received, the target partition may or may not store existing data, which makes the method more universal and able to meet the backup needs of more scenarios.
[0046] As an example, the backup end can be a backup storage medium used to back up the data of the target partition. It can be a backup partition or backup disk mounted in the operating system, or it can be a backup medium accessed from outside the operating system, such as a backup storage medium that can be accessed during system use.
[0047] According to embodiments of this disclosure, the operating system can be a Linux system. A device mapper is a block device mapping framework in the Linux system kernel that can perform various operations such as virtualization, mapping, and mirroring of underlying block devices, and can combine one or more underlying block devices to generate a new logical block device.
[0048] As an example, during operating system startup, a mirror mapping layer can be built that maps to the target partition. In this case, the entire mirror mapping layer is mapped to the target partition. During operating system operation, when a backup command for the target partition is received, the backup endpoint (e.g., the backup partition) can be associated with the mirror mapping layer based on a device mapper. The mirror mapping layer is the core intermediate layer for data synchronization, transparent to upper-layer applications and users. All subsequent read and write operations on the partition will be synchronized to the target partition of the original system through this layer. The main function of the mirror mapping layer is to handle mapping. For example, after associating the backup endpoint with the mirror mapping layer, the mirror mapping layer can copy the data written by the upper layer, writing these two copies to the corresponding locations on the target partition and the backup endpoint, respectively; or it can write the data written by the upper layer only to the target partition.
[0049] The mirroring layer may include a dm-mirror module for performing mapping, a block scheduler for scheduling blocks to be backed up, and a progress recording module for recording backup progress. Here, the dm-mirror module is a mirror module within the mirroring layer framework, used to implement the mirror backup function of block devices. It can synchronously perform data mirroring during data read and write processes. The dm-mirror module may include, for example, three core components: the source device, the backup device, and the log area. In the embodiments of this disclosure, the dm-mirror module uses the nosync parameter when establishing the mapping, indicating that the data block transfer and backup process is implemented by the online backup method according to the embodiments of this disclosure, without the need for the synchronization process built into dm-mirror.
[0050] Figure 2 An example of the hierarchy of a mirror mapping layer in a system according to an exemplary embodiment of this disclosure is shown. For example... Figure 2 As shown, the mirror mapping layer 201 can receive file read and write operations from the upper-layer system 202. Here, the upper-layer system 202 can be, for example, an upper-layer application or user of the mirror mapping layer 201. The mirror mapping layer 201 can establish a mapping with the target partition 203. In addition, the mirror mapping layer 201 can also establish a mapping with the backup end 204 (e.g., the backup partition of the backup end 204), and can connect to the log area 205 of the dm-mirror mirroring module to synchronize logs in real time.
[0051] In one example, when the above backup instruction is received, if both the target partition and the backup end are connected to the operating system, an image mapping layer can be directly built between the two.
[0052] In another example, upon receiving the aforementioned backup instruction, if the backup end is not connected to the operating system, the target partition can be associated with the image mapping layer first, and then, in response to the connection of the backup end, the backup end can be associated with the image mapping layer to build an image mapping layer between the target partition and the backup end.
[0053] Figures 3A to 3C An example of the mapping relationship between the mirror mapping layers before and after accessing the backup end is shown. For example... Figure 3A As shown, when the backup endpoint (or backup storage medium) is not connected, a mapping between the mirror mapping layer and the target partition can be established first. The mapping method can be, for example, a linear (dm-linear) mapping. Without the backup storage medium connected, the system operates normally, the partition is read and written normally, and the target partition already contains some existing data. Figure 3B As shown, in response to online backup access, the image mapping layer can be frozen online. When the image mapping layer is frozen, file data written to the upper-level file system will be blocked at the image mapping layer. While the image mapping layer is frozen, the backup end can be associated with the image mapping layer, and the current backup progress data can be set to 0. Then, as... Figure 3C As shown, after connecting to the backup endpoint online, the image mapping layer can be unfrozen, and blocked input / output (I / O) operations will continue. Since this process of connecting to the backup storage medium is almost imperceptible to the upper-layer system or application, it can be completed online without a full system restart.
[0054] In step 110 above, as an example, a user can trigger an online backup of the target partition via system commands. After receiving the user's backup command, the system can automatically execute the initialization process to build the basic environment for subsequent block-by-block backups. The system can automatically load the Linux system kernel's device mapper framework driver and the dm-mirror image module, and can detect the status of the target partition (e.g., whether it is mounted or online) and the availability of the backup storage medium (e.g., remaining space, read / write performance). If the detection fails, the subsequent backup operation will be terminated and a prompt will be returned.
[0055] In step 120, the mirror mapping layer can be used to perform block-level backup operations on the blocks in the target partition to back up the target partition to the backup end.
[0056] In this step, block-level backup operation can refer to backing up all blocks in the target partition block by block to complete the backup of the entire target partition.
[0057] The backup block targeted by the block-level backup operation can refer to, for example, the smallest data processing unit in online backup. The block size can be flexibly configured according to system performance and business needs, such as, but not limited to, 4M, 8M, or 16M. However, the embodiments of this disclosure are not limited to this. The block size can also be manually configured by the user, for example, it can be preset or entered by the user in real time; or it can be automatically adapted by the system.
[0058] As an example, the size of the backup block can be determined by identifying the partition information of the target partition and automatically recommending the optimal backup block size based on the partition information. Here, partition information may include, but is not limited to, block device information (e.g., / dev / sda1), total partition size, used space, and current IO read / write frequency.
[0059] In step 120 above, a block-by-block backup of the target partition can be performed sequentially from the first block to the last block according to a preset backup block size using a block scheduler. Combined with the log synchronization mechanism of dm-mirror, this resolves the data consistency issues caused by real-time read / write operations on the target partition. Throughout the process, the target partition remains mounted, allowing upper-layer applications to perform file read, write, modify, and delete operations normally, without any impact on normal user business operations.
[0060] In addition, as an example, the system can also allocate a separate log area for the dm-mirror module, which may occupy 1% to 5% of the storage capacity of the backup end, for storing real-time read and write operation logs of the original partition.
[0061] In addition, as an example, in response to receiving a backup command, a dedicated configuration file for this backup can be generated in the local persistent directory (e.g., / etc / backup / ) to record core information such as the original partition identifier, backup storage media path, backup block size, log area location, backup start progress (initially 0), and backup start time, providing a basis for progress recording and abnormal recovery.
[0062] After the above initialization operations are completed, the system enters the backup state. The original partition remains mounted normally, and user operations are not interrupted. The initialization time is usually between 1 and 3 seconds, which has no impact on system performance.
[0063] The following section will describe in detail an example of a block-level backup operation for each block.
[0064] As an example, such as Figure 4 As shown, for each block, a block-level backup operation may include the following steps: In step 410, a read lock can be performed on the current block in the mirror mapping layer.
[0065] Here, read locking can mean prohibiting write overwrite and read operations on the current block without affecting read and write operations on other blocks, so as to ensure that the system can operate normally.
[0066] For example, the block scheduler of the mirrored mapping layer can read the backup block size and the current starting block number from the backup configuration file, select the current block of the block to be backed up (the first block to be backed up can be, for example, block 0), and perform a read lock on that block. Here, the current block to be backed up is the block that will be backed up at the moment. For example, it can be the critical block between the mapped part (or the backed-up part) and the unmapped part (or the unbacked-up part) in the partition, and the block to be switched from the unmapped part to the mapped part.
[0067] The read lock in step 410 can be targeted at the upper-layer system, application, or user of the mirror mapping layer. The mirror mapping layer can block read and write operations from the upper-layer system, application, or user, and when it detects read and write operations from the upper layer, it can store the data content of the read and write operations in a storage location outside the target partition, such as caching it in memory.
[0068] In step 420, read / write data for the current block that is cached between the mirror mapping layer and the target partition can be written to the current block.
[0069] As mentioned above, the mirroring layer can block read and write operations from the upper-layer system, upper-layer application, or user. Before performing a read lock on the current block, read and write data already cached in the layer between the mirroring layer and the target partition (such as the driver layer) can be written to the current block. This ensures that there is no data waiting to be written to the current block between the mirroring layer and the target partition. Read and write data for the current block above the mirroring layer is also blocked by the mirroring layer. In this way, the integrity of the backup data of the current block can be ensured, and the problem of inconsistency of backup data caused by real-time read and write operations can be avoided.
[0070] In step 430, the data in the current block can be backed up to the backup end, and the read lock on the current block can be released.
[0071] In this step, all data of the current block can be completely backed up to or copied to the corresponding location on the backup end to complete the backup of the current block, and its read lock can be released.
[0072] After the backup of the current block is completed, the block is marked as a backup complete state. That is, the backup state of the block is changed from an unbacked-up state to a backed-up state. In this case, during the read lock of the current block, the read and write data blocked by the mirror mapping layer can be updated to the block and synchronously backed up to the backup end through the mapping method for blocks in the backed-up state (such as dm-mirror mapping).
[0073] Here, when the mirror mapping layer blocks read and write operations from the upper-layer system, upper-layer application, or user, whether the upper layer is performing single-process or multi-process read and write, it will not affect the backup of the target block currently being backed up. Furthermore, after the block's backup status is changed to the backed-up status, such single-process or multi-process read and write operations can be written to the target block and backed up to the backup end.
[0074] Furthermore, as an example, in response to the completion of the backup of the current block, the progress information in the backup configuration file can be updated using a mirror mapping layer (such as a progress recording module). The progress information may include, but is not limited to, the number of backed-up blocks, the amount of data backed up, and the current backup time, so as to achieve real-time persistence of the progress.
[0075] In the above block-level backup operation, since the read lock is a fine-grained block-level lock, it only targets the current block to be backed up and does not affect the reading and writing of other blocks. Therefore, it can avoid the system I / O operation blockage caused by the whole partition lock, thereby minimizing the impact on the online operation of the entire partition.
[0076] Furthermore, the partition online backup method according to the embodiments of this disclosure may further include: during the block-level backup operation, in response to the operating system's operating load exceeding a preset level, the block-level backup operation may be paused; in response to the operating system's operating load falling below a preset level, the block-level backup operation may continue to be executed.
[0077] Specifically, the block-level backup process according to the embodiments of this disclosure can be adjusted according to system load. For example, when the system is running a large number of processes and is under high load, the block-level backup process can be paused at any time to temporarily free up system resources. When the system is idle or the load decreases to a certain level, the previously paused block-level backup process can resume. In addition, the aforementioned preset level can be set according to actual needs, such as: the preset number of running processes; or the utilization rate of hardware resources such as CPU.
[0078] The above describes an example process for a backup operation on a single block. The following describes an example operation flow for receiving real-time read / write operations on the target block in the target partition during the backup process.
[0079] Specifically, in step 120 above, the block-level backup operation may include: in response to receiving a real-time read / write operation for a target block in the target partition, the mirror mapping layer may be used to update the data content of the real-time read / write operation to the target block and back it up to the backup end according to the current backup status of the target block.
[0080] As an example, the steps of updating the data content of real-time read / write operations to the target block and backing it up to the backup end using the mirror mapping layer according to the current backup status of the target block may include: when the target block is in a completed backup state, using the mirror mapping layer to map the data content of real-time read / write operations to the target block and the backup end; when the target block is in an incomplete backup state, using the mirror mapping layer to map the data content of real-time read / write operations to the target block.
[0081] Specifically, backup status can include a completed backup status and an incomplete backup status. For different backup statuses, the mirror mapping layer can use different mapping methods to map data content to the target block or to both the target block and the backup end.
[0082] In this way, data copying during the backup process can be directly transferred in kernel mode, skipping the data copying process between user mode and kernel mode, significantly improving backup speed. In some embodiments, backup speed can be improved by 30% to 50% compared to traditional user-mode backup tools.
[0083] As an example, the steps described above, which utilize a mirror mapping layer to update the data content of real-time read / write operations to the target block and back it up to the backup end based on the current backup status of the target block, may include: when the target block is in a completed backup state, the mirror mapping layer can be used to map the data content to the target block and the backup end through mirror mapping, so that the data content is updated to the target block and backed up to the backup end; when the target block is in an incomplete backup state, the mirror mapping layer can be used to update the data content of real-time read / write operations to the target block and back it up to the backup end, depending on whether the target block is the block currently being backed up.
[0084] Specifically, if the target block is in a state where backup is complete, as referred to above... Figure 4 As described, the data of the target block has been fully backed up to the backup end. In this case, the newly written data content to the target block can be copied through the mirror mapping function of the mirror mapping layer (such as dm-mirror mapping). The two copies of the data are written to the corresponding positions in the target block and the backup end respectively, so as to realize the mirror mapping of the data content in the target block and the backup end. This ensures that after the backup is completed, the dynamic updates to the target block can also be synchronized to the backup end, ensuring the consistency of data at both ends.
[0085] When the target block is in an incomplete backup state, the target block can be the block currently being backed up (e.g., the block being backed up or the next block to be backed up) or the block that has not yet started being backed up (e.g., the block that is not currently being backed up or the block that is not the next block to be backed up). In this case, the mirror mapping layer can determine the mapping method to map the data content to the target block based on whether the target block is the block currently being backed up.
[0086] As an example, the steps described above, based on whether the target block is the currently backed-up block, using a mirror mapping layer to update the data content of real-time read / write operations to the target block and back it up to the backup end, may include: in response to the target block being the currently backed-up block, caching the data content; and in response to the target block backup being completed, using the mirror mapping layer, mapping the cached data content to the target block and the backup end through mirror mapping, so as to update the target block and back it up to the backup end; in response to the target block not being the currently backed-up block, using the mirror mapping layer, mapping the data content to the target block through linear mapping, wherein the data content is backed up to the backup end when performing a block-level backup of the target block.
[0087] Specifically, if the target block is the currently backed-up block, as referred to above... Figure 4As described above, the currently backed-up block is subject to read locking. Therefore, data content for real-time read / write operations cannot be directly mapped to the target block. However, the mirror mapping layer can cache such data content (e.g., cache it in memory or store it directly in the mirror mapping layer) to wait for the target block backup to complete. When the target block backup is complete, the backup status of the target block changes from "incomplete backup status" to "complete backup status," and the mapping method from the mirror mapping layer to the target block also changes from "linear mapping method" to "mirror mapping method." Therefore, the mirror mapping layer can use mirror mapping to map the cached data content to the target block and the backup end, updating the target block with data content and backing it up to the backup end.
[0088] For example, in the block-level backup operation for a single block mentioned above, it is possible to detect whether there are real-time read / write operations (such as file modification, data writing, etc.) of the upper-layer system (such as application or user) on the currently backed-up block. This detection can be implemented based on the kernel's IO monitoring mechanism, with a detection time of microseconds and no system performance loss.
[0089] Without real-time read / write operations, the raw data of the currently backed-up block can be directly copied from the target partition to the corresponding block location on the backup end via the mirroring module. With real-time read / write operations, the details of the read / write operations (including but not limited to operation type, read / write location, and data content) are first written to kernel memory in real-time. Once the currently backed-up block completes the backup and the read lock is released, the data content of the real-time read / write operation can be synchronously mapped to the corresponding block location on both the currently backed-up block and the backup end via mirroring.
[0090] If the target block is not the block currently being backed up, the backup of the target block has not yet started, and the target block is not read-locked, allowing free reading and writing. In this case, the mapping from the mirror mapping layer to the target block is a linear mapping (e.g., dm-linear mapping). Therefore, only the data content of real-time read / write operations can be mapped to the target block through a linear mapping without any operation on the backup end. This part of the data content will be backed up (or copied) to the backup end as the existing data of the target block during the block-level backup operation for that block.
[0091] Figure 5 A schematic diagram illustrating the mapping method of the backed-up and unbacked-up portions in a target partition according to an exemplary embodiment of the present disclosure is shown. Figure 5As shown, the backup portion of the target partition and the mirror mapping layer can have a dm-mirror mapping relationship; the unbacked-up portion of the target partition and the mirror mapping layer can have a dm-linear mapping relationship. The unbacked-up portion includes the currently backed-up block (the block at the boundary between the backup portion and the unbacked-up portion) and the block that has not yet been backed up. The currently backed-up block can be locked by a read locking mechanism to prevent data from being tampered with during the backup process.
[0092] Using the above method, for scenarios during the backup process, the backed-up portion of the mirror mapping layer is mirrored to the same location on the target partition and the backup end; while the unbacked-up portion remains linearly mapped. In this way, the mapping method can be changed in accordance with the backup status to ensure that the latest and complete data of the block is backed up, thus ensuring the reliability of online backup data.
[0093] The above describes block-level backup operations for a single block and the writing and backup of data content for real-time read and write operations. In addition, in the embodiments of this disclosure, during the backup process, the backup process can also achieve seamless recovery of various anomalies by real-time persistent progress recording and operation retention in the log area, avoiding full backup after an anomaly.
[0094] As an example, the online backup method for the partition may further include: during a block-level backup operation, writing information of the currently backed-up block into the log area of the mirror mapping layer, wherein the information of the currently backed-up block includes the location of the currently backed-up block; and in response to online backup recovery, continuing the backup operation performed before the online backup was interrupted by reading the log area.
[0095] Specifically, when backing up each block, relevant information about the block can be recorded in the log area. This way, even if the backup process is interrupted, the log area will still contain the currently backed-up block, allowing for subsequent resumption of the backup from a breakpoint.
[0096] As an example, the block-level backup operation described above may also include updating the backup progress file upon completion of each block backup. Here, the backup progress file can be used to record the backup progress of the target partition, and the backup progress file can be stored on local persistent storage media.
[0097] For example, it can be used as Figure 2 The progress recording module of the mirror mapping layer, as shown, writes the backup progress (including but not limited to the backed-up block number, the amount of data backed up, and the number of remaining blocks) to a local persistent configuration file (not a memory cache) in real time when each block backup is completed. The progress information will not be lost even if the system loses power.
[0098] During real-time system monitoring and backup, detectable anomalies include system power outages, device restarts, temporary disconnection of backup storage media, and network interruptions (in remote backup scenarios). Anomaly detection is achieved based on kernel-mode process monitoring and device status detection. By persistently recording the backup progress in real time, combined with the aforementioned log area operation retention, breakpoint resume technology can be implemented after various anomalies during the backup process.
[0099] Specifically, in scenarios where backup is interrupted, after the system recovers or the fault is resolved, the user can trigger the online backup command for that partition again. In this case, the backup progress in the backup configuration file can be read, and the block scheduler of the mirror mapping layer can directly select the blocks to be backed up starting from the interrupted block number. Furthermore, the mirror mapping module will read the unsynchronized read / write operations in the kernel memory, synchronize the latest data of the interrupted block and subsequent blocks in the original target partition, and then continue executing the block-by-block backup, achieving breakpoint resumption. Because the kernel memory retains all read / write operations of the blocks to be backed up before the exception occurred, it can be ensured that the backed-up data after recovery is the latest, without data loss or inconsistency.
[0100] Furthermore, as an example, the online partition backup method according to embodiments of this disclosure may further include: in response to the completion of backup of the target partition, performing a data consistency check to verify the data consistency between the target partition and the backup end.
[0101] Specifically, when the block scheduler detects that all blocks of the target partition have been marked as backup complete, it can automatically enter the backup completion and verification phase. It can call the built-in verification function of the mirror mapping module to perform full block-level data verification on the target partition and the corresponding backup partition on the backup end, comparing the block data hash values of the two partitions block by block to confirm that all block data is completely consistent; if an inconsistent block is detected, the backup of that block is automatically re-executed.
[0102] Furthermore, as an example, the online partition backup method according to an embodiment of this disclosure may further include: deleting all operation logs in the log area of the mirror mapping layer in response to the data consistency verification passing.
[0103] Specifically, after the above verification is passed, all operation logs in the log area of the mirror mapping module can be automatically cleaned up, storage space can be released, and the backup can be marked as completed in the backup configuration file, recording information such as backup completion time, total backup data volume, total time taken, and verification results.
[0104] Furthermore, as an example, the online partition backup method according to embodiments of this disclosure may further include: deleting the logs of blocks that have been backed up in response to the log area of the mirror mapping layer being full. Specifically, the log area of the mirror mapping module may employ a circular write mechanism, automatically cleaning up the logs of backed-up blocks when the log area is full to release space and ensure the continued availability of the log area.
[0105] In addition, after the backup is completed, the mirror mapping layer can be retained in one example and put into real-time synchronization mode. Any subsequent data modifications to the target partition will be synchronized to the corresponding backup partition on the backup end in real time through the mirror mapping layer, so as to achieve dynamic data consistency between the target partition and the backup partition.
[0106] In another example, the online partition backup method may further include: removing the mirror mapping layer in response to the completion of the backup of the target partition. Specifically, after the backup is completed, the mirror mapping layer can be removed, resulting in the generation of an independent backup partition on the backup end that has completely identical data to the target partition, which can then be directly mounted and used.
[0107] Furthermore, as an example, in the online partition backup method of the embodiments of this disclosure, a backup completion notification can also be sent in response to the completion of the backup of the target partition. For example, the backup completion notification can be pushed to the user through system logs, desktop pop-ups (such as desktop system), command returns (such as server system), etc., and the notification can contain the core information of this backup.
[0108] Figure 6 An example flow of single-block data backup in a partitioned online backup method according to an exemplary embodiment of the present disclosure is shown.
[0109] like Figure 6 As shown, in step 601, in response to receiving a backup command, the target partition can be initialized for backup.
[0110] For example, backup initialization may include: automatically loading the device mapper framework driver and the dm-mirror image module, and detecting the status of the target partition and the availability of the backup storage media. Backup initialization may also include: identifying the target partition's block device information, total partition size, used space, and current IO read / write frequency; automatically recommending the optimal backup block size; and allocating a dedicated log area for the dm-mirror module. Furthermore, backup initialization may also include: building a mirror mapping layer between the target partition and the backup endpoint based on the device mapper.
[0111] In step 602, the block scheduler can be used to read the backup configuration and obtain the backup block size. When the first block is backed up, the starting block number of the first backup block of the target partition can also be obtained. For example, the block number of the first backup block can be block 0, and the block numbers of subsequent backup blocks can be incremented sequentially.
[0112] In step 603, the current block to be backed up can be selected.
[0113] In step 604, the mirror mapping module of the mirror mapping layer can be used to read the data of the current block, and real-time read / write can be detected.
[0114] In step 605, in response to the existence of real-time read / write operations for the current block, the data content of the real-time read / write operations can be cached in memory until the data of the current block is completely backed up to the backup end. The data content can then be written to the current block and the backup end in a mirror mapping manner.
[0115] In step 606, in response to the absence of any real-time read / write operations for the current block, the data of the current block can be directly copied to the backup end.
[0116] In step 607, the current block can be marked as backup complete, and in step 608, the backup progress can be updated using the progress recording module, such as updating the backed-up block number and / or the amount of data backed up.
[0117] In step 609, it can be determined whether the backup of all blocks in the target partition is complete. If the backup of all blocks is not complete, the process can return to step 603. If the backup of all blocks is complete, in step 610, the process can proceed to the backup verification stage or the backup can be terminated directly.
[0118] During block-by-block backup, the process can be executed in a loop of "selecting blocks to be backed up - data reading and read / write detection - data synchronization - progress update" until all blocks are backed up. Specifically, the block-level backup operation described above for a single block can be applied to each block in the target partition. After a block backup is complete, it can be performed through methods such as... Figure 2 The fast scheduler in the mirror mapping layer shown automatically selects the next block to be backed up until all blocks of the target partition are backed up. Throughout the entire loop, I / O operations on the target partition are always executed normally without the user's awareness.
[0119] During the single-block backup process described above, the block to be backed up can be locked based on the read locking mechanism and real-time read-write synchronization to prevent data from being tampered with during the backup process. If real-time read-write is detected, the latest data can be synchronized before the backup is performed, ensuring that the latest and complete data of the block is backed up.
[0120] The online partition backup method according to the exemplary embodiments of this disclosure can be implemented based on the system kernel's device mapper framework. The core employs a mirror mapping module, such as the dm-mirror module, to construct a three-tier architecture of "original partition - mirror mapping layer - backup partition." It processes the backup partition block-by-block with progress recording, enabling uninterrupted online partition backup even when the partition is normally mounted, the system is running normally, and real-time file read / write operations occur on the partition. Furthermore, it performs fine-grained block-by-block backups of the target partition. In this method, the entire backup process does not require shutting down the operating system or entering a live system; file read / write operations on the original partition and application execution are completely transparent to the user, without any awareness of the process.
[0121] Specifically, through three mechanisms—block-level read locking, dm-mirror log area, and real-time read-write synchronization—precise backup of dynamic read-write data on the original partition is achieved, ensuring that the data on the backup partition is always completely consistent with the original partition, thus solving the core technical challenge of data consistency in online backup. Furthermore, by processing data block by block, flexible configuration of backup block size is supported (e.g., automatic recommendation or manual setting), and direct data transfer in kernel mode is used, resulting in a 30%~50% speed improvement compared to traditional user-mode backup tools. Fine-grained block-level locking avoids blocking of entire-partition I / O operations, keeping the performance impact on the original system within 5%.
[0122] Furthermore, the partitioned online backup method according to the exemplary embodiments of this disclosure can support the feature of pausing to temporarily meet the running of other high-load tasks, and can also support online disconnection and mapping of the backup medium throughout the entire backup process. If the backup medium itself is hot-swappable (such as a Universal Serial Bus (USB) external hard drive, USB flash drive, etc.), it can be unplugged online and used for subsequent archiving and other needs, without requiring the device to be shut down and restarted during the entire process.
[0123] Furthermore, according to the exemplary embodiments of the present disclosure, the partitioned online backup method ensures that the original system's application operation, file reading and writing, and other operations remain completely normal during the backup process, allowing for normal business operations. This completely solves the business interruption problem of traditional offline backup, improves the availability of "7×24-hour" business systems, and is particularly suitable for critical business systems operating "7×24-hour".
[0124] Furthermore, the partition online backup method according to the exemplary embodiments of this disclosure can also solve the core problem of inconsistency in backup data caused by real-time data reading and writing of the original partition during online backup through the log synchronization mechanism of dm-mirror, thus balancing backup continuity, efficiency, and data accuracy. In addition, it can achieve fine-grained block-by-block backup control, supporting flexible configuration of backup block size, balancing backup speed and system I / O performance.
[0125] Furthermore, the partitioned online backup method according to the exemplary embodiments of this disclosure can also achieve real-time persistent recording. Combined with the operation retention in the log area, it realizes real-time recording of backup progress and breakpoint resume after various anomalies, without having to re-execute a full backup, which greatly reduces the time cost after anomalies and improves the reliability of the backup process.
[0126] Furthermore, the partition online backup method according to the exemplary embodiments of this disclosure is fully automated throughout the entire backup process, from initialization to completion of verification, without the need for manual intervention. The initialization time is short (approximately 1 to 3 seconds), the system resource consumption is low, and it supports multiple scenarios such as desktop or server. Operators do not need to master complex live system operations, which lowers the technical threshold, simplifies the partition backup operation process, and automates and lightens the operation, reducing the cost of manual operation and the technical threshold.
[0127] Furthermore, the partitioned online backup method according to the exemplary embodiments of this disclosure supports online backup of existing data without the need for deployment during system installation. Even when the system already has existing data, it can still access the backup storage medium online. The access process is almost seamless and requires no restart or other operations.
[0128] Furthermore, the partition online backup method according to the exemplary embodiments of this disclosure supports two modes after backup is completed: independent backup of partitions and real-time synchronization. Users can choose according to their needs, which can achieve a one-time full backup or dynamic real-time synchronization between the original partition and the backup partition. Users can also switch between the two modes to meet different backup scenario requirements and improve backup flexibility.
[0129] Furthermore, the partitioned online backup method according to the exemplary embodiments of this disclosure supports backup technologies implemented in scenarios with and without existing data.
[0130] In a second aspect of exemplary embodiments of this disclosure, a partition online backup apparatus is provided, such as... Figure 7 As shown, the partition online backup device 700 may include a building unit 710 and a backup unit 720.
[0131] The building unit 710 is configured to, in response to receiving a backup instruction for an online target partition during operating system operation, associate the backup end for backing up data of the target partition with a mirror mapping layer mapped to the target partition, wherein the mirror mapping layer is built by the operating system's device mapper.
[0132] Backup unit 720 is configured to use the mirroring layer to perform block-level backup operations on blocks in the target partition to back up the target partition to the backup end.
[0133] During the block-level backup operation, the backup unit 720 is configured to, in response to receiving a real-time read / write operation on a target block in the target partition, use the mirror mapping layer to update the data content of the real-time read / write operation to the target block and back it up to the backup end according to the current backup status of the target block.
[0134] As an example, backup unit 720 is configured to: when the target block is in a completed backup state, use the mirror mapping layer to map the data content of real-time read and write operations to the target block and the backup end; when the target block is in an incomplete backup state, use the mirror mapping layer to map the data content of real-time read and write operations to the target block.
[0135] As an example, backup unit 720 is configured to: when the target block is in a completed backup state, use the mirror mapping layer to map the data content to the target block and the backup end through mirror mapping, so as to update the target block with the data content and back it up to the backup end; when the target block is in an incomplete backup state, depending on whether the target block is the block currently being backed up, use the mirror mapping layer to update the data content of the real-time read and write operation to the target block and back it up to the backup end.
[0136] As an example, backup unit 720 is configured to: cache data content in response to the target block being the currently backed-up block; and in response to the completion of the target block backup, use a mirror mapping layer to map the cached data content to the target block and the backup end through mirror mapping, so as to update the target block with the data content and back it up to the backup end; and in response to the target block not being the currently backed-up block, use a mirror mapping layer to map the data content to the target block through linear mapping, wherein the data content is backed up to the backup end when a block-level backup is performed on the target block.
[0137] As an example, for each block, the block-level backup operation includes: performing a read lock on the current block in the mirror mapping layer; writing the read and write data for the current block cached between the mirror mapping layer and the target partition to the current block; backing up the data in the current block to the backup end and releasing the read lock on the current block.
[0138] As an example, during a block-level backup operation, backup unit 720 is configured to also perform the following operations: write information about the currently backed-up block to the log area of the mirror mapping layer, wherein the information includes the location of the currently backed-up block; and, in response to online backup recovery, continue performing the backup operation prior to the online backup interruption by reading the log area after an online backup for the target partition is interrupted.
[0139] As an example, a block-level backup operation includes updating a backup progress file when each block backup is completed. The backup progress file is used to record the backup progress of the target partition and is stored on a local persistent storage medium.
[0140] As an example, when a backup instruction is received, the target partition contains existing data.
[0141] As an example, during a block-level backup operation, backup unit 720 is configured to pause the block-level backup operation in response to the operating system's operating load exceeding a preset level, and to continue the block-level backup operation in response to the operating system's operating load falling below a preset level.
[0142] The partition online backup device according to the embodiments of this disclosure can construct a mirror mapping layer using a device mapper when the target partition is online. By performing block-level backup operations on the blocks in the target partition, the data content of real-time read and write operations can be written to the corresponding blocks and backed up to the backup end based on the current backup status of the blocks using the mirror mapping layer. In this way, online backup of the target partition can be realized, and dynamic data writing is allowed without re-performing a full backup of the partition. This avoids business loss during the backup process, improves backup efficiency, and reduces restrictions on backup scenarios.
[0143] Regarding the apparatus in the above embodiments, the specific manner in which each unit performs the operation has been described in detail in the embodiments related to the method. Each unit in the partition online backup apparatus can perform the corresponding steps in the method according to the partition online backup method in the method embodiments of the first aspect above and achieve the corresponding beneficial effects, which will not be elaborated here.
[0144] In a third aspect of exemplary embodiments of the present disclosure, a computing device is provided, the computing device comprising: a processor; and a memory for storing computer-executable instructions, wherein the computer-executable instructions, when executed by the processor, cause the processor to execute a partitioned online backup method according to the present disclosure.
[0145] Figure 8 This is an example block diagram of a computing device according to exemplary embodiments of the present disclosure. Figure 8 As shown, the computing device 800 may include a processor 810 and a memory 820, which may be used to store computer-executable instructions 821 and an operating system 822. Here, when the computer-executable instructions are executed by the processor 810, they cause the processor 810 to execute the partition online backup method as described in the exemplary embodiment above. The computer-executable instructions 821 may run together with the operating system 822 in the processor.
[0146] As an example, computing device 800 is not necessarily a single device, but can be a collection of any means or circuits capable of executing the aforementioned instructions (or instruction sets) individually or in combination. Computing device 800 can also be part of an integrated control system or system manager, or can be configured to interface with a server locally or remotely (e.g., via wireless transmission).
[0147] In computing device 800, processor 810 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. By way of example and not limitation, processor 810 may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.
[0148] The processor 810 can execute instructions or code stored in the memory 820, which can also store data. Instructions and data can also be sent and received over a network via a network interface device, which can employ any known transmission protocol.
[0149] The memory 820 may be integrated with the processor 810, for example, by placing RAM or flash memory within an integrated circuit microprocessor. Alternatively, the memory 820 may include a separate device, such as an external disk drive, a storage array, or other storage device usable by any database system. The memory 820 and the processor 810 may be operatively coupled, or may communicate with each other, for example, via I / O ports, network connections, etc., enabling the processor 810 to read files stored in the memory 820.
[0150] In addition, the computing device 800 may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, mouse, touch input device, etc.). All components of the computing device 800 can be interconnected via a bus and / or network.
[0151] In an exemplary embodiment, a computer-readable storage medium may also be provided, which, when executed by a processor of a computing device, enables the computing device to perform the partition online backup method as described in the exemplary embodiment above. The computer-readable storage medium may be, for example, a memory including instructions. Optionally, the computer-readable storage medium may be: a read-only memory (ROM), a random access memory (RAM), a random access programmable read-only memory (PROM), an electrically erasable programmable read-only memory (EEPROM), a dynamic random access memory (DRAM), a static random access memory (SRAM), flash memory, non-volatile memory, a CD-ROM, a CD-R, a CD+R, a CD-RW, a CD+RW, a DVD-ROM, a DVD-R, a DVD+R, a DVD-RW, a DVD+RW, a DVD-RAM, a BD-ROM, a BD-R, or a BD-R... LTH, BD-RE, Blu-ray or optical disc storage, hard disk drive (HDD), solid-state drive (SSD), card storage (such as multimedia cards, secure digital (SD) cards, or ultra-fast digital (XD) cards), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid-state drive, and any other device configured to store computer programs and any associated data, data files, and data structures in a non-transitory manner and to provide the computer programs and any associated data, data files, and data structures to a processor or computer so that the processor or computer can execute the computer programs. The computer programs in the aforementioned computer-readable storage media can run in an environment deployed in computer devices such as clients, hosts, agent devices, servers, etc. Furthermore, in one example, the computer programs and any associated data, data files, and data structures are distributed across a networked computer system, such that the computer programs and any associated data, data files, and data structures are stored, accessed, and executed in a distributed manner through one or more processors or computers.
[0152] According to exemplary embodiments of the present disclosure, a computer program product may also be provided, the computer program product including computer-executable instructions that, when executed by at least one processor, implement the partition online backup method according to exemplary embodiments of the present disclosure.
[0153] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0154] Furthermore, it should be noted that although several examples of each step have been described above with reference to the specific accompanying drawings, it should be understood that the embodiments of this disclosure are not limited to the combinations given in the examples. The steps appearing in different drawings can be combined, and the execution order of each step can be changed, which will not be exhaustive here.
[0155] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for online partition backup, characterized in that, The online partition backup method includes: In response to receiving a backup instruction for a target partition that is online during the operation of the operating system, the backup end for backing up the data of the target partition is associated with a mirror mapping layer mapped to the target partition, wherein the mirror mapping layer is constructed by the device mapper of the operating system; Using the mirroring layer, block-level backup operations are performed on the blocks in the target partition to back up the target partition to the backup endpoint. The block-level backup operation includes: in response to receiving a real-time read / write operation on a target block in the target partition, using the mirror mapping layer, updating the data content of the real-time read / write operation to the target block and backing it up to the backup end according to the current backup status of the target block.
2. The online partition backup method according to claim 1, characterized in that, The step of using the mirror mapping layer to update the data content of the real-time read / write operation to the target block and back it up to the backup end according to the current backup status of the target block includes: When the target block is in a backup-completed state, the mirror mapping layer is used to map the data content of the real-time read / write operation to the target block and the backup end; When the target block is in an incomplete backup state, the mirror mapping layer is used to map the data content of the real-time read / write operation to the target block.
3. The online partition backup method according to claim 1, characterized in that, The step of using the mirror mapping layer to update the data content of the real-time read / write operation to the target block and back it up to the backup end according to the current backup status of the target block includes: When the target block is in a backup-completed state, the mirror mapping layer is used to map the data content to the target block and the backup end through mirror mapping, so that the data content is updated to the target block and backed up to the backup end; If the target block is in an incomplete backup state, depending on whether the target block is the block currently being backed up, the data content of the real-time read / write operation is updated to the target block and backed up to the backup end using the mirror mapping layer.
4. The online partition backup method according to claim 3, characterized in that, The step of updating the data content of the real-time read / write operation to the target block and backing it up to the backup end using the mirror mapping layer, based on whether the target block is the currently backed-up block, includes: In response to the target block being the currently backed-up block, the data content is cached. In response to the target block being backed up, the cached data content is mapped to the target block and the backup end through the mirror mapping layer, and the data content is used to update the target block and back up to the backup end. In response to the target block not being a currently backed-up block, the data content is mapped to the target block via linear mapping using the mirror mapping layer, wherein the data content is backed up to the backup end when the block-level backup of the target block is performed.
5. The online partition backup method according to claim 1, characterized in that, For each block, the block-level backup operation includes: In the mirror mapping layer, a read lock is performed on the current block; The read / write data for the current block cached between the mirror mapping layer and the target partition is written to the current block; Back up the data in the current block to the backup end and unlock the read lock on the current block.
6. The online partition backup method according to claim 1, characterized in that, The online partition backup method also includes: During the block-level backup operation, information about the currently backed-up block is written to the log area of the mirror mapping layer, wherein the information includes the location of the currently backed-up block; In response to the online backup recovery, after the online backup of the target partition is interrupted, the backup operation performed before the online backup was interrupted is resumed by reading the log area.
7. The online partition backup method according to claim 1, characterized in that, The block-level backup operation also includes: When each block backup is completed, the backup progress file is updated, wherein the backup progress file is used to record the backup progress of the target partition and is stored on a local persistent storage medium.
8. The online partition backup method according to claim 1, characterized in that, When the backup instruction is received, the target partition contains existing data.
9. The online partition backup method according to claim 1, characterized in that, The online partition backup method further includes: during the block-level backup operation, pausing the block-level backup operation in response to the operating system's operating load exceeding a preset level; and continuing to execute the block-level backup operation in response to the operating system's operating load falling below the preset level.
10. A partitioned online backup device, characterized in that, The partition online backup device includes: A build unit is configured to, in response to receiving a backup instruction for an online target partition during operating system operation, associate a backup end for backing up data of the target partition with a mirror mapping layer mapped to the target partition, wherein the mirror mapping layer is built by the device mapper of the operating system; The backup unit is configured to utilize the mirroring layer to perform block-level backup operations on blocks in the target partition, thereby backing up the target partition to the backup endpoint. During the block-level backup operation, the backup unit is configured to, in response to receiving a real-time read / write operation on a target block in the target partition, use the mirror mapping layer to update the data content of the real-time read / write operation to the target block and back it up to the backup end according to the current backup status of the target block.
11. A computing device, characterized in that, The computing device includes: processor; Memory used to store executable instructions for a computer. Wherein, when the computer-executable instructions are executed by the processor, they cause the processor to execute the partition online backup method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of a computing device, the computing device is able to perform the partition online backup method according to any one of claims 1 to 9.
13. A computer program product comprising computer-executable instructions, characterized in that, When the computer-executable instructions are executed by at least one processor, they implement the online partition backup method according to any one of claims 1 to 9.