Method, system, device and storage medium for constructing historical data in real-time volume backup
By dividing the mirror volume and log volume into data blocks and creating index bitmaps, the time and space waste caused by storing old data blocks in traditional construction historical data methods is solved, and efficient historical data reconstruction and storage is achieved.
Patent Information
- Application Number
- CN202510258710.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-03-06
AI Technical Summary
Traditional methods of building historical data require the allocation of additional physical space to snapshots to store old data blocks, resulting in waste of time and space.
By dividing the mirrored volume into preset data blocks, real-time change data is recorded in the log volume in units of data blocks, an index bitmap is created, and the log volume, mirror volume, and index bitmap are sent to the user space file system to generate a virtual file.
This method does not require additional space to store newly built volumes, saves reconstruction time and storage space, reduces data input/output operations, reduces the impact of storage system performance, and improves the reliability of data reconstruction.
Smart Images

Figure CN119759295B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data disaster recovery and backup, and relates to a method, system, device and storage medium for constructing historical data in real-time volume backup. Background Art
[0002] Volume real-time backup technology is an important technology in the field of data disaster recovery and backup, which aims to achieve continuous protection and rapid recovery of production volume data. This technology monitors data changes in real time to ensure that the most recent data state can be quickly restored in the event of data loss or system failure, thereby ensuring business continuity and data integrity.
[0003] Volume live backup is divided into two main phases:
[0004] (1) Full synchronization of production volume data: After the task is started, a snapshot is created for the production volume, and the snapshot data is backed up to the server through the network through the backup client to generate a mirror volume;
[0005] (2) Real-time monitoring of production volume data: After the snapshot required for full synchronization is created, the driver module of the backup client will monitor the changes in the production volume, synchronize the real-time change data to the server, and generate a log volume.
[0006] Building historical data means building historical data at any point in time. It allows users to restore to a specific point in time before the accident if the data is accidentally deleted, damaged, or a security incident occurs. Building historical data is generally done after completing the two stages of full synchronization and real-time monitoring of volume real-time backup.
[0007] At present, the traditional method of constructing historical data is to first create a snapshot of the mirror volume at the time of data reconstruction, and write the old data blocks in the log volume from the reconstruction time to the latest time into the snapshot. By retaining complete data blocks for each snapshot, this method ensures that the data state at the specified time point can be accurately restored under any circumstances. However, this method requires allocating additional physical space for snapshots to store old data blocks. In the process of storing old data blocks, it will take a long time to read and write to the disk, resulting in a lot of time and space waste.
[0008] Therefore, how to improve the efficiency of historical data reconstruction in volume real-time backup and reduce the time and space waste caused by storing old data blocks is a technical problem that needs to be solved urgently. Summary of the invention
[0009] In order to solve the technical problems in the above-mentioned background technology, the present invention provides a method, system, device and storage medium for constructing historical data in real-time backup of a volume.
[0010] The technical solution of the present invention to solve the above technical problems is as follows:
[0011] In a first aspect, a method for constructing historical data in real-time volume backup is provided, the method being applied to a server and comprising the steps of:
[0012] Divide the mirror volume into a number of data blocks of preset sizes;
[0013] Record the real-time changing data in the log volume in units of data blocks;
[0014] Create an index bitmap, where the bitmap items of the index bitmap correspond one-to-one to the data blocks of the mirrored volume;
[0015] All data blocks in the log volume and mirror volume from the target time point to the latest time point are traversed in sequence, and the data block pointing information is written into the index bitmap. For the data blocks in the log volume, only the data blocks that have changed for the first time after the target time point are recorded in the index bitmap file and point to the log volume; the remaining data block positions of the index bitmap file are recorded after traversing the mirror volume and point to the mirror volume;
[0016] The log volume, the mirror volume and the index bitmap after the record index are sent to the user space file system to generate a virtual file.
[0017] In a second aspect, a system for constructing historical data in real-time volume backup is provided, the system being applied to a server side and comprising:
[0018] A data block division module, used for dividing the mirror volume into a number of data blocks of preset sizes;
[0019] The log volume recording module is used to record the real-time changes of the production volume in the log volume in units of data blocks;
[0020] An index bitmap creation module is used to create an index bitmap, wherein the bitmap items of the index bitmap correspond one-to-one to the data blocks of the mirror volume;
[0021] An index information recording module is used to sequentially traverse all data blocks in the log volume and the mirror volume from the target time point to the latest time point, and write the data block pointing information into the index bitmap, wherein for the data blocks in the log volume, only the data blocks that have changed for the first time after the target time point are recorded in the index bitmap file and point to the log volume; the positions of the remaining data blocks in the index bitmap file are all recorded after traversing the mirror volume and point to the mirror volume;
[0022] The sending module is used to send the log volume, the mirror volume and the index bitmap after recording the index to the user space file system to generate a virtual file.
[0023] In a third aspect, a computer system is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of constructing historical data in the above-mentioned real-time backup of volumes are implemented.
[0024] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method for constructing historical data in the real-time backup of the volume as described above is implemented.
[0025] The beneficial effects of the present invention are:
[0026] (1) The present invention effectively manages and reconstructs data through bitmap files, does not require additional space to store newly constructed volumes, saves reconstruction time, and saves storage space;
[0027] (2) The present invention only involves traversing the log volume and the mirror volume to construct the index bitmap, and does not involve actual data input / output operations, which effectively reduces the time and space requirements for constructing historical data;
[0028] (3) The present invention reduces the impact on storage system performance by reducing actual data input / output operations, and can also effectively reduce the risk of errors caused by data transmission and operations, improve the reliability of data reconstruction and reduce system load. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0030] Figure 1 A schematic flow chart of a method for constructing historical data in real-time volume backup provided by an embodiment of the present invention.
[0031] Figure 2 A schematic flow chart of a method for constructing historical data in a volume real-time backup using copy-on-write provided in an embodiment of the present invention.
[0032] Figure 3 A schematic diagram of the structure of a historical data construction system in real-time volume backup provided by an embodiment of the present invention.
[0033] Figure 4 A schematic diagram of the structure of an index information recording module provided in an embodiment of the present invention.
[0034] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.
[0035] In the accompanying drawings, the components represented by the reference numerals are listed as follows:
[0036] 310, data block partitioning module; 320, production volume snapshot acquisition module; 330, initial mirror volume generation module; 340, mirror volume update module; 350, log volume recording module; 360, index bitmap creation module; 370, index information recording module; 380, sending module; 3701, mark bitmap creation unit; 3702, log volume pointing information recording unit; 3703, mirror volume pointing information recording unit; 410, processor; 420, communication interface; 430, memory; 440, communication bus. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution 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.
[0038] Building historical data means building historical data at any point in time. It allows users to restore to a specific point in time before the accident if the data is accidentally deleted, damaged, or a security incident occurs. Reconstruction also means allowing users to access and view past data states, which is critical for scenarios such as auditing, compliance checks, data analysis, and research. Building historical data is usually performed after completing full synchronization of volume real-time backup and real-time monitoring.
[0039] At present, the traditional method of constructing historical data is to first create a snapshot of the mirror volume at the time of data reconstruction, and write the old data blocks in the log volume from the reconstruction time to the latest time into the snapshot. By retaining complete data blocks for each snapshot, this method ensures that the data state at the specified time point can be accurately restored under any circumstances. However, this method requires allocating additional physical space for snapshots to store old data blocks. In the process of storing old data blocks, it will take a long time to read and write to the disk, resulting in a lot of time and space waste.
[0040] Therefore, how to improve the efficiency of historical data reconstruction in volume real-time backup and reduce the time and space waste caused by storing old data blocks is a technical problem that needs to be solved urgently.
[0041] In view of the above problems, an embodiment of the present invention provides a method for constructing historical data in real-time volume backup, which is applied to a server. Figure 1 A flow chart of a method for constructing historical data in real-time volume backup provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method includes:
[0042] Step S101, dividing the mirror volume into a number of data blocks of preset sizes.
[0043] It is understandable that the mirror volume refers to a complete copy of the production volume. The mirror volume is not the volume that actually stores user data, but a backup of user data. The server first receives the full initial synchronization data sent from the client. This data is a complete snapshot of the production volume, including the data status at a specific point in time. The server writes the received full initial synchronization data to the disk to obtain the mirror volume on the local side. After that, the server also receives the real-time change data of the production volume and updates the mirror volume on the local side.
[0044] It can also be understood that the data block division of the mirror volume is to enable data management and reconstruction based on data blocks as basic units. The data volume is divided into data blocks of fixed size so that each data block can be identified and processed separately. In addition, if it is planned to divide the data volume into 1M data blocks, then the data volume of the data block = the size of the mirror volume divided by 1M. The embodiment of the present invention does not specifically limit the specific division of the data blocks.
[0045] Step S102: Record the real-time change data in a log volume in units of data blocks.
[0046] It can be understood that the log volume is used to record the sequence of data changes. The log volume records all changes in the production volume since the last backup. The server receives the real-time change data of the production volume, and then writes the real-time change data of the production volume to the disk on the local side to build the log volume.
[0047] The changes in the log volume are recorded in data blocks, which can be modifications, additions, or deletions of data blocks. In addition, the change data recorded in the log volume is in data blocks, which should be understood as the log volume recording changes at the data block level, rather than the log volume itself being divided into data blocks.
[0048] Step S103: create an index bitmap, where bitmap entries of the index bitmap correspond one-to-one to data blocks of the mirror volume.
[0049] It is understandable that the index bitmap is used to indicate which file (log volume 1, log volume 2, mirror volume) and location of each data block to read when reconstructing historical data. The index bitmap is suitable for storing large-scale data sets due to its compact data structure and small storage space occupation, which can effectively improve query performance and reduce data retrieval time.
[0050] Step S104, traverse all data blocks in the log volume and the mirror volume from the target time point to the latest point in turn, and write the data block pointing information into the index bitmap, wherein for the data blocks in the log volume, only the data blocks that have changed for the first time after the target time point are recorded in the index bitmap file and point to the log volume; the remaining data block positions of the index bitmap file are all recorded after traversing the mirror volume and point to the mirror volume.
[0051] It is worth noting that traversing the log volume is to check all recorded data changes, including the addition, deletion or modification of data blocks. These changes record the data blocks that have changed for the first time since the target time point. Traversing the mirror volume is to supplement the location information of data blocks that existed before the target time point and have not changed from the target time point to the latest point. The location information of these data blocks will be recorded as pointing to the mirror volume because they have no change records in the log volume. Integrating this information into the index bitmap can ensure that the index bitmaps of all data blocks can be successfully constructed, thereby ensuring that the location of each data block can be quickly retrieved.
[0052] It is also worth mentioning that, since the same data block may have multiple changes, there will be multiple corresponding change records in the log volume. This embodiment only overwrites the data of the first appearance of a data block, and does not process the data from the second appearance to the nth appearance. This is because the data from the second appearance to the nth appearance are all new changed data, rather than the target (required specified time) data.
[0053] Step S105, sending the log volume, the mirror volume and the index bitmap after recording the index to the user space file system to generate a virtual file.
[0054] It can be understood that the user space file system refers to file system-related programs or libraries running in user space. These programs or libraries can simulate the behavior of the file system, provide file storage and access functions, and rely on the kernel file system of the host operating system to actually store data.
[0055] Virtual files are only used to describe information, not to store data blocks. Since the index bitmap indicates the location of all data blocks of the virtual file, when accessing the virtual file, you can only read the corresponding backup set (i.e., log volume and mirror volume) according to the index bitmap. The storage and retrieval of actual data blocks are scattered in the backup set related files. Therefore, the virtual files generated in the user space file system can improve storage efficiency and access speed, without searching in a single large file, reducing I / O operations and storage space waste.
[0056] This embodiment effectively manages and reconstructs data through bitmap files. The construction process does not involve the reading and writing of actual data, nor does it require additional space to store newly constructed volumes, saving reconstruction time and storage space. It only involves traversing log volumes and mirror volumes to build index bitmaps, and does not involve actual data input / output operations, effectively reducing the time and space requirements for building historical data.
[0057] Based on the above embodiment, in the method, the step S103 includes: creating an initial index bitmap, the index bitmap is composed of a number of index bitmap items, the index bitmap items correspond one-to-one to the divided data blocks, and the constituent elements of the index bitmap items include: data block characteristic description, virtual file identifier, real volume file identifier where the data is located, data length and offset of the real volume file where the data is located.
[0058] It is understandable that the initial index bitmap is a blank bitmap structure, which does not have any data at the beginning, and its bitmap items correspond to the data blocks of the mirror volume one by one. The initial index bitmap is then filled by obtaining information from the log volume and the mirror volume.
[0059] For ease of understanding, the following is a detailed description of the meaning of each element of the index bitmap item:
[0060] (1) Data block characteristic description: This is a description of the attributes or characteristics of a data block, including information such as the type and purpose of the data block, which helps to correctly identify the data block. For example, in a file system, a data block contains the metadata or actual content of a file. The data block characteristic description can indicate whether the data block is used to store the actual content of a file, such as a text file, image file, video file, etc., or is used to store the metadata information of a file, such as the creator, creation date, size, etc.;
[0061] (2) Virtual file identifier: This is a unique identifier used to distinguish different virtual files and help accurately identify and reference a specific virtual file among many files, such as generating an MD5 hash value as the unique identifier of the virtual file identifier;
[0062] (3) The file identifier of the real volume where the data is located: This identifier points to the physical location where the data is actually stored, that is, the specific volume where the data is located, such as a log volume or a mirror volume;
[0063] (4) Data length: also refers to the size of the data block, which helps determine the boundaries of the data block and allocate appropriate storage space when processing data;
[0064] (5) The offset of the actual volume file where the data is located: This is the offset of the starting position of the data block in the storage medium, which helps to quickly locate the exact location of the data block.
[0065] Each constituent element of the index bitmap item in this embodiment provides the location information and basic attributes of the data block, so that the system can effectively store, retrieve and manage the data block.
[0066] Based on the above embodiment, in the method, further, the constituent elements of the index bitmap item also include: one or more of the CRC check value of the data block, the timestamp of the last modification of the data block, the data block status field and the signature of the data block.
[0067] Similarly, for ease of understanding, the following specifically explains the meaning of each element of the index bitmap item:
[0068] (1) CRC checksum of data block: CRC (Cyclic Redundancy Check) is a commonly used checksum method used to detect whether errors occur during data transmission or storage. The CRC checksum helps ensure data integrity.
[0069] (2) The timestamp of the last modification of the data block: records the time when the data block was last modified. This is very helpful for tracking the change history of the data and implementing version control.
[0070] (3) Data block status field: indicates the status of the data block, such as whether it is locked or in use, which helps manage resources and synchronize access;
[0071] (4) Data block signature: used to verify the source and integrity of the data block and ensure that the data has not been tampered with. It can be used in some security-sensitive application scenarios.
[0072] The constituent elements of the index bitmap item of this embodiment further improve the integrity, security and status of the data block, and increase the robustness and security of data management. Of course, according to the needs of the scenario, those skilled in the art can add and supplement other constituent elements. The inventor does not make specific restrictions on this.
[0073] Based on the above embodiment, in the method, step S104 further includes:
[0074] Step S1041, creating a mark bitmap, where the bitmap items of the mark bitmap correspond one-to-one to the data blocks of the mirror volume;
[0075] Step S1042, traverse all data blocks in the log volume from the target time point to the latest time point, record the data blocks that have changed for the first time after the target time point in the index bitmap file as pointing to the log volume, and mark the corresponding bitmap entry in the mark bitmap;
[0076] Step S1043, traverse all data blocks in the mirror volume from the target time point to the latest point in combination with the marked mark bitmap, and determine whether the data block is marked. If so, skip the data block; if not, record it in the index bitmap file as pointing to the mirror volume.
[0077] It is worth mentioning that since the data of the same block is updated repeatedly in the log volume, when constructing the index bitmap, only the data of the earliest appearance of the block is taken and the corresponding bit is marked (which can be marked as 1). When reading the data of the marked data block later, it is skipped directly. This can improve the efficiency of constructing the index bitmap.
[0078] It is also worth mentioning that the mark bitmap can be used not only in the process of traversing mirror volumes, but also in the process of traversing multiple log volumes. For example, after traversing log volume 1, the corresponding bit is marked (it can be marked as 1), and when reading the data of the marked data block during subsequent traversal of log volume 2, it can be skipped directly.
[0079] In addition, those skilled in the art should be able to understand that, in addition to using the identification bitmap to write the data block pointing information into the index bitmap, timestamp recording, difference recording and other methods can also be used. Timestamp recording, that is, maintaining a timestamp field for each data block, recording the time when the data block was last modified, when traversing the volume, comparing the timestamp to determine whether the data block has changed after the target time point; difference recording, that is, recording the difference in the change of the data block, is achieved by recording the change operation of the data block (such as adding, deleting, and modifying). Therefore, this embodiment does not make specific limitations on this.
[0080] However, the present embodiment prefers the marking bitmap, which has good advantages in storage efficiency, query performance and flexibility, and is a relatively efficient implementation method, especially when processing large-scale data.
[0081] Based on the above embodiments, Figure 2 As shown, the method includes:
[0082] Step S201, dividing the mirror volume into a number of data blocks of preset sizes;
[0083] Step S202, after the backup task is started, obtaining a snapshot of the production volume;
[0084] Step S203, generating an initial mirror volume through the production volume snapshot;
[0085] Step S204, writing the real-time changing data into the mirror volume by means of copy-on-write;
[0086] Step S205, recording the real-time change data in the log volume in units of data blocks;
[0087] Step S206, creating an index bitmap, where bitmap entries of the index bitmap correspond one-to-one to data blocks of the mirrored volume;
[0088] Step S207, traversing all data blocks in the log volume and the mirror volume from the target time point to the latest time point in sequence, and writing the data block pointing information into the index bitmap, wherein for the data blocks in the log volume, only the data blocks that have changed for the first time after the target time point are recorded in the index bitmap file and point to the log volume; the positions of the remaining data blocks in the index bitmap file are all recorded after traversing the mirror volume and point to the mirror volume;
[0089] Step S208: Send the log volume, the mirror volume, and the index bitmap after recording the index to the user space file system to generate a virtual file.
[0090] This embodiment uses the Copy-on-Write (COW) technology in the backup task, which can not only efficiently generate the mirror volume, but also save memory and storage space, ensure data consistency, improve concurrent processing capabilities, and improve the efficiency and effect of subsequent processing operations.
[0091] like Figure 3 As shown, in one embodiment, a system for constructing historical data in real-time volume backup is provided, and the system is applied to a server side, including:
[0092] The data block division module 310 is used to divide the mirror volume into a number of data blocks of preset sizes;
[0093] The production volume snapshot acquisition module 320 is used to acquire the production volume snapshot after the backup task is started;
[0094] An initial mirror volume generation module 330 is used to generate an initial mirror volume through a production volume snapshot;
[0095] The mirror volume update module 340 is used to write the real-time change data into the mirror volume through the copy-on-write method;
[0096] The log volume recording module 350 is used to record the real-time changes of the production volume in the log volume in units of data blocks;
[0097] An index bitmap creation module 360, used to create an index bitmap, wherein the bitmap items of the index bitmap correspond one-to-one to the data blocks of the mirrored volume;
[0098] The index information recording module 370 is used to sequentially traverse all data blocks in the log volume and the mirror volume from the target time point to the latest time point, and write the data block pointing information into the index bitmap, wherein for the data blocks in the log volume, only the data blocks that have changed for the first time after the target time point are recorded in the index bitmap file and point to the log volume; the positions of the remaining data blocks in the index bitmap file are all recorded after traversing the mirror volume and point to the mirror volume;
[0099] The sending module 380 is used to send the log volume, the mirror volume and the index bitmap after recording the index to the user space file system to generate a virtual file.
[0100] Based on the above embodiment, the index bitmap creation module 360 also includes: used to create an initial index bitmap, the index bitmap is composed of a number of index bitmap items, the index bitmap items correspond one-to-one to the divided data blocks, and the constituent elements of the index bitmap items include: data block characteristic description, virtual file identifier, real volume file identifier where the data is located, data length and offset of the real volume file where the data is located. Used to create an initial index bitmap, the index bitmap is composed of a number of index bitmap items, the index bitmap items correspond one-to-one to the divided data blocks, and the constituent elements of the index bitmap items include: data block characteristic description, virtual file identifier, real volume file identifier where the data is located, data length and offset of the real volume file where the data is located.
[0101] Based on the above embodiments, Figure 4 As shown, the index information recording module 370 further includes:
[0102] The mark bitmap creation unit 3701 is used to create a mark bitmap, and the bitmap items of the mark bitmap correspond to the data blocks of the mirror volume one by one;
[0103] The log volume pointing information recording unit 3702 is used to traverse all data blocks in the log volume from the target time point to the latest time point, and record the data blocks that have changed for the first time after the target time point as pointing to the log volume in the index bitmap file, and mark the corresponding bitmap item in the mark bitmap;
[0104] The mirror volume pointing information recording unit 3703 is used to traverse all data blocks in the mirror volume from the target time point to the latest point in combination with the marked mark bitmap, and determine whether the data block is marked. If so, skip the data block; if not, record it in the index bitmap file as pointing to the mirror volume.
[0105] The system of this embodiment reduces the impact on the performance of the storage system by reducing the actual data input / output operations, and can also effectively reduce the risk of errors caused by data transmission and operations, improve the reliability of data reconstruction and reduce system load.
[0106] exist Figure 5A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 5 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the following method: dividing the mirror volume into a plurality of data blocks of preset sizes; recording the real-time change data in the log volume in units of data blocks; creating an index bitmap, wherein the bitmap items of the index bitmap correspond to the data blocks of the mirror volume one by one; sequentially traversing all the data blocks in the log volume and the mirror volume from the target time point to the latest point, and writing the data block pointing information into the index bitmap, wherein for the data blocks in the log volume, only the data blocks that change for the first time after the target time point are recorded in the index bitmap file and point to the log volume; the remaining data block positions of the index bitmap file are all recorded after traversing the mirror volume and point to the mirror volume; the log volume, the mirror volume and the index bitmap after recording the index are sent to the user space file system to generate a virtual file.
[0107] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0108] In this embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method for constructing historical data in real-time volume backup described in the above embodiment is implemented.
[0109] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.
[0110] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0111] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0112] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, Ruby, Go, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0113] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A method for constructing historical data in real-time volume backup, characterized in that: The method is applied to the server side and comprises the steps of: Divide the mirror volume into a number of data blocks of preset sizes; Record the real-time changing data in the log volume in units of data blocks; Create an index bitmap, where the bitmap items of the index bitmap correspond one-to-one to the data blocks of the mirrored volume; All data blocks in the log volume and mirror volume from the target time point to the latest time point are traversed in sequence, and the data block pointing information is written into the index bitmap. For the data blocks in the log volume, only the data blocks that have changed for the first time after the target time point are recorded in the index bitmap file and point to the log volume; the remaining data block positions of the index bitmap file are recorded after traversing the mirror volume and point to the mirror volume; The log volume, the mirror volume and the index bitmap after the record index are sent to the user space file system to generate a virtual file.
2. The method for constructing historical data in real-time volume backup according to claim 1, characterized in that: The step of creating an index bitmap further includes: Create an initial index bitmap, which consists of several index bitmap items. The index bitmap items correspond one-to-one to the divided data blocks. The constituent elements of the index bitmap items include: data block feature description, virtual file identifier, real volume file identifier where the data is located, data length and offset of the real volume file where the data is located.
3. The method for constructing historical data in real-time volume backup according to claim 2, characterized in that: The constituent elements of the index bitmap item also include: one or more of a CRC check value of the data block, a timestamp of the last modification of the data block, a data block status field, and a signature of the data block.
4. The method for constructing historical data in real-time volume backup according to claim 1, characterized in that: The step of sequentially traversing all data blocks in the log volume and the mirror volume from the target time point to the latest time point and writing the data block pointing information into the index bitmap also includes: Create a mark bitmap, where the bitmap items of the mark bitmap correspond one-to-one to the data blocks of the mirror volume; Traverse all data blocks in the log volume from the target time point to the latest time point, record the data blocks that have changed for the first time after the target time point in the index bitmap file as pointing to the log volume, and mark the corresponding bitmap entry in the mark bitmap; Combined with the marked mark bitmap, traverse all data blocks in the mirror volume from the target time point to the latest point to determine whether the data block is marked. If so, skip the data block; if not, record it in the index bitmap file as pointing to the mirror volume.
5. The method for constructing historical data in real-time volume backup according to claim 1, characterized in that: Before the step of recording the real-time change data in the log volume in units of data blocks, the method further includes: After the backup task is started, take a snapshot of the production volume; Generate the initial mirror volume through the production volume snapshot; Write the real-time changing data into the mirror volume through the copy-on-write method.
6. A system for constructing historical data in real-time volume backup, characterized in that: The system is applied to the server side and includes: A data block division module, used for dividing the mirror volume into a number of data blocks of preset sizes; The log volume recording module is used to record the real-time changes of the production volume in the log volume in units of data blocks; An index bitmap creation module is used to create an index bitmap, wherein the bitmap items of the index bitmap correspond one-to-one to the data blocks of the mirror volume; An index information recording module is used to sequentially traverse all data blocks in the log volume and the mirror volume from the target time point to the latest time point, and write the data block pointing information into the index bitmap, wherein for the data blocks in the log volume, only the data blocks that have changed for the first time after the target time point are recorded in the index bitmap file and point to the log volume; the positions of the remaining data blocks in the index bitmap file are all recorded after traversing the mirror volume and point to the mirror volume; The sending module is used to send the log volume, the mirror volume and the index bitmap after recording the index to the user space file system to generate a virtual file.
7. The system for constructing historical data in real-time volume backup according to claim 6, characterized in that: The index bitmap creation module also includes: a module for creating an initial index bitmap, the index bitmap is composed of a plurality of index bitmap items, the index bitmap items correspond one-to-one to the divided data blocks, and the constituent elements of the index bitmap items include: a data block characteristic description, a virtual file identifier, a real volume file identifier where the data is located, the data length, and the offset of the real volume file where the data is located. The index bitmap is used to create an initial index bitmap, the index bitmap is composed of a plurality of index bitmap items, the index bitmap items correspond one-to-one to the divided data blocks, and the constituent elements of the index bitmap items include: a data block characteristic description, a virtual file identifier, a real volume file identifier where the data is located, the data length, and the offset of the real volume file where the data is located.
8. The system for constructing historical data in real-time volume backup according to claim 6, characterized in that: The index information recording module further includes: A mark bitmap creation unit, used for creating a mark bitmap, wherein the bitmap items of the mark bitmap correspond one to one with the data blocks of the mirror volume; The log volume pointing information recording unit is used to traverse all data blocks in the log volume from the target time point to the latest point, and for the data blocks that change for the first time after the target time point, record them as pointing to the log volume in the index bitmap file, and mark the corresponding bitmap item in the mark bitmap; The mirror volume pointing information recording unit is used to traverse all data blocks in the mirror volume from the target time point to the latest point in combination with the marked mark bitmap, and determine whether the data block is marked. If so, skip the data block; if not, record it in the index bitmap file as pointing to the mirror volume.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of constructing historical data in the real-time backup of a volume according to any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for constructing historical data in real-time volume backup according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Continuous data protection method
CN104866435A
Continuous data protection system and method combining with snapshot technology
CN105389230A