CN113823331A - Optical disc additional recording method and device and computing equipment - Google Patents

Optical disc additional recording method and device and computing equipment Download PDF

Info

Publication number
CN113823331A
CN113823331A CN202111187337.4A CN202111187337A CN113823331A CN 113823331 A CN113823331 A CN 113823331A CN 202111187337 A CN202111187337 A CN 202111187337A CN 113823331 A CN113823331 A CN 113823331A
Authority
CN
China
Prior art keywords
file
optical disc
storage area
recorded
writing
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.)
Granted
Application number
CN202111187337.4A
Other languages
Chinese (zh)
Other versions
CN113823331B (en
Inventor
张升
徐诗筒
郑幼戈
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Tongxin Software Technology Co ltd
Original Assignee
Chengdu Tongxin Software Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chengdu Tongxin Software Technology Co ltd filed Critical Chengdu Tongxin Software Technology Co ltd
Priority to CN202111187337.4A priority Critical patent/CN113823331B/en
Publication of CN113823331A publication Critical patent/CN113823331A/en
Application granted granted Critical
Publication of CN113823331B publication Critical patent/CN113823331B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B7/00Recording 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/004Recording, reproducing or erasing methods; Read, write or erase circuits therefor
    • G11B7/0045Recording

Abstract

The invention discloses a method, a device and a computing device for additionally recording an optical disc, wherein the method comprises the following steps: analyzing an optical disc file system in an optical disc to acquire metadata of all files in the current optical disc as initial metadata; creating a new optical disc file system, wherein the new optical disc file system comprises a file storage area; writing the initial metadata into the file storage area, acquiring one or more files to be recorded, and writing each file to be recorded into the file storage area to obtain an additional recording packet; and burning the additional burning packet to the optical disc. The optical disc additional recording method simplifies data migration among different operating systems and improves the utilization rate of the optical disc.

Description

Optical disc additional recording method and device and computing equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an optical disc additional recording method, an optical disc additional recording apparatus, and a computing device.
Background
Recording a file into an optical disc is a common data storage method, data storage on the optical disc needs to be managed by a file system, and common file systems used for the optical disc include ISO 9660 and derivative versions thereof (Joliet, Rock ridge) implemented based on the ECMA-119 standard, and a UDF file system implemented based on the ECMA-167 standard.
With the gradual replacement of the Windows operating system by the Linux kernel-based operating system, a unit with a high security requirement needs to migrate the optical disc data of the UDF file system originally used in Windows to the Linux kernel-based operating system, which requires the Linux system to support the additional recording of the optical disc of the UDF file system.
At present, File Explore in Windows operating system does not provide the optical disc recording function based on ISO 9660 File system, but only provides the recording and additional recording functions based on UDF File system. However, brasero in the desktop environment of the most popular optical disc recording tool in the release edition of Linux only supports recording and additional recording of ISO 9660 file system, while k3b in the desktop environment of KDE only supports recording of ISO 9660 and ISO 9660/UDF hybrid file system.
It can be seen that the Linux operating system lacks a tool software for additionally recording the optical disc of the UDF file system. Thus, a new optical disc is needed to be used each time a UDF disc is recorded, resulting in low disc utilization. Moreover, the user needs to operate various commands and configure various parameters, which is very tedious.
Based on this, an additional recording method for optical disc is needed to solve the above problems in the above technical solutions.
Disclosure of Invention
Accordingly, the present invention is directed to a method and apparatus for additionally recording an optical disc, which seek to solve or at least alleviate the above-mentioned problems.
According to an aspect of the present invention, there is provided an optical disc additionally recording method, executed in a computing device, the optical disc including an optical disc file system, the method including the steps of: analyzing the optical disc file system to acquire metadata of all files in the current optical disc as initial metadata; creating a new optical disc file system, wherein the new optical disc file system comprises a file storage area; writing the initial metadata into the file storage area, acquiring one or more files to be recorded, and writing each file to be recorded into the file storage area to obtain an additional recording packet; and burning the additional burning packet to the optical disc.
Optionally, in the optical disc additionally recording method according to the present invention, the step of creating a new optical disc file system includes: creating a blank file with a preset size; and partitioning the blank file to obtain a new optical disc file system.
Optionally, in the method for additionally recording an optical disc according to the present invention, the initial metadata includes a file entry and a file identifier descriptor of each file, and the step of writing the initial metadata into a file storage area includes: locating a file storage area in the new optical disc file system; traversing each file entry in the initial metadata, and judging whether the type corresponding to the file entry is a directory; if so, acquiring each file identifier descriptor under the file entry, and writing the file entry pointed by each file identifier descriptor into the file storage area; and if not, writing the file entry into the file storage area.
Optionally, in the optical disc additional recording method according to the present invention, the step of writing each file to be recorded into the file storage area includes: traversing each file to be recorded, and judging whether the type of the file to be recorded is a directory or not; if so, creating a file entry corresponding to the file to be recorded, and writing each file identifier descriptor under the file entry into the file storage area; if not, creating a file entry corresponding to the file to be recorded, and writing the file entry into the file storage area.
Optionally, in the optical disc additionally recording method according to the present invention, after writing the file entry into the file storage area, the method further includes the steps of: and writing the data of the file to be recorded pointed by the file entry into the file storage area.
Optionally, in the method for additionally recording an optical disc according to the present invention, writing the data of the file to be recorded to which the file entry points into the file storage area includes opening the file to be recorded to which the file entry points; and circularly reading the data in the file to be recorded based on the size of the sector and writing the data into the file storage area.
Optionally, in the method for additionally inscribing an optical disc according to the present invention, the step of inscribing the additional inscribing packet to the optical disc includes: creating a new session structure in the optical disc; and reading the additional recording packet, and writing the data in the additional recording packet into the new session structure.
Optionally, in the optical disc additionally recording method according to the present invention, after writing the initial metadata into the file storage area, the method further includes: the initial metadata is shifted.
Alternatively, in the optical disc additional recording method according to the present invention, the step of offsetting the initial metadata includes: calculating an offset of the initial metadata, and writing the offset into a tag bit of the initial metadata.
Optionally, in the optical disc additional recording method according to the present invention, the optical disc file system is a UDF file system.
According to an aspect of the present invention, there is provided an optical disc additionally recording apparatus residing in a computing device, the optical disc including an optical disc file system, including: the acquisition module is suitable for analyzing the optical disc file system to acquire the metadata of all files in the current optical disc as initial metadata; a creating module adapted to create a new optical disc file system, the new optical disc file system including a file storage area; a write-in module, adapted to write the initial metadata into the file storage area, and adapted to obtain one or more files to be recorded, and write each file to be recorded into the file storage area to obtain an additional recording packet; and a burning module adapted to burn the additional burning packet to the optical disc.
According to an aspect of the present invention, there is provided a computing device comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions comprising instructions for performing the optical disc super-recording method as described above.
According to an aspect of the present invention, there is provided a readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to perform the method as described above.
According to the technical scheme of the invention, the invention provides a method for additionally recording an optical disc, which comprises the steps of writing initial metadata of all files existing on the optical disc into PSPACE of a new UDF file system by establishing a new UDF file system, writing the metadata and file data of each file to be recorded which is additionally recorded at the time into PSPACE, creating to obtain an additionally recorded packet, and further recording the additionally recorded packet into the optical disc by creating a new session structure. Therefore, the invention realizes the additional recording of the UDF File system optical disk in the Linux/UOS operating system, so that the optical disk recorded in the Windows File explorer can be additionally recorded between the Linux/UOS system and the Windows system, thereby being beneficial to simplifying the data migration between different operating systems, improving the utilization rate of the optical disk and reducing the waste of optical disk resources.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
FIG. 1 shows a schematic diagram of a computing device 100, according to one embodiment of the invention;
FIG. 2 shows a flowchart of a method 200 for additionally recording an optical disc according to an embodiment of the present invention;
FIG. 3 illustrates a flow diagram for parsing an optical disc file system according to one embodiment of the invention; and
fig. 4 shows a schematic diagram of an optical disc additionally recording apparatus 400 according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a schematic block diagram of an example computing device 100.
As shown in FIG. 1, in a basic configuration 102, a computing device 100 typically includes a system memory 106 and one or more processors 104. A memory bus 108 may be used for communication between the processor 104 and the system memory 106.
Depending on the desired configuration, the processor 104 may be any type of processing, including but not limited to: a microprocessor (UP), a microcontroller (UC), a digital information processor (DSP), or any combination thereof. The processor 104 may include one or more levels of cache, such as a level one cache 110 and a level two cache 112, a processor core 114, and registers 116. The example processor core 114 may include an Arithmetic Logic Unit (ALU), a Floating Point Unit (FPU), a digital signal processing core (DSP core), or any combination thereof. The example memory controller 118 may be used with the processor 104, or in some implementations the memory controller 118 may be an internal part of the processor 104.
Depending on the desired configuration, system memory 106 may be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 106 may include an operating system 120, one or more applications 122, and program data 124. In some implementations, the application 122 can be arranged to execute instructions on an operating system with program data 124 by one or more processors 104.
Computing device 100 also includes a storage device 132, storage device 132 including removable storage 136 and non-removable storage 138.
Computing device 100 may also include a storage interface bus 134. The storage interface bus 134 enables communication from the storage devices 132 (e.g., removable storage 136 and non-removable storage 138) to the basic configuration 102 via the bus/interface controller 130. At least a portion of the operating system 120, applications 122, and data 124 may be stored on removable storage 136 and/or non-removable storage 138, and loaded into system memory 106 via storage interface bus 134 and executed by the one or more processors 104 when the computing device 100 is powered on or the applications 122 are to be executed.
Computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via the bus/interface controller 130. The example output device 142 includes a graphics processing unit 148 and an audio processing unit 150. They may be configured to facilitate communication with various external devices, such as a display or speakers, via one or more a/V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I/O ports 158. An example communication device 146 may include a network controller 160, which may be arranged to facilitate communications with one or more other computing devices 162 over a network communication link via one or more communication ports 164.
A network communication link may be one example of a communication medium. Communication media may typically be embodied by computer readable instructions, data structures, program modules, and may include any information delivery media, such as carrier waves or other transport mechanisms, in a modulated data signal. A "modulated data signal" may be a signal that has one or more of its data set or its changes made in a manner that encodes information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or private-wired network, and various wireless media such as acoustic, Radio Frequency (RF), microwave, Infrared (IR), or other wireless media. The term computer readable media as used herein may include both storage media and communication media.
Computing device 100 may be implemented as a personal computer including both desktop and notebook computer configurations. Of course, computing device 100 may also be implemented as part of a small-form factor portable (or mobile) electronic device such as a cellular telephone, a digital camera, a Personal Digital Assistant (PDA), a personal media player device, a wireless web-watch device, a personal headset, an application specific device, or a hybrid device that include any of the above functions. And may even be implemented as a server, such as a file server, a database server, an application server, a WEB server, and so forth. The embodiments of the present invention are not limited thereto.
In an embodiment according to the invention, the computing device 100 is configured to perform an optical disc additionally recording method 200 according to the invention. The operating system of the computing device 100 includes a plurality of program instructions for executing the optical disc additionally recording method 200 of the present invention, and the program instructions can instruct the processor to execute the optical disc additionally recording method 200 according to the present invention, so that the computing device 100 can implement the additional recording on the optical disc by executing the optical disc additionally recording method 200 of the present invention.
According to an embodiment of the present invention, the application disposed on the operating system includes an optical disc recording apparatus, which includes a plurality of program instructions for executing the optical disc recording method 200 of the present invention, so that the optical disc recording method 200 of the present invention can be executed in the optical disc recording apparatus.
It should be noted that, before the optical disc additional recording method 200 of the present invention is executed, an optical disc file system is recorded on the optical disc to be additionally recorded, where the optical disc file system is specifically a UDF file system, and the UDF file system includes file data stored on the current optical disc. According to the optical disc additional recording method 200 of the present invention, additional recording can be performed on an optical disc of the UDF file system.
In one implementation, recording the UDF file system on a brand new optical disc can be implemented according to the following method: first, a blank binary file of a suitable size is created, where the blank file size should be smaller than the size of the optical disc medium (CD disc is only 700M, DVD can reach 4.7G), larger than the minimum size of UDF file system metadata (about 1.1M), and the size must be an integer multiple of the size of the optical disc sector (typically 2048 bytes for one sector). Subsequently, the blank file is formatted into a UDF file system by means of a command mkudffs. And mounting the file to a mounting point of the directory tree through a mount command, and copying one or more files to the mounting point. The mount point is then unloaded using the umount command, at which point the files previously copied to the mount point have already been written to the UDF file system. Finally, the UDF file is written into the optical disc by an optical disc recording command (e.g. cdrecord), so that an optical disc with the UDF file system recorded therein is obtained, which can be identified and mounted by various mainstream operating systems.
Fig. 2 shows a flowchart of a method 200 for additionally recording an optical disc according to an embodiment of the present invention. The optical disc additionally recording method 200 can be executed in an operating system of a computing device (e.g., the computing device 100).
According to an embodiment of the present invention, an additional recording packet is created, and an optical disc in which a UDF file system has been recorded is additionally recorded based on the additional recording packet. It should be noted that the file data in the additionally recorded package should contain metadata for all files in the current disc.
According to one embodiment of the invention, the operating system of the computing device may be a Linux operating system, a UOS operating system. The following describes the optical disc recording method 200 in detail by taking Linux operating system as an example.
As shown in fig. 2, the method 200 begins at step S210.
In step S210, an existing optical disc file system (UDF file system) on the optical disc is parsed, so as to obtain metadata of all files in the current optical disc from a current session structure (session), use the obtained metadata of all files in the current optical disc as initial metadata, and store the initial metadata in a memory of the computing device 100, so as to read the initial metadata from the memory when an additional recording package is subsequently created. It should be noted that the number of the holes,
it should be noted that in the embodiment of the present invention, the optical disc file system may specifically be a UDF file system.
Fig. 3 shows a flow diagram for parsing an optical disc file system according to an embodiment of the invention.
As shown in fig. 3, first, by reading the 256 th sector (256 × 2048 bytes position) of the current session of the optical disc, the AVDP (Anchor Volume Descriptor Pointer, which is the 256 th block at the beginning of each session for UDF metadata, can be obtained, and the key information of the UDF file system can be obtained by the AVDP). Here, AVDP can be defined as the following structure:
/*Anchor Volume Descriptor Pointer(ECMA 167r3 3/10.2)*/
struct anchorVolDescPtr
{
tag descTag;
extent _ ad mainVolDescSeqExt; // record the sector and length of the MVDS
extent_ad reserveVolDescSeqExt;
uint8_t reserved[480];
};
Subsequently, the mainvoldesseqext is read from the AVDP, and the sector and length where the MVDS (Main Volume Descriptor Sequence, including a series of metadata of UDF) is located is obtained from the mainvoldesseqext.
Next, an LVD (Logical Volume Descriptor, a metadata located in the MVDS and mainly used for recording the position of the RootFE) and a PD (Partition Descriptor, a metadata located in the MVDS and recording the start address and size of the Partition, all files and directories being stored in the Partition) are obtained from the MVDS.
The method comprises the steps of obtaining the sector position where the current session starts from the locatalcontentuses of the LVD, obtaining the partitionationStartingLocation at the start of the partition from the PD, and calculating the position where the FSD (File Set Descriptor, which is a metadata in the PSPACE) is located according to the two positions. Here, the rootdirectory icb in the FSD records the logical location of the root directory FE.
Then, the location of the root directory FE is located based on the FSD, and a piece of data of the FID length is read. The logical location of the FE is recorded in the FID's ICB so that it can be read to the FE based on the ICB in the FID.
It should be noted that an FE (File Entry) is metadata describing a File, and is located in the PSPACE area of the UDF File system, and there is one FE for each File. The FID (File Identifier Descriptor) is metadata describing a File, and includes an FID for each File in each directory, which records the location of the File FE and the File name of the File.
Next, the reading of the next FID continues with a one FID length unit shift back from the FID, and the reading of the next FE continues with the ICB in the FID.
And determining the file type corresponding to the FE according to the field fileCharacteristics of the FE. If the FE corresponds to a conventional FILE TYPE ICBTAG _ FILE _ TYPE _ REGULAR (0x05), then the variable length space of FE- > extendedAttrAnAllocDescs + FE- > length hExtendedAttr of the FE stores data with the size of a short _ ad TYPE, the position and the length of a logical sector where the data content of the FILE is located are stored, and the binary content of the FILE can be analyzed.
If the file type corresponding to the FE is a directory, the FID of one or more other files is contained under the directory. In this way, the corresponding FE can be read from the ICB in each FID, and file parsing can be performed by repeatedly performing the above steps.
By executing the above method, metadata (including file entry FE, file identifier descriptor FID, etc.) of all files in the current session structure (session) of the UDF optical disc can be obtained, and these metadata are all cached in the memory as initial metadata, so that the initial metadata are directly read from the cached data in the memory when the additional recording packet is created next.
In this way, the initial metadata includes a File Entry (FE) and a File Identification Descriptor (FID) for each file currently stored in the optical disc.
Subsequently, in step S220, a new optical disc file system is created, the new optical disc file system containing a file storage area (PSPACE). Here, the new optical disc file system is a new UDF file system.
In one embodiment, a new optical disc file system (UDF file system) can be obtained by creating a blank file of a predetermined size and partitioning the blank file.
In one implementation, the sector (block) size block _ size of the known UDF file system is 2048 bytes; defining the newly added SIZE of each file as an increment _ SIZE ═ 2 × block _ SIZE byte; each file (SESSION- > num _ dirs) of the last SESSION (i.e., the current SESSION structure described above), and a SIZE SESSION _ SIZE occupied by the directory (SESSION- > num _ files) (SESSION- > num _ dirs + SESSION- > num _ files) byte; additionally recording packets are aligned in 2M, and the SIZE is defined as MIN _ UDF _ IMG _ SIZE which is 2 bytes by 1024 bytes; the total size of the files to be recorded (files _ capacity) and the number of files to be recorded (files _ count) are known. From the above conditions, the SIZE of the blank file FileSize ═ SESSION _ SIZE + (files _ capacity + files _ count · increment _ SIZE) + ((MIN _ UDF _ IMG _ SIZE-1) & (MIN _ UDF _ IMG _ SIZE-1)) bytes can be calculated. Thus, by creating a file with the size of FileSize bytes, the content of the file is all 0, and a blank file with a preset size is obtained.
The size of each sector (block) is known to be 2048 bytes, so that the total number of blocks N of the additionally recorded packets can be calculated as FileSize/2048, and after the structure partition processing is performed on the blank file based on the total block number N of the additionally recorded packets, a new UDF file system can be obtained. Wherein, the partition structure is shown as the following table:
Figure BDA0003299805670000101
Figure BDA0003299805670000111
next, in step S230, the initial metadata is read from the memory, and the read initial metadata is written into a file storage area (PSPACE) of the new UDF file system. And, by obtaining one or more files to be recorded, writing each file to be recorded additionally recorded into a file storage area of a new optical disc file system. And obtaining an additional recording packet according to the initial metadata written into the file storage area and each file to be recorded.
It should be noted that the additional recording packet is a mirror image packet based on the UDF file system, and the additional recording packet obtained after the step S240 is executed includes all the initial metadata, and includes metadata and file data of all the files to be recorded that are additionally recorded this time.
It is understood that the initial metadata contains a File Entry (FE), a File Identification Descriptor (FID) for each file contained on the disc before the additional recording.
In one embodiment, the initial metadata may be written to the file storage area PSPACE of the new UDF file system according to the following method:
the file storage area PSPACE is located in the new optical disc file system.
And traversing each File Entry (FE) in the initial metadata read from the memory, and judging whether the file type corresponding to the file entry is a directory or not for each file entry. Here, by obtaining the value of the fileCharacteristics field in the FE, if the value is ICBTAG _ FILE _ TYPE _ direct (0x04), it can be determined that the FILE TYPE corresponding to the FE is a DIRECTORY. If the value is other, the file type corresponding to the FE is a regular file.
If the file type to which the file entry corresponds is a directory, the file entry contains the FID of one or more files. At this time, each File Identifier Descriptor (FID) under the file entry is acquired, and the file entry FE pointed to by each file identifier descriptor is written into the file storage area PSPACE. Here, the FE pointed to by each FID under the file entry is recursively traversed, and whether the file type corresponding to the FE is a directory is determined until the last FE corresponds to the directory is recursively traversed.
If the file type corresponding to the file entry is not a directory, i.e. the type corresponding to the file entry is a file, the file entry FE is directly written into the file storage area PSPACE in sequence.
In addition, after each file entry FE, file identification descriptor FID contained in the initial metadata is written to the PSPACE, all the written initial metadata is offset. That is, all of the initial metadata is written to the offset data. Each piece of initial metadata includes a predefined structure tag descTag, which includes a tag bit (tag location) for recording an offset. And calculating to obtain the offset of each metadata, and writing the offset of each metadata into the tag bit tagLocation in each metadata.
In one implementation, tag descTag may be defined by the following structure:
/*Descriptor Tag(ECMA 167r3 3/7.2)*/
typedef struct
{
uint16_t tagIdent;
uint16_t descVersion;
uint8_t tagChecksum;
uint8_t reserved;
uint16_t tagSerialNum;
uint16_t descCRC;
uint16_t descCRCLength;
agent 32_ t tag location; // record offset
}tag。
In one embodiment, the step of writing each file to be recorded into the file storage area PSPACE comprises:
and traversing each file to be recorded, and judging whether the type of the file to be recorded is a directory or not for each file to be recorded.
If the type of the file to be recorded is a directory, creating a file entry corresponding to the file to be recorded, and writing each File Identifier Descriptor (FID) under the file entry into a file storage area.
If the type of the file to be recorded is not a directory (is a file), a file entry corresponding to the file to be recorded is created, and the file entry is written into the file storage area. Here, the file entries FE are written in order into the corresponding sectors in the file storage area.
In one implementation, by creating a blank FE object, the value ICBTAG _ FILE _ TYPE _ DIRECTORY (0x04) is written into the fileCharacteries field to indicate that the FILE TYPE corresponding to the FE is a DIRECTORY. Subsequently, a blank FID object is created, and the attribute information (e.g., creation time, authority, etc.) of the directory corresponding to the FE is written into the FID. Then, the FID is written into the corresponding file entry of the directory in which the FID is located. Then, the file size occupied by the directory FID is obtained and recorded in the informationLength field in the FE, and the FE of the directory is written to the next sector in sequence.
In addition, after the file entry is written in the file storage area, the file data (binary data) of the file to be recorded to which the file entry points is also written in the file storage area PSPACE.
Specifically, the to-be-recorded file pointed by the file entry is opened by a system call open. Subsequently, by the system call read, the data in the file to be recorded is read cyclically based on the sector size (2048 bytes), and the data of the sector size read each time is written into the file storage area PSPACE until all the data in the file to be recorded is read and written into the file storage area.
Next, the file entry FE and the file identifier descriptor FID of the file to be recorded written in the file storage area in step S240 are shifted according to the data shifting method described above. Namely, by calculating the offset of each metadata of the file to be burned, and writing the offset of each metadata into the tag bit tagLocation in each metadata. Therefore, the offset of the FE and the FID written in the file to be recorded at this time can be modified.
Finally, in step S240, the additional recording packet is recorded to the optical disc.
In particular by creating a new session structure in the optical disc. And reading the additional recording packet, and writing the data in the additional recording packet into a new session structure based on the size of the sector, thereby recording the additional recording packet onto the optical disc.
In one implementation, the additional recording packet may be recorded to the optical disc by:
the open function is called to open the optical drive by means of O _ RDWR | O _ noblockk to get the file descriptor ofd. And opening the file to be recorded in the additionally recorded packet through the O _ RDONLY to obtain a descriptor ifd of the file to be recorded. Subsequently, data is written in a sector size from a specified position. Calling the lead function reads 2048 bytes long data from the specified offset and WRITEs the data to the optical drive via the ioctl (ofd, SG _ IO, someObject) function, where the critical command GPCMD _ WRITE _10 can be used, looping the process until the data read is complete. In addition, after the data writing is completed, the current session (i.e., the new session structure) needs to be closed. Here, the CLOSE session structure may be implemented by an ioctl function using a key command GPCMD _ CLOSE _ TRACK.
Fig. 4 shows a schematic diagram of an optical disc additionally recording apparatus 400 according to an embodiment of the present invention. The optical disc recording apparatus 400 resides in a computing device (e.g., the computing device 100).
As shown in fig. 4, the optical disc recording apparatus 400 includes an obtaining module 410, a creating module 420, a writing module 430, and a recording module 440 connected in sequence.
The obtaining module 410 may parse the optical disc file system to obtain metadata of all files in the current optical disc as the initial metadata. The creation module 420 is adapted to create a new optical disc file system, where the new optical disc file system contains the file storage area PSPACE. The write module 430 may write the initial metadata into the file storage area PSPACE, obtain one or more files to be recorded, and write each file to be recorded into the file storage area to obtain an additional recording packet. Finally, the recording module 440 records the additional recording packet to the optical disc.
It should be noted that the obtaining module 410 is configured to perform the step S210, the creating module 420 is configured to perform the step S220, the writing module 430 is configured to perform the step S230, and the recording module 440 is configured to perform the step S240. Here, for the specific execution logic of the obtaining module 410, the creating module 420, the writing module 430, and the recording module 440, reference is made to the description of the steps S210 to S240 in the method 200, and details are not repeated here.
According to the optical disc additional recording scheme of the present invention, a new UDF file system is established, the initial metadata of all existing files on the optical disc is written into the PSPACE of the new UDF file system, and the metadata and file data of each file to be recorded that is additionally recorded this time are written into the PSPACE, so as to create an additional recording packet, and further, the additional recording packet is recorded into the optical disc by creating a new session structure. Therefore, the invention realizes the additional recording of the UDF File system optical disk in the Linux/UOS operating system, so that the optical disk recorded in the Windows File explorer can be additionally recorded between the Linux/UOS system and the Windows system, thereby being beneficial to simplifying the data migration between different operating systems, improving the utilization rate of the optical disk and reducing the waste of optical disk resources.
A8, the method of any one of A1-A7, wherein after writing the initial metadata to the file storage area, further comprising the steps of: the initial metadata is shifted.
A9, the method of A8, wherein the step of offsetting the initial metadata comprises: calculating an offset of the initial metadata, and writing the offset into a tag bit of the initial metadata.
A10, the method according to any of a1-a9, wherein the optical disc file system is a UDF file system.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U.S. disks, floppy disks, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the computing device will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to execute the optical disc additionally recording method according to the instructions in the program codes stored in the memory.
By way of example, and not limitation, readable media may comprise readable storage media and communication media. Readable storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with examples of this invention. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
Furthermore, some of the described embodiments are described herein as a method or combination of method elements that can be performed by a processor of a computer system or by other means of performing the described functions. A processor having the necessary instructions for carrying out the method or method elements thus forms a means for carrying out the method or method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is used to implement the functions performed by the elements for the purpose of carrying out the invention.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this description, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The present invention has been disclosed in an illustrative rather than a restrictive sense, and the scope of the present invention is defined by the appended claims.

Claims (10)

1. An optical disc additional recording method, executed in a computing device, wherein the optical disc includes an optical disc file system, the method comprising the steps of:
analyzing the optical disc file system to acquire metadata of all files in the current optical disc as initial metadata;
creating a new optical disc file system, wherein the new optical disc file system comprises a file storage area;
writing the initial metadata into the file storage area, acquiring one or more files to be recorded, and writing each file to be recorded into the file storage area to obtain an additional recording packet; and
and recording the additional recording packet to the optical disc.
2. The method of claim 1, wherein the step of creating a new optical disc file system comprises:
creating a blank file with a preset size;
and partitioning the blank file to obtain a new optical disc file system.
3. The method of claim 1 or 2, wherein the initial metadata comprises a file entry, a file identification descriptor for each file, and the step of writing the initial metadata to a file storage area comprises:
locating a file storage area in the new optical disc file system;
traversing each file entry in the initial metadata, and judging whether the type corresponding to the file entry is a directory;
if so, acquiring each file identifier descriptor under the file entry, and writing the file entry pointed by each file identifier descriptor into the file storage area;
and if not, writing the file entry into the file storage area.
4. A method according to any one of claims 1-3, wherein writing each file to be inscribed in the file storage area comprises:
traversing each file to be recorded, and judging whether the type of the file to be recorded is a directory or not;
if so, creating a file entry corresponding to the file to be recorded, and writing each file identifier descriptor under the file entry into the file storage area;
if not, creating a file entry corresponding to the file to be recorded, and writing the file entry into the file storage area.
5. The method of claim 4, wherein after writing the file entry to the file storage area, further comprising the steps of:
and writing the data of the file to be recorded pointed by the file entry into the file storage area.
6. The method of claim 5, wherein writing the data of the file to be burned to which the file entry points to the file storage area comprises:
opening the file to be recorded pointed by the file entry;
and circularly reading the data in the file to be recorded based on the size of the sector and writing the data into the file storage area.
7. The method of any one of claims 1-6, wherein burning the supplemental burn package to the optical disc comprises:
creating a new session structure in the optical disc;
and reading the additional recording packet, and writing the data in the additional recording packet into the new session structure.
8. An optical disc additionally recording device residing in a computing device, the optical disc including an optical disc file system, comprising:
the acquisition module is suitable for analyzing the optical disc file system to acquire the metadata of all files in the current optical disc as initial metadata;
a creating module adapted to create a new optical disc file system, the new optical disc file system including a file storage area;
a write-in module, adapted to write the initial metadata into the file storage area, and adapted to obtain one or more files to be recorded, and write each file to be recorded into the file storage area to obtain an additional recording packet; and
and the recording module is suitable for recording the additional recording packet to the optical disc.
9. A computing device, comprising:
at least one processor; and
a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the program instructions comprising instructions for performing the method of any of claims 1-7.
10. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method of any of claims 1-7.
CN202111187337.4A 2021-10-12 2021-10-12 Optical disc additional recording method and device and computing equipment Active CN113823331B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111187337.4A CN113823331B (en) 2021-10-12 2021-10-12 Optical disc additional recording method and device and computing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111187337.4A CN113823331B (en) 2021-10-12 2021-10-12 Optical disc additional recording method and device and computing equipment

Publications (2)

Publication Number Publication Date
CN113823331A true CN113823331A (en) 2021-12-21
CN113823331B CN113823331B (en) 2023-02-28

Family

ID=78916470

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111187337.4A Active CN113823331B (en) 2021-10-12 2021-10-12 Optical disc additional recording method and device and computing equipment

Country Status (1)

Country Link
CN (1) CN113823331B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114446328A (en) * 2021-12-27 2022-05-06 奇安信科技集团股份有限公司 Optical disk recording auditing method and device
CN114512151A (en) * 2021-12-28 2022-05-17 奇安信科技集团股份有限公司 Method and system for auditing and controlling optical disc recording
CN116778975A (en) * 2023-05-29 2023-09-19 上海沪方软件有限公司 Method and device for additionally recording optical disc, electronic equipment and readable storage medium
CN116774927A (en) * 2023-05-29 2023-09-19 上海沪方软件有限公司 Optical disk data management method, optical disk data management device, electronic equipment and readable storage medium

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2732497A1 (en) * 1995-04-03 1996-10-04 Ambre Sarl Digital audio and text information recording method
US20050175317A1 (en) * 2003-12-13 2005-08-11 Samsung Electronics Co., Ltd. Method of converting file system format and apparatus thereof
EP1811382A1 (en) * 2004-09-17 2007-07-25 Pioneer Corporation Information recording medium, information recording device and method, information reproducing device and method, and computer program
JP2009016010A (en) * 2007-07-09 2009-01-22 Canon Inc File management method
CN101527152A (en) * 2008-03-06 2009-09-09 深圳迈瑞生物医疗电子股份有限公司 Method for realizing editable CD file data
US20110167049A1 (en) * 2010-01-05 2011-07-07 Apple Inc. File system management techniques for computing environments and systems
US20130028062A1 (en) * 2011-02-28 2013-01-31 Mediatek Singapore Pte. Ltd. Optical disc drive and method of accessing optical disc
CN103198102A (en) * 2013-03-20 2013-07-10 广东欧珀移动通信有限公司 Transfer method and device of Android equipment internal hard disk file system
CN104123952A (en) * 2014-07-18 2014-10-29 武汉光忆科技有限公司 Cache-free disc burning method and device
CN105488153A (en) * 2015-11-27 2016-04-13 北京北信源软件股份有限公司 Method and device for appending mirror image based on binary stream
CN107735774A (en) * 2015-05-05 2018-02-23 华为技术有限公司 A kind of SMR perceives only additional file system
CN112530467A (en) * 2019-10-08 2021-03-19 北京中科开迪软件有限公司 Optical disk storage additional recording method and system
CN113066515A (en) * 2021-04-14 2021-07-02 统信软件技术有限公司 Optical disc recording method, computing equipment and readable storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2732497A1 (en) * 1995-04-03 1996-10-04 Ambre Sarl Digital audio and text information recording method
US20050175317A1 (en) * 2003-12-13 2005-08-11 Samsung Electronics Co., Ltd. Method of converting file system format and apparatus thereof
EP1811382A1 (en) * 2004-09-17 2007-07-25 Pioneer Corporation Information recording medium, information recording device and method, information reproducing device and method, and computer program
JP2009016010A (en) * 2007-07-09 2009-01-22 Canon Inc File management method
CN101527152A (en) * 2008-03-06 2009-09-09 深圳迈瑞生物医疗电子股份有限公司 Method for realizing editable CD file data
US20110167049A1 (en) * 2010-01-05 2011-07-07 Apple Inc. File system management techniques for computing environments and systems
US20130028062A1 (en) * 2011-02-28 2013-01-31 Mediatek Singapore Pte. Ltd. Optical disc drive and method of accessing optical disc
CN103198102A (en) * 2013-03-20 2013-07-10 广东欧珀移动通信有限公司 Transfer method and device of Android equipment internal hard disk file system
CN104123952A (en) * 2014-07-18 2014-10-29 武汉光忆科技有限公司 Cache-free disc burning method and device
CN107735774A (en) * 2015-05-05 2018-02-23 华为技术有限公司 A kind of SMR perceives only additional file system
CN105488153A (en) * 2015-11-27 2016-04-13 北京北信源软件股份有限公司 Method and device for appending mirror image based on binary stream
CN112530467A (en) * 2019-10-08 2021-03-19 北京中科开迪软件有限公司 Optical disk storage additional recording method and system
CN113066515A (en) * 2021-04-14 2021-07-02 统信软件技术有限公司 Optical disc recording method, computing equipment and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李寒韦: "光盘异地更新机制的设计与实现", 《中国优秀硕士学位论文全文数据库》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114446328A (en) * 2021-12-27 2022-05-06 奇安信科技集团股份有限公司 Optical disk recording auditing method and device
CN114446328B (en) * 2021-12-27 2023-09-22 奇安信科技集团股份有限公司 Method and device for auditing CD (compact disc) burning
CN114512151A (en) * 2021-12-28 2022-05-17 奇安信科技集团股份有限公司 Method and system for auditing and controlling optical disc recording
CN114512151B (en) * 2021-12-28 2024-03-22 奇安信科技集团股份有限公司 Method and system for auditing, managing and controlling optical disk writing
CN116778975A (en) * 2023-05-29 2023-09-19 上海沪方软件有限公司 Method and device for additionally recording optical disc, electronic equipment and readable storage medium
CN116774927A (en) * 2023-05-29 2023-09-19 上海沪方软件有限公司 Optical disk data management method, optical disk data management device, electronic equipment and readable storage medium
CN116774927B (en) * 2023-05-29 2024-02-23 上海沪方软件有限公司 Optical disk data management method, optical disk data management device, electronic equipment and readable storage medium
CN116778975B (en) * 2023-05-29 2024-03-12 上海沪方软件有限公司 Method and device for additionally recording optical disc, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN113823331B (en) 2023-02-28

Similar Documents

Publication Publication Date Title
CN113823331B (en) Optical disc additional recording method and device and computing equipment
US6823417B2 (en) Memory controller for memory card manages file allocation table
TWI465936B (en) File system and methods for managing files according to application
CN113553010B (en) Optical disc file verification method, optical disc recording method and computing device
US7822931B2 (en) File storage device, host apparatus, method for formatting nonvolatile semiconductor memory, and method of writing data in nonvolatile semiconductor memory
RU2248625C2 (en) Optical data carrier
US20060282653A1 (en) Method for updating frimware of memory card
CN113066515B (en) Optical disc recording method, computing equipment and readable storage medium
CN112346668B (en) Optical disc information acquisition method, computing equipment and readable storage medium
WO2018040802A1 (en) Full-image file generation method and apparatus, and computer storage medium
US20080250189A1 (en) Circuit and Method for Improving Operation Life of Memory
US6591363B1 (en) System for writing incremental packet data to create bootable optical medium by writing boot catalog and boot image onto second track before writing volume descriptors onto first track
KR100637787B1 (en) Method and program for file information write processing
US20040068635A1 (en) Universal disk format volumes with variable size
CN113655960B (en) CD readability restoration method and computing device
JPH09115246A (en) Method and device for recording information, and recording medium
CN111090396A (en) File processing method and device and electronic equipment
CN114242119B (en) Optical disk data repairing method, optical disk data checking method and computing device
CN112231176B (en) Simple and convenient log recording method for VxWorks operating system
JP7435470B2 (en) Information processing device, information processing method, and information processing program
CN114281257A (en) Rapid previewing method of optical disc file, computing equipment and storage medium
JPH1186512A (en) Data rewriting method for optical disk
US7634172B1 (en) Methods for recording multiple sessions on a rewritable DVD disc
CN117687667A (en) Firmware updating method, device, terminal equipment and storage medium
CN117666964A (en) Data coding synthesis storage method, system and storage medium

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