CN109326307B - Disc streaming method - Google Patents
Disc streaming method Download PDFInfo
- Publication number
- CN109326307B CN109326307B CN201811045454.5A CN201811045454A CN109326307B CN 109326307 B CN109326307 B CN 109326307B CN 201811045454 A CN201811045454 A CN 201811045454A CN 109326307 B CN109326307 B CN 109326307B
- Authority
- CN
- China
- Prior art keywords
- file
- optical disc
- image
- directory
- disc image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 230000003287 optical effect Effects 0.000 claims abstract description 99
- 230000005856 abnormality Effects 0.000 claims description 4
- 238000013500 data storage Methods 0.000 claims description 2
- 230000009286 beneficial effect Effects 0.000 abstract description 2
- 230000003068 static effect Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000005192 partition Methods 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000010410 layer Substances 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 239000002356 single layer Substances 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11B—INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
- G11B7/00—Recording or reproducing by optical means, e.g. recording using a thermal beam of optical radiation by modifying optical properties or the physical structure, reproducing using an optical beam at lower power by sensing optical properties; Record carriers therefor
- G11B7/002—Recording, reproducing or erasing systems characterised by the shape or form of the carrier
- G11B7/0037—Recording, reproducing or erasing systems characterised by the shape or form of the carrier with discs
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11B—INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
- G11B27/00—Editing; Indexing; Addressing; Timing or synchronising; Monitoring; Measuring tape travel
- G11B27/02—Editing, e.g. varying the order of information signals recorded on, or reproduced from, record carriers
- G11B27/022—Electronic editing of analogue information signals, e.g. audio or video signals
- G11B27/026—Electronic editing of analogue information signals, e.g. audio or video signals on discs
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11B—INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
- G11B7/00—Recording or reproducing by optical means, e.g. recording using a thermal beam of optical radiation by modifying optical properties or the physical structure, reproducing using an optical beam at lower power by sensing optical properties; Record carriers therefor
- G11B7/004—Recording, reproducing or erasing methods; Read, write or erase circuits therefor
- G11B7/0045—Recording
- G11B7/00451—Recording involving ablation of the recording layer
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing For Digital Recording And Reproducing (AREA)
- Management Or Editing Of Information On Record Carriers (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明公开了一种光盘流式刻录方法,包括如下步骤:包括至少两个光盘镜像,用户应用程序不断流式地把文件数据以及文件所在的目录信息写入光盘镜像;光盘镜像包括第一光盘镜像和第二光盘镜像,当使用中的第一光盘镜像的存储空间使用完之后,对文件数据进行分割,把文件一部分数据写入第一光盘镜像,文件的后续数据写入第二光盘镜像。本发明的有益效果为:一方面使得光盘空间效率最大化,另一方面能够在读取时,识别某个文件可能分布在一张或者多张光盘上。
The invention discloses an optical disc streaming recording method, comprising the following steps: including at least two optical disc images, a user application program continuously writes file data and directory information where the files are located into the optical disc images; the optical disc image includes a first optical disc For the mirror image and the second optical disc image, when the storage space of the first optical disc image in use is used up, the file data is divided, a part of the data of the file is written into the first optical disc image, and the subsequent data of the file is written into the second optical disc image. The beneficial effects of the present invention are: on the one hand, the space efficiency of the optical disc is maximized, and on the other hand, it can be recognized that a certain file may be distributed on one or more optical discs during reading.
Description
技术领域technical field
本发明涉及计算机技术领域,具体涉及一种光盘流式刻录方法。The invention relates to the technical field of computers, in particular to a method for stream recording of an optical disc.
背景技术Background technique
目前一般的数据归档存储介质有磁盘、磁带和光盘。其中越来越多重要数据需要长期保存。其中光盘存储具有长期保存维护成本很低的特点,能够可靠保存光盘超过30年。虽然光盘的写性能差且写次数少,但是这恰巧符合冷数据多读少写的特性。所以基于光盘安全性高、可靠性强、寿命长、成本低等特性,越来越多的企业选用了光盘库作为存储介质。At present, the general data archive storage media are magnetic disks, magnetic tapes and optical disks. More and more important data needs to be stored for a long time. Among them, optical disk storage has the characteristics of low maintenance cost for long-term storage, and can reliably store optical disks for more than 30 years. Although the write performance of the optical disc is poor and the number of writes is small, this happens to be in line with the characteristics of cold data read more and write less. Therefore, based on the characteristics of high security, high reliability, long life and low cost of optical discs, more and more enterprises choose optical disc libraries as storage media.
但是目前单张光盘的容量还是比较小的。CD光盘约是700MB,DVD盘片单面4.7GB,最多能刻录约4.59G的数据(因为DVD的1GB=1000MB,而硬盘的1GB=1024MB)(双面8.5GB,最多约能刻8.3GB的数据),蓝光(BD)的则比较大,BD单面单层25GB、双面50GB、四层100GB,目前300GB的光盘也已经面世。日本东京理工大学的全息光盘其容量达到2TB。但这样单盘容量还是无法和硬盘及磁带相比。However, the capacity of a single disc is still relatively small. The CD disc is about 700MB, and the DVD disc is 4.7GB on one side, and can record about 4.59G of data at most (because the DVD's 1GB=1000MB, and the hard disk's 1GB=1024MB) (double-sided 8.5GB, up to about 8.3GB) Data), Blu-ray (BD) is relatively large, BD single-sided single-layer 25GB, double-sided 50GB, four-layer 100GB, the current 300GB disc has also been available. The holographic disc of Tokyo Institute of Technology in Japan has a capacity of 2TB. However, the capacity of a single disk is still not comparable to that of hard disks and tapes.
使用光盘库能够把海量光盘分离的物理空间合并为一个大的逻辑空间,也就是采用光盘库虚拟化机制,把多张光盘对外虚拟成一个大容量存储池。为了提高光盘库系统的整体性能、易用性和可用性,当用户在使用这种光盘库时,数据首先写入光盘库硬盘缓存中的一系列光盘镜像中,一旦某一镜像装满,则封闭该镜像,把其变为只读镜像,最后把该镜像完全刻录对应的物理光盘,因此可以把一个完整的数据集透明刻录到多张物理光盘之上。在实际应用中,用户不断地把数据写入光盘库。系统需要把这种流式写入的文件或者目录,以顺序、合理地写入依次写入一系列光盘镜像中,这要求系统能一方面够自动划分镜像,保证每个镜像不超过光盘大小,同时尽量保证文件目录自身的连续性;另一方面,需要尽量充分使用镜像的存储空间,避免光盘存储空间的浪费。Using the optical disc library can combine the physical space separated by a large number of optical discs into a large logical space, that is, using the optical disc library virtualization mechanism to virtualize multiple optical discs into a large-capacity storage pool externally. In order to improve the overall performance, ease of use and usability of the CD library system, when a user uses this CD library, the data is first written into a series of CD images in the CD library hard disk cache. Once a certain image is full, it will be closed. The image is turned into a read-only image, and finally the image is completely burned to the corresponding physical disc, so a complete data set can be transparently burned to multiple physical discs. In practical applications, users continuously write data into the optical disc library. The system needs to write the stream-written files or directories into a series of disc images sequentially and reasonably. This requires the system to automatically divide the images to ensure that each image does not exceed the size of the disc. At the same time, try to ensure the continuity of the file directory itself; on the other hand, it is necessary to make full use of the storage space of the mirror image to avoid the waste of the storage space of the optical disc.
但是目前针对大容量数据集的光盘刻录的方式,主要使用先完全缓存、后静态分割的方式,也就是把待刻录数据集完整保存在硬盘中,然后再进行数据集静态分割,分割完成之后,把每个分割后的子数据集刻录到光盘中。但是这种静态离线分割方式不适应在线流式刻录模式。在流式刻录情况下,也就是不断有新文件或者目录写入,系统无法事先确定当前写入的目录和文件的大小和边界,也就无法进行静态数据集分割。However, the current method of CD burning for large-capacity data sets mainly uses the method of first fully caching and then statically splitting, that is, the data set to be burned is completely saved in the hard disk, and then the data set is statically divided. After the division is completed, Burn each split sub-data set to disc. However, this static offline segmentation method is not suitable for online streaming recording mode. In the case of streaming recording, that is, new files or directories are constantly being written, the system cannot determine the size and boundaries of the currently written directories and files in advance, and thus cannot perform static data set segmentation.
一个可行方法是把一批文件先保存在硬盘缓存中,然后再采用传统静态划分的方法。但是这需要大量硬盘空间进行缓存本批次待刻录的数据;同时也引入额外的写入数据流和分盘数据流,这两者对于硬盘会进行I/O竞争,从而降低实际数据写入性能;更重要的是,批次划分本身就很困难,在线情况下,不能保证一个批次中文件数据正好是光盘容量的整数倍,那么本批次中的最后一张光盘的剩余空间在下批次刻录过程中也不方便利用。A feasible method is to save a batch of files in the hard disk cache first, and then use the traditional static partition method. However, this requires a lot of hard disk space to cache the data to be recorded in this batch; at the same time, it also introduces additional write data streams and partition data streams, which will compete for I/O with the hard disk, thereby reducing the actual data writing performance. ; More importantly, the batch division itself is very difficult. In the online case, it cannot be guaranteed that the file data in a batch is exactly an integer multiple of the disc capacity, then the remaining space of the last disc in this batch will be in the next batch. It is also inconvenient to use during the recording process.
因此需要一种方法能够实现针对光盘的流式数据刻录,一方面保证存储过程的连续性,另一方面也保证光盘存储空间的存储效率最大化。Therefore, there is a need for a method that can realize streaming data recording for an optical disc, on the one hand, to ensure the continuity of the storage process, and on the other hand, to maximize the storage efficiency of the optical disc storage space.
发明内容SUMMARY OF THE INVENTION
本发明的目的在于提供一种光盘流式刻录方法,一方面使得光盘空间效率最大化,另一方面能够在读取时,识别某个文件可能分布在一张或者多张光盘上。The purpose of the present invention is to provide an optical disc streaming recording method, which on the one hand maximizes the space efficiency of the optical disc, and on the other hand, can recognize that a certain file may be distributed on one or more optical discs during reading.
为实现上述目的,本发明的技术方案是In order to achieve the above object, the technical scheme of the present invention is
一种光盘流式刻录方法,其特征在于,包括如下步骤:A method for stream recording of an optical disc, comprising the steps of:
包括至少两个光盘镜像,用户应用程序不断流式地把文件数据以及文件所在的目录信息写入光盘镜像;At least two disc images are included, and the user application program continuously writes the file data and the directory information where the file is located into the disc images;
光盘镜像包括第一光盘镜像和第二光盘镜像,当使用中的第一光盘镜像的存储空间使用完之后,对文件数据进行分割,把文件一部分数据写入第一光盘镜像,文件的后续数据写入第二光盘镜像。The optical disc image includes a first optical disc image and a second optical disc image. When the storage space of the first optical disc image in use is used up, the file data is divided, a part of the data of the file is written into the first optical disc image, and the subsequent data of the file is written into the second disc image.
优选地,Preferably,
第一光盘镜像和第二光盘镜像中储存的被分割文件中分别增设有标识文件,第一光盘镜像中的标识文件内容包括第二光盘镜像的ID,第二光盘镜像中的标识文件的内容包括第一光盘镜像的ID。The divided files stored in the first optical disc image and the second optical disc image are respectively added with identification files, the content of the identification file in the first optical disc image includes the ID of the second optical disc image, and the content of the identification file in the second optical disc image includes ID of the first disc image.
优选地,当创建目录时,系统为该目录分配光盘簇,并在内存中维护该目录数据的更新,当该目录关闭时,把该目录所涉及的簇写入第一光盘镜像对应位置;Preferably, when creating a directory, the system allocates an optical disc cluster for the directory, and maintains the update of the directory data in the memory, and when the directory is closed, writes the cluster involved in the directory into the corresponding position of the first optical disc image;
如果在写入过程中第一光盘镜像系统报无空闲空间的异常时,则把该目录创建到第二光盘镜像;在第二光盘镜像创建目录时,先在该第二光盘镜像中创建该目录的绝对路径中的所有前序目录,之后创建自己,最后该目录关闭时,把所有更新的簇写入第二光盘镜像所对应的位置。If the first optical disc mirror system reports that there is no free space abnormality during the writing process, the directory will be created in the second optical disc image; when the second optical disc image creates a directory, the directory will be created in the second optical disc image first. All pre-order directories in the absolute path of , then create themselves, and finally when the directory is closed, write all the updated clusters to the corresponding position of the second optical disc image.
优选地,当用户写入文件时,创建该文件绝对路径中的前序目录信息直到根目录;在创建完前序目录后,创建文件元数据,并开始写入文件数据;在创建目录过程中,发生光盘文件系统报无空闲空间的异常时,则把该目录创建到下一张光盘;Preferably, when the user writes a file, the pre-order directory information in the absolute path of the file is created until the root directory; after the pre-order directory is created, the file metadata is created, and the file data is started to be written; in the process of creating the directory , when the disc file system reports that there is no free space, the directory will be created to the next disc;
当文件写入过程中,第一光盘镜像系统报无空闲空间的异常时;选择第二光盘镜像作为后续数据存储的载体,得到第二光盘镜像的ID;During the file writing process, when the first optical disc mirror system reports that there is no free space abnormality; select the second optical disc mirror image as the carrier for subsequent data storage, and obtain the ID of the second optical disc mirror image;
然后检测第一光盘镜像剩余簇数,如果实际剩余空闲簇数大于一个阈值时;在第一光盘镜像中创建第一标识文件,第一标识文件名称由原文件名称和数字标记组成,第一标识文件的内容包括记录该文件后续数据内容所在的第二光盘镜像的ID;在第二光盘镜像中,重新创建该文件绝对路径中的前置目录,然后创建第二标识文件,第二标识文件名称由原文件名称和数字标记组成,第二标识文件的内容包括前部分文件数据所在的第一光盘镜像的ID;最后,把后续数据写入;Then detect the remaining number of clusters in the first optical disc image, if the actual number of remaining free clusters is greater than a threshold; create a first identification file in the first optical disc image, the first identification file name is composed of the original file name and a digital mark, the first identification file The content of the file includes the ID of the second optical disc image where the subsequent data content of the file is recorded; in the second optical disc image, recreate the pre-directory in the absolute path of the file, and then create a second identification file, the second identification file name It is composed of the original file name and the digital mark, and the content of the second identification file includes the ID of the first optical disc image where the previous part of the file data is located; finally, the subsequent data is written;
检测第一光盘镜像剩余簇数时,如果实际剩余簇数小于一个阈值时,则读出文件第一光盘镜像最后阈值大小范围内的簇的内容保存在内存缓存中,并在第一光盘镜像中删除这些簇的内容,在该文件元数据中记录当前文件实际长度;创建第三标识文件,第三标识文件的名称由原文件名和数字标记组成,第三标识文件内容包括记录该文件后续内容的第二光盘镜像的卷号;在第二光盘镜像中,重新创建该文件绝对路径中的前置目录,然后创建第四标识文件,第四标识文件的名称由原文件名称和数字标记组成,第四标识文件的内容包括第一光盘镜像的ID号;最后,把内存中保存的阈值大小范围内的簇的数据以及之后的后续数据依次写入。When detecting the number of remaining clusters in the first optical disc image, if the actual number of remaining clusters is less than a threshold, read out the contents of the clusters within the last threshold size of the first optical disc image and save them in the memory cache, and store them in the first optical disc image. Delete the content of these clusters, record the actual length of the current file in the file metadata; create a third identification file, the name of the third identification file is composed of the original file name and a digital mark, and the content of the third identification file includes recording the subsequent content of the file. The volume number of the second optical disc image; in the second optical disc image, re-create the pre-directory in the absolute path of the file, and then create a fourth identification file, the name of the fourth identification file is composed of the original file name and a digital mark, the first The content of the four-identification file includes the ID number of the first optical disc image; finally, the data of the clusters within the threshold size range stored in the memory and subsequent data are written in sequence.
本发明的工作原理为:1、本发明能够在不知道当前文件目录实际所需分配空间的情况下,流式地在光盘镜像中创建目录和写入文件,当数据写入光盘镜像发生“无空闲空间”(out-of-space)异常时,利用该异常处理过程,把无法创建的目录或者剩余数据写入后续空闲光盘中。这种方法能够简化系统设计,无需实时跟踪一张光盘的剩余空间大小。The working principles of the present invention are as follows: 1. The present invention can create directories and write files in the optical disc image in a streaming manner without knowing the actual allocated space required by the current file directory. When the "out-of-space" (out-of-space) exception occurs, use the exception handling process to write the directory that cannot be created or the remaining data into the subsequent free disc. This approach simplifies system design, eliminating the need to track the amount of space remaining on a disc in real time.
2、光盘镜像在没有封闭时,其内部数据簇内容是可以修改的。本发明利用这一点,当一个光盘镜像剩余空间不足以重建同名的标记文件时,则读取该文件的最后几个簇到内存中,然后清除这个簇的内容,创建相应的标识文件。最后把内存中的几个簇作为后续文件的内容。2. When the disc image is not closed, the content of its internal data cluster can be modified. The present invention utilizes this point, when the remaining space of an optical disc image is not enough to reconstruct a marked file with the same name, the last few clusters of the file are read into the memory, then the content of the cluster is cleared, and a corresponding marking file is created. Finally, several clusters in memory are used as the content of subsequent files.
3、利用一个文件实际至少占用两个簇的原理,一个簇为该文件的元数据,另一个簇文件数据内容,通过保留或者人为产生对于2个簇的空间,从而能够创建标识文件。3. Using the principle that a file actually occupies at least two clusters, one cluster is the metadata of the file, and the other cluster file data content, the identification file can be created by reserving or artificially generating space for the two clusters.
在读某个光盘文件时,如果该文件所在目录含有一个相同文件名但是尾部为特殊标记的文件,先读取文件数据,从元数据中获得文件数据的长度,然后从特殊文件中读出后续文件所在的光盘ID,之后从下一个光盘中按照相同文件路径读出同名特殊文件的数据内容,和前面文件保存内容进行拼接,得到完整的文件数据。When reading a CD file, if the directory where the file is located contains a file with the same file name but a special mark at the end, first read the file data, obtain the length of the file data from the metadata, and then read the subsequent files from the special file The ID of the CD where it is located, and then read the data content of the special file with the same name from the next CD according to the same file path, and spliced with the saved content of the previous file to obtain complete file data.
标识文件具有和该文件相同的文件名称,但是在标识文件尾部增加一个特殊标记,所述特殊标记可以为“+”和序列号,例如第一个分割文件为“+1”,如果该文件在下张光盘中仍需分割,在标记为文件名加“+2”,并依该规则标记该文件的后续分割文件。The identification file has the same file name as the file, but a special mark is added at the end of the identification file. The special mark can be "+" and serial number, for example, the first split file is "+1", if the If the disc still needs to be split, add "+2" to the file name and mark the subsequent split files of the file according to this rule.
本发明的有益效果为:能够在不知道当前写入文件最终大小,或者创建目录实际分配空间的情况下,顺序地创建目录,或者把文件数据写入光盘镜像。通过文件目标的高效分割机制,可以充分利用光盘的存储空间。通过文件名标识机制,确定一个分割文件所在的光盘位置,从而通过合并,还原文件全部内容。The beneficial effect of the present invention is that directories can be created sequentially, or file data can be written into an optical disc image without knowing the final size of the currently written file or the actual allocated space for creating a directory. Through the efficient partitioning mechanism of the file object, the storage space of the optical disc can be fully utilized. Through the file name identification mechanism, the location of the disc where a split file is located is determined, so that the entire content of the file can be restored by merging.
附图说明Description of drawings
图1为本发明中流式光盘刻录的整体流程示意图;1 is a schematic diagram of the overall flow of streaming disc recording in the present invention;
图2为本发明实施例中的创建目录的流程图;2 is a flowchart of creating a directory in an embodiment of the present invention;
图3为本发明实施例中的写入文件的流程图;3 is a flow chart of writing a file in an embodiment of the present invention;
图4为本发明实施例中的读文件的流程图。FIG. 4 is a flowchart of reading a file in an embodiment of the present invention.
具体实施方式Detailed ways
下面结合附图和实施例,对本发明的具体实施方式作进一步描述。以下实施例仅用于更加清楚地说明本发明的技术方案,而不能以此来限制本发明的保护范围。The specific embodiments of the present invention will be further described below with reference to the accompanying drawings and embodiments. The following examples are only used to illustrate the technical solutions of the present invention more clearly, and cannot be used to limit the protection scope of the present invention.
本发明具体实施的技术方案是:The technical scheme of the specific implementation of the present invention is:
实施例:图1为流式光盘刻录的整体流程示意图,图2为创建目录的流程图,图3为写入文件的流程图,图4为读文件的流程图。Embodiment: FIG. 1 is a schematic diagram of the overall flow of streaming optical disc recording, FIG. 2 is a flow chart of creating a directory, FIG. 3 is a flow chart of writing a file, and FIG. 4 is a flow chart of reading a file.
用户应用程序不断流式地把文件、目录写入一组空闲光盘镜像。光盘镜像和物理光盘有相同的物理存储空间,每个字节一一对应,具有全局唯一的镜像标识ID,具有本地文件系统。初始时,镜像能够写入和更改,能够在该镜像中创建和更新目录及文件,当数据写完或者镜像存储空间使用完后,可以主动封闭该镜像,使得其变为只读镜像。只读镜像能够一次性写入一张物理光盘。User applications continuously stream files and directories to a set of free disc images. The optical disk image and the physical optical disk have the same physical storage space, each byte corresponds to each other, has a globally unique image identification ID, and has a local file system. Initially, the image can be written and changed, and directories and files can be created and updated in the image. When the data is written or the image storage space is used up, the image can be automatically closed to make it a read-only image. A read-only image can be written to one physical disc at a time.
文件和目录包含一个绝对目录,也就是从本文件到根目录的完整路径。Files and directories contain an absolute directory, that is, the full path from this file to the root directory.
光盘使用簇作为基本分配存储块单位,每个目录至少包含一个簇,每个文件包含至少2个簇,一个簇放置文件元数据信息;剩下的簇包含文件数据。Optical discs use clusters as the basic allocation storage block unit, each directory contains at least one cluster, each file contains at least 2 clusters, and one cluster contains file metadata information; the remaining clusters contain file data.
本实施例中,如图1所示,假设某一时刻用户需要创建路径为/A/B/C的目录,而当前光盘镜像(ID号为1)文件系统抛出“无空闲空间”(out-of-space)的异常时,将该目录创建到下一张光盘镜像(ID号为2)。In this embodiment, as shown in Figure 1, it is assumed that a user needs to create a directory with a path of /A/B/C at a certain moment, and the file system of the current disc image (ID number is 1) throws a "no free space" (out -of-space), create the directory to the next CD image (ID number is 2).
假设某一时刻用户需要写入路径为/A/B/C.txt的文件(文件内容为aaabbbcccddef…),当写入数据aaabbb后,当前光盘镜像(ID号为3)文件系统抛出“无空闲空间”(out-of-space)的异常时,在当前光盘镜像中创建标识文件,然后把后续文件数据(cccddef…)自动写入下一张光盘镜像(ID号为4),也进行文件标识。Suppose the user needs to write a file whose path is /A/B/C.txt at a certain moment (the content of the file is aaabbbcccddef...), when the data aaabbb is written, the file system of the current disc image (ID number is 3) throws "No When the out-of-space is abnormal, create an identification file in the current disc image, and then automatically write the subsequent file data (cccddef...) into the next disc image (ID number is 4), and also file the file. logo.
下面说明在实施例中本发明具体的工作过程:Describe the concrete working process of the present invention in the embodiment below:
(1)创建目录/A/B/C过程如下:(1) The process of creating the directory /A/B/C is as follows:
(1-1)首先,执行创建目录操作;(1-1) First, perform the create directory operation;
(1-2)当前光盘镜像(ID号为1)文件系统有无抛出“无空闲空间”(out-of-space)异常,若有,则转步骤(1-3);若无,则转步骤(1-5);(1-2) Whether the file system of the current disc image (ID number is 1) throws an "out-of-space" exception, if so, go to step (1-3); if not, then Go to step (1-5);
(1-3)在下一张光盘镜像(ID号为2)创建该目录绝对路径中的所有前序目录(/、/A、/A/B);(1-3) Create all the preceding directories (/, /A, /A/B) in the absolute path of the directory in the next CD image (ID number 2);
(1-4)创建该目录(/A/B/C);(1-4) Create the directory (/A/B/C);
(1-5)将更新的簇写入该目录所在光盘对应位置;(1-5) Write the updated cluster to the corresponding location of the CD where the directory is located;
(1-6)完成创建目录操作。(1-6) Complete the directory creation operation.
(2)写入文件/A/B/C.txt过程如下:(2) The process of writing the file /A/B/C.txt is as follows:
(2-1)首先,执行写入文件操作;(2-1) First, perform the write file operation;
(2-2)当前第一光盘镜像(ID号为3)文件系统有无抛出“无空闲空间”(out-of-space) 异常,若有,则转步骤(2-3);若无,则转步骤(2-15);(2-2) Whether the file system of the current first disc image (ID number 3) throws an "out-of-space" exception, if so, go to step (2-3); if not , then go to step (2-15);
(2-3)选取一张新的空白第二光盘镜像并获取其ID(ID号为4);(2-3) Select a new blank second disc image and obtain its ID (ID number is 4);
(2-4)检测当前第一光盘剩余簇数,若实际剩余空间簇数大于某个阈值(假设为2),则转步骤(2-5);若小于,则转步骤(2-9);(2-4) Detect the number of remaining clusters of the current first disc. If the actual number of remaining space clusters is greater than a certain threshold (assuming 2), go to step (2-5); if it is less than, go to step (2-9) ;
(2-5)在当前第一光盘镜像创建一个具有相同文件名但是尾部增加一个特殊编号标记(假设为“+1”)的新文件(文件名为C+1,文件内容包括该文件后续内容的光盘镜像ID号4);(2-5) Create a new file with the same file name but with a special number mark (assuming "+1") at the end of the current first disc image (the file name is C+1, and the file content includes the subsequent content of the file) The disc image ID number 4);
(2-6)在第二光盘镜像重新创建该文件绝对路径的前置目录(/、/A、/A/B);(2-6) Recreate the pre-directory (/, /A, /A/B) of the absolute path of the file on the second CD-ROM image;
(2-7)在第二光盘镜像创建文件名为元文件名但在尾部增加一个特殊编号标记(假设为“+1”)的新文件(文件名为C+1),并在文件元数据中标识前部分文件所在光盘的ID号3;(2-7) Create a new file (the file name is C+1) with the file name of the meta file name but add a special number mark (assumed to be "+1") at the end of the second disc image, and add the file metadata in the file name. ID number 3 of the disc where the previous part of the file is located;
(2-8)将后续数据写入新文件,转步骤(2-15);(2-8) Write subsequent data to a new file, go to step (2-15);
(2-9)读出最后2簇的数据保存在内存中,并在当前光盘镜像中删除这些数据;(2-9) Read out the data of the last 2 clusters and save them in the memory, and delete these data in the current disc image;
(2-10)在文件C的元数据中记录当前文件的实际长度;(2-10) Record the actual length of the current file in the metadata of file C;
(2-11)在当前第一光盘镜像创建一个具有相同文件名但是尾部增加一个特殊编号标记(假设为“+1”)的新文件(文件名为C+1,新标识文件内容包括记录该文件后续内容的光盘镜像ID号4);(2-11) Create a new file (the file name is C+1) with the same file name but add a special number mark (assumed to be "+1") at the end of the current first disc image, and the content of the new marked file includes recording the CD image ID number of the subsequent content of the file 4);
(2-12)在第二光盘镜像重新创建该文件绝对路径的前置目录(/、/A、/A/B);(2-12) Recreate the pre-directory (/, /A, /A/B) of the absolute path of the file in the second CD-ROM image;
(2-13)在第二光盘镜像创建文件名为元文件名但在尾部增加一个特殊编号标记(假设为“+1”)的新文件(文件名为C+1),并在文件元数据中标识前部分文件所在光盘的ID号3;(2-13) Create a new file (the file name is C+1) with the file name of the meta file name but add a special number mark (assumed to be "+1") at the end of the second disc image, and add the file metadata in the file name. ID number 3 of the disc where the previous part of the file is located;
(2-14)将内存中2个簇的数据及文件后续数据写入新文件;(2-15)完成写入文件操作。(2-14) Write the data of the two clusters in the memory and the subsequent data of the file into a new file; (2-15) Complete the file writing operation.
(3)读文件/A/B/C.txt过程如下:(3) The process of reading the file /A/B/C.txt is as follows:
(3-1)首先,执行读文件操作;(3-1) First, perform the read file operation;
(3-2)该文件所在目录下是否含有一个相同文件名(C)但是尾部为特殊标记(“+1”)的文件,若有,则转步骤(3-3);若无,则转步骤(3-7);(3-2) Whether the directory where the file is located contains a file with the same file name (C) but a special mark (“+1”) at the end, if so, go to step (3-3); if not, go to step (3-3) steps (3-7);
(3-3)从该文件元数据获取文件数据的长度,读取对应的文件数据;(3-3) Obtain the length of the file data from the file metadata, and read the corresponding file data;
(3-4)从特殊文件读取后续文件所在光盘的ID号4;(3-4) Read the ID number 4 of the CD where the subsequent file is located from the special file;
(3-5)从ID号为4的光盘按照相同文件路径(/A/B)读出特殊文件(C+1)的数据内容;(3-5) Read the data content of the special file (C+1) from the CD with ID number 4 according to the same file path (/A/B);
(3-6)将该内容与前面文件内容进行拼接,得到完整文件内容;(3-6) Splicing the content with the previous file content to obtain the complete file content;
(3-7)完成读文件操作。(3-7) Complete the read file operation.
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明技术原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above are only the preferred embodiments of the present invention. It should be pointed out that for those skilled in the art, without departing from the technical principles of the present invention, several improvements and modifications can be made. These improvements and modifications It should also be regarded as the protection scope of the present invention.
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811045454.5A CN109326307B (en) | 2018-09-07 | 2018-09-07 | Disc streaming method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811045454.5A CN109326307B (en) | 2018-09-07 | 2018-09-07 | Disc streaming method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109326307A CN109326307A (en) | 2019-02-12 |
CN109326307B true CN109326307B (en) | 2020-12-11 |
Family
ID=65264572
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811045454.5A Active CN109326307B (en) | 2018-09-07 | 2018-09-07 | Disc streaming method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109326307B (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5497244A (en) * | 1993-01-29 | 1996-03-05 | Scitex Digital Video, Inc. | Method for storage and retrieval of video from disks |
US5724552A (en) * | 1993-07-16 | 1998-03-03 | Kabushiki Kaisha Toshiba | Disk array management unit for distributively recording data in a plurality of disks depending on the data access frequency |
CN1395246A (en) * | 2002-06-14 | 2003-02-05 | 清华大学 | Method for implementing virtual image optical disk and and its system hardware structure |
CN1959649A (en) * | 2006-09-19 | 2007-05-09 | 珠海金山软件股份有限公司 | Method for rebuilding directory structure and recovering data in NTFS volume |
CN101364431A (en) * | 2008-09-23 | 2009-02-11 | 无敌科技(西安)有限公司 | Recording apparatus and method for continuous storage |
CN101542447A (en) * | 2006-12-15 | 2009-09-23 | 松下电器产业株式会社 | Write once recording device |
CN102622431A (en) * | 2012-02-27 | 2012-08-01 | 福建联迪商用设备有限公司 | Stream-oriented file system based on flash and method for reading and writing files |
CN103617250A (en) * | 2013-11-28 | 2014-03-05 | 中经云数据存储科技(北京)有限公司 | File management method based on optical storage array and file format system |
CN104008066A (en) * | 2014-05-26 | 2014-08-27 | 武汉光忆科技有限公司 | File access method and device of optical disc storage system |
CN104616680A (en) * | 2014-12-25 | 2015-05-13 | 武汉光忆科技有限公司 | Repeating data deleting system based on optical disc storage as well as data operating method and device |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3965271B2 (en) * | 2000-05-22 | 2007-08-29 | パイオニア株式会社 | Optical disc playback apparatus and setup method |
WO2006018993A1 (en) * | 2004-08-17 | 2006-02-23 | Matsushita Electric Industrial Co., Ltd. | Authoring device, authoring method, authoring program, and recording medium containing the program |
CN102629941B (en) * | 2012-03-20 | 2014-12-31 | 武汉邮电科学研究院 | Caching method of a virtual machine mirror image in cloud computing system |
CN105989008B (en) * | 2015-01-27 | 2020-06-23 | 炬芯(珠海)科技有限公司 | Method and equipment for writing data into mirror image file |
CN106155626B (en) * | 2016-07-04 | 2019-08-27 | 江苏大学 | A fast and effective method for downloading images in Sparse format for Android |
CN107122133B (en) * | 2017-04-24 | 2020-08-07 | 珠海全志科技股份有限公司 | Data storage method and device |
-
2018
- 2018-09-07 CN CN201811045454.5A patent/CN109326307B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5497244A (en) * | 1993-01-29 | 1996-03-05 | Scitex Digital Video, Inc. | Method for storage and retrieval of video from disks |
US5724552A (en) * | 1993-07-16 | 1998-03-03 | Kabushiki Kaisha Toshiba | Disk array management unit for distributively recording data in a plurality of disks depending on the data access frequency |
CN1395246A (en) * | 2002-06-14 | 2003-02-05 | 清华大学 | Method for implementing virtual image optical disk and and its system hardware structure |
CN1959649A (en) * | 2006-09-19 | 2007-05-09 | 珠海金山软件股份有限公司 | Method for rebuilding directory structure and recovering data in NTFS volume |
CN101542447A (en) * | 2006-12-15 | 2009-09-23 | 松下电器产业株式会社 | Write once recording device |
CN101364431A (en) * | 2008-09-23 | 2009-02-11 | 无敌科技(西安)有限公司 | Recording apparatus and method for continuous storage |
CN102622431A (en) * | 2012-02-27 | 2012-08-01 | 福建联迪商用设备有限公司 | Stream-oriented file system based on flash and method for reading and writing files |
CN103617250A (en) * | 2013-11-28 | 2014-03-05 | 中经云数据存储科技(北京)有限公司 | File management method based on optical storage array and file format system |
CN104008066A (en) * | 2014-05-26 | 2014-08-27 | 武汉光忆科技有限公司 | File access method and device of optical disc storage system |
CN104616680A (en) * | 2014-12-25 | 2015-05-13 | 武汉光忆科技有限公司 | Repeating data deleting system based on optical disc storage as well as data operating method and device |
Also Published As
Publication number | Publication date |
---|---|
CN109326307A (en) | 2019-02-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10521131B2 (en) | Storage apparatus and storage control apparatus | |
Amer et al. | Design issues for a shingled write disk system | |
US9996557B2 (en) | Database storage system based on optical disk and method using the system | |
CN105718217B (en) | A kind of method and device of simplify configuration storage pool data sign processing | |
CN107526689B (en) | Read cache management | |
US10956071B2 (en) | Container key value store for data storage devices | |
CN104850358A (en) | Magnetic-optical-electric hybrid storage system and data acquisition and storage method thereof | |
JPS6258479A (en) | How to write a label for file data | |
US10176183B1 (en) | Method and apparatus for reducing overheads of primary storage while transferring modified data | |
TW201028843A (en) | Method and system for dynamic storage tiering using allocate-on-write snapshots | |
KR20130083356A (en) | A method for metadata persistence | |
CN111475102B (en) | Object storage system based on blue light and storage method thereof | |
KR20050118731A (en) | Format mapping scheme for universal drive device | |
US11221989B2 (en) | Tape image reclaim in hierarchical storage systems | |
CN102968381A (en) | Method for improving snapshot performance by using solid state disk | |
CN108763531A (en) | A kind of MDVR document storage systems and its operation method | |
JP2006293981A (en) | Database storage method and database storage system | |
WO2016082559A1 (en) | Data writing method and storage device | |
CN102520885B (en) | Data management system for hybrid hard disk | |
JP6531574B2 (en) | Storage device, storage device control program and storage device control method | |
JP5141234B2 (en) | Hierarchical storage control device, hierarchical storage control system, hierarchical storage control method used therefor, and program thereof | |
CN109326307B (en) | Disc streaming method | |
US9235352B2 (en) | Datastore for non-overwriting storage devices | |
CN102750111B (en) | A kind of method of RAID bitmap storage | |
US10831624B2 (en) | Synchronizing data writes |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20250402 Address after: No. 32-3 Zhichuang Yitiao Street, Juneng Road, High tech Industrial Zone, Yingtan City, Jiangxi Province, 335000 Patentee after: Jiangxi Shalan Information Technology Co.,Ltd. Country or region after: China Address before: Building 1, No. 2 Jianye Road, Changshu City, Suzhou City, Jiangsu Province, 215500 Patentee before: JIANGSU FINE STORAGE INFORMATION TECHNOLOGY CO.,LTD. Country or region before: China |
|
TR01 | Transfer of patent right |