Business data synchronization methods, devices, equipment and storage media

By identifying and separating the overlapping areas of the target host's operating system startup data and the newly added business synchronization data during the data synchronization process, the problem of incomplete data after the target host restarts is solved, ensuring normal system boot and data synchronization.

CN120687527BActive Publication Date: 2025-12-02SHENZHEN KELIRI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511187820.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-25
Publication Date
2025-12-02
Estimated Expiration
2045-08-25

AI Technical Summary

Technical Problem

During the disaster recovery primary and backup data synchronization process, after the target host restarts, the disk data on the target host is in an intermediate state, which prevents the operating system from booting and completing subsequent data synchronization, resulting in restart failure.

Method used

When receiving new service synchronization data from the source host, it determines whether there is an overlapping area between the first disk area corresponding to the operating system startup data of the target host and the second disk area corresponding to the new service synchronization data. If there is an overlapping area, the new service synchronization data outside the overlapping area in the second disk area is synchronized to the target host to avoid data overwriting in the overlapping area.

Benefits of technology

By identifying and separating overlapping data synchronization areas, the system avoids overwriting the operating system startup data after the target host restarts, ensuring that the system can boot normally and complete data synchronization, thus avoiding restart failure issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120687527B_ABST
    Figure CN120687527B_ABST
Patent Text Reader

Abstract

This application discloses a business data synchronization method, apparatus, device, and storage medium, relating to the field of data disaster recovery technology. The method includes: upon receiving new business synchronization data from a source host, determining whether there is an overlapping area between a first disk area corresponding to the operating system startup data of the target host and a second disk area corresponding to the new business synchronization data; if an overlapping area exists, then synchronizing the new business synchronization data outside the overlapping area in the second disk area to the target host. This application determines whether disk overlap exists during data synchronization. If overlap exists, the synchronization data in the overlapping area is not synchronized initially; only the synchronization data in the non-overlapping area is synchronized to the target host. If the target host restarts during the synchronization process, the operating system startup data on the target host will not be overwritten by the synchronized data, thereby avoiding the problem of restart failure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data disaster recovery technology, and in particular to a business data synchronization method, apparatus, device and storage medium. Background Technology

[0002] To ensure the continuity of computer business systems, many critical systems require primary / backup disaster recovery. Existing primary / backup disaster recovery technologies typically involve first transferring primary hot data to the target host. This primary hot data allows the target host system to boot normally. At a certain stage (before the kernel network initialization is complete and all system volume devices are mounted), the primary / backup disaster recovery kernel driver pauses system booting, connects to the backup server, and continuously retrieves synchronization data from the source host, writing it to the target host's disk. When a service switchover command is received, the operating system boots again, completing the system and service startup. However, if the target host restarts during data synchronization, it will fail to boot afterward because the primary hot data on the target host will be overwritten by subsequent synchronization data. The target host's disk data is in an intermediate state—incomplete—making it impossible for the operating system to boot and perform subsequent data synchronization. Summary of the Invention

[0003] The main purpose of this application is to provide a business data synchronization method, apparatus, device and storage medium, which aims to solve the technical problem that the target host will fail to restart during the disaster recovery primary and backup data synchronization process.

[0004] To achieve the above objectives, this application proposes a business data synchronization method, which includes:

[0005] When receiving new service synchronization data from the source host, it is determined whether there is an overlapping area. The overlapping area refers to the area that overlaps between the first disk area and the second disk area. The first disk area is the disk area corresponding to the operating system startup data of the target host, and the second disk area is the disk area corresponding to the new service synchronization data.

[0006] If the overlapping area exists, the newly added service synchronization data outside the overlapping area in the second disk area will be synchronized to the target host.

[0007] In one embodiment, before the step of determining whether there is an overlapping region when receiving new service synchronization data from the source host, the method further includes:

[0008] Receive full machine backup data sent by the source host, and generate a full machine backup point based on the full machine backup data. The full machine backup data includes at least one of the following: operating system, application, business data, and disk metadata.

[0009] Obtain the hardware configuration information of the target host, and generate the operating system boot data of the target host based on the whole machine backup point and the hardware configuration information;

[0010] The first disk area is identified as the disk area corresponding to the operating system boot data, and the operating system boot data is pushed to the target host.

[0011] In one embodiment, the step of obtaining the hardware configuration information of the target host and generating the operating system boot data of the target host based on the system backup point and the hardware configuration information includes:

[0012] A virtual machine is created based on the hardware configuration information, and the operating system of the virtual machine is started based on the whole machine backup point. The hardware configuration of the virtual machine is consistent with the hardware configuration of the target host.

[0013] Monitor disk read / write behavior occurring in the virtual machine, obtain the virtual disk area and virtual read / write data corresponding to the disk read / write behavior, and determine the operating system startup data of the target host as the virtual disk area and the virtual read / write data.

[0014] In one embodiment, the step of monitoring disk read / write behavior occurring in the virtual machine and obtaining the virtual disk area and virtual read / write data corresponding to the disk read / write behavior includes:

[0015] The virtual machine's disk area is divided into multiple virtual data blocks of equal size based on the disk offset;

[0016] Monitor whether disk read / write behavior occurs in each virtual data block in the virtual machine, and mark the virtual data block as read / write if disk read / write behavior is detected.

[0017] The virtual disk area and virtual read / write data are determined in the virtual machine's disk based on the read / write markers.

[0018] In one embodiment, the step of determining whether there is an overlapping region when receiving new service synchronization data from the source host includes:

[0019] When new service synchronization data is received from the source host, the new service synchronization data is divided into multiple new data blocks according to the disk offset of the new service synchronization data. The size of the new data block is not greater than the size of the virtual data block.

[0020] Determine whether the disk area of ​​each newly added data block overlaps with the first disk area;

[0021] If there is overlap, the overlapping area is determined based on the disk area of ​​the newly added data block.

[0022] In one embodiment, after the step of determining the overlapping region based on the disk region of the newly added data block if overlap exists, the method further includes:

[0023] Determine whether the size of the newly added data block is equal to the size of the virtual data block;

[0024] If the size is equal to the size of the virtual data block, the newly added data block is cached in the sparse file, and a write mark is added to the cache area corresponding to the newly added data block in the sparse file. The size of the sparse file is consistent with the disk size of the virtual machine. The sparse file is used to record the data synchronized to the target host when a disaster recovery service switching instruction is received.

[0025] If it is smaller than the size of the virtual data block, then determine whether there is a write mark in the cache area corresponding to the newly added data block in the sparse file;

[0026] If a write flag exists, the newly added data block is cached in the sparse file;

[0027] If the size is smaller than the virtual data block and there is no write mark in the cache area corresponding to the newly added data block in the sparse file, then the operating system startup data corresponding to the disk area of ​​the virtual data block in the first disk area is cached in the sparse file, and a write mark is added to the cache area corresponding to the startup data in the sparse file, and the newly added data block is cached in the sparse file.

[0028] In one embodiment, the step of synchronizing the new service synchronization data outside the overlapping area in the second disk area to the target host if the overlapping area exists includes:

[0029] If the overlapping area exists, the newly added business synchronization data outside the overlapping area in the second disk area is divided into multiple consecutive synchronization data blocks, and the data size of the synchronization data block does not exceed a preset data size threshold.

[0030] The first synchronized data block is taken as the current data block according to the preset order, the current data block is synchronized to the target host, and a disk write confirmation message is sent to the target host.

[0031] Upon receiving feedback from the target host after writing the current data block to disk, the next synchronized data block is used as the current data block, and the steps of synchronizing the current data block to the target host and sending disk write confirmation information to the target host are executed until all the new service synchronization data is synchronized to the target host.

[0032] Furthermore, to achieve the above objectives, this application also proposes a business data synchronization device, which includes:

[0033] The overlapping area determination module is used to determine whether there is an overlapping area when receiving new service synchronization data from the source host. The overlapping area refers to the area that overlaps between the first disk area and the second disk area. The first disk area is the disk area corresponding to the operating system startup data of the target host, and the second disk area is the disk area corresponding to the new service synchronization data.

[0034] The non-overlapping data synchronization module is used to synchronize the newly added service synchronization data outside the overlapping area in the second disk area to the target host if the overlapping area exists.

[0035] In addition, to achieve the above objectives, this application also proposes a business data synchronization device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the business data synchronization method as described above.

[0036] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the business data synchronization method described above.

[0037] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the business data synchronization method described above.

[0038] This application provides a business data synchronization method. Upon receiving new business synchronization data from a source host, it determines whether there is an overlap between the first disk area corresponding to the operating system startup data of the target host and the second disk area corresponding to the new business synchronization data. If an overlapping area exists, the new business synchronization data outside the overlapping area in the second disk area is synchronized to the target host. This application determines whether there is an overlap between the operating system startup data of the target host and the disk area corresponding to the new business synchronization data upon receiving new business synchronization data from the source host. If an overlap exists, the synchronization data in the overlapping area is not synchronized initially; only the new business synchronization data outside the overlapping area is synchronized to the target host. If the target host restarts during the synchronization process, the operating system startup data on the target host will not be overwritten by the synchronized data, thus avoiding the problem of restart failure. Attached Figure Description

[0039] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0040] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0041] Figure 1 This is a flowchart illustrating an embodiment of the business data synchronization method of this application.

[0042] Figure 2 This is a flowchart illustrating the second embodiment of the business data synchronization method in this application.

[0043] Figure 3 This is a flowchart illustrating Embodiment 3 of the business data synchronization method of this application;

[0044] Figure 4 This is a schematic diagram of the module structure of the business data synchronization device according to an embodiment of this application;

[0045] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the business data synchronization method in this application embodiment.

[0046] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0047] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0048] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0049] The main solution of this application embodiment is: when receiving new service synchronization data from the source host, it is determined whether there is an overlapping area. The overlapping area refers to the area overlapping between the first disk area and the second disk area. The first disk area is the disk area corresponding to the operating system startup data of the target host, and the second disk area is the disk area corresponding to the new service synchronization data. If the overlapping area exists, the new service synchronization data outside the overlapping area in the second disk area is synchronized to the target host.

[0050] To ensure the continuity of computer business systems, many critical systems require primary / backup disaster recovery. Current primary / backup disaster recovery technologies typically involve first transferring primary hot data to the target host. This primary hot data allows the target host system to boot normally. At a certain stage (before the kernel network initialization is complete and all system volume devices are mounted), the primary / backup disaster recovery kernel driver pauses system booting, connects to the backup server, and continuously retrieves synchronization data from the source host, writing it to the target host's disk. When a service switchover command is received, the operating system boots again, completing the system and service startup. However, if the target host restarts during data synchronization, it will fail to boot because the primary hot data on the target host will be overwritten by subsequent synchronization data. The target host's disk data is in an intermediate state—incomplete—making it impossible for the operating system to boot and perform subsequent data synchronization.

[0051] This application provides a solution that, upon receiving new service synchronization data from a source host, determines whether there is an overlap between the first disk area corresponding to the operating system startup data of the target host and the second disk area corresponding to the new service synchronization data. If an overlap exists, the new service synchronization data outside the overlap area in the second disk area is synchronized to the target host. This application, by determining whether there is an overlap between the operating system startup data of the target host and the disk area corresponding to the new service synchronization data upon receiving new service synchronization data from the source host, if an overlap exists, the synchronization data in the overlap area is not synchronized initially; only the new service synchronization data outside the overlap area is synchronized to the target host. If the target host restarts during the synchronization process, the operating system startup data on the target host will not be overwritten by the synchronized data, thus avoiding the problem of restart failure.

[0052] It should be noted that a primary-backup disaster recovery system generally consists of three parts: a backup server, a source host, and a target host. The source host hosts the primary business system, carrying the customer's specific business operations. The source host performs data backup and synchronization operations, sending basic and incremental data from its disk to the backup server periodically or in real-time. The backup server receives and stores the backup and synchronization data sent from the source host. When performing recovery or synchronization operations, it provides the data to be restored to the target host; when performing synchronization operations, it pushes incremental data from the source host to the target host periodically or in real-time. The target host is the backup system for business disaster recovery. When the primary business system on the source host fails, the customer's business will switch to the backup business system on the target host to ensure business continuity. In this embodiment, the execution entity can be the backup server.

[0053] Based on this, the embodiments of this application provide a business data synchronization method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the business data synchronization method of this application.

[0054] In this embodiment, the business data synchronization method includes steps S10 to S20:

[0055] Step S10: When receiving new service synchronization data from the source host, determine whether there is an overlapping area. The overlapping area refers to the area that overlaps between the first disk area and the second disk area. The first disk area is the disk area corresponding to the operating system startup data of the target host, and the second disk area is the disk area corresponding to the new service synchronization data.

[0056] It's important to note that primary / standby disaster recovery data synchronization is a data synchronization technology. First, the data required for system startup (primary hot data) is pushed to the target host. Once the system boots to a certain stage (before kernel network initialization is complete and all system volume devices are mounted), the primary / standby disaster recovery kernel driver pauses system booting and connects to the backup server. It continuously retrieves data from the backup server for business data synchronization. Upon receiving a business switchover command, it resumes system booting and startup. After the operating system has finished booting, the services on the system will subsequently start and provide services, completing the takeover of the source host's services and achieving business switchover.

[0057] Understandably, during primary / standby disaster recovery data synchronization, operating system boot data (i.e., primary hot data) is first generated based on the full machine backup point of the source host, and the disk area corresponding to the primary hot data is recorded as the first disk area. Then, the primary hot data is pushed to the target host, waiting for the target host to connect and receive the synchronization data. When the backup server receives new service synchronization data from the source host, it determines whether the second disk area corresponding to the new service synchronization data overlaps with the first disk area.

[0058] Step S20: If the overlapping area exists, the newly added service synchronization data outside the overlapping area in the second disk area is synchronized to the target host.

[0059] Understandably, if overlapping areas exist, the data in the overlapping areas will be cached on the backup server and not pushed immediately. New service synchronization data outside the overlapping areas in the second disk area will be synchronized to the target host. Subsequently, when a user's service switching command is received, the cached new service synchronization data in the overlapping areas will be synchronized to the target host. After synchronization is complete, the target host will be notified to restore the boot process and complete the system and service startup.

[0060] In one feasible implementation, step S20 may include steps S201 to S203:

[0061] Step S201: If the overlapping area exists, the newly added service synchronization data outside the overlapping area in the second disk area is divided into multiple consecutive synchronization data blocks, and the data size of the synchronization data block does not exceed a preset data size threshold.

[0062] It should be noted that, through the above processing, if the target host restarts during data synchronization, there will be no system startup failure preventing data synchronization. However, if the target host restarts, it is uncertain from which point incremental data synchronization should resume, because the target host has a cache (without using a cache, synchronization efficiency would be very low), and data successfully sent by the backup server to the target host may not be successfully written to the target host's disk.

[0063] Understandably, in order to determine from which moment to start synchronizing incremental data after the target host has restarted, if there is an overlapping area, the new business synchronization data outside the overlapping area in the second disk area will be divided into multiple consecutive synchronization data blocks. The size of the synchronization data block will not exceed the preset data size threshold (e.g., 100~150MB).

[0064] Step S202: The first synchronized data block is selected as the current data block according to a preset order, the current data block is synchronized to the target host, and a disk write confirmation message is sent to the target host.

[0065] Step S203: Upon receiving feedback information from the target host after writing the current data block to the disk, the next synchronized data block is used as the current data block, and the steps of synchronizing the current data block to the target host and sending disk write confirmation information to the target host are executed until all the newly added service synchronization data is synchronized to the target host.

[0066] It should be understood that synchronization data blocks can be sent sequentially according to the time order of the newly added business synchronization data. Each time the backup server sends a certain amount of incremental synchronization data to the target host, it sends a disk write confirmation message to the target host to refresh the disk cache, confirming that the target host has written the data to disk. Upon receiving feedback from the target host confirming that the current data block has been written to disk, the synchronization of subsequent data continues until all newly added business synchronization data is synchronized to the target host. Using this method, if the target host restarts during the process, the backup server does not need to resynchronize data synchronized before the confirmation command; it only needs to resynchronize data synchronized after the confirmation command. This ensures that the amount of retransmitted data will not exceed 100MB, saving time and improving efficiency.

[0067] This embodiment provides a service data synchronization method. When receiving new service synchronization data from a source host, it determines whether there is an overlap between the first disk area corresponding to the operating system startup data of the target host and the second disk area corresponding to the new service synchronization data. If an overlapping area exists, the new service synchronization data outside the overlapping area in the second disk area is synchronized to the target host. This embodiment determines whether there is an overlap between the operating system startup data of the target host and the disk area corresponding to the new service synchronization data upon receiving new service synchronization data from the source host. If an overlap exists, the synchronization data in the overlapping area is not synchronized initially; only the new service synchronization data outside the overlapping area is synchronized to the target host. If the target host restarts during the synchronization process, the operating system startup data in the target host will not be overwritten by the synchronized data, thus avoiding the problem of restart failure.

[0068] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in Embodiment 1 above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 Before step S10, the business data synchronization method further includes steps S01 to S03:

[0069] Step S01: Receive the full machine backup data sent by the source host, and generate a full machine backup point based on the full machine backup data. The full machine backup data includes at least one of the following: operating system, application, business data, and disk metadata.

[0070] Understandably, a full system backup can be performed on the source host. The backup server receives the full system backup data sent by the source host, including, for example, the operating system, applications, business data, and metadata such as disk partitions, volumes, and file systems. This full system backup data is then backed up and stored on the backup server, forming a full system backup point.

[0071] Step S02: Obtain the hardware configuration information of the target host, and generate the operating system boot data of the target host based on the whole machine backup point and the hardware configuration information.

[0072] It should be understood that the hardware configuration information of the target host can be obtained, including hardware information such as network card controller and disk controller. Based on the full backup point of the source host and the hardware configuration information of the target host, the first-level hot data of the target host is generated. The first-level hot data represents the programs, configurations and data required for the target host's operating system to start. Here, the first-level hot data is the operating system startup data of the target host.

[0073] Step S03: Determine the first disk area as the disk area corresponding to the operating system boot data, and push the operating system boot data to the target host.

[0074] It is understandable that the disk area corresponding to the operating system startup data is recorded as the first disk area, and the first-level hot data is pushed to the target host.

[0075] In one feasible implementation, step S02 may include steps S021-S022:

[0076] Step S021: Create a virtual machine based on the hardware configuration information, and start the operating system of the virtual machine based on the whole machine backup point. The hardware configuration of the virtual machine is consistent with the hardware configuration of the target host.

[0077] It's important to note that since the source host performs a full system backup, containing the complete operating system and business data, a virtual machine can be created using virtualization technology, and its corresponding operating system can be started. Copy-on-write (COW) technology can be used to create a virtual disk. When the virtual machine modifies a disk data block at a specific offset, the original data block is first copied to a new data block, and then the write operation is performed on the copied data block. Subsequent read and write operations on that disk offset will be converted into read and write operations on the new data block. To construct a first-level hot data instance that can be started on the target host, the virtual machine needs to be created with the same hardware configuration as the target host. That is, the virtual machine is created based on the target host's hardware configuration information, and its operating system is started based on the full system backup point.

[0078] Step S022: Monitor the disk read / write behavior occurring in the virtual machine, obtain the virtual disk area and virtual read / write data corresponding to the disk read / write behavior, and determine the operating system startup data of the target host as the virtual disk area and the virtual read / write data.

[0079] Understandably, after the virtual machine's operating system has booted up, it can be configured, such as installing hardware drivers, configuring the network card's IP address, writing the backup server's address, and implanting the primary / standby disaster recovery kernel driver. Afterward, the operating system is shut down, completing the construction of the primary hot data.

[0080] It should be understood that during the above process, the virtualization engine can monitor the read and write behavior of all disks in the virtual machine, recording the virtual disk areas and virtual read / write data corresponding to these behaviors. The disk area data of all read and write operations of the virtual machine monitored by the virtualization engine is the first-level hot data. After the first-level hot data is pushed to the target host, the machine can start normally on the target host, configure the network, connect to the backup server, and block the operating system's boot and the reception of synchronization data.

[0081] In one feasible implementation, step S022 may include steps S0221 to S0223:

[0082] Step S0221: Divide the disk area of ​​the virtual machine into multiple virtual data blocks of equal size according to the disk offset.

[0083] It's worth noting that when generating first-level hot data, virtual disks are created based on backup point data and using Copy-on-Write (COW) technology. Simultaneously, the virtualization engine monitors all read and write operations on the virtual disks. The data in the backup points is the original data; it can only be read, not written. All write operations are based on copied data blocks. Therefore, to facilitate tracking of disk read / write areas, the entire disk area can be divided into a series of equally sized virtual data blocks (e.g., 64KB per block) according to disk offsets.

[0084] Step S0222: Monitor whether each virtual data block in the virtual machine has disk read / write behavior, and mark the virtual data block as read / write if disk read / write behavior is detected.

[0085] It should be understood that monitoring each virtual data block in the virtual machine to detect disk read / write operations is crucial, and when such operations are detected, the virtual data block is marked as read / write. For example, a bitmap method can be used to identify whether a virtual data block has undergone a read / write operation; if a read or write operation occurs, the bitmap corresponding to that virtual data block is set to 1. Other marking methods can also be used, such as adding a "write" or "read" marker to virtual data blocks where read / write operations have occurred.

[0086] Step S0223: Determine the virtual disk area and virtual read / write data in the virtual machine's disk based on the read / write markers.

[0087] Understandably, after marking virtual data blocks for read and write operations, when the virtual machine shuts down, a bitmap (let's call this bitmap A) can be used to determine which areas of the disk have undergone read and write operations, thus identifying the virtual disk areas and the virtual read / write data, i.e., the first-level hot data. Subsequently, after pushing the first-level hot data to the target host, the operating system can be booted up to receive subsequent synchronization data.

[0088] In this embodiment, the system receives full-machine backup data sent by the source host, generates a full-machine backup point based on the full-machine backup data, which includes at least one of the following: operating system, application, business data, and disk metadata; obtains the hardware configuration information of the target host, generates operating system boot data for the target host based on the full-machine backup point and the hardware configuration information; identifies a first disk area as the disk area corresponding to the operating system boot data, and pushes the operating system boot data to the target host. By creating a virtual machine, it is possible to construct operating system boot data that boots on the target host.

[0089] Based on the first embodiment of this application, in the third embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 Step S10, the business data synchronization method further includes steps S101~S103:

[0090] Step S101: When receiving new service synchronization data from the source host, the new service synchronization data is divided into multiple new data blocks according to the disk offset of the new service synchronization data. The size of each new data block is not greater than the size of the virtual data block.

[0091] It is worth noting that when the backup server receives new service synchronization data from the source host, it first determines the overlapping area. Specifically, based on the disk offset of the new service synchronization data, it divides the new service synchronization data into multiple new data blocks. The size of each new data block is no larger than the size of the virtual data block, i.e., each block is also 64K in size.

[0092] Step S102: Determine whether the disk area of ​​each newly added data block overlaps with the first disk area.

[0093] Step S103: If there is overlap, determine the overlapping area based on the disk area of ​​the newly added data block.

[0094] Understandably, the process involves determining whether the disk area of ​​each newly added data block overlaps with the first disk area corresponding to the first-level hot data. If they do not overlap, the newly added data block can be directly sent to the target host; if they overlap, it is not sent immediately, and the data in the newly added data block is cached on the backup server, awaiting subsequent service switchover commands.

[0095] In one feasible implementation, after step S103, steps S104 to S108 may also be included:

[0096] Step S104: Determine whether the size of the newly added data block is equal to the size of the virtual data block;

[0097] It's important to note that because the data block size is not fixed when the source host writes data to disk, the disk offset may not be aligned with the boundary of the partitioned data block size. In other words, the disk write offset and data size are not necessarily integer multiples of the virtual data block size of 64KB. Therefore, the disk offset and data size of newly added synchronization data also have the same issue. Thus, the first step is to check if the size of the newly added data block is equal to the virtual data block size of 64KB.

[0098] Step S105: If the size is equal to the size of the virtual data block, the newly added data block is cached in the sparse file, and a write mark is added to the cache area corresponding to the newly added data block in the sparse file. The size of the sparse file is consistent with the disk size of the virtual machine. The sparse file is used to record the data synchronized to the target host when a disaster recovery service switching instruction is received.

[0099] Understandably, a sparse file of the same size as the virtual disk (constructed when the virtual machine was created earlier) can be created. Areas in this sparse file that haven't been written to won't occupy disk space. The sparse file is used to record data synchronized to the target host when a disaster recovery service switchover instruction is received; that is, it's used to cache newly added service synchronization data in overlapping areas. Simultaneously, a new bitmap (Bitmap B) is constructed to track which areas of the sparse file have undergone write operations. Each bit in the bitmap describes a 64KB data block.

[0100] It should be understood that if the size of the newly added data block is not equal to the size of the virtual data block (64K), then the newly added data block is directly cached in the sparse file, and a write flag is added to the cache area corresponding to the newly added data block in the sparse file. For example, the bitmap corresponding to the newly added data block in bitmap B can be set to 1.

[0101] Step S106: If the size is smaller than the virtual data block size, determine whether there is a write mark in the cache area corresponding to the newly added data block in the sparse file.

[0102] Step S107: If a write flag exists, the newly added data block is cached in the sparse file.

[0103] Understandably, if the size of the newly added data block is less than 64K, it is determined whether a write flag exists in the cache region corresponding to the newly added data block in the sparse file. For example, it is checked whether the bitmap of that region has been set to 1. If a write flag exists, the newly added data block is directly cached in the sparse file.

[0104] Step S108: If the size is smaller than the virtual data block and there is no write mark in the cache area corresponding to the newly added data block in the sparse file, then the operating system startup data corresponding to the disk area of ​​the virtual data block in the first disk area is cached in the sparse file, and a write mark is added to the cache area corresponding to the startup data in the sparse file, and the newly added data block is cached in the sparse file.

[0105] Understandably, if the preceding conditions are not met, namely, the size of the synchronized data block is not 64K, and the data in this area has not yet been written to the sparse file (there is no write mark), then it is necessary to first read out the first-level hot data corresponding to the disk area of ​​the virtual data block in the first disk area, write it to the sparse file, set the corresponding area bitmap to 1, and then write the newly added data block to the sparse file.

[0106] This example illustrates the process of writing to a sparse file. Assume the disk offset of the newly added synchronization data block is 32K, the data size is 128K, and the corresponding disk region range is [32K, 160K]. First, divide the disk according to the 64K boundary, resulting in three data blocks with disk region ranges of [32K, 64K), [64K, 128K), and [128K, 160K], respectively. For the first data block, assuming its corresponding disk region does not overlap with the disk region of the first-level hot data (i.e., bit 0 of bitmap A is 0, equivalent to the first data block of the virtual disk not having undergone any read / write operations), then this 32K data block is directly synchronized to the target host. For the second data block, assuming its corresponding disk region overlaps with the first-level hot data, and since its size is 64K, it is directly written to the sparse file, and bit 1 of bitmap B is set to 1. For the third data block, assuming that its corresponding disk area overlaps with the first-level hot data, since its size is not 64K and the data in this disk area has not been written to the sparse file (that is, the second bit of bitmap B is 0), then the data block needs to be read from the first-level hot data, written to the sparse file, and the second bit of bitmap B is set to 1, and then the 32K data is written to the sparse file.

[0107] Suppose the backup server receives a new synchronization data block with a disk offset of 132K and a data size of 4K, corresponding to a disk region range of [132K, 136K]. As mentioned earlier, this disk region overlaps with the primary hot data. Since this region has already been written to the sparse file (i.e., bit 2 of bitmap B is 1), the synchronization data can be directly written to the sparse file.

[0108] It should be noted that after synchronizing the newly added business data in the aforementioned cached overlapping areas, the system awaits the user's disaster recovery switchover command. Once the backup server receives the user's switchover command, it sends the newly added synchronized data (i.e., the data stored in the sparse file) from the primary hot data disk area to the target host and notifies the target host to restore system boot, start the business, and complete the business switchover. Since bitmap B stores which areas of the sparse file contain synchronized data, scanning bitmap B to read the corresponding data from the sparse file and sending it to the target host completes the synchronization of the remaining data.

[0109] The above method ensures that if an abnormal restart occurs during the target host's data synchronization process, data synchronization can be quickly restored, which is simple and efficient. It avoids the costly problem of rebuilding primary hot data and pushing it to the target host, as well as synchronizing all incremental data, as is done in existing solutions.

[0110] In this embodiment, upon receiving new service synchronization data from the source host, the new service synchronization data is divided into multiple new data blocks based on the disk offset of the new service synchronization data. The size of each new data block is no larger than the size of the virtual data block. It is determined whether the disk area of ​​each new data block overlaps with the first disk area. If overlap exists, the overlapping area is determined based on the disk area of ​​the new data block. It is also determined whether the size of the new data block is equal to the size of the virtual data block. Based on the determination result, the new data blocks are cached in a sparse file using different methods. This ensures accurate caching of new data blocks in the overlapping area. When a service switching command is subsequently received, the cached data in the overlapping area is synchronized to the target host. After synchronization is complete, the target host is notified to resume booting and complete the system and service startup.

[0111] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the business data synchronization method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0112] This application also provides a business data synchronization device, please refer to... Figure 4 The business data synchronization device includes:

[0113] The overlapping area determination module 10 is used to determine whether there is an overlapping area when receiving new service synchronization data from the source host. The overlapping area refers to the area that overlaps between the first disk area and the second disk area. The first disk area is the disk area corresponding to the operating system startup data of the target host, and the second disk area is the disk area corresponding to the new service synchronization data.

[0114] The non-overlapping data synchronization module 20 is used to synchronize the newly added service synchronization data outside the overlapping area in the second disk area to the target host if the overlapping area exists.

[0115] The business data synchronization device provided in this application, employing the business data synchronization method described in the above embodiments, can solve the technical problem. Compared with the prior art, the beneficial effects of the business data synchronization device provided in this application are the same as those of the business data synchronization method described in the above embodiments, and other technical features in the business data synchronization device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0116] This application provides a business data synchronization device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the business data synchronization method in Embodiment 1 above.

[0117] The following is for reference. Figure 5 The diagram illustrates a structural schematic suitable for implementing a service data synchronization device according to embodiments of this application. The service data synchronization device in embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The business data synchronization device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0118] like Figure 5 As shown, the business data synchronization device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the business data synchronization device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the service data synchronization device to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows service data synchronization devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.

[0119] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0120] The business data synchronization device provided in this application, employing the business data synchronization method described in the above embodiments, can solve the technical problem of business data synchronization. Compared with the prior art, the beneficial effects of the business data synchronization device provided in this application are the same as those of the business data synchronization method described in the above embodiments, and other technical features of the business data synchronization device are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.

[0121] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0122] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0123] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the business data synchronization method described in the above embodiments.

[0124] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0125] The aforementioned computer-readable storage medium may be included in the business data synchronization device; or it may exist independently and not be assembled into the business data synchronization device.

[0126] The aforementioned computer-readable storage medium carries one or more programs. When the aforementioned one or more programs are executed by the business data synchronization device, the business data synchronization device: upon receiving new business synchronization data from the source host, determines whether there is an overlapping region, wherein the overlapping region refers to the region overlapping between a first disk region and a second disk region, wherein the first disk region is the disk region corresponding to the operating system startup data of the target host, and the second disk region is the disk region corresponding to the new business synchronization data; if the overlapping region exists, the new business synchronization data outside the overlapping region in the second disk region is synchronized to the target host.

[0127] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0128] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0129] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0130] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described business data synchronization method, and is capable of solving the technical problem. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the business data synchronization method provided in the above embodiments, and will not be repeated here.

[0131] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the business data synchronization method described above.

[0132] The computer program product provided in this application can solve the technical problem. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the business data synchronization method provided in the above embodiments, and will not be repeated here.

[0133] The above description is only a part of the embodiments of this application and does not limit the scope of protection of this application. All equivalent structural transformations made under the technical concept of this application and using the content of this application specification and drawings, or direct / indirect applications in other related technical fields, are included in the scope of protection of this application.

Claims

1. A method for synchronizing business data, characterized in that, The method includes: When receiving new service synchronization data from the source host, it is determined whether there is an overlapping area. The overlapping area refers to the area that overlaps between the first disk area and the second disk area. The first disk area is the disk area corresponding to the operating system startup data of the target host, and the second disk area is the disk area corresponding to the new service synchronization data. If the overlapping area exists, the newly added service synchronization data outside the overlapping area in the second disk area will be synchronized to the target host; The step of determining whether there is an overlapping region when receiving new service synchronization data from the source host includes: Create a virtual machine based on the target host's hardware configuration information; The virtual machine's disk area is divided into multiple virtual data blocks of equal size based on the disk offset; When new service synchronization data is received from the source host, the new service synchronization data is divided into multiple new data blocks according to the disk offset of the new service synchronization data. The size of the new data block is not greater than the size of the virtual data block. Determine whether the disk area of ​​each newly added data block overlaps with the first disk area; If there is overlap, the overlapping area is determined based on the disk area of ​​the newly added data block.

2. The method as described in claim 1, characterized in that, Before the step of determining whether there is an overlapping area when receiving new service synchronization data from the source host, the method further includes: Receive full machine backup data sent by the source host, and generate a full machine backup point based on the full machine backup data. The full machine backup data includes at least one of the following: operating system, application, business data, and disk metadata. Obtain the hardware configuration information of the target host, and generate the operating system boot data of the target host based on the whole machine backup point and the hardware configuration information; The first disk area is identified as the disk area corresponding to the operating system boot data, and the operating system boot data is pushed to the target host.

3. The method as described in claim 2, characterized in that, The steps of obtaining the hardware configuration information of the target host and generating the operating system boot data of the target host based on the whole machine backup point and the hardware configuration information include: A virtual machine is created based on the hardware configuration information, and the operating system of the virtual machine is started based on the whole machine backup point. The hardware configuration of the virtual machine is consistent with the hardware configuration of the target host. Monitor disk read / write behavior occurring in the virtual machine, obtain the virtual disk area and virtual read / write data corresponding to the disk read / write behavior, and determine the operating system startup data of the target host as the virtual disk area and the virtual read / write data.

4. The method as described in claim 3, characterized in that, The step of monitoring disk read / write behavior occurring in the virtual machine and obtaining the virtual disk area and virtual read / write data corresponding to the disk read / write behavior includes: The virtual machine's disk area is divided into multiple virtual data blocks of equal size based on the disk offset; Monitor whether disk read / write behavior occurs in each virtual data block in the virtual machine, and mark the virtual data block as read / write if disk read / write behavior is detected. The virtual disk area and virtual read / write data are determined in the virtual machine's disk based on the read / write markers.

5. The method as described in claim 1, characterized in that, Following the step of determining the overlapping area based on the disk area of ​​the newly added data block if overlap exists, the method further includes: Determine whether the size of the newly added data block is equal to the size of the virtual data block; If the size is equal to the size of the virtual data block, the newly added data block is cached in the sparse file, and a write mark is added to the cache area corresponding to the newly added data block in the sparse file. The size of the sparse file is consistent with the disk size of the virtual machine. The sparse file is used to record the data synchronized to the target host when a disaster recovery service switching instruction is received. If it is smaller than the size of the virtual data block, then determine whether there is a write mark in the cache area corresponding to the newly added data block in the sparse file; If a write flag exists, the newly added data block is cached in the sparse file; If the size is smaller than the virtual data block and there is no write mark in the cache area corresponding to the newly added data block in the sparse file, then the operating system startup data corresponding to the disk area of ​​the virtual data block in the first disk area is cached in the sparse file, and a write mark is added to the cache area corresponding to the startup data in the sparse file, and the newly added data block is cached in the sparse file.

6. The method as described in claim 1, characterized in that, The step of synchronizing the newly added service synchronization data outside the overlapping area in the second disk area to the target host if the overlapping area exists includes: If the overlapping area exists, the newly added business synchronization data outside the overlapping area in the second disk area is divided into multiple consecutive synchronization data blocks, and the data size of the synchronization data block does not exceed a preset data size threshold. The first synchronized data block is taken as the current data block according to the preset order, the current data block is synchronized to the target host, and a disk write confirmation message is sent to the target host. Upon receiving feedback from the target host after writing the current data block to disk, the next synchronized data block is used as the current data block, and the steps of synchronizing the current data block to the target host and sending disk write confirmation information to the target host are executed until all the new service synchronization data is synchronized to the target host.

7. A business data synchronization device, characterized in that, The business data synchronization device includes: The overlapping area determination module is used to determine whether there is an overlapping area when receiving new service synchronization data from the source host. The overlapping area refers to the area that overlaps between the first disk area and the second disk area. The first disk area is the disk area corresponding to the operating system startup data of the target host, and the second disk area is the disk area corresponding to the new service synchronization data. A non-overlapping data synchronization module is used to synchronize the newly added service synchronization data outside the overlapping area in the second disk area to the target host if the overlapping area exists. The overlapping area determination module is also used to create a virtual machine based on the hardware configuration information of the target host, and to divide the disk area of ​​the virtual machine into multiple virtual data blocks of equal size based on the disk offset. The overlapping area determination module is also used to divide the new service synchronization data into multiple new data blocks according to the disk offset of the new service synchronization data when receiving new service synchronization data from the source host, wherein the size of the new data block is not greater than the size of the virtual data block. The overlapping region determination module is further configured to determine whether the disk region of each newly added data block overlaps with the first disk region; if there is an overlap, the overlapping region is determined based on the disk region of the newly added data block.

8. A business data synchronization device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the business data synchronization method as described in any one of claims 1 to 6.

9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the business data synchronization method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Host backup reconstruction method and device, server and storage medium

    CN110941515A

  • Cloud hard disk data synchronization method and electronic equipment

    CN113726861A

  • Data synchronization method and device, equipment and storage medium

    CN118012677A