CN113655960A - Optical disc readability repairing method and computing device - Google Patents

Optical disc readability repairing method and computing device Download PDF

Info

Publication number
CN113655960A
CN113655960A CN202110935489.1A CN202110935489A CN113655960A CN 113655960 A CN113655960 A CN 113655960A CN 202110935489 A CN202110935489 A CN 202110935489A CN 113655960 A CN113655960 A CN 113655960A
Authority
CN
China
Prior art keywords
optical disc
session
session structure
structures
last
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
CN202110935489.1A
Other languages
Chinese (zh)
Other versions
CN113655960B (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 CN202110935489.1A priority Critical patent/CN113655960B/en
Publication of CN113655960A publication Critical patent/CN113655960A/en
Application granted granted Critical
Publication of CN113655960B publication Critical patent/CN113655960B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0677Optical disk device, e.g. CD-ROM, DVD

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Optical Recording Or Reproduction (AREA)

Abstract

The invention discloses a method for restoring readability of an optical disk, which comprises the following steps: the optical disc is mounted, and when the mounting fails, whether an incomplete session structure exists in the optical disc is checked, wherein the method comprises the following steps: acquiring the position information of the last session structure, wherein the position information comprises the initial address and the next writable address of the session structure; judging whether the starting address of the session structure is the same as the next writable address, and if so, determining that the last session structure is incomplete; based on the position information of the last session structure, erasing the sector data corresponding to the last session structure in the optical disc; and mounting the optical disc subjected to the erasing processing again so as to read the file data in the optical disc. The invention also discloses corresponding computing equipment. According to the method for repairing the readability of the optical disc, the existing complete file system data in the optical disc can still be normally read after the recording of the optical disc fails.

Description

Optical disc readability repairing method and computing device
Technical Field
The present invention relates to the field of optical disc recording technologies, and in particular, to a method for repairing readability of an optical disc and a computing device.
Background
Optical discs, which are one of the most commonly used data storage media, have hitherto played an irreplaceable role in the field of data storage. The optical disc can be divided into several types of optical discs of ROM, RW and R type suffixes according to whether the optical disc has erasable and sustainable recording characteristics, and data in the ROM type optical disc is suppressed when the optical disc leaves a factory and does not have recordable characteristics for users; the RW type optical disc has both continuous read-write characteristic and erasable characteristic, and is a reusable optical disc; the R-type optical disc has only a continuous read/write characteristic, and is incapable of erasing and rewriting after capacity use.
According to the existing operating systems, both organization and access of data in storage media need to go through file systems, which in optical disc media include both ISO9660 and UDF. Unlike the file system in a data hard disk, each time a file is recorded into an optical disc, a data structure called session is created in the optical disc, and each session has a complete optical disc data file system (ISO9660 or UDF). A series of files recorded each time are stored in the session recorded each time, and a plurality of sessions are created in the optical disc by executing a plurality of times of recording.
When a computer system identifies a data file in a storage medium, a file system is firstly identified through a kernel, the integrity of the file system must be ensured, otherwise, the kernel cannot identify a correct file system, and the file in the storage medium cannot be provided for a user layer to access through the file system. Therefore, when the recording process of the optical disc is interrupted due to external factors such as power failure of the host, power failure of the external optical drive, and the like, the file system or session written in the optical disc is incomplete, and thus, the result that the computer cannot read the file in the optical disc is caused. How to repair and make up the optical disc with recording interruption on a computer in time is urgent to be solved.
Currently, for erasable optical discs, the erasing function used in the market is to erase all discs, and the erasing of all discs will cause the original complete session in the optical disc to be erased at the same time, thereby causing all data to be lost. Full disc erasure is clearly not a good solution if there are more important files in the disc.
Based on this, there is a need for a readability repair method for erasable type optical discs to solve the problems in the above technical solutions.
Disclosure of Invention
To this end, the present invention provides a method of optical disc readability repair in an attempt to solve or at least alleviate the above-identified problems.
According to an aspect of the present invention, there is provided an optical disc readability repair method, executed in an operating system of a computing device, comprising the steps of: mounting an optical disc, and checking whether an incomplete session structure exists in the optical disc when mounting fails, wherein the steps of the mounting include: acquiring the position information of the last session structure, wherein the position information comprises the starting address and the next writable address of the session structure; and judging whether the starting address of the session structure is the same as the next writable address or not, and if the starting address of the session structure is different from the next writable address, determining that the last session structure is incomplete. Based on the position information of the last session structure, erasing the sector data corresponding to the last session structure in the optical disc; and mounting the optical disc subjected to the erasing processing again so as to read the file data in the optical disc.
Optionally, in the method for repairing readability of an optical disc according to the present invention, the step of obtaining the location information of the last session structure includes: determining the number of session structures in the optical disc; and acquiring the position information of the last session structure according to the number of the session structures.
Optionally, in the method for repairing readability of an optical disc according to the present invention, if the number of session structures is 1, the optical disc is directly subjected to a full-disc erasing process; and if the number of the session structures is more than 1, acquiring the position information of the last session structure according to the number of the session structures.
Optionally, in the method for repairing readability of an optical disc according to the present invention, the step of erasing the sector data corresponding to the last session structure in the optical disc includes: acquiring a BLANK instruction sent by system call and a corresponding parameter structure; and erasing the corresponding section data based on the parameter structure.
Optionally, in the method for repairing readability of an optical disc according to the present invention, before performing an erasing process on section data corresponding to a last session structure in the optical disc, the method further includes the steps of: performing summary calculation on one or more session structures located before the last session structure in the optical disc to obtain a first summary value, and storing the first summary value; after erasing the sector data corresponding to the last session structure in the optical disc, the method further comprises the following steps: performing summary calculation on one or more session structures in the optical disc to obtain a second summary value; and comparing the second abstract value with the first abstract value so as to verify whether one or more session structures in the processed optical disc are complete.
Optionally, in the optical disc readability repairing method according to the present invention, the digest value is a sum of digest values of the one or more session structures; storing the first digest value includes: the first digest value is stored in a temporary variable.
Optionally, in the method for repairing readability of an optical disc according to the present invention, the step of checking whether an incomplete session structure exists in the optical disc includes: determining a type of the optical disc based on an optical disc suffix; if the type of the optical disc is determined to be an erasable optical disc, it is checked whether an incomplete session structure exists in the optical disc.
Optionally, in the method for repairing readability of an optical disc according to the present invention, after determining that the type of the optical disc is an erasable optical disc, the method further includes the steps of: and determining whether the sector erasing processing is carried out on the optical disc, and if so, checking whether an incomplete session structure exists in the optical disc.
Optionally, in the method for repairing readability of an optical disc according to the present invention, before the optical disc is mounted, the method includes the steps of: when one or more files are recorded on the optical disc each time, a corresponding session structure is respectively constructed in the optical disc, so that the one or more files recorded each time are stored in the corresponding session structure, and a file system corresponding to the session structure is formed.
Optionally, in the method for repairing readability of an optical disc according to the present invention, the session structure includes file information of one or more corresponding pre-session structures, and the file information of the pre-session structure includes a file address and a file name in the pre-session structure.
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 readability repair 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 repairing the readability of an optical disc, which comprises the steps of determining whether an incomplete session structure exists in the optical disc by checking the integrity of the last session structure in the optical disc when the mounting of the optical disc fails, and only erasing the data of the section corresponding to the last session structure in the optical disc when the incomplete session structure is determined. Based on the sector erasure scheme, only the incomplete sector data in the optical disc is erased, and the original data in the complete session structure is retained. In this way, each session structure in the erased optical disc contains a complete file system, so that the optical disc can be successfully mounted, and new files can be continuously written into the optical disc. Therefore, according to the optical disc readability repair scheme of the present invention, the computing device can always read the existing complete file system data in the optical disc, and can still normally read the existing complete file system data in the optical disc after the recording failure of the optical disc.
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 is a flow chart of a method 200 for optical disc readability repair according to one embodiment of the present invention;
FIG. 3 illustrates a schematic diagram of a sequential media disc metadata space structure according to one embodiment of the present invention;
FIG. 4 shows a BLANK instruction parameter table defined according to the SSF 8090i specification.
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 in accordance with the invention, the computing device 100 is configured to perform an optical disc readability repair method 200 in accordance with the invention. The operating system of the computing device 100 includes a plurality of program instructions for executing the optical disc readability repair method 200 of the present invention, so that the optical disc readability repair method 200 of the present invention can be executed in the operating system of the computing device 100.
FIG. 2 is a flowchart illustrating a method 200 for repairing readability of an optical disc according to one embodiment of the present invention. The optical disc readability repair method 200 may be performed in an operating system of a computing device, such as the computing device 100 described above.
According to one embodiment of the invention, the operating system of the computing device may be a UOS operating system. The following describes the optical disc readability repair method 200 in detail by taking the UOS operating system as an example, but the method 200 of the present invention is not limited to being executed in the UOS operating system.
According to one embodiment, a file manager is included on the operating system, the file manager being configured to perform the optical disc readability repair method 200 according to the present invention.
As shown in fig. 2, the method 200 begins at step S210.
In step S210, an attempt is made to mount an optical disk on the optical disk drive tray. When the optical disc mounting fails, whether an incomplete session structure exists in the optical disc is checked.
In one implementation, after pushing the disc into the optical drive, the kernel of the operating system generates an Add event, and the udev captures the Add event and filters the Add event, and when the event type is found to be device-related, the udev broadcasts the Add event to the upper layer application. After the event is captured by udisks2, a DBus interface for controlling the device is generated, and then the libudisks2-Qt5 library captures the change of the interface, converts it into Qt signal blockdeviceadd and triggers. When the file manager receives the blockDeviceAdded signal, the display of the CD-ROM icon is updated on the interface to prompt the user that the CD is identified, and then the CD-ROM can be mounted after the operation that the user clicks the CD-ROM icon is received. In particular, the optical disc may be mounted through the mount interface provided by udisks 2. When the optical disc mounting fails, the mount interface throws an error, and the file manager cannot acquire a mounting point, so that the mounting failure is determined.
When the mounting fails, the file manager can send the popup window to the system desktop and display the popup window on the system desktop, so that the popup window can prompt a user that the optical disc mounting fails, and the user can send an instruction whether to try to repair the readability of the optical disc through the popup window. Subsequently, it is determined whether to attempt to fix the disc readability according to instructions sent by the user through the pop-up window. And if the readability of the optical disc is determined to be repaired according to the instruction of the user, the readability of the optical disc is determined to be repaired. Further, in case that it is determined that the optical disc is an erasable optical disc, the readability of the optical disc may be repaired by checking whether an incomplete session structure exists in the optical disc so as to perform a session erasure process on the optical disc based on the incomplete session structure.
In one implementation, the type of the optical disc may be determined by checking an optical disc suffix, and if the optical disc suffix is RW, the type of the optical disc may be determined to be an erasable optical disc, and then, whether an incomplete session structure exists in the optical disc may be checked. Here, when it is determined that the optical disc suffix is RW, it may be requested to acquire an instruction of the user to determine whether to perform the session erasure processing on the optical disc, and if it is determined to perform the session erasure processing on the optical disc according to the instruction transmitted by the user, the integrity check is started. Specifically, it may be checked whether an incomplete session structure exists in the optical disc by performing the following steps S220 to S230.
It should be noted that, before the optical disc is mounted, the recording operation has been performed on the optical disc, and one or more files are recorded on the optical disc. In the process of writing an optical disc, the writing process can be divided into multiple times of writing, and one or more files are written each time. Specifically, when one or more files are recorded on the optical disc each time, a corresponding session structure (session) is respectively constructed in the optical disc, so that the one or more files recorded on the optical disc each time are stored in the corresponding session structure, and a file system corresponding to the session structure is formed. Thus, the optical disc includes one or more session structures, and each session structure corresponds to a file system formed by recording once.
It should be noted that each session structure has a complete Disc data file system, such as ISO9660 or UDF (Universal Disc Format).
It should be noted that, in the optical disc recording process, power needs to be continuously supplied, and if the host is powered off or the external optical drive is powered off, the recording process is interrupted, and the current recording session structure (file system) is incomplete. Thus, due to the existence of an incomplete session structure in the optical disc, the mounting of the optical disc fails, and the computing device cannot read the files in the optical disc. Based on this, when the optical disc mount fails, it may be that there is an incomplete session structure in the optical disc, whether there is an incomplete session structure in the optical disc may be determined through detection, and when it is determined that there is an incomplete session structure in the optical disc, the session erasure processing may be performed on the optical disc based on the incomplete session structure, so as to read the data that is not erased in the optical disc.
Fig. 3 shows a schematic diagram of a data storage structure in an optical disc according to an embodiment of the present invention. As shown in fig. 3, a plurality of session structures in the optical disc have a contextual relationship. In particular, if one or more session structures have been built before the current session structure, the one or more session structures built before the current session structure are pre-session structures relative to the current session structure. The current session structure includes file information in one or more corresponding pre-session structures, and the file information of the pre-session structure includes information such as addresses and file names of files in the pre-session structure.
For example, in the schematic diagram of the data storage structure shown in fig. 3, session1 is a pre-session structure of session2, and session2 contains file information in session1, such as information of related files with file names "unified trust", "UOS", "best operating system", and the like, and also contains file information "dream" in session 2. session1 and session2 are both session3 pre-structures, and session3 includes file information in session1 and session2, for example, file names "unified trust", "UOS", "best operating system", "creation for dream", and other related files, and also includes file information in session3, such as "beautiful interface", "simple operation", "powerful function".
That is, each time a session structure is newly constructed, file information of one or more pre-session structures corresponding to the session structure is referenced to construct the session structure, so that each time the new session structure is constructed, the file information of the corresponding one or more pre-session structures is included in the new session structure, and thus, a pre-and-post reference relationship is formed among the session structures in the optical disc.
Based on the context reference relationship between the session structures, each time a session structure is constructed, the integrity of one or more pre-session structures needs to be ensured, in other words, a new session structure can be constructed based on the pre-session structure on the basis that the recording file based on the pre-session structure is not interrupted and the pre-session structure is complete. It is understood that the pre-session structure corresponding to each session structure present on the optical disc is complete. It is also understood that of all session structures existing on the optical disc, only the integrity of the last session structure cannot be determined, and any session structure before the last session structure is a complete session structure. Therefore, whether the incomplete session structure exists in the optical disc can be determined only by checking whether the last session structure is complete.
According to the method 200 of the present invention, it can be checked whether an incomplete session structure exists in the optical disc by performing the following steps S220 to S230. I.e. it is checked whether the last session structure is complete.
In step S220, the location information of the last session structure is obtained, and the location information includes the starting address (startAddress) and the next writable address (nextwritableadress) of the last session structure. Here, by determining the number of session structures in the optical disc, the position information of the last session structure can be acquired according to the number of session structures.
It should be noted that, according to the determined number of session structures in the optical disc, if the number of session structures is 1, it means that the last session structure is the only session structure on the optical disc, and there is no pre-session structure, in this case, the full-disc erasing process can be directly performed on the optical disc. And if the number of the session structures is more than 1, which indicates that one or more pre-session structures exist before the last session structure, acquiring the position information of the last session structure according to the number of the session structures.
In one implementation, the location information of the specified session structure (session) within the optical disc is obtained by calling a function read _ session _ info (session _ index), the core instruction is 0x52, and the return result of the function is parsed to determine the start address and the next writable address of the session structure. The obtained starting address startAddress and the next writable address nextWritableAddress are then stored in the memory.
Subsequently, in step S230, it is determined whether the start address of the last session structure is the same as the next writable address. If the starting address of the session structure is different from the next writable address, it is determined that the last session structure is incomplete. Conversely, if the starting address of the session structure is the same as the next writable address, it may be determined that the last session structure is complete.
Here, it should be noted that, since the recording of the optical disc is performed each time by taking the session structure as a unit, a closed session structure is added to each recording. For an optical disc in the initial unwritten state, an open session structure is provided by default, the start address of the open session structure is the same as the next writable address without insritting, and the length of the session structure is consistent with the length of the remaining available space. After successful writing based on a session structure each time, the session structure is in a closed state, and as long as the optical disc has a writable space, the last session structure is an open session structure, and the start address of the last session structure is consistent with the next writable address. If the starting address of the last session structure is not the same as the next writable address, it indicates that the last session structure is an incomplete session structure caused by recording failure.
In addition, any session structure preceding the last session structure is a complete session structure, as described above. Based on this, if the last session structure is complete, it can be determined that all session structures in the optical disc are complete, i.e. there is no incomplete session structure. If the last session structure is not complete, it indicates that there is an incomplete session structure in the optical disc as the last session structure.
In the case that it is determined that the last session structure is not complete, the erasing process may be performed on the section data corresponding to the last session structure by performing step S240.
In step S240, based on the position information of the last session structure, the erasure process is performed on the sector data corresponding to the last session structure in the optical disc.
Finally, in step S250, the optical disc after the erasing process is mounted again so as to read the file data in the optical disc. Thus, the readability repair of the optical disc after recording failure is realized.
It should be noted that according to the technical solution of the present invention, when it is determined that the last session structure is incomplete, only the sector data corresponding to the last session structure in the optical disc is erased, and based on this sector erasing scheme, only the incomplete sector data in the optical disc is erased, and the data in the original complete session structure is retained. In this way, each session structure in the erased optical disc contains a complete file system, and when the erased optical disc is mounted again, the kernel of the operating system can normally identify the file system in the optical disc, so that the optical disc can be successfully mounted, file data in one or more session structures which are not erased in the optical disc can be read, and new files can be continuously written into the optical disc.
In one implementation, a BLANK instruction and a corresponding parameter structure, which are introduced by a user process through a system call ioctl, are obtained, where the parameter structure can be referred to as a BLANK instruction parameter table defined according to the SSF 8090i specification shown in fig. 4. Subsequently, the erasure processing is performed on the sector data corresponding to the specified last session structure based on the parameter structure. Here, key fields in the parameter structure are a start position StartAddress and an erasure type BlankingType.
According to an embodiment, before erasing the sector data corresponding to the last session structure in the optical disc, digest calculation is also performed on one or more session structures located before the last session structure in the optical disc (i.e., digest calculation is performed on each complete session structure), so as to obtain a first digest value, and the first digest value is stored. Here, the first digest value is used for integrity check of a session structure in the optical disc after the erasure process in the following.
In addition, after erasing the sector data corresponding to the last session structure in the optical disc, digest calculation is performed on one or more session structures in the optical disc to obtain a second digest value. And comparing the second abstract value with the first abstract value so as to verify whether one or more session structures in the optical disc after the erasing process are complete. And when the second digest value of each session structure is determined to be the same as the corresponding first digest value, the data in the session structure in the optical disc after the erasure processing is complete, and no damaged or lost data exists. Otherwise, if the second digest value is different from the corresponding first digest value, it indicates that there is a session structure with incomplete data in the optical disc after the erasure process.
In one embodiment, the Digest value may be an MD5 value calculated by an MD5(Message-Digest Algorithm 5) Algorithm on data in the session structure. The first digest value is a first MD5 value and the second digest value is a second MD5 value.
According to one embodiment, the final computed digest value (first digest value, second digest value) may be the sum of the digest values of one or more session structures. That is, before the sector erasure process is performed on the optical disc, the sum of the first digest values is used as a basis for verification by calculating the first digest value of each session structure before the last session structure, summing the first digest values of all session structures, and storing the sum of the first digest values. Here, the first digest value may be stored in the temporary variable session array session _ sum [ ].
In addition, after the optical disc is subjected to the sector erasure processing, a digest calculation is performed on each session structure remaining in the optical disc to obtain a second digest value of each session structure, and then the second digest values of all session structures are summed, and the sum of the second digest values is compared with the sum of the first digest values stored in the session array to perform integrity check on one or more session structures in the optical disc after the erasure processing, that is, to check whether one or more session structures in the optical disc after the erasure processing are complete.
According to the method 200 for repairing readability of an optical disc of the present invention, when the mounting of the optical disc fails, it is determined whether an incomplete session structure exists in the optical disc by checking the integrity of the last session structure in the optical disc, and when it is determined that the last session structure is incomplete, only the section data corresponding to the last session structure in the optical disc is erased. Based on the sector erasure scheme, only the incomplete sector data in the optical disc is erased, and the original data in the complete session structure is retained. In this way, each session structure in the erased optical disc contains a complete file system, so that the optical disc can be successfully mounted, and new files can be continuously written into the optical disc. Therefore, according to the optical disc readability repair scheme of the present invention, the computing device can always read the existing complete file system data in the optical disc, and can still normally read the existing complete file system data in the optical disc after the recording failure of the optical disc.
A9, the method according to any one of a1-A8, wherein before mounting the optical disc, comprising the steps of: when one or more files are recorded on the optical disc each time, a corresponding session structure is respectively constructed in the optical disc, so that the one or more files recorded each time are stored in the corresponding session structure, and a file system corresponding to the session structure is formed.
A10, the method according to any one of A1-A9, wherein the session structures contain file information of corresponding one or more pre-session structures, and the file information of the pre-session structures comprises file addresses and file names in the pre-session structures.
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 multilingual spam-text recognition method of the present invention according to instructions in said program code 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 readability repair method, executed in an operating system of a computing device, comprising the steps of:
mounting an optical disc, and checking whether an incomplete session structure exists in the optical disc when mounting fails, wherein the steps of the mounting include:
acquiring the position information of the last session structure, wherein the position information comprises the starting address and the next writable address of the session structure;
judging whether the starting address of the session structure is the same as the next writable address, and if the starting address of the session structure is different from the next writable address, determining that the last session structure is incomplete;
based on the position information of the last session structure, erasing the sector data corresponding to the last session structure in the optical disc; and
and the optical disc after the erasing processing is mounted again so as to read the file data in the optical disc.
2. The method of claim 1, wherein the step of acquiring the location information of the last session structure comprises:
determining the number of session structures in the optical disc;
and acquiring the position information of the last session structure according to the number of the session structures.
3. The method of claim 2, wherein,
if the number of the session structures is 1, directly carrying out full disk erasing processing on the optical disk;
and if the number of the session structures is more than 1, acquiring the position information of the last session structure according to the number of the session structures.
4. The method according to any of claims 1-3, wherein the step of erasing the sector data corresponding to the last session structure in the optical disc comprises:
acquiring a BLANK instruction sent by system call and a corresponding parameter structure;
and erasing the corresponding section data based on the parameter structure.
5. The method according to any of claims 1-4, wherein before erasing the sector data corresponding to the last session structure in the optical disc, further comprising the steps of:
performing summary calculation on one or more session structures located before the last session structure in the optical disc to obtain a first summary value, and storing the first summary value;
after erasing the sector data corresponding to the last session structure in the optical disc, the method further comprises the following steps:
performing summary calculation on one or more session structures in the optical disc to obtain a second summary value;
and comparing the second abstract value with the first abstract value so as to verify whether one or more session structures in the processed optical disc are complete.
6. The method of claim 5, wherein the digest value is a sum of digest values of the one or more session structures;
storing the first digest value includes:
the first digest value is stored in a temporary variable.
7. The method of any one of claims 1-6, wherein the step of checking whether an incomplete session structure exists in the optical disc comprises:
determining a type of the optical disc based on an optical disc suffix;
if the type of the optical disc is determined to be an erasable optical disc, it is checked whether an incomplete session structure exists in the optical disc.
8. The method as claimed in claim 7, wherein after determining the type of the optical disc as an erasable optical disc, further comprising the steps of:
and determining whether the sector erasing processing is carried out on the optical disc, and if so, checking whether an incomplete session structure exists in 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-8.
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-8.
CN202110935489.1A 2021-08-16 2021-08-16 CD readability restoration method and computing device Active CN113655960B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110935489.1A CN113655960B (en) 2021-08-16 2021-08-16 CD readability restoration method and computing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110935489.1A CN113655960B (en) 2021-08-16 2021-08-16 CD readability restoration method and computing device

Publications (2)

Publication Number Publication Date
CN113655960A true CN113655960A (en) 2021-11-16
CN113655960B CN113655960B (en) 2023-09-12

Family

ID=78479143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110935489.1A Active CN113655960B (en) 2021-08-16 2021-08-16 CD readability restoration method and computing device

Country Status (1)

Country Link
CN (1) CN113655960B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114242119A (en) * 2021-12-17 2022-03-25 统信软件技术有限公司 Optical disc data repairing method, optical disc data checking method and computing device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003346422A (en) * 2002-05-29 2003-12-05 Sony Corp Optical disk device, reproducing method, program, and recording medium
US20050055500A1 (en) * 2003-09-08 2005-03-10 Park Yong Cheol Write-once optical disc and method for recording management information thereon
US20050052972A1 (en) * 2003-09-08 2005-03-10 Park Yong Cheol Write-once optical disc and method for recording management information thereon
CN1867985A (en) * 2003-09-08 2006-11-22 Lg电子株式会社 Write-once optical disc, and method for recording management information on the write-once optical disc
JP2008198349A (en) * 2008-03-24 2008-08-28 Hitachi Ltd Information recording medium, video signal recording device using the same, and video signal reproducing device
CN101521035A (en) * 2003-07-14 2009-09-02 Lg电子株式会社 Write-once optical disc, method and apparatus for recording management information on write-once optical disc
CN110192176A (en) * 2017-01-06 2019-08-30 甲骨文国际公司 Guaranteed file system hierarchy structured data integrality in cloud object repository
CN113066515A (en) * 2021-04-14 2021-07-02 统信软件技术有限公司 Optical disc recording method, computing equipment and readable storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003346422A (en) * 2002-05-29 2003-12-05 Sony Corp Optical disk device, reproducing method, program, and recording medium
CN101521035A (en) * 2003-07-14 2009-09-02 Lg电子株式会社 Write-once optical disc, method and apparatus for recording management information on write-once optical disc
US20050055500A1 (en) * 2003-09-08 2005-03-10 Park Yong Cheol Write-once optical disc and method for recording management information thereon
US20050052972A1 (en) * 2003-09-08 2005-03-10 Park Yong Cheol Write-once optical disc and method for recording management information thereon
CN1867985A (en) * 2003-09-08 2006-11-22 Lg电子株式会社 Write-once optical disc, and method for recording management information on the write-once optical disc
JP2008198349A (en) * 2008-03-24 2008-08-28 Hitachi Ltd Information recording medium, video signal recording device using the same, and video signal reproducing device
CN110192176A (en) * 2017-01-06 2019-08-30 甲骨文国际公司 Guaranteed file system hierarchy structured data integrality in cloud object repository
CN113066515A (en) * 2021-04-14 2021-07-02 统信软件技术有限公司 Optical disc recording method, computing equipment and readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114242119A (en) * 2021-12-17 2022-03-25 统信软件技术有限公司 Optical disc data repairing method, optical disc data checking method and computing device
CN114242119B (en) * 2021-12-17 2024-03-01 统信软件技术有限公司 Optical disk data repairing method, optical disk data checking method and computing device

Also Published As

Publication number Publication date
CN113655960B (en) 2023-09-12

Similar Documents

Publication Publication Date Title
US6691213B1 (en) Computer system and method for accessing a protected partition of a disk drive that lies beyond a limited address range of a host computer's BIOS
CN102934114B (en) For the checkpoint of file system
CN113553010B (en) Optical disc file verification method, optical disc recording method and computing device
US20130232325A1 (en) Electronic device to restore mbr, method thereof, and computer-readable medium
CN113823331B (en) Optical disc additional recording method and device and computing equipment
KR20090012821A (en) Method and apparatus for controlling i/o to optimize flash memory
TW201217968A (en) Data writing method, memory controller and memory storage apparatus
CN112988464A (en) Power-off protection method and computing device
CN111881012A (en) Log recording method, device, equipment and storage medium
JP2013530441A (en) Dismount storage volume
WO2021169163A1 (en) File data access method and apparatus, and computer-readable storage medium
CN113655960B (en) CD readability restoration method and computing device
CN113568787A (en) Power failure protection method, computing device and storage medium
US9009430B2 (en) Restoration of data from a backup storage volume
CN110489425B (en) Data access method, device, equipment and storage medium
US20050246485A1 (en) Method and apparatus for modifying reserve area of disk drive or memory
CN114661243A (en) Method, device, equipment and medium suitable for adjusting visible capacity of SSD
CN115373608A (en) Data storage method and device
CN113138778A (en) Operating system installation method and computing device
US8176274B2 (en) Electronic data reproduction
CN114242119B (en) Optical disk data repairing method, optical disk data checking method and computing device
CN113742140B (en) File backup method and device and computing equipment
CN113254888B (en) Method for acquiring hardware information, authorization control system and computing equipment
CN113703671B (en) Data block erasing method and related device
CN110018968B (en) Data reading method, electronic equipment and computer 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