Method for improving CDP real-time data backup speed
By introducing the merged data area in CDP, the client combines and packages multiple I/O requests and writes them to the mirror disk, which solves the problem of low writing speed in the traditional CDP method and achieves more efficient real-time data backup and recovery capabilities.
Patent Information
- Application Number
- CN202410926661.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-10-01
AI Technical Summary
When the traditional block device-based CDP continuous data protection method captures write I/O requests in real time, especially when the iSCSI protocol is used, the write speed is lower than the source block device, resulting in low data backup efficiency and the inability to maintain real-time protection status, which reduces data Recovery point objective.
By creating a virtual block device on the server side, including the real data area, communication control area and merged data area, the client merges and packages multiple I/O requests into large data blocks and writes them into the merged data area, and the server unpacks and processes them. Improve backup speed.
Significantly improves the CDP real-time data backup speed, reduces the number of mirror disk writes, ensures that data is protected in real-time, and improves the reliability of data recovery point targets.
Smart Images

Figure CN118733348A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data storage and backup, and in particular to a method for improving CDP real-time data backup speed. Background Art
[0002] In the traditional block device-based CDP (Continuous Data Protection) continuous data protection method, the server creates a virtual block device with the same size as the client's source block device through a virtual block device driver, and provides the virtual block device to the client as a mirror disk through the iSCSI (Internet Small Computer System Interface) protocol or the FC (Fibre Channel) protocol. The client uses the block device filter driver to synchronously or asynchronously back up the I / O requests of the source block device captured in real time to the mirror disk. The server processes and records the I / O requests through the virtual block device driver, thereby realizing the CDP continuous data protection function.
[0003] When backing up the I / O requests captured in real time, the client of the traditional block device-based CDP continuous data protection method will back up the captured write I / O requests to the mirror disk. In many application scenarios, the write IO request of the client system is generally less than or equal to 4KiB. When a large number of small I / O requests are written to the mirror disk, the transmission efficiency of CDP real-time backup data will be very low, especially the write speed of the mirror disk connected by the iSCSI protocol will be significantly lower than the write speed of the client's source block device, resulting in the overflow of the cache storing I / O requests and the inability to be in the real-time protection state, thereby reducing the RPO (Recovery Point Objective, mainly refers to the amount of data loss that the business system can tolerate) of CDP continuous data protection. Summary of the invention
[0004] In order to solve the above problem, the present invention proposes a method for improving the CDP real-time data backup speed.
[0005] In order to achieve the above object, the present invention is implemented by the following technical solutions: The present invention is a method for improving the CDP real-time data backup speed, comprising the following operations: Step 1, the server creates a virtual block device through a virtual block device driver, wherein the virtual block device includes a real data area, a communication control area, and a merged data area; Step 2: The server connects the virtual block device to the client through the iSCSI protocol or the FC protocol as the client's mirror disk; Step 3: The client backs up the valid data of the source block device to the real data area of the mirror disk through the block replication application; Step 4: The client's block device filter driver captures the I / O requests of the source block device in real time, and adds the captured I / O requests to the request queue. The real-time data synchronization thread merges and packages the I / O requests in the request queue into data blocks, and writes the data blocks to the merged data area of the mirror disk. Step 5: The virtual block device driver on the server side unpacks the data blocks in the merged data area of the virtual block device into I / O requests, and processes and records the I / O requests.
[0006] A further improvement of the present invention is that step 1 specifically includes the following operations: Step 1.1, the client application queries the client's block device information, and sends the queried block device information to the server through RabbitMQ; Step 1.2, the application program at the server side notifies the virtual block device driver at the server side to create a virtual block device according to the block device information received from the client side; In step 1.3, the virtual block device driver of the server creates a virtual block device.
[0007] A further improvement of the present invention is that in step 1.3, when creating the virtual block device, an additional storage space of a preset size is added based on the storage space required by the source block device of the client.
[0008] A further improvement of the present invention is that step 2 specifically includes the following operations: Step 2.1, the application on the server side maps the virtual block device created by the virtual block device driver to an iSCSI target or FC target through the iSCSI protocol or the FC protocol; In step 2.2, the client application discovers and connects to the iSCSI target or FC target through the iSCSI protocol or FC protocol to generate a mirror disk.
[0009] A further improvement of the present invention is that the specific operations of step 3 include: the client's block copy application parses the metadata and file system of the source block device, generates a valid data bitmap of the block device, and backs up the valid data of the source block device to the real data area of the mirror disk according to the valid data bitmap.
[0010] A further improvement of the present invention is that the specific operations of step 4 include: Step 4.1, the client's block device filter driver captures the I / O request of the source block device in real time, clones the captured I / O request and adds it to the request queue, and hands the I / O request to the operating system for further processing; In step 4.2, the real-time data synchronization thread of the client's block device filter driver merges and packages the I / O requests in the request queue into data blocks according to the backup strategy, and writes the data blocks to the merged data area of the mirror disk, wherein the data blocks contain packet header information and I / O request information.
[0011] A further improvement of the present invention is that the specific operation of step 5 includes: the virtual block device driver of the server intercepts the BIO of the virtual block device, and if the BIO is located in the merged data area of the virtual block device, the BIO is unpacked into multiple I / O requests according to the header information in the BIO, and the unpacked I / O requests are written into the real data area of the virtual block device for processing and recording.
[0012] A further improvement of the present invention is that the size of the real data area is consistent with the size of the source block device of the client.
[0013] A further improvement of the present invention is that the size of the communication control area is 2 GiB, which is used to store control messages.
[0014] A further improvement of the present invention is that the size of the merged data area is 10 GiB.
[0015] The beneficial effects of the present invention are as follows: the virtual block device created by the server of the present invention has a newly added merged data area, which is specifically used to store the data blocks after the I / O requests are merged and packaged, and can improve the CDP real-time data backup speed. The client of the present invention merges and packages multiple I / O requests of the block device captured in real time into a large data block, and writes the data block to the merged data area of the mirror disk. The speed of writing a large data block to the mirror disk is significantly higher than the speed of writing a small I / O request to the mirror disk, and significantly reduces the number of times the mirror disk is written, thereby further improving the CDP real-time data backup speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a schematic diagram of the principle of the present invention; Figure 2 is a structural diagram of a virtual block device on the server side in an embodiment of the present invention; Figure 3 is a structural diagram of the header information of the data block in an embodiment of the present invention; Figure 4 is a structural diagram of header information of an I / O request in an embodiment of the present invention; Figure 5 It is a structural diagram of a data block in an embodiment of the present invention. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0018] like Figure 1 As shown, this embodiment is a method for improving the CDP real-time data backup speed, adopting a C / S architecture, and includes the following steps: Step 1: The server creates a virtual block device through the virtual block device driver. Figure 2 As shown, the virtual block device includes a real data area, a communication control area, and a merged data area. In this embodiment, the size of the real data area is consistent with the size of the client's source block device, which is used to store the data of the client's source block device; the size of the communication control area is 2GiB, which is used to store control messages; the size of the merged data area is 10GiB, which is used to store the merged and packaged data blocks. The specific operation steps include: Step 1.1, the client application queries the client's block device information and sends the queried block device information to the server through RabbitMQ (an open source messaging middleware); Step 1.2, the application program at the server side notifies the virtual block device driver at the server side to create a virtual block device according to the block device information received from the client side; Step 1.3, the virtual block device driver of the server creates a virtual block device. When creating a virtual block device, in addition to the storage space required by the source block device of the client, an additional 12GiB of storage space is required, that is, the size of the virtual block device is equal to the size of the source block device of the client plus 12GiB.
[0019] Step 2: The server connects the virtual block device to the client through the iSCSI (Internet Small Computer System Interface) protocol or the FC (Fibre Channel) protocol as the client's mirror disk, including: Step 2.1, the application on the server side maps the virtual block device created by the virtual block device driver to an iSCSI target or FC target through the iSCSI protocol or the FC protocol; In step 2.2, the client application discovers and connects to the iSCSI target or FC target through the iSCSI protocol or FC protocol to generate a mirror disk.
[0020] Step 3: The client backs up the valid data of the source block device to the real data area of the mirror disk through the block copy application, which specifically includes: the client's block copy application parses the metadata and file system of the source block device, generates a valid data bitmap of the block device, and backs up the valid data of the source block device to the real data area of the mirror disk according to the valid data bitmap.
[0021] Step 4: The client's block device filter driver captures the I / O requests of the source block device in real time, adds the captured I / O requests to the request queue, and the real-time data synchronization thread merges and packages the I / O requests in the request queue into data blocks, and writes the data blocks to the merged data area of the mirror disk, which specifically includes: Step 4.1, the client's block device filter driver captures the I / O request of the source block device in real time, clones the captured I / O request and adds it to the request queue, and then passes it to the operating system to continue processing the I / O request; Step 4.2, the real-time data synchronization thread of the client's block device filter driver merges and packages the I / O requests in the request queue into data blocks according to the backup strategy, and writes the data blocks to the merged data area of the mirror disk, where the data blocks contain the header information and the I / O request information, such as Figure 5 As shown in the figure, packed_io_hdr_t represents the header information of the data block. block_io_req_hdr_t represents the header information of the I / O request. The size of the header information of the data block (including the header information and the header information of the I / O request) must be aligned based on 512. bio_req[i] represents the i-th I / O request and is used to store the actual data content of the I / O request. The structure of the header information of the data block is as follows Figure 3 As shown in the figure, size indicates the size of the data block, including the size of the packet header and the size of the I / O request. magic indicates the magic number, which is set to a fixed value for verification. io_hdr_offset indicates the offset position of the header information of the I / O request in the data block. io_hdr_size indicates the size of the header information of all I / O requests. io_data_offset indicates the offset position of the IO data area. io_data_size indicates the sum of the sizes of all I / O requests. io_req_num indicates the number of I / O requests. reserved indicates a reserved field for future expansion. The structure of the header information of the I / O request is as follows: Figure 4As shown in the figure, seq_no represents the sequence number of the I / O request, which is globally unique based on the block device. size represents the size of the I / O request. offset represents the offset position of the I / O request in the block device. reserved1 and reserved2 represent reserved fields for future expansion.
[0022] Step 5: The virtual block device driver on the server unpacks the data blocks in the merged data area of the virtual block device into I / O requests, and processes and records the I / O requests, specifically including: Step 5.1, the virtual block device driver on the server intercepts the BIO (Block Input Output) of the virtual block device. If the BIO is located in the merged data area of the virtual block device, the BIO is unpacked into an I / O request according to the header information in the BIO. In step 5.2, the virtual block device driver on the server side writes the unpacked I / O request to the real data area of the virtual block device for processing and recording.
[0023] If the BIO is located in the real data area of the virtual block device, there is no need to perform unpacking operations, and the I / O request can be directly processed and recorded.
[0024] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have the same meaning as in the context of the prior art, and will not be interpreted with an idealized or overly formal meaning unless defined similarly here.
[0025] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for improving CDP real-time data backup speed, characterized by: The following operations are included: Step 1, the server creates a virtual block device through a virtual block device driver, wherein the virtual block device includes a real data area, a communication control area, and a merged data area; Step 2: The server connects the virtual block device to the client through the iSCSI protocol or the FC protocol as the client's mirror disk; Step 3: The client backs up the valid data of the source block device to the real data area of the mirror disk through the block replication application; Step 4: The client's block device filter driver captures the I / O requests of the source block device in real time, and adds the captured I / O requests to the request queue. The real-time data synchronization thread merges and packages the I / O requests in the request queue into data blocks, and writes the data blocks to the merged data area of the mirror disk. Step 5: The virtual block device driver on the server side unpacks the data blocks in the merged data area of the virtual block device into I / O requests, and processes and records the I / O requests.
2. The method for improving CDP real-time data backup speed according to claim 1, characterized in that: The step 1 specifically includes the following operations: Step 1.1, the client application queries the client's block device information, and sends the queried block device information to the server through RabbitMQ; Step 1.2, the application program at the server side notifies the virtual block device driver at the server side to create a virtual block device according to the block device information received from the client side; In step 1.3, the virtual block device driver of the server creates a virtual block device.
3. The method for improving CDP real-time data backup speed according to claim 2, characterized in that: In step 1.3, when creating the virtual block device, an additional storage space of a preset size is added based on the storage space required by the source block device of the client.
4. The method for improving CDP real-time data backup speed according to claim 1, characterized in that: The step 2 specifically includes the following operations: Step 2.1, the application on the server side maps the virtual block device created by the virtual block device driver to an iSCSI target or FC target through the iSCSI protocol or the FC protocol; In step 2.2, the client application discovers and connects to the iSCSI target or FC target through the iSCSI protocol or FC protocol to generate a mirror disk.
5. The method for improving CDP real-time data backup speed according to claim 1, characterized in that: The specific operations of step 3 include: the block copy application of the client parses the metadata and file system of the source block device, generates a valid data bitmap of the block device, and backs up the valid data of the source block device to the real data area of the mirror disk according to the valid data bitmap.
6. The method for improving CDP real-time data backup speed according to claim 1, characterized in that: The specific operations of step 4 include: Step 4.1, the client's block device filter driver captures the I / O request of the source block device in real time, clones the captured I / O request and adds it to the request queue, and hands the I / O request to the operating system for further processing; In step 4.2, the real-time data synchronization thread of the client's block device filter driver merges and packages the I / O requests in the request queue into data blocks according to the backup strategy, and writes the data blocks to the merged data area of the mirror disk, wherein the data blocks contain packet header information and I / O request information.
7. The method for improving CDP real-time data backup speed according to claim 1, characterized in that: The specific operations of step 5 include: the virtual block device driver of the server intercepts the BIO of the virtual block device, and if the BIO is located in the merged data area of the virtual block device, the BIO is unpacked into multiple I / O requests according to the header information in the BIO, and the unpacked I / O requests are written into the real data area of the virtual block device for processing and recording.
8. The method for improving CDP real-time data backup speed according to claim 1, characterized in that: The size of the real data area is consistent with the size of the source block device of the client.
9. The method for improving CDP real-time data backup speed according to claim 8, characterized in that: The size of the communication control area is 2GiB, which is used to store control messages.
10. The method for improving CDP real-time data backup speed according to claim 9, characterized in that: The size of the merged data area is 10 GiB.
Citation Information
Cited By
Data backup and recovery method and device, electronic equipment and storage medium
CN121070696A
Data backup and recovery methods, devices, electronic equipment and storage media
CN121070696B
