The present invention contains subject matter related to Japanese Patent Application JP 2005-310826 filed in the Japanese Patent Office on Oct. 26, 2005, the entire contents of which are incorporated herein by reference.
1. Field of the Invention
The present invention relates to an information processing apparatus, an information processing method, and a compute program. More specifically, the present invention relates to an information processing apparatus, an information processing method, and a computer program that are capable of recoding file system information more reliably on an information recording medium, such as a hard disk, and minimizing recording errors occurring at power-off or the like.
2. Description of the Related Art
For example, when information is to be recorded on a medium (information recording medium), such as a hard disk, in a digital video camera or other types of information processing apparatuses, management information of a recorded data file, e.g., file system information including a FAT (file allocation table) and a directory entry is also written and updated.
Examples of the FAT include FAT16 and FAT32. These file systems manage recording position information and recording position chain information about respective data files recorded on a medium (information recording medium). A usage configuration of the FAT is described in Patent Document 1 (Japanese Unexamined Patent Application Publication No. 2005-141335), for example. The directory entry is file attribute information including the name (file name), date and time of generation, and starting cluster number information used for access of each file recorded on an information recording medium.
Recently, a hard disk has often been used as a data recording medium in digital video cameras and other types of information processing apparatuses, due to miniaturization of the hard disk. However, if the apparatus is dropped, the head of the hard disk or a magnetic disk is damaged and it may become impossible to read data therefrom. In order to prevent such a problem, mobile apparatuses provided with a hard disk typically include a drop detecting unit, such as an acceleration sensor. If the sensor detects a drop, power to the hard disk is shut off so that the head is brought into a save state.
With this process, the hard disk is protected from being damaged and a state where data cannot be read can be avoided. However, such a power-off is performed as an emergency measure. If the power-off occurs during recording of data, a data recording error with respect to an information recording medium may occur. Some countermeasures against a writing error have been suggested for real data, but countermeasures against a writing error for file system information, such as FAT information and a directory entry, have not adequately been made under the present circumstances.
The present invention has been made in view of the above-described problems and is directed to providing an information processing apparatus, an information processing method, and a computer program that are capable of recoding file system information more reliably on an information recording medium, such as a hard disk, and minimizing recording errors occurring at power-off or the like.
According to an embodiment of the present invention, there is provided an information processing apparatus including a recording control unit configured to control recording of information on an information recording medium and recording of file system information corresponding to a file storing the recorded information. The recording control unit performs a sequential recording process of the file system information by switching between two modes of writing information on the information recording medium in accordance with a preset condition. The two modes include (a) a normal write mode where the file system information is not preferentially recorded; and (b) an immediate write mode where the file system information is preferentially recorded.
The recording control unit may perform the sequential recording process of the file system information by switching the mode from the normal write mode to the immediate write mode on the basis of at least any of a count value, indicating the number of data recording commands issued from start of the normal write mode, and a timer value, indicating elapsed time from start of the normal write mode.
The recording control unit may compare a threshold that varies depending on the type of information recorded on the information recording medium with at least any of the count value and the timer value, and switch the mode from the normal write mode to the immediate write mode in accordance with the comparison result.
In the immediate write mode, the recording control unit may control a write process of the file system information on the information recording medium and perform a cache flash process to complete writing information stored in a cache in an information recording medium driving unit on the information recording medium.
The recording control unit may switch the mode to the normal write mode after performing the write process of the file system information on the information recording medium in the immediate write mode and the cache flash process.
In the immediate write mode, the recording control unit may perform a write process of the file system information on the information recording medium, the file system information including a file allocation table and a directory entry.
The recording control unit may hold file size information indicating the size of file written on the information recording medium. The recording control unit may perform a file seek at restart of writing information after a pause of writing information on the basis of the file size information at completion of the last immediate write mode before the pause, so as to ensure the continuity at an information writing position.
The information processing apparatus may further include a buffer configured to temporarily store data to be recorded on the information recording medium; and an application executing unit configured to output an execution command of an information recording process on the information recording medium. The application executing unit may hold a pointer indicating a data recording end position at completion of the immediate write mode, the pointer corresponding to the data stored in the buffer, and may perform a process by using the pointer as a write start position at restart of writing information after a pause of an information writing process.
The recording control unit may write management information on the information recording medium by applying the immediate write mode.
The recording control unit may set the immediate write mode when opening a file in which information is to be recorded, and may perform a cache flash process to complete writing information stored in a cache in an information recording medium driving unit on the information recording medium during a file closing process.
The recording control unit may set the immediate write mode and perform setting so as to prohibit use of a cache in an information recording medium driving unit when opening a file in which information is to be recorded, and may perform control so that information is written without using the cache.
According to another embodiment of the present invention, there is provided an information processing method including the step of controlling recording of information on an information recording medium and recording of file system information corresponding to a file storing the recorded information. The recording control step performs a sequential recording process of the file system information by switching between two modes of writing information on the information recording medium in accordance with a preset condition. The two modes include (a) a normal write mode where the file system information is not preferentially recorded; and (b) an immediate write mode where the file system information is preferentially recorded.
The recording control step may include the step of performing the sequential recording process of the file system information by switching the mode from the normal write mode to the immediate write mode on the basis of at least any of a count value, indicating the number of data recording commands issued from start of the normal write mode, and a timer value, indicating elapsed time from start of the normal write mode.
The recording control step may include the step of comparing a threshold that varies depending on the type of information recorded on the information recording medium with at least any of the count value and the timer value, and switching the mode from the normal write mode to the immediate write mode in accordance with the comparison result.
In the immediate write mode, the recording control step may include the step of controlling a write process of the file system information on the information recording medium and performing a cache flash process to complete writing information stored in a cache in an information recording medium driving unit on the information recording medium.
The recording control step may include the step of switching the mode to the normal write mode after performing the write process of the file system information on the information recording medium in the immediate write mode and the cache flash process.
In the immediate write mode, the recording control step may include the step of performing a write process of the file system information on the information recording medium, the file system information including a file allocation table and a directory entry.
The recording control step may include the step of holding file size information indicating the size of file written on the information recording medium, and performing a file seek at restart of writing information after a pause of writing information on the basis of the file size information at completion of the last immediate write mode before the pause, so as to ensure the continuity at an information writing position.
The information processing method may further include the steps of: holding a pointer indicating a data recording end position at completion of the immediate write mode, the pointer corresponding to a buffer temporarily storing data to be recorded on the information recording medium; and performing a process by using the pointer as a write start position at restart of writing information after a pause of an information writing process.
The information processing method may further include the step of writing management information on the information recording medium by applying the immediate write mode.
The information processing method may further include the step of setting the immediate write mode when opening a file in which information is to be recorded and performing a cache flash process to complete writing information stored in a cache in an information recording medium driving unit on the information recording medium during a file closing process.
The information processing method may further include the step of setting the immediate write mode and performing setting so as to prohibit use of a cache in an information recording medium driving unit when opening a file in which information is to be recorded, and writing information without using the cache.
According to another embodiment of the present invention, there is provided a computer program allowing an information processing apparatus to control an information recording process. The program includes the step of controlling recording of information on an information recording medium and recording of file system information corresponding to a file storing the recorded information. The recording control step performs a sequential recording process of the file system information by switching between two modes of writing information on the information recording medium in accordance with a preset condition. The two modes include (a) a normal write mode where the file system information is not preferentially recorded; and (b) an immediate write mode where the file system information is preferentially recorded.
The computer program according to the embodiment of the present invention can be provided via a storage medium (e.g., a CD, an FD, or an MO) or a communication medium (e.g., a network), which is provided to a multi-purpose computer system capable of performing various program codes in a computer-readable manner. By providing this program in a computer-readable manner, a process according to the program can be realized in the computer system.
Further features of the present invention will become apparent from the following description of exemplary embodiments with reference to the attached drawings. In this specification, the system means a logical set of a plurality of apparatuses, and the apparatuses need not always be placed in the same package.
According to an embodiment of the present invention, a sequential recording process of file system information is performed by switching between two modes of writing information on an information recording medium in accordance with a preset condition, the two modes including (a) a normal write mode where the file system information is not preferentially recorded; and (b) an immediate write mode where the file system information is preferentially recorded. For example, the sequential recording process of the file system information is performed by switching the mode from the normal write mode to the immediate write mode on the basis of at least any of a count value, indicating the number of data recording commands issued from start of the normal write mode, and a timer value, indicating elapsed time from start of the normal write mode. With this configuration, even if power-off occurs due to a drop of the apparatus, a state where no file system information (e.g., a FAT and a directory entry) is written can be prevented, and a data recording process can be performed while minimizing recording errors.
Hereinafter, an information processing apparatus, an information processing method, and a computer program according to an embodiment of the present invention are described in detail with reference to the drawings. The description is made in accordance with the following items.
As described above, when information is to be recorded on a medium (information recording medium), such as a hard disk, in a digital video camera, a PC (personal computer), or other information processing apparatuses, a process is performed by applying management information of a recorded data file, e.g., a FAT (file allocation table). Examples of the FAT include FAT16 and FAT32. These file systems manage recording position information and recording position chain information about each data file recorded on a medium (information recording medium). The details of the FAT16/32 are described in, for example, “Microsoft Extensible Firmware Initiative FAT32 File System Specification”.
Hereinafter, configurations of data formatted by FAT16 and FAT32 in a case where a partition is provided in a hard disk are described with reference to
As shown in
As shown in
As shown in
At startup, a startup code (program) is read from a startup code area of the MBR. The read startup code of the MBR refers to the partition tables in a partition table area placed just after the startup code shown in
A plurality of partition tables (e.g., four tables) can be provided. As described above, each partition table holds information about the position (start address) and size (partition size) of each of partition area formed by dividing a recording area of a hard disk. A sign to the partition table is attached in 2 bytes (OE, OF) after the partition table area.
In the CHS method, an address (position) on a recording medium (hard disk) is specified by using three parameters: cylinder, head, and sector as a set. On the other hand, in the LBA method, numbers (block addresses (logical addresses)) from 0 (zero) are assigned to respective accessible unit blocks (e.g., units of sectors) on a recording area of a hard disk, so that an address (position) on the recording area of the hard disk is specified by specifying a corresponding number.
As shown in
Also, as shown in
In the CHS method, a physical configuration of a hard disk is used as is and three parameters (cylinder, head, and sector) are used to specify an address, so that a software process is complicated. On the other hand, in the LBA method, an address can be specified very easily by using a single parameter (block address). For this reason, the LBA method is the mainstream of a method for specifying an address in a hard disk. Also, in many of other recording media, such as various memory cards that have widely been used as so-called removable media, an address can be specified in the LBA method. Any of the CHS method and the LBA method can be applied in the information processing apparatus according to the embodiment of the present invention.
Management information including a file name and date/time of recording is set in each file recorded in the information recording medium.
As shown in
The starting cluster number is information to specify a cluster where recording of data of a file starts in a data area of a partition. In other words, the starting cluster number indicates a cluster where recording of data of the file starts among clusters in the data area of the partition. In this example, as shown in
As shown in
In the data configurations of FAT shown in
Now, an example of a data configuration of a typical file allocation table (FAT) is described with reference to
As described above, data of each data file is recorded on an information recording medium while being distributed to one or more clusters. The FAT stores chain information of cluster numbers of clusters storing data of each file.
The FAT shown in
At a position of the cluster number of a cluster storing data of each file, the cluster number of a cluster storing next data is recorded. A code [0FFFFFFFh] indicating EOF (end of file) is recorded at a position of the last cluster. A starting cluster number is recorded in a directory entry of each file described with reference to
For example, starting cluster numbers recorded in directory entries of respective files are as follows.
Since the starting cluster number of the first file is [00000007h], first data of the first file can be obtained by reading the cluster of the cluster number [00000007h]. The cluster number of the cluster storing next data of the first file can be known on the basis of the information recorded at the position of the cluster number [00000007h] of the FAT shown in
Likewise, the cluster number of a cluster storing next data of the first file is recorded at the position of the cluster number [00000008h] of the FAT shown in
As a result, it is determined that the data of the first file is stored in the clusters specified by the cluster numbers [00000007h], [00000008h], and [00000009h].
Likewise, it is determined that the data of the second file is stored in the clusters specified by the cluster numbers [0000000Ah], [0000001Fh], [00000025h], [00000031h], and [00000030h].
Also, it is determined that the data of the third file is stored in the clusters specified by the cluster numbers [0000001Bh], [00000011h], [00000012h], [00000013h], [00000014h], and [00000003h].
Also, it is determined that the data of the fourth file is stored in the clusters specified by the cluster numbers [0000002Ch], [0000002Dh], [0000002Eh], [0000002Fh], [00000038h], [00000039h], [0000003Ah], and [0000003Bh].
Accordingly, the data can be obtained from these clusters.
The FAT shown in
As described above, each file recorded in an information recording medium has the following three elements:
Hereinafter, a system configuration of an information processing apparatus performing the above-described processes is described. The processes of recording data on an information recording medium and obtaining or playing back data from the information recording medium are performed by a CPU (central processing unit) of the information processing apparatus, such as a digital video camera or a PC (personal computer), in accordance with a predetermined data processing program.
As shown in
When data is to be recorded on the information recording medium 104 or when data is to be played back from the information recording medium 104, data is written or played back by the functions of the file system 102 and the device driver 103. As in a known art, the process is performed in the configuration of: file system⇄device driver⇄recording medium (hard disk).
If a plurality of different files are applied as continuously-recorded files during recording of data, a special code is recorded to a file allocation table (FAT) that is applied by the file system. If a plurality of different files are applied as continuously-recorded files during playback of data, the files are switched on the condition of detecting the special code from the FAT.
The file system (core) 203 transmits/receives data and commands to/from the application 201 via the file system (interface) 202. The file system (core) 203 controls a device driver 204 on the basis of information from the application 201 or the file system (interface) 202 and writes data and file system information on the information recording medium 205, updates the data and information, or reads the data and information.
The application 201, the file system (interface) 202, the file system (core) 203, and the device driver 204 access and use a memory 341, which serves as storage of programs and parameters used for processes in respective units and as a work area in data processing.
The file system (core) 203 holds mount drive information 311 including the type of a recording medium and format information and controls recording and playback of data in accordance with the drive information 311. The file system (core) 203 includes a recording/playback controller 320 to control recording and playback of data and a medium controller 330 to control a medium.
The recording/playback controller 320 includes a FAT controller 321 to record and refer to a FAT, a cluster controller 322 to determine a cluster as data recording position information and determine a playback position based on a cluster number, and a directory entry controller 323 to generate or refer to a directory entry (see
The medium controller 330 includes a position calculator 331, controls the device driver 204 on the basis of cluster information determined by the cluster controller 322 or cluster chain information of a FAT, determines a position on a disk where data is to be recorded or played back on the basis of a cluster number, and records or plays back data from the position on the disk via the device driver 204 in accordance with the determined position information.
3. Details of Information Recording Process Performed by Information Processing Apparatus
Hereinafter, a sequence of recording data on the information recording medium in the configuration shown in
(3.1) Typical Information Recording Process According to Known Art
The sequence diagrams shown in
When data is to be recorded, the application 201 outputs a file open command to the file system (interface) 202 and the command is further transmitted to the file system (core) 203 in step S101. The file system (core) 203 searches for a free cluster by applying the device driver 204 and generates a directory entry (DE) for a new file. As described above with reference to
After this process, a process completion notice is transmitted to the application 201, so that the file opening process completes in step S102. Then, in step S103, the application 201 starts writing data in the set file, that is, starts a file writing process. In this file writing process, too, the application 201 outputs a file write command to the file system (interface) 202, and the command is further transmitted to the file system (core) 203. The file system (core) 203 writes data on the set file by applying the device driver 204, that is, performs a file writing process. Then, a completion notice is transmitted to the application 201. Accordingly, the file writing process for one data write unit ends in step S104.
Then, data writing is continuously performed. After data writing in the file ends, the application 201 starts a file closing process in step S111 shown in
In step S113, write of a directory entry (DE) is performed. Herein, FAT data and a directory entry corresponding to the file in which data has been written are written. The directory entry includes various attribute information corresponding to the file, as described above with reference to
In step S114, completion of these processes is notified to the application 201 via the file system (interface) 202, so that the file closing process ends.
As can be understood from the sequence diagrams shown in
When a hard disk is used as an information recording medium and when a drop of the apparatus is detected, power to the hard disk is shut off to save the head as an emergency measure in order to prevent damage of the head of the hard disk or the disk.
If power to the hard disk as a recording medium is shut off during the data writing sequence described above with reference to
The FAT information is intermittently recorded on the information recording medium. However, since the directory entry has no information, cluster chain information written in the FAT cannot be used. Thus, the real data written in clusters recorded in the FAT are set as unreadable clusters, that is, so-called “orphan clusters”. In other words, many unreadable data are generated.
In order to prevent the generation of unreadable data, the information processing apparatus according to the embodiment of the present invention performs a data recording process in a sequence that is different from the data recording sequence described above with reference to
(3.2) Information Recording Process Performed by Information Processing Apparatus According to the Embodiment of the Present Invention
Hereinafter, the information recording process performed in the information processing apparatus according to the embodiment of the present invention is described in detail.
In this information processing apparatus, the following two modes:
In the “immediate write mode”, the file system (core) 203 writes file system information on the information recording medium. That is, updated latest FAT information and directory entry are written on the information recording medium.
After the file system information has been written on the information recording medium in the “immediate write mode”, an internal cache set in an information recording medium driving unit, such as a HDD (hard disk drive), is flashed, that is, a cache flash process is performed to compete write of information recorded in the internal cache on the information recording medium. Accordingly, the FAT and directory entry (DE) information are reliably reflected on the information recording medium.
As described above, in the information processing apparatus according to the embodiment of the present invention, the file system (interface) 202 allows the file system (core) 203 to switch to the “immediate write mode” every time a predetermined condition is satisfied, and sequentially writes file system information, such as a FAT and a directory entry.
The predetermined condition includes, for example,
Now, an example of setting a condition to switch the mode from the normal write mode to the immediate write mode in the information processing apparatus according to the embodiment of the present invention is described with reference to
For example, when the mode is to be switched every data recording time of a predetermined unit, the mode is switched from the normal write mode to the immediate write mode in accordance with a threshold shown in
After file system information such as a FAT and a directory entry has been written on the information recording medium in the immediate write mode, the counter value and the timer value are reset, so that the mode returns to the normal write mode and recording of real data starts. When the counter value from start of the normal write mode becomes 19 or more or after 8 seconds set as the timer threshold have passed, the mode is switched from the normal write mode to the immediate write mode. This process is performed repeatedly.
When moving images of a high bit rate are to be recorded, a large counter threshold is set. In a process of recording moving images of 10 Mbps, the mode is switched from the normal write mode to the immediate write mode when the counter value from start of the normal write mode becomes 199 or more or after 8 seconds set as the timer threshold have passed. This is because, in recording of moving images of a high bit rate, write requests are frequently issued by the application. That is, if the mode is switched every data recording time of a predetermined unit and if the moving images to be recorded have a high bit rate, a large counter threshold is set and an immediate write process is reliably performed every predetermined time, so as to write a FAT and a directory entry.
The timer threshold is variable with respect to a bit rate. Basically, in this example, a process is controlled on the basis of a counter value, and file system information is written at predetermined intervals even if no data recording request is issued by the application 201. Also, during recording of a management information file (holding index information of each recorded file, for example) other than real data, such as moving image data and still image data, a process of writing a FAT and a directory entry occurs. In a process of writing such a file, both the counter threshold and the timer threshold are 0 (zero) as in recording of still images. In a process of recording still images, the process is performed constantly in the immediate write mode.
The threshold setting table shown in
In the threshold setting table shown in
In the threshold setting table shown in
After file system information such as a FAT and a directory entry has been written on the information recording medium in the immediate write mode, the counter value and the timer value are reset, the mode returns to the normal write mode, and recording of real data starts. When the counter value from start of the normal write mode becomes equal to or larger than the threshold or after 8 seconds set as the timer threshold have passed, the mode is switched from the normal write mode to the immediate write mode. This process is repeatedly performed.
With the above-described process, recording of a FAT and a directory entry is sequentially performed. Even if power to the information recording medium, such as a hard disk, is shut off and recording of data is stopped, the amount of write error data of file system information, such as a FAT and a directory entry, is reduced. Accordingly, generation of the above-described orphan clusters can be minimized.
Hereinafter, a data recording sequence performed in the information processing apparatus according to the embodiment of the present invention is described. First, the following processes are described with reference to flowcharts.
First, (a) process of opening a file is described with reference to the flowchart shown in
In step S302, the file system (interface) 202 resets a counter value of a referable counter of the file system (interface) 202. This counter counts the number of write requests issued by the application 201 from start of a data recording process in the normal write mode, as described above.
In step S303, the file system (interface) 202 sets the normal write mode and starts a data recording process in the normal write mode.
Next, a sequence of the recording mode switching process based on only the counter is described with reference to
In step S402, the file system (interface) 202 compares the count value of the counter with a predetermined counter threshold. The threshold is included in the threshold data described above with reference to
If it is determined in step S402 that the count value of the counter is smaller than the predetermined counter threshold, the process proceeds to step S411, where a data writing process, that is, file write, is performed in the normal write mode.
If it is determined in step S402 that the count value of the counter is equal to or larger than the predetermined counter threshold, the process proceeds to step S403, where the file system (interface) 202 allows the file system (core) 203 to switch to the immediate write mode. Then, the file system (interface) 202 resets the count value of the counter in step S404, and allows the file system (core) 203 to perform file write of writing file system information, such as a FAT and a directory entry, in step S405.
Then, in step S406, the file system (interface) 202 flashes the internal cache set in the information recording medium driving unit, such as a HDD, that is, performs a cache flash process to complete writing information recorded in the internal cache on the information recording medium. With this process, FAT and directory entry (DE) information can be reliably reflected on the information recording medium.
Then, in step S407, the file system (interface) 202 returns the mode from the immediate write mode to the normal write mode. The file system (interface) 202 repeatedly performs the process shown in
Next, a sequence of the recording mode switching process based on not only the counter but also the timer is described with reference to the flowchart shown in
In step S402, the file system (interface) 202 compares the count value of the counter with a predetermined counter threshold. The threshold is included in the threshold data described above with reference to
If it is determined in step S402 that the count value of the counter is smaller than the predetermined counter threshold, the process proceeds to step S421, where the file system (interface) 202 refers to a timer value. The timer measures the elapsed time after start of a data recording process in the normal write mode. Then, the process proceeds to step S422, where the file system (interface) 202 compares the timer value with a predetermined timer threshold. The timer threshold is included in the threshold data described above with reference to
If it is determined in step S402 that the count value of the counter is equal to or larger than the predetermined counter threshold, or if it is determined in step S422 that the timer value is equal to or larger than the predetermined timer threshold, the process proceeds to step S403, where the file system (interface) 202 allows the file system (core) 203 to switch to the immediate write mode. Then, the file system (interface) 202 resets the count value of the counter in step S404, and allows the file system (core) 203 to perform file write, which is a process of writing file system information such as a FAT and a directory entry, in step S405.
Then, in step S406, the file system (interface) 202 flashes the internal cache set in the information recording medium driving unit, such as a HDD, that is, performs a cache flash process to complete writing information recorded in the internal cache on the information recording medium. With this process, FAT and directory entry (DE) information can be reliably reflected on the information recording medium.
Then, in step S407, the file system (interface) 202 returns the mode from the immediate write mode to the normal write mode. The file system (interface) 202 repeatedly performs the process shown in
The information processing apparatus according to the embodiment of the present invention records data in accordance with any of the processes shown in
Each of the sequence diagrams shown in FIGS. 13 to 15 shows, from the left, the application 201, the file system (interface) 202, the file system (core) 203, and the device driver 204, and also shows a time-series sequence of transmitting commands and data among the respective elements.
First, when data is to be recorded, the application 201 outputs a file open command to the file system (interface) 202 in step S501. Further, the command is transmitted to the file system (core) 203. The file system (core) 203 searches for a free cluster by applying the device driver 204 and generates a directory entry (DE) for a new file. As described above with reference to
After this process, a process completion notice is transmitted to the application 201, so that the file opening process completes in step S502. Then, in step S503, the application 201 starts a file write process of writing data in the set file. In the file write process, the application 201 outputs a file write command to the file system (interface) 202. Furthermore, the command is transmitted to the file system (core) 203. The file system (core) 203 performs a file write process of writing data in the set file by applying the device driver 204, and then a completion notice is transmitted to the application 201. In step S504, the file write process of one data write unit ends. At this time, the file system (interface) 202 increments the counter by one, that is, performs step S401 in the process shown in
Then, data writing is continuously performed. In step S511, the file system (interface) 202 switches the write mode on the basis of a counter value or a timer value. The switching of the write mode is a process including comparison with a threshold and determination in accordance with the flowchart described above with reference to
At the switching of the write mode, the file system (interface) 202 allows the file system (core) 203 to switch to the immediate write mode. The file system (core) 203 writes real data in the immediate write mode in step S512, and then writes file system information on the information recording medium in steps S522 and S523 shown in
After the file system information has been written, a process completion notice is transmitted to the file system (interface) 202. Then, the file system (interface) 202 flashes the internal cache in step S524. That is, the file system (interface) 202 performs a cache flash process to complete write of information recorded in the internal cache on the information recording medium. With this process, the FAT and the directory entry (DE) information can be reliably reflected on the information recording medium.
After the process, the file system (interface) 202 switches the mode from the immediate write mode to the normal write mode in step S525, and continues writing real data. At the switching of the mode, the counter and the timer are reset.
After data writing in the normal write mode has been continued, the write mode is switched again to the immediate write mode on the basis of the counter value or the timer value in step S526 shown in
With this process, recording of a FAT and a directory entry is sequentially performed. Therefore, even if the power to the information recording medium such as a hard disk is shut off and even if recording of data stops, the amount of write error data of file system information such as a FAT and a directory entry reduces. Accordingly, generation of the above described orphan clusters, that is, cluster data that is recorded as data constituting a file in the information recording medium but cannot be played back, can be minimized.
The information processing apparatus according to the embodiment of the present invention has such a configuration that data recording errors can be minimized when power to the information recording medium such as a hard disk is shut off. Hereinafter, an example of a sequence of a process of shutting off the power to the information recording medium such as a hard disk is described with reference to the flowchart shown in
Typically, a mobile apparatus provided with a hard disk includes a drop detecting unit, such as an acceleration sensor. If the sensor detects a drop, power to the hard disk is shut off so that the head is brought into a save state. With this configuration, the hard disk can be protected against damage, and a state where data cannot be read can be avoided. The information processing apparatus performing such a process performs a process shown in
In the information processing apparatus according to the embodiment of the present invention, even if the power is urgently shut off, file system information including a FAT and a directory entry is recorded on the information recording medium at predetermined intervals, so that orphan clusters from which data cannot be read can be minimized.
Hereinafter, a process sequence of restarting data recording after data recording has stopped due to power-off is described with reference to
The application 201 to record moving or still images manages the pointers shown in
A write pointer is a pointer that is incremented in synchronization with an encoding result; a read pointer 1 is a pointer that is incremented in synchronization with file write; and a read pointer 2 is a pointer indicating a position where write of file system information on the information recording medium in the immediate write mode and a cache flash process have completed in the file system (interface) 202. For example, if a data recording process is to be restarted after pause of data recording due to power-off, the application 201 provides a write command to the file system so that recording is restarted from the position indicated by the read pointer 2.
The file system (interface) 202 holds file size information [X] of a file written on the information recording medium at the end of the latest immediate write mode. At restart of recording, the file system (interface) 202 instructs the file system (core) 203 to perform file close→file open→file seek to the position X, so as to be ready for restarting recording. Accordingly, the continuity between the data written on the information recording medium before the end of the immediate write mode and the data to be written after restart of recording can be ensured.
Hereinafter, a process sequence of restarting data recording after recording has stopped due to power-off is described with reference to
After the process, a process completion notice is transmitted to the application 201, and the file opening process completes in step S602. Then, the application 201 starts writing data in the set file, that is, a file write process, in step S603. In the file write process, the application 201 outputs a file write command to the file system (interface) 202, and the command is transmitted to the file system (core) 203. The file system (core) 203 performs the file write process, that is, writes data in the set file by applying the device driver 204. Then, a completion notice is transmitted to the application 201, so that the file write process of one data write unit ends.
During the file write process, the file system (interface) 202 increments the counter by one in step S604. In other words, the file system (interface) 202 performs step S401 shown in
After that, data writing is continuously performed. Then, in step S606, the file system (interface) 202 switches the write mode on the basis of the counter value or the timer value. This mode switching is a process including comparison with a threshold and determination in accordance with the flowchart shown in
At the switching of the write mode, the file system (interface) 202 allows the file system (core) 203 to switch to the immediate write mode, and a FAT and a directory entry are written. The file system (interface) 202 performs a process of flashing an internal cache of the medium in step S611 in the immediate write mode. That is, the file system (interface) 202 performs a cache flash process to complete write of information recorded in the internal cache on the information recording medium.
Also, the file system (interface) 202 updates and holds file size information [X] of the file written on the information recording medium at the end of the immediate write mode in step S612. Then, in step S613, the file system (interface) 202 switches the mode to the normal write mode. The application 201 increments the file write completion read pointer 1 shown in
After this process, assume that power-off occurs due to drop of the apparatus in step S615 in the normal write mode and that recording is restarted in step S621. At restart of data recording, the file system (interface) 202 clears the counter in step S622, and allows the file system (core) 203 to perform a file closing process and a file opening process. Then, in step S623, the file system (interface) 202 refers to the file size information [X] of the file written on the information recording medium at the end of the last immediate write mode before the power-off and seeks the position X in the file.
On the other hand, the application 201 restarts data recording from the position of the read pointer 2 in step S624. As described above with reference to
The data recording process performed in the information processing apparatus according to the embodiment of the present invention has been described above in detail. This recording sequence can be applied not only to write of file system information including a FAT and a directory entry accompanying a process of recording real data of moving or still images, but also to recording of a management information file holding reference information attached to moving image data or still image data. A process sequence of writing such a management information file is described below with reference to
First, a procedure of file opening and file closing processes performed by the file system (interface) 202 of the information processing apparatus according to the embodiment of the present invention is described with reference to
First, (a) file opening process and (b) file closing process as example 1 are described with reference to
After this process, write of management data (file write) is performed. That is, in this example, all management information is processed in the immediate write mode, and after the management information has been written, a FAT and a directory entry are reliably written.
Next, a file closing process is described with reference to
In this example, a FAT and directory entry (DE) information are reliably reflected on the information recording medium by performing a cache flash process to complete write of information recorded in the internal cache on the information recording medium at file closing.
Next, file opening and file closing processes of a management information file according to example 2 are described with reference to
After this process, write of management data (file write) is performed. That is, in this example, management information is written without using the internal cache, and thus it can be prevented that a write error occurs due to loss of data in the internal cache at power-off.
Next, a file closing process according to this example is described with reference to
In the information processing apparatus according to the embodiment of the present invention, a process of writing management information, such as index information of recorded files, is performed in accordance with the process sequence shown in
Hereinafter, an entire sequence of writing management information, such as index information of recorded files, is described with reference to the sequence diagrams shown in
Before writing management information, such as index information of recorded files, the application 201 performs a process of closing a moving/still image file in step S901. Then, a process of opening a management information file is performed in step S902. This step corresponds to the flowchart shown in
Then, write of management information in the file starts in step S904. This process is performed in the immediate write mode. More specifically, the file system (interface) 202 outputs a file write command to the system file (core) 203. Then, the file system (core) 203, which is set in the immediate write mode, writes management information in the immediate write mode in step S905, and also writes file system information on the information recording medium in steps S906 and S907. That is, FAT information (S906) and a directory entry (S907) that are updated and have the latest information are written on the information recording medium.
After the file system information has been written, a process completion notice is transmitted to the file system (interface) 202, and then the file system (interface) 202 performs a process of flashing the internal cache in step S911 shown in
Then, write of management information continues in the immediate write mode. In step S912, when recording of all management information completes, the application 201 performs a process of closing the management information file. This closing process is performed in accordance with the flowchart shown in
The file system (interface) 202 outputs a file close command to the file system (core) 203. The file system (core) 203 writes file system information on the information recording medium after writing management information. Then, the file system (interface) 202 performs a process of flashing the internal cache in step S913 shown in
As described above, in this example, a cache flash process is performed to complete write of information recorded in the internal cache on the information recording medium at closing the file, so that a FAT and directory entry (DE) information can be reliably reflected on the information recording medium. Note that, as described above with reference to
4. Examples of Configuration of Information Processing Apparatus
Hereinafter, exemplary configurations of a digital video camera and a PC (personal computer) are described as examples of a configuration of the information processing apparatus performing the above-described processes, with reference to
First, an example of a configuration of a digital video camera is described with reference to
The image pickup mode includes a moving image pickup mode of picking up moving images and recording the images together with voice collected at the same time on a recording medium; and a still image pickup mode of picking up still images. In the VTR mode, supplied data is recorded by operating an operation input unit 420 including a recording button switch and so on, and desired data recorded on the recording medium can be played back by operating a playback button switch.
As shown in
The control unit (CPU) 401 performs processes in accordance with various process programs stored in the ROM 419. The RAM 418 is mainly used as a work area to temporarily store an intermediate result in each process.
The operation input unit 420 includes various operation keys and function keys, e.g., a mode switching key to switch operation modes, such as a moving image shooting mode, a still image shooting mode, and a VTR mode; a shutter key to shoot still images; a shooting start key to shoot moving images; a recording key; a playback key; a stop key; a fast-forward key; and a fast-rewind key. The operation input unit 420 receives an operation input by a user and supplies an electric signal corresponding to the operation to the control unit (CPU) 401.
The control unit (CPU) 401 reads a program to perform a desired process from the ROM 419 in accordance with an operation input by the user and executes the program. The control unit (CPU) 401 controls each unit so as to control a process in accordance with instructions from the user. Various types of information recording media, such as a magnetic disc, an optical disc, a magneto-optical disc, and a semiconductor memory, can be loaded in the digital video camera. The digital video camera records various information on these types of recording media via the drive 432 and plays back information recorded thereon.
Hereinafter, an example of a hardware configuration of a PC, which is an example of the information processing apparatus performing the above-described processes, is described with reference to
A ROM (read only memory) 502 stores programs and operation parameters used by the CPU 501. A RAM (random access memory) 503 stores programs used in execution of the CPU 501 and parameters changing in the execution. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a host bus 504 including a CPU bus or the like.
The host bus 504 connects to an external bus 506, which is a PCI (peripheral component interconnect/interface) bus or the like, via a bridge 505.
A keyboard 508 and a pointing device 509 are input devices operated by a user. A display 510 includes a liquid crystal display device or a CRT (cathode ray tube) and displays various information by text or image.
A HDD (hard disk drive) 511 includes a hard disk, drives the hard disk, and allows a program executed by the CPU 501 or information to be recorded or played back. The hard disk is used as a storage area of an image data file and stores various computer programs, such as a data processing program.
A drive 512 reads data or a program recorded on a removable recording medium 521, such as a magnetic disc, an optical disc, a magneto-optical disc, or a semiconductor memory, and supplies the data or the program to the RAM 503 via an interface 507, the external bus 506, the bridge 505, and the host bus 504.
A connection port 514 is a port to connect an external apparatus 522 and includes connection units of USB, IEEE1394, and the like. The connection port 514 connects to the CPU 501 and so on via the interface 507, the external bus 506, the bridge 505, and the host bus 504. A communication unit 515 connects to a network and communicates with other information processing apparatuses.
The configurations of the information processing apparatuses shown in
The present invention has been described in detail with reference to a specific embodiment. However, it should be understood by those skilled in the art that various modifications, combinations, sub-combinations and alterations may occur depending on design requirements and other factors insofar as they are within the scope of the appended claims or the equivalents thereof.
The series of processes described above in this specification can be performed by hardware, software, or a combination of hardware and software. When the processes are performed by software, a program including a process sequence can be installed in a memory of a computer incorporated in a dedicated hardware so as to be executed, or can be installed in a multi-purpose computer capable of performing various processes so as to be executed.
For example, the program can be recorded in advance in a hard disk or a ROM as a recording medium. Alternatively, the program can be temporarily or permanently stored (recorded) on a removable recording medium, such as a flexible disk, a CD-ROM (compact disc read only memory), an MO (magneto optical) disc, a DVD (digital versatile disc), a magnetic disc, or a semiconductor memory. These types of removable recording media can be provided as so-called package software.
The program can be installed from the above-described removable medium to a computer, can be wirelessly transferred from a download site to the computer, or can be transferred in a wired manner through a network, such as a LAN (local area network) or the Internet. The computer can receive the transferred program and install the program in a recording medium, such as an internal hard disk.
The various processes described in this specification may be performed in time series in accordance with the described order. Alternatively, the processes may be performed in parallel or individually in accordance with a processing ability of an apparatus performing the processes or as necessary. In this specification, the system means a logical set of a plurality of apparatuses, and the apparatuses need not always be placed in the same package.
Number | Date | Country | Kind |
---|---|---|---|
P2005-310826 | Oct 2005 | JP | national |