The present invention relates to a device for recording and reproducing video or audio using a semiconductor memory medium.
Recently, semiconductor memory cards using a flash memory are becoming widespread. A flash memory is a non-volatile memory that can record and erase data electrically and that retains the recorded data even when the power source is disconnected. Semiconductor memory cards do not include a mechanical driving portion, which is necessary for conventional tape devices and disk devices. Therefore, semiconductor memory cards are compact, light, and shock-resistant, so that they are used in various applications such as digital cameras. However, semiconductor memory cards cannot record high-quality moving images or audio satisfactorily, since the storage capacity per semiconductor memory card is small and their recording/reproducing data transfer rate is low.
To address this problem, conventional examples include a semiconductor memory pack device in which a plurality of semiconductor memory cards are combined in order to improve the storage capacity and the transfer rate.
For example, a semiconductor memory pack device that is disclosed in JP 2000-207137A can record data onto a plurality of semiconductor memory cards simultaneously, so that the recording transfer rate can be increased.
Generally, most conventional semiconductor memory cards are provided with an internal flash memory in which data of a certain size called an “erase block” is erased electrically all at once. Herein, in order to record data that is smaller than the erase block, data in the block is first read out and retained, the data in the block is erased all at once, and then the retained data is partially updated to the recording data and is written back into the block. This operation is called “read-modify-write,” and it is a cause for the recording operation becoming complicated and the transfer rate being lowered. In order to record data at a high transfer rate, it is necessary to avoid such a partial data update of the erase block. Thus, the size of the data that is to be recorded should be the same as, or an integral multiple of, the size of the erase block. Furthermore, an address from which the data is recorded has to be matched with the start of the erase block.
In semiconductor memory pack devices in which a plurality of semiconductor memory cards are combined, like the one disclosed in JP 2000-207137A, in order to record data simultaneously onto the plurality of semiconductor memory cards, the data is recorded at the size of the erase block of one semiconductor memory card multiplied by the number of semiconductor memory cards. As described above, in a recording device using a plurality of semiconductor memory cards, it is necessary to enlarge the amount of data that is to be recorded in one recording operation so as to record the data at a high transfer rate.
On the other hand, in order to manage the recorded data as a file, a means or a method for managing data, that is, a so-called file system is generally necessary. The file system generally manages files in units of a certain data size such as a sector or a cluster. However, since the size of a sector or a cluster is generally small, the size of one sector or one cluster is sometimes insufficient for a large data unit such as described above. In such a case, the file system needs to record the data for a continuous plurality of sectors or clusters as one group into the above-described device.
However, in conventional semiconductor memory pack devices using semiconductor memory cards, there are various problems when a unit of recording data does not match a unit of data that is managed by the file system. Hereinafter, these problems will be described in detail with reference to
The conventional problems will be described with reference to the above-described
However, in
Thus, even when the data recording unit is set to match the erase block unit, if an address from which recording starts does not match a boundary of the erase block, a read-modify-write operation occurs, which results in a low recording transfer rate.
Furthermore, in
In
First, in
Furthermore, in
Furthermore, ordinary file systems need to update file management information every time when data is recorded for several sectors or clusters. This management information is, for example, a table showing a usage state of sectors or clusters, bitmap data, or information of the size of the file into which the data is being recorded. When the file management information is frequently updated, even if the recording is interrupted because of a power source disconnection or the like, it becomes possible to restore the file to a state just before the power source disconnection to the extent possible. However, in a semiconductor memory medium using, for example, a flash memory, the number of rewriting operations is limited, and thus when management information is frequently updated, the rewriting life of the semiconductor memory medium becomes short.
Therefore, with the foregoing in mind, it is an object of the present invention to provide a data recording device that can record data at a high speed into a semiconductor memory pack device including a plurality of flash memories that operate in parallel.
In order to solve this problem, the data recording device according to the invention uses the following means.
First, a data recording device of the invention is a data recording device that records data into a semiconductor memory pack device that includes a plurality of flash memories performing recording operations in parallel, the data recording device including: a file management portion for managing data that is to be recorded into the semiconductor memory pack device as a file; in which the file management portion sets a data recording unit of data that is supplied to the semiconductor memory pack device to a common multiple of a size obtained by adding up the sizes of erase blocks of the plurality of flash memories and a data management size of the file management portion.
Consequently, a read-modify-write operation that conventionally has been an impediment to high speed recording can be prevented, and as a result, the number of rewriting operations of the semiconductor memory cards can be reduced.
Second, it is preferable that in the data recording device of the invention according to the first aspect, a data recording unit is an integral multiple of the size obtained by adding up the sizes of the erase blocks of the plurality of flash memories, and a data management unit of the file management portion has the same size as the data recording unit.
Consequently, a read-modify-write operation that conventionally has been an impediment to high speed recording can be prevented, and as a result, the number of rewriting operations of the semiconductor memory cards can be reduced.
Third, it is preferable that in the data recording device of the invention according to the first or second aspect, the file management portion lets each data recording unit include only data of the same file.
By setting the data recording unit to include only data of the same file in this manner, the data of the same file is written into the plurality of flash memories in parallel. Consequently, when reading out this data from the flash memories, it is possible to read out the data at a high speed by reading out in parallel.
Fourth, it is preferable that in the data recording device of the invention according to the first or second aspect, the file management portion records data only when the semiconductor memory pack device includes free space that is equivalent to the data recording unit.
Consequently, the boundaries of the erase blocks of the flash memories always match the boundaries of the data recording units, and thus a read-modify-write operation that has been conventionally an impediment to high speed recording can be prevented more effectively, and as a result, the number of rewriting operations of the semiconductor memory cards can be reduced.
Fifth, it is preferable that in the data recording device of the invention according to the first or second aspect, when data of different files is recorded in the data recording unit, the file management portion sorts recording data in such a manner that the data recording unit includes only data of the same file.
Consequently, a read-modify-write operation that conventionally has been an impediment to high speed recording can be prevented, and as a result, the number of rewriting operations of the semiconductor memory cards can be reduced. Furthermore, by sorting recording data in such a manner that the data recording unit includes only data of the same file, the data of the same file is recorded into the plurality of flash memories in parallel. Thus, when reading out this data from the flash memories, it is possible to read out the data at a high speed by reading out in parallel.
Sixth, it is preferable that in the data recording device of the invention according to the first or second aspect, the semiconductor memory pack device is provided with a region into which file management information of the file management portion is recorded, and when the file management portion records at least two files of an audio data file and a video data file simultaneously and in parallel into the semiconductor memory pack device, the file management information that is recorded in the semiconductor memory pack device is updated at a time when an amount of audio data accumulated as data that is to be supplied to the semiconductor memory pack device becomes an integral multiple of the data recording unit.
Consequently, a read-modify-write operation that conventionally has been an impediment to high speed recording can be prevented, and as a result, the number of rewriting operations of the semiconductor memory cards can be reduced. Furthermore, since recording of audio data, which has a low bit rate, triggers the backup of the file management information, the number of rewriting the file management information in the semiconductor memory pack device is not increased needlessly.
Seventh, it is preferable that in the data recording device of the invention according to the first or second aspect, when the file management portion records an MPEG stream into a file, the file management information of the file management portion is updated at a time when an amount of recorded data becomes an integral multiple of 1 GOP.
Eighth, it is preferable that in the data recording device of the invention according to the first or second aspect, the flash memories are mounted on the semiconductor memory pack device as semiconductor memory cards.
Ninth, a data recording device of the invention is a data recording device that records data according to a FAT file system into a semiconductor memory pack device that includes a plurality of flash memories, in which the FAT file system manages the total number of sectors obtained by adding the number of existing sectors in the semiconductor memory pack device and the number of non-existing virtual sectors; and in which by storing a value that does not indicate a free region in FAT entries of clusters corresponding to the non-existing virtual sectors, the non-existing sectors will not be written into.
Tenth, it is preferable that in the data recording device of the invention according to the ninth aspect, all bits in the FAT entry are set to 1 indicating an end of file, as the value that does not indicate a free region.
As described above, with the present invention, data can be recorded into a semiconductor memory pack device that includes a plurality of semiconductor memory cards at a high speed, and the rewriting life of the built-in semiconductor memory cards can be extended.
Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings.
First, configurations of a data recording device according to an embodiment of the invention and a semiconductor memory pack device will be described with reference to
Next, a functional configuration of the data recording device 110 according to this embodiment will be described with reference to
The control portion 1102 corresponds to the CPU 111 in
The input data I/F 1104 receives data that has been input from the outside. The encoder control portion 1105 receives the data that has been input through the input data I/F 1104, encodes the data by controlling the encoder 1106, and sends the encoded data to the buffer control portion 1107. It should be noted that the encoder control portion 1105 can obtain information from the encoder 1106 and forward the information to the control portion 1102. Examples of the information from the encoder 1106 include, for example, information indicating that data for 1 GOP (group of pictures) is completely encoded when encoding video data into MPEG (moving pictures coding experts group) format.
The buffer control portion 1107 stores the encoded data that has been received from the encoder control portion 1105 in separate regions of the buffer 1108 according to the data types. The buffer control portion 1107 monitors the amount of the data that is stored in the buffer 1108, and sends a message to the control portion 1102 when the amount has reached a certain level. When receiving the message, the control portion 1102 sends a data recording request to the file management portion 1109.
Generally, the file management portion 1109 is a so-called “file system” serving as a function of an operating system, and manages files that are recorded in the semiconductor memory pack device 120. The file management portion 1109 reads out file system management information from the semiconductor memory pack device 120 via the media I/F 1110, and stores the information in the memory 1103. When receiving the data recording request from the control portion 1102, the file management portion 1109 searches for a free region with reference to the file system management information. When a region is found, the file management portion 1109 sends a data recording command to the semiconductor memory pack device 120 to record the data into the region. Simultaneously with this process, the file management portion 1109 writes information of the recorded data, such as the recording position or the data amount, into the file system management information that is stored in the memory 1103.
The semiconductor memory pack device 120 is provided with semiconductor memory cards 123 to 126 using a flash memory, a multi-card access control portion 121 controlling these four semiconductor memory cards 123 to 126, and a work memory 122 temporarily storing data that is to be recorded onto the memory cards 123 to 126. The semiconductor memory cards 123 to 126 are assigned the numerals #1 to #4 respectively.
Next, a data recording operation by the data recording device 110 according to this embodiment will be described with reference to
A method for mapping of the logical addresses of the semiconductor memory cards 123 to 126 is as follows. The four semiconductor memory cards 123 to 126 that are built into the semiconductor memory pack device 120 are interleaved in units of the erase block size (16 KB) are arranged in order from #1 to #4 of the semiconductor memory cards 123 to 126, and then are mapped to continuous logical addresses of the semiconductor memory pack device 120. Since the four semiconductor memory cards 123 to 126 that are built into the semiconductor memory pack device 120 simultaneously perform recording operations in parallel, data is recorded into the semiconductor memory pack device 120 in units of these continuous addresses, which have a size of 16 KB×4=64 KB. The size of a cluster 305, which is a data management unit of the file management portion 1109 of the data recording device 110, matches this data recording unit. More specifically, one cluster is allocated to continuous logical addresses that have a size of 64 KB in the semiconductor memory pack device 120. Hereinafter, a recording operation by the data recording device 110 for the case that the cluster size is set to 64 KB will be described.
In the data recording device 110, the file management portion 1109 is realized by software that controls an operation of the CPU 111. The file management portion 1109 divides data that is to be recorded into the semiconductor memory pack device 120 into portions with the same size as the cluster serving as the data management unit (64 KB in this case). Furthermore, the file management portion 1109 searches for a free region for one cluster in the memory space of the semiconductor memory pack device 120, and hands over logical addresses of a found free region and the data that is to be recorded together with a recording command to the semiconductor memory pack device 120.
When receiving the recording command from the data recording device 110, the semiconductor memory pack device 120 temporarily stores the data for one cluster that is to be recorded together with the recording command in the work memory 122. Furthermore, in the semiconductor memory pack device 120, the multi-card access control portion 121 converts the logical addresses of the semiconductor memory pack device 120 that have been specified together with the recording command into individual logical addresses of the semiconductor memory cards 123 to 126 as shown in
As described above, in this embodiment, the size of one cluster, which is the smallest unit with which the file management portion 1109 of the data recording device 110 manages data, matches the size obtained by adding up the sizes of the erase blocks of the four semiconductor memory cards that are built into the semiconductor memory pack device 120 (64 KB), so that a read-modify-write operation that conventionally has been an impediment to high speed recording can be prevented, and as a result, the number of rewriting operations of the semiconductor memory cards can be reduced. Furthermore, the semiconductor memory pack device 120 records data simultaneously onto its four built-in semiconductor memory cards 123 to 126 in parallel, and thus the data can be recorded four times faster than in the case of only one semiconductor memory card.
Embodiment 1 was described for an example of the semiconductor memory pack device including four semiconductor memory cards that operate in parallel. However, it should be noted that the number of semiconductor memory cards that are built into the semiconductor memory pack device is not limited to four in the data recording device according to the invention. Also, it is not necessary that all of the built-in semiconductor cards operate in parallel, and for example, four built-in semiconductor memory cards may operate in two pairs in parallel. Furthermore, Embodiment 1 was described for an example in which the four erase blocks are allocated to one cluster. However, the number is not limited to four as long as setting the number to an integral multiple of the total number of erase blocks of the semiconductor memory cards that are built into the semiconductor memory pack device. The size of one erase block is not limited to 16 KB either. The form of the built-in semiconductor memory is not limited to a card, and the technical field of the invention includes semiconductor memories that are mounted in form of a chip.
Furthermore, Embodiment 1 was described for an example of a configuration in which a plurality of semiconductor memory cards operate in parallel in a semiconductor memory pack device. However, the invention can also be applied to, for example, a configuration in which a plurality of flash memories operate in parallel in a semiconductor memory card. More specifically, according to the invention, the size obtained by adding up the sizes of the erase blocks of the plurality of flash memories that operate in parallel matches the size of one cluster, which is the smallest unit with which the file management portion 1109 manages data.
Another embodiment of the invention will be described with reference to
In the data recording device 110, the file management portion 1109 is realized by software that controls an operation of the CPU 111. The file management portion 1109 divides data that is to be recorded into the semiconductor memory pack device 120 into portions with the same size as the clusters serving as the data management units (16 KB). So far, a similar procedure to the conventional methods for recording data is followed. However, in this embodiment, the file management portion 1109 searches for a free region for the data recording unit (64 KB), that is, four clusters (16 KB×4=64 KB) in the semiconductor memory pack device 120, and hands over logical addresses of a found free region and the data for four clusters together with a recording command to the semiconductor memory pack device 120.
When receiving the recording command from the data recording device 110, the semiconductor memory pack device 120 temporarily stores the data for four clusters in the work memory 122. At the same time, the multi-card access control portion 121 converts the logical addresses of the semiconductor memory pack device 120 that have been specified together with the recording command into individual logical addresses of the four semiconductor memory cards 123 to 126 that are built into the semiconductor memory pack device 120 as shown in
As described above, in this embodiment, recording is performed not in units of one cluster (16 KB), which is the smallest unit with which the file management portion 1109 of the data recording device 110 manages data, but in units of four clusters (64 KB), which is a common multiple of the size obtained by adding up the sizes of the erase blocks (64 KB) of the four semiconductor memory cards 123 to 126 that are built into the semiconductor memory pack device 120 and the size of one cluster (16 KB), so that a read-modify-write operation that has been conventionally an impediment to high speed recording can be prevented, and as a result, the number of rewriting operations of the semiconductor memory cards can be reduced. Furthermore, the semiconductor memory pack device 120 records data simultaneously onto its four built-in semiconductor memory cards 123 to 126 in parallel, and thus the data can be recorded four times faster than in the case of only one semiconductor memory card.
Embodiment 2 was described for an example of the semiconductor memory pack device including four semiconductor memory cards. However, according to the invention, the number of semiconductor memory cards that are built into the semiconductor memory pack device is not limited to four, and it is possible to apply the invention in a similar manner to a configuration that includes a plurality of semiconductor memory cards. Also, it is not necessary that all of the built-in semiconductor cards operate in parallel, and for example, four built-in semiconductor memory cards may operate in two pairs in parallel. Furthermore, Embodiment 2 was described for an example in which the four erase blocks are allocated to four clusters. However, a similar effect can be obtained as long as setting the data recording unit to a common multiple of the size obtained by adding up the sizes of the erase blocks of the semiconductor memory cards that are built into the semiconductor memory pack device and the size of one cluster, and recording only data of the same file into one data recording unit. Furthermore, the size of one erase block is not limited to 16 KB. The form of the built-in semiconductor memory is not limited to a card, and the technical field of the invention includes semiconductor memories that are mounted in form of a chip. Furthermore, Embodiment 2 was described for an example of a configuration in which a plurality of semiconductor memory cards operate in parallel in a semiconductor memory pack device. However, the invention also can be applied to, for example, a configuration in which a plurality of flash memories operate in parallel in a semiconductor memory card. More specifically, according to the invention, the data recording unit of the file management portion 1109 is a common multiple of the size obtained by adding up the sizes of the erase blocks of the plurality of flash memories that operate in parallel and the size of one cluster.
Subsequently, another embodiment of the invention will be described with reference to
In conventional file systems, free regions are searched in units of clusters, which are the data management units. If there is a free region even for one cluster, data for one cluster is recorded at that logical address. However, in the file management portion 1109 of the data recording device 120 according to this embodiment, a data recording unit is set to four clusters, and thus data is not recorded without a continuous free region at least for four clusters. In
As described above, in this embodiment, data is recorded in such a manner that an alignment of logical addresses at which the entire data for four clusters is recorded always matches a boundary of the data recording unit with a size of 64 KB, by searching for a free region at the data recording unit (64 KB). Therefore, the boundary of the erase blocks of the four semiconductor memory cards reliably matches the boundary of the data recording unit, so that a read-modify-write operation that conventionally has been an impediment to high speed recording can be prevented, and as a result, the number of rewriting operations of the semiconductor memory cards can be reduced.
Embodiment 3 was described for an example of the semiconductor memory pack device including four semiconductor memory cards. However, according to the invention, the number of semiconductor memory cards that are built into the semiconductor memory pack device is not limited to four, and it is possible to apply the invention in a similar manner to a configuration that includes a plurality of semiconductor memory cards. Also, it is not necessary that all of the built-in semiconductor cards operate in parallel, and for example, four built-in semiconductor memory cards may operate in two pairs in parallel. Furthermore, Embodiment 3 was described for an example in which the four erase blocks are allocated to four clusters. However, a similar effect can be obtained as long as setting the data recording unit to a common multiple of the size obtained by adding up the sizes of the erase blocks of the semiconductor memory cards that are built into the semiconductor memory pack device and the size of one cluster, and searching for a free region at the data recording unit. Furthermore, the size of one erase block is not limited to 16 KB. The form of the built-in semiconductor memory is not limited to a card, and the technical field of the invention includes semiconductor memories that are mounted in form of a chip.
Another embodiment of the invention will be described with reference to
On the other hand,
Therefore, in this embodiment, data of files recorded in cluster sizes that are smaller than the data recording unit of the semiconductor memory pack device 120 as shown in
The above-described sorting of recording data may be performed automatically at a predetermined timing such as when the semiconductor memory pack device 120 is connected to the data recording device 110, or when the data recording device 110 has performed a certain operation. Examples of the certain operation include, for example, a completion of image-taking when the data recording device 110 is a digital camera or a video camera.
Embodiment 4 was described for an example of the semiconductor memory pack device including four semiconductor memory cards. However, according to the invention, the number of semiconductor memory cards that are built into the semiconductor memory pack device is not limited to four, and it is possible to apply the invention in a similar manner to a configuration that includes a plurality of semiconductor memory cards. Also, it is not necessary that all of the built-in semiconductor cards operate in parallel, and for example, four built-in semiconductor memory cards may operate in two pairs in parallel. Furthermore, Embodiment 4 was described for an example in which the four erase blocks are allocated to four clusters. However, a similar effect can be obtained as long as setting the data recording unit to a common multiple of the size obtained by adding up the sizes of the erase blocks of the semiconductor memory cards that are built into the semiconductor memory pack device and the size of one cluster, and sorting the recording data in such a manner that only data of the same file is recorded into one data recording unit. Furthermore, the size of one erase block is not limited to 16 KB. The form of the built-in semiconductor memory is not limited to a card, and the technical field of the invention includes semiconductor memories that are mounted in the form of a chip.
Subsequently, another embodiment of the invention will be described with reference to FIGS. 8 to 10. First, a configuration of a FAT file system will be described with reference to
Generally, in the FAT file system that is regulated by ISO/IEC 9292, file system management information and a user data region are arranged in a logical volume in a storage medium as shown in
A boot sector is recorded in the logical sector number 0. In the boot sector, information of the entire volume and information relating to the location of management information such as a FAT that is necessary to read out a file described in the user data region or a route entry are recorded.
A reserved region is sometimes provided between the FAT in which arrangement information of files in the user data region is written and the boot sector. The number of sectors of the reserved region is listed in the boot sector.
Furthermore, in the FAT file system, a plurality of FATs may be recorded, and the number of FATs and the number of sectors per FAT are listed in the boot sector.
In sectors directly after the one or plurality of FATs, information relating to files that are recorded in the a root directory is provided continuously. The information relating to files is referred to as a “file entry,” and is managed in units of 32 bytes. In the file entry, a file name, a file creation time, a file size, a file length, and a first cluster number from which the file is stored are recorded. The maximum number of file entries (the number of entries in the root directory) that are provided in the root directory is listed in the boot sector, and a region of a size corresponding to this value is secured in advance for the root directory entries. The number of entries in the root directory is listed in the boot sector.
The sectors directly after the root directory entry serve as the user data region. The user data region is managed in units of a so-called cluster, which includes one or a plurality of continuous sectors, and all clusters are numbered consecutively from the top.
FAT entries corresponding to each of the clusters are prepared in the FAT. Hereinafter, a method for recording a file into the user data regions will be described with reference to
In this example, a file 1001 that is to be recorded has a size that is equivalent to four clusters in the user data region. In this case, the file system finds four FAT entries in which a particular bit string representing an unallocated state (0×00, in the FAT 16 file system) is recorded. For example, when it is found that a bit string representing an unallocated state is recorded in FAT entries (1002 to 1005) corresponding to four clusters No. A, B, C, and D, the file system divides and records the file into the four clusters No. A, B, C, and D in the user data region. Furthermore, in order to record the relationship of the four clusters, the number of next cluster in which the file is stored, that is, the number of cluster B is recorded into the FAT entry 1002 corresponding to the cluster A. In a similar manner, the number of cluster C is recorded into the FAT entry 1003 corresponding to the cluster B, and the number of cluster D is recorded into the FAT entry 1004 corresponding to the cluster C. In the FAT entry 1005 corresponding to the last cluster in which the file is recorded (the cluster D, in this example), a particular bit string representing an end of file (0xFF, in the FAT 16 file system) is recorded. When the file is read out from the user data region, by tracing this chain of the clusters, it is possible to follow the file until its end. A file system that uses 12 bits for each FAT entry is called a FAT 12 file system, a file system that uses 16 bits is called a FAT 16 file system, and a file system that uses 32 bits is called a FAT 32 file system.
The size SF of the space allocated to the entire FAT is listed in the bits 23 and 24 in the boot sector (
In Formula 1, RSC refers to the number of reserved sectors, SF refers to the number of sectors per FAT, RDE refers to the number of root directory entries, SS refers to the number of bytes in a data field of a sector, and SC refers to the number of sectors per cluster. The function ip(x) returns an integer part of x, and the function ceil(x) returns the minimum integer number that is larger than x. In Formula 1, the function ceil(32×RDE/SS) calculates the number of sectors that are secured for the root directory. Therefore, the formula (TS-RSC-SF-ceil(32×RDE/SS)) has the value obtained by subtracting the number of sectors in the management region from the total number of sectors, that is, the number of sectors in the user data region. The number of clusters that can be secured in the user data region can be calculated as the integer part of the value obtained by dividing the number of sectors in the user data region by SC. In order to secure special FAT entries relating to the management region, 2 further is added.
The FAT file system is a file system that is widely used. In some operating systems, the lower limit on the number of valid clusters is calculated by Formula 1. Thus, when a storage medium with less than a certain capacity, that is, a storage medium with a total number of sectors TS smaller than a certain value is used in the FAT file system, the cluster size should be made small in order to enlarge the total number of clusters. However, when the recording medium is a semiconductor memory pack device, it is not easy to change the cluster size since it is preferable that the cluster size matches the size of the erase block of the semiconductor memory pack device. Therefore, a small-capacity storage medium with a cluster size limitation cannot be used with an operating system having a minimum number of clusters.
Thus, in this embodiment, when a small-capacity storage medium that can secure only the number of clusters below the range supported by the operating system is used in the FAT file system, the above problem is avoided by listing a value that is larger than the number of actually existing sectors in the total number of sectors TS of the boot sector. More specifically, a small-capacity storage medium can be used with an operating system with a limitation by setting the total number of sectors TS to a value that is larger than the value that is calculated by the following Formula 2, when formatting the small-capacity storage medium. Here, LS refers to the lower limit on the number of clusters that is regulated by the operating system.
Formula 2 is derived by taking the solution of Formula 1 as LS and solving the formula for TS.
When the total number of sectors obtained by Formula 2 is set in the boot sector, the FAT entries in the FAT include entries that can be associated with actually existing clusters and entries that cannot be associated with actually existing clusters. In
In this embodiment, when formatting a small-capacity storage medium in the FAT file system, all bits are set to 1, indicating an end of file, in all FAT entries 802 that cannot be associated with actually existing clusters. This is because when writing a file into the FAT file system in which the total number of sectors is overstated, if the FAT entries 802 that cannot be associated with actually existing clusters include bit strings representing an unallocated state, the file system may try to write data into a non-existing cluster, and thus an error might occur. If data appears to be already allocated in clusters pointed to by the FAT entries 802 that cannot be associated with actually existing clusters, then non-existing clusters will not be written into when the file system searches for a free region in the volume in order to write the file.
In the FAT 12 and FAT 16 file systems, most operating systems calculate the free space in the storage medium that is informed to the user by counting the FAT entries containing a bit string representing an unallocated state. Thus, according to this embodiment, it is possible to provide the user with accurate information of the free space. In the FAT 32 file system, the number of free clusters that can be obtained on the logical volume is listed in a reserved sector, and most operating systems provide the user with information of the free space of the disk based on this information. In this embodiment, when formatting a storage medium in the FAT file system, the value obtained by subtracting the number of FAT entries 802 that cannot be associated with actually existing clusters from the total number of clusters calculated from the total number of sectors TS is written into the reserved sector as the number of free clusters, and thus accurate information of the free space is provided.
By constructing the FAT file system according to the above-described method, it becomes possible to write onto and read from a small-capacity storage medium with a cluster size limitation even in an operating system with a lower limit on FAT entries. Furthermore, it is also possible to provide the user with accurate information of free space. In Embodiment 5, the bit strings written into the FAT entries 802 that cannot be associated with actually existing clusters are bit strings representing an end of file. However, it is possible to use any bit string that does not represent an unallocated state such as a bit string representing a defective sector.
Lastly, another embodiment of the invention will be described with reference to
The control portion 1102 controls the entire data recording device 1101 by using the memory 1103. The input data I/F 1104 receives data that has been input from the outside.
The encoder control portion 1105 receives the data that has been input from the input data I/F 1104, encodes the data by controlling the encoder 1106, and sends the encoded data to the buffer control portion 1107. It should be noted that the encoder control portion 1105 can obtain information from the encoder 1106 and forward the information to the control portion 1102. Examples of the information from the encoder 1106 include, for example, information indicating that data for 1 GOP (group of pictures) is completely encoded when encoding video data into MPEG (moving pictures coding experts group).
The buffer control portion 1107 stores the encoded data that has been received from the encoder control portion 1105 in separate regions of the buffer 1108 according to the data types. The buffer control portion 1107 monitors the amount of the data that is stored in the buffer 1108, and sends a message to the control portion 1102 when the amount has reached a certain level. When receiving the message, the control portion 1102 sends a data recording request to the file management portion 1109.
The file management portion 1109 manages files that are recorded in the medium 1111. The file management portion 1109 reads out file system management information from the medium 1111 via the media I/F 1110, and stores the information in the memory 1103. When receiving the data recording request from the control portion 1102, the file management portion 1109 searches for a free region with reference to the file system management information. When a region is found, the file management portion 1109 sends a data recording command to the medium 1111 to record the data into the region. Simultaneously with this process, the file management portion 1109 writes information of the recorded data, such as the recording position or the data amount, into the file system management information that is stored in the memory 1103.
The file system management information that is stored in the memory 1103 should be backed up to the medium 1111 in predetermined intervals, since there might be an unexpected event, such as the power source of the recording device 1101 failing. When the file system management information is not backed up to the medium 1111, for example, there is no way of knowing the recording position or the data amount of the recorded data, and thus the state becomes the same as that in which no recording was performed.
On the other hand, when the file system management information is frequently backed up to the medium 1111, in a medium with an upper limit on the number of rewriting operations, the number of rewriting operations soon may exceed the upper limit. Furthermore, the process for rewriting the file system management information lowers the access efficiency of the medium 1111. Thus, it is important to back up the file system management information to the medium 1111 at an appropriate timing.
Hereinafter, the timing to back up the file system management information will be described with two examples, that is, a case that audio data and video data are recorded simultaneously into different files, and a case that audio data and video data are recorded into one file.
First, the case that audio data and video data are recorded simultaneously into different files will be described.
When audio data and video data are recorded into different files, even if both of them are input into the recording device 1101 simultaneously, they are not simultaneously recorded onto the medium 1111. This is because the bit rate of video data is higher than the bit rate of audio data, and thus the amount of the video data that is stored in the buffer 1108 reaches a certain level sooner than that of the audio data, and the video data is recorded first.
Since audio data and video data constitute a clip together, when only video data is recorded onto the medium 1111, the video data generally becomes meaningless.
Therefore, in this embodiment, when audio data and video data are recorded simultaneously into different files, every time when the audio data is recorded onto the medium 1111, the file system management information is backed up to the medium 1111. More specifically, the recording of data with the lowest bit rate triggers the backup of the file system management information.
As described above, the buffer control portion 1107 monitors the buffer 1108 according to the data types, and sends a message to the control portion 1102 when the amount of the data has reached a certain level. The control portion 1102 knows which data has the lowest bit rate among the data types that currently are being recorded. In this example, the audio data is the data that has the lowest bit rate. When receiving the message that the amount of the audio data accumulated in the buffer 1108 has reached a certain level, the control portion 1102 sends a request to record the audio data and a request to update the file system management information to the file management portion 1109. If the data recording units are set to a common multiple of the size obtained by adding up the sizes of the erase blocks of the semiconductor memory cards 123 to 126 that operate in parallel in the medium 1111 (the semiconductor memory pack device 120) and the data management size of the file management portion 1109, then the above-noted “amount of a certain level” refers to an integral multiple of the data recording unit.
As described above, when audio data and video data are recorded simultaneously into different files, if file system management information is backed up to a medium every time when the audio data, which has a low bit rate, is recorded, then it is possible to adopt measures to protect against a disconnection of the power source without needlessly increasing the number of rewriting operations of the medium.
Next, the case that audio data and video data are recorded into one file as an MPEG system stream will be described.
When recording an MPEG system stream, data is compressed between frames, the compression being completed in units of 1 GOP, and thus data cannot be normally decoded and reproduced when the data is recorded at a unit that is shorter than 1 GOP. Thus, in most cases, it is meaningless to back up file system management information to a medium at a time when data of less than 1 GOP has been recorded. Therefore, in this embodiment, in the case of recording the MPEG system stream onto a medium as one file, file system management information is updated when data for an integral multiple of 1 GOP has been recorded. Thus, the file system management information is prevented from being rewritten more often than necessary, and it is possible to extend the rewriting life of the medium.
Number | Date | Country | Kind |
---|---|---|---|
2003-121179 | Apr 2003 | JP | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP04/05575 | 4/19/2004 | WO | 4/5/2005 |