Optical disc information acquisition method, computing device and readable storage medium
By identifying the file system category of the CD and using corresponding methods to obtain information, the problem of unstable acquisition of CD information under Linux systems is solved, and accurate information acquisition of CDs in different file systems is achieved, and compatibility is improved.
Patent Information
- Application Number
- CN202111021533.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-08
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2041-01-08
AI Technical Summary
In Linux desktop environment, CD information acquisition is unstable, especially the parsing of UDF file system, resulting in inaccurate reading of CD information.
By identifying the file system category of the CD, the corresponding method is used to obtain the CD information. Specific steps include obtaining the basic address of the CD, identifying the volume recognition sequence code and main volume descriptor sequence in the UDF file system, or using the GNU xorriso tool to parse the ISO9660 file system.
It realizes the acquisition of CDs of different file systems in Linux systems, solves the problem of inaccurate reading of CD information, and improves compatibility and accuracy.
Smart Images

Figure CN113791732B_ABST
Abstract
Description
[0001] This application is a divisional application of invention patent application 2021100223090 filed on January 8, 2021. Technical Field
[0002] The present invention relates to the field of optical disc data storage, and in particular to an optical disc information acquisition method, a computing device and a readable storage medium. Background Art
[0003] Optical discs are common external storage media for computers and are widely used in application scenarios involving data confidentiality. Similar to hard disks having file systems such as FAT16, FAT32, and NTFS, optical discs also have their own file systems. Common optical disc file systems include ISO9660 (and its extensions) and UDF. ISO9660 is the original standard file system for CD data discs. This format is recognized on multiple operating systems, including MSDOS, MacOS, UNIX, and Windows operating systems. The ISO9660 format is published by the International Organization for Standardization (ISO). There is also a Universal Disc Format (UDF), which is a newer file system developed by the Optics Storage Technology Association (OSTA) for optical media. UDF is a portable format recognized by multiple operating systems. UDF is replacing ISO9660 as the new standard, especially for read / write media.
[0004] Due to historical reasons, most optical discs are burned under the Windows operating system. There are two native Windows burning methods. The first method is similar to the USB flash drive burning method. The file system of the optical disc burned by this method is pure UDF. The second method is the CD / DVD burning method. The file system of the optical disc burned by this method is a mixed mode of ISO9660 and UDF.
[0005] In the Windows file explorer, the file information of the CDs burned in both ways can be clearly read and displayed. However, in the desktop environments of various Linux distributions based on the Linux kernel, the way to parse CDs is mostly still to parse them according to the ISO9660 specification. For CDs that follow the UDF specification, the data is often not correctly parsed.
[0006] At present, in the Linux desktop environment, the application software often uses the xorriso tool provided by GNU to read the CD information. The CD information is obtained by importing the header file xorriso.h to make an interface call. There are differences in the implementation of UDF between Windows and Linux. The biggest problem with using xorriso is that the CD information parsed by the UDF file system is unstable. It can also be implemented through the D-BUS interface. After the computer CD-ROM drive loads the CD, the name of the file system can be directly obtained through the system D-BUS interface according to the device name and the name of the file system. However, the data obtained through the D-BUS interface is limited. As a developer, you cannot flexibly write code and obtain CD information in a personalized way. Secondly, the data provided by D-BUS is not necessarily reliable. Relying on other system components to provide data, the correctness of the CD information cannot be guaranteed under different architectures and system versions. Summary of the invention
[0007] To this end, the present invention provides a method for obtaining optical disc information, a computing device and a readable storage medium, in an effort to solve or at least alleviate the above problems.
[0008] According to one aspect of the present invention, there is provided a method for obtaining optical disc information, which is suitable for execution in an operating system, the operating system resides in a computing device, the computing device includes an optical drive, the method includes: mounting an optical disc inserted into the optical drive, the file system category of the optical disc includes a first category and a second category; identifying the file system category of the optical disc according to a loading process of a file system of the first category; if the file system category of the optical disc is successfully identified according to the loading process of the file system of the first category, then judging the file system category of the optical disc to be the first category, otherwise, judging the file system category of the optical disc to be the second category; and obtaining the optical disc information of the optical disc according to the file system category of the optical disc.
[0009] Optionally, in the optical disc information acquisition method according to the present invention, identifying the file system category of the optical disc according to the loading process of the first category of file system includes: obtaining the base address of the optical disc; identifying the first identification information of the optical disc according to the loading process of the first category of file system; identifying the second identification information of the optical disc according to the loading process of the first category of file system.
[0010] Optionally, in the CD information acquisition method according to the present invention, obtaining the base address of the CD includes: if the CD is multi-segment burned, the base address of the CD is the starting address of the last burned segment; if the CD is not multi-segment burned, the base address of the CD is 0.
[0011] Optionally, in the optical disc information acquisition method according to the present invention, the first category is UDF, and the first identification information of the optical disc identified according to the loading process of the first category file system is implemented based on ECMA-167 and OSTA_UDF.
[0012] Optionally, in the optical disc information acquisition method according to the present invention, the first identification information of the optical disc is identified according to the loading process of the first category file system, including: offsetting 32k bytes backward from the base address to obtain the volume identification sequence code VRS; obtaining the start extended area descriptor BEAD, the volume sequence descriptor VSD and the end extended area descriptor TEAD from the volume identification sequence code VRS.
[0013] Optionally, in the optical disc information acquisition method according to the present invention, the second identification information of the optical disc is identified according to the loading process of the first category file system, including: obtaining the positioning volume descriptor pointer AVDP from the 256 address of the optical disc sector; obtaining the main volume descriptor sequence VDS from the positioning volume description pointer; obtaining the partition descriptor PD and the logical volume descriptor LVD.
[0014] Optionally, in the method for obtaining optical disc information according to the present invention, the optical disc information includes the optical disc formatting identifier, the optical disc format, the used capacity of the optical disc, the optical disc data block, the optical disc device ID, the total capacity of the optical disc and the optical disc volume name. When the file system of the optical disc is UDF, obtaining the optical disc information of the optical disc according to the file system category of the optical disc includes: obtaining the optical disc formatting identifier, the optical disc format, the optical disc data block and the optical disc device ID through the file system tool GNUxorriso; based on ECMA-167 and OSTA_UDF, obtaining the total capacity of the optical disc, the used capacity of the optical disc and the volume name of the optical disc through system function calls.
[0015] Optionally, in the method for obtaining optical disc information according to the present invention, when the file system of the optical disc is ISO9660, obtaining the optical disc information of the optical disc according to the identified file system category includes: obtaining the optical disc formatting identifier, optical disc format, optical disc used capacity, optical disc data block, optical disc device ID, total optical disc capacity and optical disc volume name through the file system tool GNUxorriso.
[0016] Optionally, in the optical disc information acquisition method according to the present invention, identifying the first identification information of the optical disc according to the loading process of the first category file system also includes: identifying the start extended area descriptor BEAD by obtaining the character string "BEA01"; identifying the volume sequence descriptor VSD by obtaining the character string "NSR02" or "NSR03"; identifying the end extended area descriptor TEAD by obtaining the character string "TEA01".
[0017] Optionally, in the optical disc information acquisition method according to the present invention, obtaining the partition descriptor PD and the logical volume descriptor LVD includes: scanning the main volume descriptor sequence VDS and offsetting it with the block size; obtaining the first two bytes after the offset; converting the first two bytes of data into integers to obtain the values of the partition descriptor PD and the logical volume descriptor LVD; if the value of the partition descriptor PD is equal to 0x0005, it is judged that the partition descriptor is successfully identified, and if the value of the logical volume descriptor LVD is 0x0006, it is judged that the logical descriptor is successfully identified.
[0018] Optionally, in the optical disc information acquisition method according to the present invention, the second category is ISO9660.
[0019] Optionally, in the optical disc information acquisition method according to the present invention, the operating system is a Linux operating system.
[0020] According to another 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 suitable for execution by the at least one processor, and the program instructions include instructions for executing the above-mentioned optical disc information acquisition method.
[0021] According to another aspect of the present invention, a readable storage medium storing program instructions is provided. When the program instructions are read and executed by a computing device, the computing device executes the above-mentioned optical disc information acquisition method.
[0022] According to the optical disc information acquisition method of the present invention, the problem that the optical disc file system has different categories can be solved. The optical disc is loaded for the first time according to the loading process of the first category file system. If the loading is successful, the file system of the optical disc is judged to be the first category, otherwise it is the second category, and the optical disc information of the optical disc is obtained again according to the file system category. In this way, it is avoided to identify the optical disc file system by two different methods, and a universal method is provided to parse the optical disc information of different file systems with strong compatibility. In addition, for optical discs with different file systems, the optical disc information acquisition method corresponding to the file system category is used to acquire the optical disc information, thereby avoiding the problem of inaccurate optical disc information acquisition by a unified method, and solving the technical problem of optical disc information reading under the operating system of the Linux desktop environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] To achieve the above and related purposes, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings, which indicate various ways in which the principles disclosed herein can be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The above and other purposes, features and advantages of the present disclosure will become more apparent by reading the following detailed description in conjunction with the accompanying drawings. Throughout the present disclosure, the same reference numerals generally refer to the same parts or elements.
[0024] Figure 1 A block diagram of a computing device 100 according to one embodiment of the present invention is shown;
[0025] Figure 2 A flow chart of a method 200 for obtaining optical disc information according to an embodiment of the present invention is shown;
[0026] Figure 3 A flow chart of an optical disc file system identification process 300 according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0027] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0028] Optical discs are widely used as storage media, but most optical discs are burned under Windows operating system, and the file systems include ISO9660 and UDF. In Windows file explorer, the information of optical discs burned in the two modes can be clearly read. When converted to Linux, different modes are required to obtain optical disc information for different types of file systems. The present invention first identifies the file system category according to the file system loading process, and then obtains the optical disc information through the corresponding optical disc information acquisition method.
[0029] The operating system for executing the optical disc information acquisition method of the present invention is suitable for being resident in a computing device. Figure 1 FIG. 1 is a schematic diagram of a computing device 100 according to an embodiment of the present invention. It should be noted that: Figure 1 The computing device 100 shown is only an example. In practice, the computing device used to implement the optical disc information acquisition method of the present invention can be any type of device, and its hardware configuration can be different from the above. Figure 1 The computing device 100 shown is the same as Figure 1 The computing device 100 shown in the figure is different. In practice, the computing device used to implement the optical disc information acquisition method of the present invention can be Figure 1 The hardware components of the computing device 100 shown are increased or deleted, and the present invention does not limit the specific hardware configuration of the computing device.
[0030] like Figure 1As shown, in a basic configuration 102, computing device 100 typically includes system memory 106 and one or more processors 104. A memory bus 108 may be used for communication between processor 104 and system memory 106.
[0031] Depending on the desired configuration, the processor 104 can be any type of processor, including but not limited to: a microprocessor (μP), a microcontroller (μC), a digital information processor (DSP), or any combination thereof. The processor 104 can include one or more levels of cache such as a first-level cache 110 and a second-level cache 112, a processor core 114, and registers 116. An example processor core 114 can include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An example memory controller 118 can be used with the processor 104, or in some implementations, the memory controller 118 can be an internal part of the processor 104.
[0032] Depending on the desired configuration, the system memory 106 can 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. The physical memory in the computing device generally refers to the volatile memory RAM, and the data in the disk needs to be loaded into the physical memory before it can be read by the processor 104. The system memory 106 may include an operating system 120, one or more applications 122, and program data 124. In some embodiments, the application 122 may be arranged to execute instructions on the operating system by one or more processors 104 using program data 124. The operating system 120 may be, for example, Linux, Unix, UOS, etc., which includes program instructions for processing basic system services and performing tasks that depend on hardware. The application 122 includes program instructions for implementing various user-desired functions, and the application 122 may be, for example, a browser, instant messaging software, a software development tool (such as an integrated development environment IDE, a compiler, etc.), etc., but is not limited thereto. When the application 122 is installed in the computing device 100, a driver module may be added to the operating system 120.
[0033] When the computing device 100 starts running, the processor 104 reads and executes the program instructions of the operating system 120 from the memory 106. The application 122 runs on the operating system 120 and uses the interfaces provided by the operating system 120 and the underlying hardware to implement various functions desired by the user. When the user starts the application 122, the application 122 is loaded into the memory 106, and the processor 104 reads and executes the program instructions of the application 122 from the memory 106.
[0034] Computing device 100 also includes a storage device 132 including a removable storage 136 and a non-removable storage 138 , both of which are connected to storage interface bus 134 .
[0035] The 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. Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150. They can 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., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 158. Example communication devices 146 may include a network controller 160, which may be arranged to facilitate communication with one or more other computing devices 162 via a network communication link via one or more communication ports 164.
[0036] A network communication link can be an example of a communication medium. Communication media can generally be embodied as computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A "modulated data signal" can be a signal in which one or more of its data sets or its changes can be carried out in a manner that encodes information in the signal. As non-limiting examples, communication media can include wired media such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer-readable medium used herein can include both storage media and communication media.
[0037] In the computing device 100 according to the present invention, the operating system 120 includes instructions for executing the optical disc information obtaining method 200 of the present invention.
[0038] Figure 2 FIG. 2 is a flow chart of a method 200 for obtaining optical disc information according to an embodiment of the present invention. The method is suitable for running in a Linux operating system, which is installed on a computing device (such as Figure 1 In the computing device shown in FIG. 1 , the computing device includes an optical drive.
[0039] like Figure 2As shown, the method 200 starts at step S210. In step S210, when an optical disc is inserted into the optical drive, the optical disc is loaded. The file system of the optical disc has different categories. According to an embodiment of the present invention, the file system of the optical disc includes a UDF (i.e., a first category) file system and an ISO9660 (i.e., a second category) file system.
[0040] Then, the process proceeds to step S220 to identify the file system type of the optical disc according to the loading process of the file system of the first type (ie, UDF).
[0041] The UDF file system includes two specifications: ECMA-167 and OSTA_UDF. ECMA-167 is a standard for volume and file structure, also known as ISO / IEC 13346. ECMA-167 has two versions: ECMA-167 / 2 and ECMA-167 / 3. UDF is developed by OSTA, also known as OSTA_UDF. It is based on the ECMA-167 framework and supplements some necessary details. UDF1.x is based on ECMA-167 / 2, and UDF2.x is based on ECMA-167 / 3.
[0042] The UDF file system loading process is to parse and process the file system volume structure of the optical disc according to the above two specifications. The metadata structure of UDF is defined as descriptors in ECMA-167 and OSTA_UDF standards. The starting addresses of all descriptors are aligned with sectors, and these descriptors are connected in a specific order. The volume structure recognition process includes the recognition of the first identification information and the recognition of the second identification information.
[0043] According to an embodiment of the present invention, the identification of the first identification information of UDF is specifically, according to ECMA-167 and OSTA_UDF, the position of the disc data read is offset to the address 32kB after the base address, and the volume identification sequence code VRS is obtained, which includes the start extension area descriptor BEA, the volume sequence descriptor VSD, and the end extension area descriptor TEA, and BEA, VSD, and TEA are searched in sequence. Descriptor matching is performed through string comparison. When all three descriptors are matched, it means that the UDF volume identification sequence code VRS is successfully identified, otherwise it fails.
[0044] After the volume identification sequence code VRS is successfully identified, the identification of the second identification information continues. According to an embodiment of the present invention, the anchor volume descriptor pointer (Anchor Volume Descriptor Pointer, AVDP) is found at address 256 of the optical disc sector, and the main volume descriptor sequence VDS in the AVDP is read. Before encountering the end descriptor TD, the partition descriptor (Partition Descriptor, PD) and the logical volume descriptor (Logical Volume Descriptor, LVD) need to be confirmed.
[0045] In the above identification process, if any descriptor fails to be identified, the UDF file system identification fails.
[0046] According to an embodiment of the present invention, in step S220, if the UDF file system is successfully identified and the optical disc file system is identified as a UDF file system, the process proceeds to step S230, where the optical disc is parsed based on ECMA-167 and OSTA_UDF, and a system function is called to obtain optical disc information.
[0047] The optical disc information includes the optical disc formatting mark, optical disc format, optical disc used capacity, optical disc data block, optical disc device ID, optical disc total capacity and optical disc volume name. The optical disc formatting mark, optical disc format, optical disc data block and optical disc device ID can be obtained through the file system tool GNUxorriso, while it is unreliable to use GNU xorriso to parse the optical disc capacity, optical disc used capacity, volume name and other information, so it is necessary to parse it through methods based on ECMA-167 and OSTA_UDF and system calls.
[0048] According to one embodiment of the present invention, the size of a block in the optical disc is equivalent to the size of a sector on the optical disc. After opening the optical disc to obtain the file descriptor, the system function ioctl() is called, and the request parameter BLKSSZGET is passed in to obtain the block size. The parameter BLKGETSIZE64, that is, ioctl(fd,BLKGETSIZE64,&size) is passed in to obtain the total capacity of the optical disc.
[0049] According to the above identification process, it can be known that the volume descriptor sequence VDS contains many descriptors before encountering the end descriptor TD. The one related to the volume name is the logical volume descriptor LVD. Therefore, the name of the UDF volume can be clearly identified through the LVD.
[0050] If any descriptor fails to be identified during the identification process of step S220, it is determined that the file system of the optical disc is ISO9660. After step S220, the process proceeds to step S240 to enter the process of obtaining optical disc information based on GNU xorisso.
[0051] The core idea of obtaining CD information based on GNU xorisso is to pass in rules and obtain the data of interest through the interface. The relevant interfaces are as follows:
[0052] xorriso_opt_dev interface: specifies the optical drive device, usually a string of / dev / srN, where N is a natural number;
[0053] xorriso_sieve_get_results interface: query a result through the set rules, such as Xorriso_sieve_get_result(xorriso,PCHAR("Volumeid:"),&ac,&av,&avail,0); in this code, the volume name of the CD can be queried through the rule PCHAR("Volume id:");
[0054] xorriso__dispose_words interface: processing result record string;
[0055] xorriso_sieve_clear_results interface: clean up the query site.
[0056] In actual applications, it is inconvenient to use xorriso directly for development. The current UOS file manager method is to encapsulate it and encapsulate the API provided by xorriso into a class function macro for application calls. The sample code is as follows:
[0057] #define XORRISO_OPT(opt,x,...)\
[0058] Xorriso_set_problem_status(x,PCHAR(""),0);\
[0059] r=Xorriso_option_##opt(x,__VA_ARGS__);\
[0060] r=Xorriso_eval_problem_status(x,r,0);
[0061] Figure 3 FIG. 3 is a flowchart of UDF file system identification 300 according to an embodiment of the present invention. Figure 3 As shown, the method 300 begins with step S310, ie, detecting whether the optical disc is in a normal state.
[0062] If the optical disc is in a normal state, enter step S320 to obtain the base address of the optical disc. According to one embodiment of the present invention, the base address of the optical disc is confirmed according to whether the optical disc is burned in multiple sessions: if the optical disc is burned in multiple sessions, the base address of the optical disc is the starting address of the last burned segment; if the optical disc is not burned in multiple sessions, the base address of the optical disc is 0.
[0063] Then, step S330 is entered to identify the first identification information. According to one embodiment of the present invention, according to ECMA-167 and OSTA_UDF, the position of the optical disc data reading is offset to the address 32kB after the base address, and the volume identification sequence code VRS is obtained, which includes the start extended area descriptor BEA, the volume sequence descriptor VSD, and the end extended area descriptor TEA, and BEA, VSD, and TEA are searched in sequence. According to the standard, the size of each descriptor is 5 bytes, and the string comparison function memcmp() is called to compare the key string "BEA01" to confirm the existence of the start extended area descriptor BEA, and the existence of the volume sequence descriptor VSD is confirmed by comparing the key string "NSR02" or "NSR03", and the existence of the end extended area descriptor TEA is confirmed by comparing the key string "TEA01". Finally, when all three descriptors are matched, it means that the UDF volume identification sequence code VRS is successfully identified, otherwise it means that the identification fails.
[0064] Then, the process proceeds to step S340 to perform second identification information identification.
[0065] According to an embodiment of the present invention, by finding the anchor volume descriptor pointer (AnchorVolume Descriptor Pointer, AVDP) at address 256 of the optical disc sector, reading the main volume descriptor sequence VDS in the AVDP, and before encountering the end descriptor TD, it is also necessary to confirm the partition descriptor (Partition Descriptor, PD) and the logical volume descriptor (LogicalVolume Descriptor, LVD). Specifically: first, it is necessary to scan the main volume descriptor sequence VDS, and then offset it with the block size. After each offset, the first 2 bytes of data are intercepted and converted into an integer, and compared with the TAG value 0x0005 of the partition descriptor PD and the TAG value 0x0006 of the logical volume descriptor LVD specified in ECMA-167 to see if they are equal. If they are equal, it is confirmed that the UDF file system is recognized.
[0066] According to the optical disc information acquisition method of the present invention, during the optical disc loading process, the volume structure of the UDF file system is parsed to identify whether the file system of the optical disc is UDF or ISO9660. If it is ISO9660, xorisso is used to obtain the optical disc information. If it is a UDF file system, the optical disc information is obtained based on ECMA-167 and OSTA_UDF combined with system function calls, which solves the problem that the Linux system cannot obtain the optical disc information or obtains inaccurate optical disc information, and has universality.
[0067] The various techniques described herein may be implemented in combination with hardware or software, or a combination thereof. Thus, the method and apparatus of the present invention, or some aspects or parts of the method and apparatus of the present invention may be in the form of program codes (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.
[0068] In the case where the program code is executed on a programmable computer, the computing device generally includes 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. The memory is configured to store the program code; the processor is configured to execute the optical disc information acquisition method of the present invention according to the instructions in the program code stored in the memory.
[0069] By way of example and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer readable instructions, data structures, program modules or other data. Communication media generally embody computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and include any information transfer medium. Any combination of the above is also included within the scope of readable media.
[0070] In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the examples of the present invention. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to implement the content of the present invention described herein, and the above description of specific languages is for the purpose of disclosing the best mode of the present invention.
[0071] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0072] It should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.
[0073] 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 the devices described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or may be divided into multiple submodules.
[0074] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0075] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0076] In addition, some of the embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other devices that perform the functions. Therefore, a processor with necessary instructions for implementing the method or method elements forms a device for implementing the method or method elements. In addition, the elements described herein of the device embodiments are examples of devices for implementing the functions performed by the elements for the purpose of implementing the invention.
[0077] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved, and is not intended to imply that the objects so described must have a given order in time, space, order, or in any other manner.
[0078] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative, not restrictive, with respect to the scope of the present invention, which is defined by the appended claims.
Claims
1. A method for obtaining optical disc information, suitable for being executed in an operating system, wherein the operating system resides in a computing device, wherein the computing device includes an optical drive, and the method comprises: Mounting an optical disc inserted into the optical drive, wherein the category of the file system of the optical disc includes a first category and a second category; identifying the file system category of the optical disc according to the loading process of the file system of the first category; If the file system category of the optical disc is successfully identified according to the file system loading process of the first category, the file system category of the optical disc is determined to be the first category; otherwise, the file system category of the optical disc is determined to be the second category; Acquire the optical disc information of the optical disc according to the file system type of the optical disc; The step of identifying the file system category of the optical disc according to the loading process of the file system of the first category includes: Get the base address of the disc; Identify first identification information of the optical disc according to a loading process of a first category file system; The second identification information of the optical disc is identified according to the loading process of the first type file system.
2. The method of claim 1, wherein: The basic address of obtaining the optical disc includes: If the disc is recorded in multiple sessions, the base address of the disc is the starting address of the last recorded session; If the disc is not multisession recorded, the base address of the disc is 0.
3. The method according to claim 1 or 2, wherein: The first category is UDF, and the first identification information for identifying the optical disc according to the loading process of the first category file system is implemented based on ECMA-167 and OSTA_UDF.
4. The method according to claim 1 or 2, wherein: The first identification information of the optical disc identified according to the loading process of the first category file system includes: Offset 32k bytes backward from the base address to obtain the volume identification sequence code VRS; The start extended area descriptor BEAD, the volume sequence descriptor VSD and the end extended area descriptor TEAD are obtained from the volume identification sequence code VRS.
5. The method of claim 3, wherein: The second identification information for identifying the optical disc according to the loading process of the first category file system includes: Get the volume description pointer AVDP from the address 256 of the CD sector; Obtaining a primary volume descriptor sequence VDS from the positioning volume description pointer; Get the partition descriptor PD and the logical volume descriptor LVD.
6. The method according to claim 1 or 2, wherein: The optical disc information includes an optical disc formatting identifier, an optical disc format, an optical disc used capacity, an optical disc data block, an optical disc device ID, an optical disc total capacity, and an optical disc volume name. When the file system of the optical disc is UDF, obtaining the optical disc information of the optical disc according to the file system type of the optical disc includes: Obtain the disc formatting mark, disc format, disc used capacity, disc data block and disc device ID through the file system tool GNU xorriso; Based on ECMA-167 and OSTA_UDF, the total capacity, used capacity and volume name of the disc are obtained by calling system functions.
7. The method according to claim 1 or 2, wherein: When the file system of the optical disc is of the second category, acquiring the optical disc information of the optical disc according to the identified file system category includes: Use the file system tool GNU xorriso to obtain the disc formatting mark, disc format, disc used capacity, disc data block, disc device ID, disc total capacity and disc volume name.
8. A computing device comprising: at least one processor; as well as A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for executing the method according to any one of claims 1 to 7.
9. A readable storage medium storing program instructions, when the program instructions are read and executed by a computing device, the computing device executes the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Optical disc drive, user terminal, and file processing method
CN103594102A