Hard Disk and Optical Disc Data Mutual Backup System and Method
Through the hard disk and optical disk data mutual backup system and methods, the problems of limited optical disk capacity and limited hard disk life are solved, and efficient mutual backup between hard disk and optical disk is achieved to ensure trustworthy storage of data when replacing hard disks.
Patent Information
- Application Number
- CN202111464761.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-03
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2041-12-03
AI Technical Summary
In the prior art, the capacity of a single optical disk is limited, which is much lower than that of a hard disk, resulting in low data backup efficiency and limited hard disk life, which is prone to inaccessibility of sector failure or overall failure, resulting in unrecoverable data.
It provides a hard disk and optical disk data mutual backup system and method. It backs up the hard disk file volume to the optical disk through the controller, and reconstructs the complete file volume in the hard disk. It utilizes the long-term data storage capability of the optical disk to realize efficient mutual backup between the hard disk, including file volume segmentation strategy and data recovery mechanism.
It realizes efficient backup of hard disk and optical disk, taking into account the daily access performance and long-term reliability of data, ensuring trustworthy storage of data when replacing hard disks.
Smart Images

Figure CN114138202B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer data storage, and particularly relates to a hard disk and optical disc data mutual backup system and method. Background Art
[0002] In the era of big data, data is an important production factor. Therefore, a storage device, system, and mechanism that can store a large amount of data cheaply, conveniently, reliably, and trustworthily for a long time are needed. An optical disc is a storage medium suitable for cheap, long-term, and trustworthy data storage. Without special storage environment requirements, a Blu-ray disc can reliably store data for up to 50 years, and a glass disc can store data for more than thousands of years. An optical disc is composed of a millimeter-level plastic sheet and a micron-level film coating, and its basic material cost is low. In the case of mass production, the cost of an optical disc can be reduced to a very low level. Currently, the common capacities of Blu-ray discs are 25GB, 50GB, 100GB, etc. Blu-ray discs with a capacity of 500GB are also gradually entering the consumer market.
[0003] Currently, the capacity and performance of a single optical disc are still limited, far lower than those of mainstream hard disks and solid state disks (collectively referred to as hard disks for short). However, high-performance hard disks have a lifespan of about five years, and there is also a possibility of partial data loss due to sector failure during normal use. Traditionally, a redundant group can be constructed among multiple hard disks through a disk array method to ensure data availability when a small number of sectors or hard disks fail. However, when a hard disk approaches its lifespan, the hard disks in the disk array may fail simultaneously, resulting in irrecoverable data.
[0004] Therefore, in order to balance the daily access performance and long-term reliability of data, hard disks and optical discs can be mutually backed up. Hard disk data is regularly burned onto optical discs to ensure reliability and feasibility. The hard disk still provides online storage services for front-end applications. Only when hard disk data is lost can it be recovered from the optical disc. More importantly, when the hard disk needs to be replaced, the optical disc data can be restored to the new hard disk as a whole to ensure long-term and trustworthy data storage.
[0005] However, currently the capacity of a single optical disc is much smaller than that of a hard disk. Therefore, large data sets on the hard disk need to be reasonably segmented and then burned onto a series of optical discs. When needed, the physical optical disc and its internal location can be located through the directory and file name.
[0006] In order to better utilize the advantages of optical discs in long-term data storage and at the same time ensure the overall online storage performance of the storage system, a hard disk and optical disc data mutual backup system and its method are proposed. Summary of the Invention
[0007] The purpose of the present invention is to provide a hard disk and optical disk data mutual backup system and method, which is designed to fully utilize the differences in the lifespan, data expiration and access behavior of optical disks and hard disks, realize efficient data backup between hard disks and optical disks, and ensure long-term reliable and trustworthy data storage.
[0008] The present invention is achieved in that:
[0009] On the one hand, the present invention provides a hard disk and optical disk data backup system, including a controller, a hard disk and an optical disk group, wherein the hard disk is a single physical hard disk or a disk array composed of multiple physical hard disks, and the optical disk group includes multiple optical disks. A data channel is provided between the hard disk and the optical disk group for mutual reading and writing of data between the two. The hard disk contains at least one file volume for users to read and write online, and each file volume contains a file directory tree. The top layer of the file directory tree has a unique root node, and the internal files or directories have a name and an absolute path starting from the root. The absolute path plus the name constitute the absolute name of the file or directory, and each absolute name is unique within the file volume to which it belongs; the controller is used to back up the file volume on the hard disk to the optical disk, and to restore the data in the optical disk to the hard disk, so as to reconstruct the complete file volume in the hard disk.
[0010] On the other hand, the present invention provides a hard disk and optical disk data mutual backup method, based on the hard disk and optical disk data mutual backup system, the method comprises:
[0011] Back up the data in the hard disk file volume to the optical disk. During the backup process, according to the capacity of the optical disk and the file volume segmentation strategy, the entire file volume or the updated file volume is divided into one or more sub-file volumes, and each sub-file volume is burned to a disc;
[0012] When a file on the hard disk file volume cannot be accessed, read the data from the corresponding CD and restore it to the hard disk;
[0013] If the hard disk fails as a whole, after replacing the new hard disk, all the CD data will be restored to the new hard disk.
[0014] Furthermore, backing up the data in the hard disk file volume to the optical disk specifically includes:
[0015] Regularly scan the entire file volume on the hard disk to identify files not backed up to optical discs; then perform a depth-first traversal of the file directory tree, accumulating the sizes of backup files one by one until the total capacity reaches the capacity of the optical disc. Then pre-allocate these files to an optical disc image. For each file, create or update its upper directories in the optical disc image according to its absolute path until the root directory, ensuring that the path of the file in the hard disk file volume is the same as the path of the file in the optical disc image. Then copy the file to the optical disc image, and finally set the optical disc image to read-only status; then start accumulating the remaining backup files from scratch until all files to be backed up are allocated to the optical disc image; repeat the above process until all files in the file directory tree to be backed up are copied to the optical disc image; finally, burn the optical disc images to optical discs in batches.
[0016] Furthermore, the method further includes: creating a file backup information record table in the index of each hard disk file or a specific area of the file. After a hard disk file is allocated to one or more optical disc images, record the information of the corresponding backup file in its file backup information record table. After copying the file to the optical disc image, save the identifier of the backup optical disc in the corresponding file backup information record table.
[0017] Furthermore, the file volume splitting strategy includes:
[0018] When allocating the file directories to be backed up to optical discs, first try to allocate all files in a subdirectory to the same optical disc, and secondly try to allocate the corresponding adjacent subdirectories to the same optical disc. The specific process is as follows: scan all file directories to be allocated, and count the total size of the files directly contained in each directory as a unit, excluding the size of its subdirectories; then start counting the total size of the subdirectories and their nested subdirectories from the deepest subdirectory according to depth-first until the capacity of the optical disc is reached, and then allocate these subdirectories and their files to one optical disc; if the files in the top-level subdirectory cannot all be placed on the same optical disc, split the subdirectory files, and according to capacity priority, try to fill the allocated optical disc.
[0019] Furthermore, the file volume splitting strategy further includes:
[0020] Allocate files to an optical disc in units of subdirectories and files. If there is still remaining space on this optical disc, divide a file into two parts. The first part is placed on this optical disc, and the remaining part is placed on the next optical disc, and add a special mark to the absolute file name to indicate that these two files belong to different parts of the same file; and record this situation in the backup file record table, and record the relative position of the data of each split file in the data part of the original file.
[0021] Furthermore, the process of reading data from the corresponding optical disc and restoring it to the hard disk specifically includes:
[0022] If the absolute name of the invalid file is known, search for the corresponding optical disc and internal file in the backup file record table, and restore the corresponding file to the hard disk. If the entire hard disk file volume or a part of it fails, scan all relevant optical discs, and restore each file and its corresponding upper-level directory structure and file one by one. When two files with the same absolute name are found, only restore the latest file.
[0023] Further, the specific process of restoring all optical disc data to a new hard disk includes:
[0024] Read all optical discs one by one, copy the directories and files in the optical discs to the hard disk. If a file already exists in the hard disk, analyze whether there is a splitting mark in the file name. If so, splice the multiple split files into one file. If there is no splitting mark, only keep the latest version file according to the creation time of the file in the optical disc.
[0025] Further, the method further includes:
[0026] According to the predefined fault tolerance method, N data backup optical discs form a group, generating M check optical discs. These N + M optical discs form an optical disc check group. When the number of failed data optical discs is less than or equal to M, all data can still be accessed.
[0027] Further, the method further includes:
[0028] If the failed file or the optical disc where it is located cannot be accessed, determine the optical disc check group where the optical disc is located, read the corresponding data from other optical discs in the optical disc check group, and restore the file or the optical disc data through decoding.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] The hard disk optical disc data mutual backup system and method provided by the present invention fully consider the different lifetimes, data failures, and access behaviors of optical discs and hard disks, realize efficient mutual backup between hard disks and optical discs, and take into account the daily access performance and long-term reliability of data. Regularly burning hard disk data to optical discs ensures reliability and feasibility. The hard disk still provides online storage services for front-end applications. Only when the hard disk data is lost can it be restored from the optical disc. More importantly, when the hard disk needs to be replaced, the optical disc data can be restored to the new hard disk as a whole, ensuring the long-term reliable preservation of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a schematic structural diagram of the hard disk optical disc data mutual backup system provided by an embodiment of the present invention;
[0032] Figure 2A schematic diagram of a file backup information record table of a hard disk and optical disk data backup system provided by an embodiment of the present invention;
[0033] Figure 3 A schematic diagram of a process of backing up data from a hard disk to an optical disk provided by an embodiment of the present invention;
[0034] Figure 4 A flow chart of a file volume segmentation strategy provided by an embodiment of the present invention;
[0035] Figure 5 A schematic diagram of a file volume segmentation strategy provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0037] like Figure 1 As shown, an embodiment of the present invention provides a hard disk and optical disk data backup system, including a controller, a hard disk and an optical disk group, wherein the hard disk is a single physical hard disk or a disk array composed of multiple physical hard disks, the optical disk group includes multiple optical disks, and a data channel is provided between the hard disk and the optical disk group for mutual reading and writing of data between the two. The hard disk contains at least one file volume for users to read and write online, and each file volume contains a file directory tree, the top layer of the file directory tree has a unique root node, and the internal files or directories have a name and an absolute path starting from the root, and the absolute path plus the name constitute the absolute name of the file or directory, and each absolute name is unique in the file volume to which it belongs; the controller is used to back up the file volume on the hard disk to the optical disk, and to restore the data in the optical disk to the hard disk, so as to reconstruct the complete file volume in the hard disk.
[0038] The file volume in the optical disc is a secondary file volume and is accessed only when needed. After all the optical disc file directories are merged, they are consistent with the file volume in the hard disk.
[0039] Preferably, the files and directories in the hard disk file volume are backed up to a set of optical discs in two stages. First, the files are pre-allocated to the optical disc image, and then the prepared optical disc images are batch-recorded onto physical optical discs. During the pre-allocation process, the files and directories to be backed up are allocated to an optical disc image according to the integrity and spatial locality priority strategy. After an optical disc image is full, the remaining files and directories are allocated to the next optical disc image until all the backup files and directories are allocated to the optical disc images. After a set of optical disc images is prepared, they are batch-recorded onto physical optical discs, and the identifier of the physical optical disc is the identifier of the corresponding optical disc image.
[0040] As Figure 2 shown, further preferably, the index of each hard disk file or a specific area of the file contains a file backup information record table. This record table can save the reserved positions in the file header area. After a hard disk file is allocated to one or more optical disc images, the information of the corresponding optical disc backup file will be recorded in the file record table. After the optical disc image is recorded onto the optical disc, the identifier of the backup optical disc is saved in the file backup information record table.
[0041] When the total capacity of the file volume is less than that of a single optical disc, the content of the file volume is stored entirely on one optical disc, and the content of the file volume on the hard disk and the optical disc is exactly the same. When the total capacity of the file volume is greater than that of a single optical disc, the content of the file volume is split and stored on multiple optical discs.
[0042] The embodiment of the present invention also provides a method for mutual backup of hard disk and optical disc data. Based on the hard disk and optical disc data mutual backup system of the above embodiment, the method includes:
[0043] Back up the data in the hard disk file volume to the optical disc. During the backup process, according to the optical disc capacity and based on the file volume splitting strategy, the entire file volume or the updated file volume is divided into one or more sub-file volumes, and each sub-file volume is recorded onto one optical disc;
[0044] When a file in the hard disk file volume cannot be accessed, read the data from the corresponding optical disc and restore it to the hard disk;
[0045] If the entire hard disk fails, after replacing the new hard disk, restore all the optical disc data to the new hard disk as a whole.
[0046] As Figure 3 shown, the specific steps of backing up the data in the hard disk file volume to the optical disc include:
[0047] Regularly scan the entire file volume on the hard disk to identify files that have not been backed up to the optical disc. Then perform a depth-first traversal of the file directory tree, accumulating the sizes of the backup files one by one until the total capacity reaches the capacity of the optical disc. Then pre-allocate these files to an optical disc image. For each file, create or update its upper-level directories in the optical disc image according to its absolute path until the root directory, ensuring that the path of the file in the hard disk file volume is the same as the path of the file in the optical disc image. Then copy the file to the optical disc image, and finally set the optical disc image to read-only status. Then start accumulating the remaining backup files from scratch until all the files to be backed up are allocated to the optical disc image. Repeat the above process until all the files in the file directory tree to be backed up are copied to the optical disc image. Finally, burn the optical disc images in batches to the optical discs.
[0048] Preferably, the method further includes: creating a file backup information record table in a specific area of each hard disk file. After a hard disk file is allocated to one or more optical disc images, record the information of the corresponding backup file in its file backup information record table. After copying the file to the optical disc image, save the identifier of the backup optical disc in the corresponding file backup information record table.
[0049] As Figure 4 shown, further, the file volume splitting strategy includes:
[0050] When allocating the file directories to be backed up to the optical discs, first try to allocate all the files in a subdirectory to the same optical disc, and secondly try to allocate the corresponding adjacent subdirectories to the same optical disc. The specific process is as follows: scan all the file directories to be allocated, and count the total size of the files directly contained in each directory as a unit, excluding the size of its subdirectories. Then start counting the total size of the subdirectories and their nested subdirectories from the deepest subdirectory according to the depth-first method until the capacity of the optical disc is reached, and then allocate these subdirectories and their files to one optical disc. If the files in the top-level subdirectory cannot all be placed on the same optical disc, split the subdirectory files, and according to the capacity priority, try to fill the allocated optical disc. For example, as Figure 5 shown: In this embodiment, file c is in the same subdirectory as files a and b and is allocated to different optical discs.
[0051] Preferably, the file volume splitting strategy further includes:
[0052] Allocate the files to one optical disc in units of subdirectories and files. If there is still remaining space on this optical disc, divide a file into two parts. The first part is placed on this optical disc, and the remaining part is placed on the next optical disc, and add a special mark to the absolute file name to indicate that these two files belong to different parts of the same file. And record this situation in the backup file record table. For example, in Figure 5In the illustrated embodiment, the optical disc capacity is set to 100 GB. If the size of file c and its subdirectories in optical disc 2 is 90 GB, then file d needs to be split into two parts. 10 GB of it is allocated to optical disc 2, and the remaining part is allocated to optical disc 3. Both parts carry complete directory information. And record the relative position of the data of each split file in the data part of the original file. For example, the file in optical disc 2 is the first 10 GB of the original file, and the file in optical disc 3 is the last 90 GB of the original file.
[0053] The file volume splitting strategy greatly improves the utilization rate of the optical disc storage space and enhances the adaptability and performance of the optical disc - hard disk mutual backup system in complex scenarios.
[0054] Further, the process of reading data from the corresponding optical disc and restoring it to the hard disk specifically includes:
[0055] If the absolute name of the failed file is known, then search for the corresponding optical disc and internal file in the backup file record table, and restore the corresponding file to the hard disk; if the entire or part of the hard disk file volume fails, then scan all relevant optical discs, and restore each file and its corresponding upper - level directory structure and file one by one. When two files with the same absolute name are found, only restore the latest file.
[0056] Further, the process of restoring all the optical disc data as a whole to a new hard disk specifically includes:
[0057] Read all optical discs one by one, copy the directories and files in the optical discs to the hard disk. If a file already exists in the hard disk, then analyze whether there is a split mark in the file name. If so, splice the multiple split files into one file. If there is no split mark, then according to the creation time of the file in the optical disc, only retain the latest version of the file.
[0058] Preferably, the method further includes:
[0059] According to the predefined fault - tolerance method, N data backup optical discs form a group, generating M parity optical discs. These N + M optical discs form an optical disc parity group. When the number of failed data optical discs is less than or equal to M, all data can still be accessed. Among them, the process of generating parity optical discs is as follows: when the N data optical discs are ready, generate corresponding parity blocks according to the data blocks at the same offset inside each optical disc, and store them in the corresponding offset data blocks of the parity optical discs.
[0060] Further preferably, if a failed file in the optical disc or the optical disc where the failed file is located cannot be accessed, then determine the optical disc parity group where the optical disc is located, read the corresponding data from other optical discs in the optical disc parity group, and recover the file or the optical disc data through decoding.
[0061] In summary, the hard disk and optical disc data mutual backup system and method provided by the embodiments of the present invention fully consider the different lifetimes, data failures, and access behaviors of optical discs and hard disks, realize efficient mutual backup between hard disks and optical discs, and balance the daily access performance and long-term reliability of data. Regularly burning hard disk data onto optical discs ensures reliability and feasibility. The hard disk still provides online storage services for front-end applications. Only when the hard disk data is lost can it be recovered from the optical disc. More importantly, when the hard disk needs to be replaced, the optical disc data can be restored to the new hard disk as a whole to ensure long-term reliable preservation of data.
[0062] The foregoing are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A hard disk and optical disc data mutual backup system, characterized in that: It includes a controller, a hard disk, and an optical disc group. The hard disk is a single physical hard disk or a disk array composed of multiple physical hard disks. The optical disc group includes multiple optical discs. There is a data channel between the hard disk and the optical disc group for mutual data reading and writing between the two. The hard disk contains at least one file volume for users to read and write online. The hard disk file volume contains a file directory tree. The top layer of the file directory tree has a unique root node. Its internal files or directories have names and absolute paths starting from the root. The absolute path plus the name constitutes the absolute name of the file or directory. Each absolute name is unique within the file volume to which it belongs. The controller is used to back up the file volume on the hard disk to the optical disc, and to restore the data in the optical disc to the hard disk and reconstruct a complete file volume on the hard disk. The files and directories in the hard disk file volume are backed up to a group of optical discs in two stages. First, the files are pre-allocated to the optical disc images, and then the prepared optical disc images are batch-burned to the physical optical discs. During the pre-allocation process, the files and directories to be backed up are allocated to an optical disc image according to the integrity and spatial locality priority strategy. After an optical disc image is full, then the remaining files and directories are allocated to the next optical disc image until all the backed-up files and directories are allocated to the optical disc images. After a group of optical disc images are prepared, they are batch-burned to the physical optical discs. The identifier of the physical optical disc is the identifier of the corresponding optical disc image.
2. A method for mutually backing up hard disk and optical disc data, characterized in that, Based on the hard disk-optical disc data mutual backup system described in claim 1, the method includes: Back up the data in the hard disk file volume to the optical disc. During the backup process, according to the optical disc capacity, the entire file volume or the updated file volume is divided into one or more sub-file volumes according to the file volume segmentation strategy, and each sub-file volume is burned to an optical disc. When a file in the hard disk file volume cannot be accessed, read the data from the corresponding optical disc and restore it to the hard disk. If the hard disk fails as a whole, after replacing it with a new hard disk, restore all the optical disc data to the new hard disk as a whole. The specific steps of backing up the data in the hard disk file volume to the optical disc include: Regularly scan the entire file volume on the hard disk to determine the files not backed up to the optical disc. Then perform a depth-first traversal of the file directory tree, and gradually accumulate the sizes of the backed-up files one by one until the total capacity reaches the optical disc capacity. Then pre-allocate these files to an optical disc image. Each file creates or updates its upper-level directory in the optical disc image according to its absolute path until the root directory to ensure that the path of the file in the hard disk file volume is the same as the path of the file in the optical disc image. Then copy the file to the optical disc image, and finally set the optical disc image to read-only status. Then start accumulating the remaining backed-up files from scratch until all the files to be backed up are allocated to the optical disc images. Repeat the above process until all the files in the file directory tree to be backed up are copied to the optical disc images. Finally, batch-burn the optical disc images to the optical discs. The method further includes: creating a file backup information record table in the index of each hard disk file or a specific area of the file. After a hard disk file is allocated to one or more optical disc images, record the information of the corresponding backup file in its file backup information record table. After copying the file to the optical disc image, save the identifier of the backup optical disc in the corresponding file backup information record table.
3. The hard disk and optical disc data mutual backup method according to claim 2, wherein, The file volume splitting strategy includes: When allocating the file directories to be backed up to the optical disc, first, try to allocate all the files in a subdirectory to the same optical disc as much as possible. Second, try to allocate the corresponding adjacent subdirectories to one optical disc. The specific process is as follows: scan all the file directories to be allocated, and count the total size of the files directly contained in each directory, excluding the size of its subdirectories; then, starting from the deepest subdirectory, count the total size of the subdirectory and its nested subdirectories according to the depth-first method until the capacity of the optical disc is reached, and then allocate these subdirectories and their files to one optical disc; if the files in the top-level subdirectory cannot all be placed on the same optical disc, then split the subdirectory files, and according to the capacity priority, try to fill the allocated optical disc as much as possible.
4. The hard disk and optical disk data mutual backup method according to claim 3, characterized in that, The file volume splitting strategy further includes: Allocate the files to one optical disc in units of subdirectories and files. If there is still remaining space on this optical disc, then split a file into two parts. The first part is placed on this optical disc, and the remaining part is placed on the next optical disc, and add a special mark to the absolute file name to indicate that these two files belong to different parts of the same file; and record this situation in the file backup information record table, and record the relative position of the data of each split file in the data part of the original file.
5. The hard disk - optical disc data mutual backup method according to claim 2, characterized in that, The process of reading data from the corresponding optical disc and restoring it to the hard disk specifically includes: If the absolute name of the failed file is known, then search for the corresponding optical disc and internal file in the file backup information record table, and restore the corresponding file to the hard disk; if the entire hard disk file volume or a part of it fails, then scan all the relevant optical discs, and restore each file and its corresponding upper-level directory structure and file one by one. When two files with the same absolute name are found, only restore the latest file.
6. The hard disk and optical disc data mutual backup method according to claim 2, characterized in that, The process of restoring all the optical disc data to a new hard disk specifically includes: Read all the optical discs one by one, copy the directories and files in the optical disc to the hard disk. If a file already exists in the hard disk, then analyze whether there is a split mark in the file name. If so, splice the split multiple files into one file. If there is no split mark, then according to the creation time of the file in the optical disc, only keep the latest version of the file.
7. The method for mutual backup of hard disk and optical disc data according to claim 2, characterized in that, The method further includes: According to the predefined fault tolerance method, N data backup optical discs form a group, and M check optical discs are generated. These N + M optical discs form an optical disc check group. When the number of failed data optical discs is less than or equal to M, all the data can still be accessed.
8. The hard disk and optical disc data mutual backup method according to claim 7, characterized in that The method further includes: If the failed file or the optical disc where it is located cannot be accessed, then determine the optical disc check group where the optical disc is located, read the corresponding data from other optical discs in the optical disc check group, and restore the file or the optical disc data through decoding.
Citation Information
Patent Citations
Optical disc array tower structure
CN1228582A
Permanent dynamic holding technique for hard discs
CN1609986A