Recording device and control method thereof, and storage medium storing control program thereof

By recording directory entries of multiple files in the same sector, the problem of reduced writing speed of management information in the FAT file system is solved, and efficient data writing is achieved when recording multiple files.

CN111159054BActive Publication Date: 2025-01-24CANON KK
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN201911081565.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-11-08
Filing Date
2019-11-07
Publication Date
2025-01-24
Estimated Expiration
2039-11-07

AI Technical Summary

Technical Problem

In a recording medium using a FAT file system, when multiple files are recorded simultaneously, the writing speed of management information is reduced, resulting in the bit rate requirement that may not be met when continuously recording stream data.

Method used

By recording the directory entries of multiple files in the same sector when recording multiple files, the number of times management information is written is reduced and the writing speed is improved.

Benefits of technology

Without increasing the time of preparation time, prevent the writing speed of management information, and ensure that multiple streaming data can be recorded efficiently.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111159054B_ABST
    Figure CN111159054B_ABST
Patent Text Reader

Abstract

The present invention provides a recording device and a control method thereof, and a storage medium storing a control program thereof. When recording multiple files at the same time, the recording device can prevent the writing speed of management information in the recording from being reduced without increasing the recording preparation time. The recording device includes a memory and a processor, which are used as: a recording unit that records the file in a recording medium; and a controller that controls to record the directory entry of the file in a specified sector in the recording medium. The recording medium includes blocks, each block includes a plurality of pages, and the recording medium allows data to be written in units of pages, allows data to be erased in units of blocks, and allows access to pages corresponding to sectors specified by sector numbers. In the case where multiple files are to be recorded, the controller controls so that the directory entries of the multiple files will be recorded in the same sector.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a recording device for recording data using a file system, a control method thereof, and a storage medium storing a control program thereof. Background Art

[0002] In recent years, in many cases, a removable small recording medium such as an SD card is used as a recording medium for a combined device such as a digital camera. In many cases, a FAT (File Allocation Table) file system is used as a format of a file system for the small recording medium.

[0003] The FAT file system is roughly classified into a system information area and a data storage area. The data storage area is composed of units called clusters. In the data storage area, files that hold actual data such as moving images and still images, and directories for managing metadata are recorded. In addition, the area where metadata managed by the directory is recorded is called a directory entry. The directory includes a subdirectory that manages metadata of files, and a root directory that manages metadata of subdirectories. That is, one directory entry is provided for each file and subdirectory.

[0004] The name, attribute, time stamp and starting cluster number of a file or subdirectory are recorded in the directory entry. The system information area consists of an area that records information about the recording medium itself, and a FAT that manages the status (used or unused) and connection status of each cluster. In the FAT file system, files and directories in the data storage area are managed in clusters. That is, each of the files and directories in the data storage area consists of at least one cluster.

[0005] Whenever actual data is written to a small recording medium, management information about the FAT file system, such as FAT and directory, is updated. Therefore, although the amount of information required to update the management information is less than the amount of information written as real-time data, the update frequency of the management information is greater than the writing frequency of real-time data.

[0006] Meanwhile, SD cards generally use NAND flash memory. In NAND flash memory, the smallest unit that can be rewritten by a write request is called a page. When a written page is overwritten, the data needs to be erased. The smallest unit that can be erased by an erase request is called a block, and a block is larger than a page. Therefore, when updating management information such as directory entries in a FAT file system in a NAND flash memory, a read action in blocks, a change action for the content in a page, an erase action in blocks, and a rewrite action in blocks are required. Therefore, when actual data such as motion image data is written to the flash memory in blocks, the update speed of the management information becomes lower than the write speed of the actual data.

[0007] Furthermore, the increase in block size due to the increase in flash memory capacity in recent years tends to reduce the speed of actions associated with content changes in units smaller than blocks, such as the update speed of management information.

[0008] This reduction in the update speed of management information is particularly problematic when data should be written continuously (for example, when recording streaming data). This is because when the average writing speed to the recording medium is lower than the bit rate of the streaming data, continuous recording becomes impossible.

[0009] In view of such a problem, a storage unit disclosed in Japanese Patent Laid-Open No. 2006-018471 (JP 2006-018471A) detects a write start address and a data size from a write command of data to a recording medium, and detects whether data has been written in the write start address in the past. Thereafter, when it is determined based on these detection results that the current write command is for updating a directory entry, the storage control section writes the data to a page including the detected address under control different from the control for updating management information described above. Thus, high-speed data writing is achieved.

[0010] However, even when the data writing method disclosed in the above-mentioned publication is used, a problem arises when recording a plurality of stream data at the same time. Since the directory entries of the plurality of stream data do not have to be written into the same page, even if the above-mentioned result is detected, the storage control unit cannot determine whether the write command is used to update the directory entry based on the detection result.

[0011] Considering this problem, Japanese Patent Application Laid-Open No. 2016-015057 (JP 2016-015057A) discloses a method in which a new directory is created before recording a plurality of stream data to store all directory entries of the stream data in the created directory. Thus, the directory entries of the plurality of stream data can be stored in the same page.

[0012] However, the method disclosed in JP 2016-015057A must create a new directory every time a plurality of stream data is recorded. Since the newly created directory needs to be filled with "0" except for the reserved entry, it is necessary to write data of at least one cluster filled with "0" to the recording medium when the directory is created. In addition, since the cluster size of flash memory has increased in recent years, the time required to create a new directory has also increased.

[0013] As a result, the method disclosed in JP 2016-015057A causes a problem of increasing the recording preparation time for recording streaming data. Summary of the invention

[0014] The present invention provides a recording device and a control method thereof, and a storage medium storing a control program thereof, which can prevent a decrease in the writing speed of management information being recorded without increasing the recording preparation time when recording a plurality of files simultaneously.

[0015] Therefore, a first aspect of the present invention provides a recording device, which includes at least one memory and at least one processor, which functions as: a recording unit configured to record a file in a recording medium; and a controller configured to control so that a directory entry of a file is recorded in a specified sector in the recording medium. The recording medium includes blocks, each block includes a plurality of pages, and the recording medium allows writing of data in units of pages, allows erasing of data in units of blocks, and allows access to a page corresponding to a sector specified by a sector number. In the case where a plurality of files are to be recorded, the controller controls so that the directory entries of the plurality of files are to be recorded in the same sector.

[0016] Therefore, a second aspect of the present invention provides a control method for a recording device, the recording device including a memory storing a program and a processor executing the program to perform the control method, the control method including: a recording step of recording a file in a recording medium; and a control step of controlling to record a directory entry of a file in a specified sector in the recording medium. The recording medium includes blocks, each block includes a plurality of pages, the recording medium allows writing of data in units of pages, allows erasing of data in units of blocks, and allows access to a page corresponding to a sector specified by a sector number. In the case where a plurality of files are to be recorded, control is performed so that the directory entries of the plurality of files will be recorded in the same sector.

[0017] Therefore, a third aspect of the present invention provides a non-transitory computer-readable storage medium storing a control program that causes a computer to execute the control method of the second aspect.

[0018] According to the present invention, when a plurality of files are recorded simultaneously, the writing speed of management information being recorded is prevented from being lowered without increasing the recording preparation time.

[0019] Further features of the present invention will become apparent from the following description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a block diagram schematically showing an internal hardware configuration of a digital camera including a recording medium controller as a recording device related to the first embodiment of the present invention.

[0021] Figure 2 This is a diagram showing how to use the FAT file system to manage Figure 1 A diagram of an example of data arrangement of a recording medium.

[0022] Figure 3 It is shown in Figure 2 Schematic diagram of the structure of the directory entries recorded in the directory.

[0023] Figure 4 is described in Figure 2 A diagram of the types of individual directory entries recorded in a directory.

[0024] Figure 5 Is shown when the new creation Figure 4 A block diagram of the hint location storage area used when valid entries are made in .

[0025] Figure 6 1 is a flowchart showing the procedure of the same-sector record determination processing related to the first embodiment.

[0026] Figure 7 It is shown Figure 6 Flowchart of the procedure of the directory entry creation processing in step S607.

[0027] Figure 8 It is shown Figure 6 Flowchart of the procedure of the recordable sector designation processing in step S603.

[0028] Fig. 9 It is shown Figure 6 Flowchart of the procedure of the deletion entry conversion processing in step S605.

[0029] Fig.10 : is a flowchart showing the procedure of the same-sector record determination processing related to the second embodiment. DETAILED DESCRIPTION

[0030] Hereinafter, embodiments according to the present invention will be described in detail with reference to the accompanying drawings.

[0031] Will refer to Figures 1 to 9 A digital camera 100 including a recording medium controller as a recording device related to a first embodiment of the present invention is described. The digital camera 100 can record captured moving image data into a recording medium 109 .

[0032] Figure 1 : is a block diagram schematically showing the internal hardware configuration of the digital camera 100 relating to the first embodiment.

[0033] The digital camera 100 is composed of an imaging unit 101, an operation unit 102, a display unit 103, a CPU 105, a ROM 106, a RAM 107, and a recording medium controller 108. Figure 1 As shown, these units are connected to each other via an internal bus 104 .

[0034] The CPU 105 executes programs stored in the ROM 106 or the RAM 107 to control various behaviors of the digital camera 100 .

[0035] The ROM 106 is a nonvolatile memory that stores in advance a program for controlling the digital camera 100 and a program of a FAT (File Allocation Table) file system for managing data in the recording medium 109 .

[0036] The RAM 107 is a temporary storage area for programs and data supplied from the ROM 106 etc. Furthermore, the RAM 107 is used as a buffer area for operating data recorded in the recording medium 109 from the CPU 105.

[0037] The recording medium controller 108 is physically and electrically connected to the recording medium 109, and controls reading and writing of data (e.g., digital image data and management data thereof) of the recording medium 109. The configuration of the recording medium 109 is not limited as long as the recording medium controller 108 can control reading and writing of data. For example, the recording medium 109 may be a removable medium such as an SD card that can be detached from the digital camera 100, or may be a fixed medium such as an E-MMC that is fixed to the digital camera 100.

[0038] The CPU 105 manages data in the recording medium 109 through the recording medium controller 108 by running a program of the FAT file system stored in the ROM 106. The sector, which is the minimum access unit of the FAT file system, corresponds to a page, which is the minimum unit that can be rewritten to the recording medium 109 by one write request. Unique sector numbers starting from "No. 0" are assigned to sectors on the entire recording medium 109. The CPU 105 is allowed to access a specific page of the recording medium 109 by specifying the sector number to the recording medium controller 108. Thus, the CPU 105 can write (record) data in units of pages. At the same time, the CPU 105 erases data in the recording medium 109 in units of blocks including a plurality of pages.

[0039] The CPU 105 determines whether all directory entries of a plurality of files to be recorded simultaneously can be recorded in a page designated by the same sector number (referred to as "the same sector") of the same directory, in order to manage the recording medium 109. As a result of the determination, in the case where only a part of the directory entries of the files to be recorded simultaneously can be recorded in the same sector of the same directory, the directory entries of the files to be recorded are recorded in a new different sector of the same directory. Therefore, the CPU 105 converts the non-recorded area in the new sector of the directory into a reusable type of directory entry.

[0040] Figure 2This is a diagram showing how to use the FAT file system to manage Figure 1 2 is a diagram showing an example of data arrangement of a recording medium 109 in a FAT file system. The FAT file system includes a system information area 204 including a boot sector 203 and a FAT 202, and a data storage area 201 managed in cluster units. A uniquely determined management serial number (cluster number) is assigned to each cluster constituting the data storage area 201. Cluster numbers starting from "2" are sequentially assigned to each cluster, and FAT entries corresponding to the assigned cluster numbers are stored in the FAT 202.

[0041] A file 211 recording actual data such as motion picture data and a directory 210 of metadata of the file 211 are recorded in the data storage area 201. Both the directory 210 and the file 211 can be constructed by connecting a plurality of clusters. In this case, FAT 202 is used to indicate the connection status of the cluster. Specifically, a FAT entry corresponding to the cluster number assigned to the head cluster in the connected cluster records the cluster number assigned to the subsequent cluster. Similarly, a FAT entry corresponding to the cluster number assigned to the cluster other than the terminal cluster in the connected cluster also records the cluster number assigned to the cluster after the relevant cluster. At the same time, a value indicating the terminal cluster is recorded in the FAT entry corresponding to the cluster number assigned to the terminal cluster of the connected cluster.

[0042] In the case where valid data is not recorded in a cluster, "0" is recorded in the FAT entry corresponding to the cluster. Therefore, in the case of recording new data or a new directory, a cluster (free cluster) in which "0" is recorded in the corresponding FAT entry is retrieved and the retrieved cluster is used.

[0043] Figure 3 It shows that the record is Figure 2 Schematic diagram of the structure of directory entries in directory 210.

[0044] A plurality of directory entries are recorded in the directory 210, which are the directory entries for the file 211 and other directories ( Figure 2 Each directory entry corresponds to a file or a directory.

[0045] Hereinafter, a description will be given of the configuration of directory entries recorded in the directory 210. The directory entry 301 in which metadata of the file 211 is recorded among a plurality of directory entries recorded in the directory 210 is discussed as an example.

[0046] In the directory entry 301, a file name 302, attributes 303, last change time (time stamp) 305, a start cluster number 304, and a file size 306 are recorded. In the FAT file system, one directory entry is composed of at least 32 bytes.

[0047] Figure 4 Is the description recorded in Figure 2 A diagram of the types of each directory entry in directory 210.

[0048] According to except Figure 3 In addition to the directory entry 301 illustrated in FIG. 2 , some types of directory entries may be recorded in the directory 210. Specifically, there are three types of directory entries: valid entries, deleted entries, and free entries.

[0049] Figure 4 The directory entry 401 whose header 402 is "0xE5" is an invalid deletion entry. A deletion entry is created by recording "0xE5" in the header of the directory entry. The values ​​of other areas are not a problem.

[0050] Figure 4 The directory entry 403a in which the header 404a is "0x00" is a free entry, which is an unused and invalid directory entry that has not been used yet.

[0051] The valid entries 400 other than the deleted entries and the free entries record the metadata of the files and directories existing in the recording medium 109 as Figure 3 The metadata may be recorded to a directory entry obtained by converting a deleted entry or a free entry into a valid entry. In addition, the directory is constructed so that there will be no valid entry after the free entry. That is, in the presence of Figure 4 In the case of the plurality of directory entries 403a and 403b shown, metadata is recorded starting from the directory entry 403a.

[0052] Figure 5 Is shown when the new creation Figure 4 A block diagram of a hint position storage area used when valid entries 400 are present.

[0053] The cue position storage area 500 stores a cue position used when starting to search for a directory entry in which metadata can be recorded in a directory entry creation process described below.

[0054] The cue position storage area 500 is ensured in the RAM 107 and is operated and referred to by the CPU 105. The cue position storage area 500 is ensured for each directory including the directory 210 in the data storage area 201 and includes a sector number storage area 501 and an offset storage area 502.

[0055] The sector number storage area 501 stores the sector number from which the directory entry can be retrieved.

[0056] The offset storage area 502 stores a hint position, which is an offset from the head of a sector where retrieval of a recordable directory entry is started, in byte units.

[0057] When the value of the sector number storage area 501 is "0", the hint position information is invalid. When the hint position information is invalid, the search for the recordable directory entry can be started from the head sector of the directory. When the value of the sector number storage area 501 is not "0", that is, when the hint position information is valid, the search for the recordable directory entry can be started from the hint position stored in the sector number storage area 501.

[0058] In the case where the file 211 is recorded in the recording medium 109 , the CPU 105 determines whether a new sector is used by executing the same sector recording determination processing described below before creating the directory entry 301 of the metadata of the recorded file 211 .

[0059] Will use Figure 6 The flowchart in describes the same-sector record determination processing.

[0060] In step S601, the CPU 105 determines whether two or more files are recorded simultaneously in the recording medium 109. If it is determined in step S601 that one file is to be recorded, the process proceeds to step S606. If it is determined in step S601 that two or more files are to be recorded simultaneously, the process proceeds to step S602.

[0061] In step S602, the CPU 105 determines whether all directory entries of the files to be recorded simultaneously can be recorded in the same directory (hereinafter referred to as directory 210). In a case where it is determined in step S602 that at least one of the directory entries of the files to be recorded simultaneously is recorded in a directory different from directory 210, the process proceeds to step S606. In a case where it is determined in step S602 that all directory entries of the files to be recorded simultaneously are recorded in the same directory 210, the process proceeds to step S603.

[0062] In step S603, the CPU 105 executes Figure 8 The recordable sector designation process described is to designate, from among the recording sectors in the directory 210, sectors in which all directory entries of files to be recorded simultaneously can be recorded.

[0063] The CPU 105 determines in step S604 whether a sector has been designated by the recordable sector designation process. That is, the CPU 105 determines whether all directory entries of the files to be recorded simultaneously can be recorded in the same sector. In the case where it is determined in step S604 that a sector has been designated, the process proceeds to step S606. In the case where it is determined in step S604 that a sector cannot be designated, the process proceeds to step S605.

[0064] In step S605, the CPU 105 executes Fig. 9 The described deletion entry conversion process is performed to create sectors that can record all directory entries of files to be recorded simultaneously. Then, the process proceeds to step S606.

[0065] The CPU 105 determines in step S606 whether directory entries for all files have been created. In the case where it is determined in step S606 that directory entries for all files have been created, the process ends. In the case where it is determined in step S606 that there is at least one file for which a directory entry has not been created, the process proceeds to step S607.

[0066] The CPU 105 in step S607 Figure 7 The directory entry creation processing described above creates a directory entry for the file and returns the process to step S606. For example, in the case where it is determined in step S606 that a directory entry for the file 211 has not been created, the CPU 105 creates a new directory entry 301 in the directory 210 in the recording medium 109 through the directory entry creation processing.

[0067] As mentioned above, complete the Figure 6 The same sector record in the determination processing description.

[0068] Next, we will use Figure 7 Flowchart description in Figure 6 The directory entry creation processing in step S607 of . Hereinafter, a case where a directory entry of the file 211 is not created in step S606 will be described.

[0069] The CPU 105 specifies the directory 210 in which the directory entry 301 is to be newly created based on the transfer information about the file 211 in step S701 .

[0070] The CPU 105 determines in step S702 whether the cue position information is valid by referring to the cue position storage area 500 corresponding to the directory 210 specified in step S701. That is, the CPU 105 determines whether a sector number other than "0" is recorded in the sector number storage area 501 of the cue position storage area 500 corresponding to the directory 210. In the case where it is determined in step S702 that the cue position information is valid, the process proceeds to step S703. In the case where it is determined in step S702 that the cue position information is invalid, the process proceeds to step S704.

[0071] In step S703, the CPU 105 sets the position at which retrieval of recordable directory entries is started (hereinafter referred to as "retrieval start entry position") to the cue position stored in the cue position storage area 500. Thereafter, the process proceeds to step S705.

[0072] In step S704, the CPU 105 sets the search start entry position to the directory entry at the head of the head sector of the directory 210. Thereafter, the process proceeds to step S705.

[0073] In step S705, the CPU 105 determines whether the directory entry at the position where the currently recordable directory entry is retrieved (hereinafter referred to as "retrieved entry position") is a deleted entry or a free entry. In the case where it is determined in step S705 that the relevant directory entry is a deleted entry or a free entry, the process proceeds to step S706. In the case where it is determined in step S705 that the relevant directory entry is neither a deleted entry nor a free entry, the process proceeds to step S707.

[0074] In step S706, the CPU 105 determines that the directory entry at the current search entry position is a recordable directory entry, and records the metadata of the new record file in the directory entry. Thereafter, the process is completed.

[0075] In step S707, the CPU 105 sets the retrieval entry position to the next directory entry.

[0076] In step S708, the CPU 105 determines whether the search entry position reaches the end of the sector. In the case where it is determined that the search entry position has not reached the end of the sector, the process proceeds to step S705. In the case where it is determined in step S708 that the search entry position reaches the end of the sector, the process proceeds to step S709.

[0077] In step S709, the CPU 105 determines whether the search entry position reaches the end of the cluster. If it is determined in step S709 that the search entry position does not reach the end of the cluster, the process proceeds to step S710. If it is determined in step S709 that the search entry position reaches the end of the cluster, the process proceeds to step S711.

[0078] The CPU 105 sets the search entry position to the directory entry in the head of the next sector in step S710, and advances the process to step S705.

[0079] In step S711, the CPU 105 determines whether the next cluster exists by referring to the FAT. In the case where it is determined in step S711 that the next cluster does not exist (i.e., in the case where the value indicating the terminal is recorded in the FAT entry assigned to the current cluster), the process proceeds to step S712. In the case where it is determined in step S711 that the next cluster exists, the process proceeds to step S713.

[0080] In step S712, the CPU 105 ensures an area of ​​one cluster size as the next cluster in the data storage area 201, and writes "0" to all the ensured areas. After that, the process proceeds to step S713. At this time, the CPU 105 changes the value of the FAT entry assigned to the current cluster to the cluster number assigned to the next cluster, and records the value indicating the terminal to the FAT entry assigned to the next cluster.

[0081] The CPU 105 sets the search entry position to the directory entry at the head of the next cluster in step S713, and advances the process to step S705.

[0082] about Figure 7 The description of the directory entry creation process in has been completed.

[0083] Next, we will use Figure 8 The flowchart in the description is in Figure 6 The recordable sector designation process in step S603 is performed.

[0084] In step S801, the CPU 105 determines whether the investigation of the sectors including the free entry in the directory 210 is completed, that is, whether the next investigation target sector is the next sector including the free entry. In the case where it is determined in step S801 that the investigation of the sectors including the free entry is completed (that is, the next investigation target sector is the next sector including the free entry), the process ends. In this case, there is no sector among the recording sectors in which all the files to be recorded can be recorded. In the case where it is determined in step S801 that the investigation of the sectors including the free entry is not completed, the process proceeds to step S802.

[0085] In step S802, the CPU 105 initializes a counter for counting the number of recordable directory entries to "0".

[0086] In step S803, the CPU 105 sets the position of a directory entry to be investigated in step S805 described below (hereinafter referred to as a "search entry") as the head of the sector.

[0087] In step S804, the CPU 105 determines whether the position of the survey entry reaches the end of the sector. If it is determined in step S804 that the position of the survey entry reaches the end of the sector, the process proceeds to step S808. If it is determined in step S804 that the position of the survey entry does not reach the end of the sector, the process proceeds to step S805.

[0088] In step S805, the CPU 105 determines whether the investigated entry is a deleted entry or a free entry. If it is determined in step S805 that the investigated entry is a deleted entry or a free entry, the process proceeds to step S806. If it is determined in step S805 that the investigated entry is neither a deleted entry nor a free entry, the process proceeds to step S807.

[0089] In step S806, the CPU 105 increments the counter by 1. In step S807, the CPU 105 moves the investigation entry to the position of the next directory entry, and returns the process to step S804.

[0090] In step S808, the CPU 105 determines whether the value of the counter is equal to or greater than the number of files to be simultaneously recorded to the recording medium 109. In a case where it is determined in step S808 that the value of the counter is equal to or greater than the number of files to be simultaneously recorded, the process proceeds to step S809. In a case where it is determined in step S808 that the value of the counter is less than the number of files to be simultaneously recorded, the process proceeds to step S810.

[0091] In step S809, the CPU 105 stores the sector number of the currently investigated sector in the hint position storage area 500, and terminates the processing.

[0092] The CPU 105 sets the next sector as the investigation target in step S810, and returns the process to step S801. Figure 8 The description of the recordable sector designation processing in has been completed.

[0093] As described above, in the case where there is no sector in which all directory entries of files to be recorded simultaneously do not exist in the same sector recording determination process ("No" in step S604), the deletion entry conversion process is performed in step S605. That is, by performing the deletion entry conversion process, a new sector is generated that enables directory entries of all files to be recorded in the same directory. Therefore, the directory entries of all files to be recorded can be recorded starting from the head of the generated new sector.

[0094] Will use Fig. 9 The flowchart in the description is in Figure 6 The deletion entry conversion process in step S605 is performed.

[0095] In step S901 , the CPU 105 sets a survey entry as a directory entry at the head of a sector including a free entry.

[0096] In step S902, the CPU 105 determines whether the investigated entry is a free entry. In the case where it is determined in step S902 that the investigated entry is a free entry, the process proceeds to step S904. In the case where it is determined in step S902 that the investigated entry is not a free entry, the process proceeds to step S903.

[0097] The CPU 105 sets the position of the investigated entry to the next directory entry in step S903, and returns the process to step S902.

[0098] In step S904, the CPU 105 determines whether the position of the investigation entry is the head of the sector. If it is determined in step S904 that the position of the investigation entry is the head of the sector, the process proceeds to step S909. If it is determined in step S904 that the position of the investigation entry is not the head of the sector, the process proceeds to step S905.

[0099] In step S905, the CPU 105 determines whether the position of the survey entry reaches the end of the sector. If it is determined in step S905 that the position of the survey entry reaches the end of the sector, the process proceeds to step S908. If it is determined in step S905 that the position of the survey entry does not reach the end of the sector, the process proceeds to step S906.

[0100] In step S906 , the CPU 105 records “0xE5” at the head of the investigated entry to convert the free entry into a deleted entry.

[0101] The CPU 105 sets the investigation entry as the next directory entry in step S907 , and advances the process to step S905 .

[0102] In step S901, the CPU 105 sets the investigation entry as the directory entry at the head of the next sector.

[0103] The CPU 105 stores the sector number of the sector including the investigation entry in the sector number storage area 501 of the hint position storage area 500 in step S909, and ends the processing. Fig. 9 The description of the deletion entry conversion processing in has been completed.

[0104] According to the above embodiment, when recording multiple files at the same time, only one sector is updated for recording the directory entry of the file. As a result, only one page of the recording medium 109 is updated while recording multiple files at the same time, which makes it possible to reduce the decrease in the writing speed of the management information such as the directory entry of the FAT file system.

[0105] Furthermore, although the free entry as a non-recording area is converted into a deleted entry in step S906 in the deleted entry conversion process as described above, the free entry may be converted into a directory entry different from the deleted entry as long as it is a reusable directory entry. The reusable directory entry may be converted into a new valid directory entry and enable retrieval of the directory entry following the converted valid directory entry.

[0106] Next, a second embodiment of the present invention will be described. In the second embodiment, the conditions for recording to the same sector in the same directory are limited compared to the first embodiment. Therefore, directory entries can be stored in one sector only when necessary and available.

[0107] Furthermore, in the same sector recording determination processing in the first embodiment, in the case where all directory entries of the files to be recorded simultaneously cannot be recorded in the same sector of the same directory, a new sector is created using the cue position stored in the cue position storage area 500. Thereafter, a directory entry is created in the new sector. In contrast, in the same sector recording determination processing in the second embodiment, in the case where all directory entries of the files to be recorded simultaneously cannot be recorded in the same sector of the same directory, a directory entry recorded at the head of the directory can be retrieved with certainty. Thus, the directory can be used more efficiently.

[0108] Since the hardware configuration in the second embodiment is the same as that in the first embodiment, the same reference numerals are applied to the same components and repeated descriptions are omitted. In addition, as in the first embodiment, the files of actual data in the recording medium 109 are managed using the FAT file system. Therefore, in the second embodiment, the directory entry creation process ( Figure 7 ), delete entry conversion processing ( Fig. 9 ) and prompt position storage area 500.

[0109] Will use Fig.10 The flowchart in describes the same-sector record determination processing in the second embodiment.

[0110] In step S1001, the CPU 105 determines whether two or more files are to be recorded simultaneously. In the case where it is determined in step S1001 that one file is to be recorded, the process proceeds to step S1010. In the case where it is determined in step S1001 that two or more files are to be recorded simultaneously, the process proceeds to step S1002.

[0111] The CPU 105 sets the cue position stored in the cue position storage area 500 as the head of the directory of the recording destination in step S1010 , and advances the processing to step S1007 .

[0112] In step S1002, the CPU 105 determines whether the current shooting mode allows the recording of files to be continued even when the update speed (bit rate) of the directory entry is lower than a predetermined speed. That is, the CPU 105 determines whether the writing speed of the management information has no influence on the recording of the file in the current shooting mode. In the case where it is determined that the current shooting mode allows the recording of files to be continued even if the update speed is low, the processing proceeds to step S1010. That is, even when the file to be created includes a moving image during shooting as actual data, in the case of shooting in a shooting mode that ends shooting in a short time, or in the case of shooting in a shooting mode with a low bit rate but a long shooting time, the processing proceeds to step S1010. In the case where it is determined in step S1002 that the current shooting mode does not allow the recording to be continued during the low-speed update of the directory entry during recording, the processing proceeds to step S1003.

[0113] In step S1003, the CPU 105 determines whether the number of files to be recorded simultaneously is equal to or less than a threshold value held in advance in the ROM 106. The threshold value held in advance in the ROM 106 is the maximum number of directory entries recordable in one sector, and is "16" in the FAT file system. Due to the standard specification of the FAT file system, it is impossible to store directory entries exceeding the threshold value in one sector. Therefore, in the case where it is determined in step S1003 that the number of files to be recorded simultaneously is equal to or less than the threshold value, the processing proceeds to step S1004. In the case where it is determined in step S1003 that the number of files to be recorded simultaneously is greater than the threshold value, the processing proceeds to step S1010.

[0114] In step S1004, the CPU 105 determines whether all directory entries of the files to be recorded simultaneously can be recorded in the same directory (hereinafter referred to as directory 210). In the case where it is determined in step S1004 that at least one of the directory entries of the files to be recorded simultaneously is recorded in a directory different from directory 210, the process proceeds to step S1010. In the case where it is determined that all directory entries of the files to be recorded simultaneously can be recorded in the same directory 210, the process proceeds to step S1005.

[0115] In step S1005, the recordable sector designation process described in the first embodiment is executed ( Figure 8 ).

[0116] The CPU 105 determines in step S1006 whether a sector has been specified by the recordable sector specifying process. That is, the CPU 105 determines whether all directory entries of the files to be recorded simultaneously can be recorded in the same sector. In the case where it is determined in step S1006 that a sector has been specified, the process proceeds to step S1007. In the case where it is determined in step S1006 that a sector cannot be specified, the process proceeds to step S1009.

[0117] In step S1009, the deletion entry conversion process described in the first embodiment is executed ( Fig. 9 ), and the processing enters step S1007.

[0118] The CPU 105 determines in step S1007 whether directory entries for all files have been created. In the case where it is determined in step S1007 that directory entries for all files have been created, the process ends. In the case where it is determined in step S1007 that there is at least one file for which a directory entry has not been created, the process proceeds to step S1008.

[0119] In step S1008, the directory entry creation process described in the first embodiment is executed ( Figure 7 ) to create a directory entry, and the process returns to step S1007. Fig.10 The description of the same sector record determination processing in the second embodiment in FIG. 1 has been completed. Therefore, according to the present embodiment, the directory entry can be stored in one sector only when it is necessary and available.

[0120] Furthermore, the deleted entry converted from the free entry can be preferentially used as a directory entry for a file determined not to be required to be recorded in the same sector by the same sector recording determination process through the deleted entry conversion process. That is, the directory can be used more efficiently.

[0121] Other embodiments

[0122] The embodiments of the present invention may also be implemented by reading and executing computer executable instructions (e.g., one or more programs) recorded on a storage medium (which may also be more completely referred to as a "non-transitory computer-readable storage medium") to perform one or more functions in the above-mentioned embodiments, and / or a computer of a system or device including one or more circuits (e.g., an application-specific integrated circuit (ASIC)) for performing one or more functions in the above-mentioned embodiments, and the embodiments of the present invention may be implemented by, for example, reading and executing the computer executable instructions from the storage medium by the computer of the system or device to perform one or more functions in the above-mentioned embodiments, and / or controlling the one or more circuits to perform one or more functions in the above-mentioned embodiments. The computer may include one or more processors (e.g., a central processing unit (CPU), a microprocessing unit (MPU)), and may include a network of separate computers or separate processors to read and execute the computer executable instructions. The computer executable instructions may be provided to the computer, for example, from a network or the storage medium. The storage medium may include, for example, a hard disk, a random access memory (RAM), a read-only memory (ROM), a memory of a distributed computing system, an optical disk (such as a compact disc (CD), a digital versatile disc (DVD), or a Blu-ray disc (BD) TM ), flash memory devices, memory cards, etc.

[0123] The embodiments of the present invention may also be implemented by providing software (program) for performing the functions of the above-described embodiments to a system or device via a network or various storage media, and a computer or a central processing unit (CPU) or a microprocessing unit (MPU) of the system or device reads and executes the program.

[0124] While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments.The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.

[0125] This application claims the benefit of Japanese Patent Application No. 2018-210647, filed on November 8, 2018, which is hereby incorporated by reference herein in its entirety.

Claims

1. A recording device, comprising: at least one memory and at least one processor configured to: a recording unit configured to record a file in a recording medium, wherein the recording medium includes blocks, each block includes a plurality of pages, the recording medium allows writing of data in units of pages, allows erasing of data in units of blocks, and allows access to a page corresponding to a sector specified by a sector number; and a controller configured to control to record a directory entry of a file in a designated sector in the recording medium, The controller performs control so that: (i) in a case where a plurality of files are to be recorded simultaneously, recording the directory entries of the plurality of files in the same sector by performing a recordable sector designation process for designating that the directory entries of the plurality of files are recordable sectors that are recordable simultaneously and determining the recording positions of the directory entries based on the designated recordable sectors, and (ii) When one file is to be recorded, by determining the recording position of the directory entry based on a predetermined position without performing the recordable sector designation process, the directory entry of the one file is to be recorded.

2. The recording device according to claim 1, wherein When only a part of the directory entries of the plurality of files can be recorded in the target sector where the directory entry should be recorded, the controller controls to record the directory entries of the plurality of files in a sector next to the target sector where the directory entry should be recorded.

3. The recording device according to claim 1, wherein: The controller includes a conversion unit configured to convert a free entry in a target sector to a deletion entry when only a part of directory entries of the plurality of files can be recorded in the target sector where recording should be performed.

4. The recording device according to claim 3, wherein: When the plurality of files are recorded in the same directory, the controller controls to record directory entries of the plurality of files in the same sector.

5. The recording device according to claim 3, wherein: The recording unit records a series of moving images captured by the camera unit as the plurality of files, and The controller switches whether the processing by the conversion unit is to be performed according to one of a bit rate of the moving image and a mode of the moving image.

6. The recording device according to claim 3, wherein: The controller controls to record the directory entries of the plurality of files in a next sector of the target sector where the directory entry should be recorded after the conversion unit performs the processing.

7. The recording device according to claim 3, further comprising: A storage area stores, as a hint position, a sector number of a sector where a search for a recordable directory entry starts and an offset from a head of the sector where a search for a recordable directory entry starts.

8. The recording device according to claim 7, wherein: When the number of the plurality of files is greater than a threshold value, the conversion unit starts searching for a recordable directory entry by setting a hint position to a head of a sector where recording should be performed.

9. The recording device according to claim 7, wherein: When the writing speed of the directory entries has no influence on the recording of the plurality of files, the conversion unit sets the cue position to the head of a sector where recording should be performed and starts searching for recordable directory entries.

10. A control method for a recording device, the recording device comprising a memory storing a program and a processor executing the program to perform the control method, the control method comprising: a recording step, recording the document in a recording medium; as well as a control step of controlling to record a directory entry of a file in a designated sector in the recording medium, wherein the recording medium includes blocks, each block includes a plurality of pages, the recording medium allows data to be written in units of pages, allows data to be erased in units of blocks, and allows access to a page corresponding to a sector specified by a sector number, and Among them, control is performed in the control step so that: (i) in a case where a plurality of files are to be recorded simultaneously, recording the directory entries of the plurality of files in the same sector by performing a recordable sector designation process for designating that the directory entries of the plurality of files are recordable sectors that are recordable simultaneously and determining the recording positions of the directory entries based on the designated recordable sectors, and (ii) When one file is to be recorded, by determining the recording position of the directory entry based on a predetermined position without performing the recordable sector designation process, the directory entry of the one file is to be recorded.

11. A non-transitory computer-readable storage medium storing a control program for causing a computer to execute a control method for a recording device, the recording device comprising a memory storing the program and a processor executing the program to perform the control method, the control method comprising: a recording step, recording the document in a recording medium; as well as a control step of controlling to record a directory entry of a file in a designated sector in the recording medium, wherein the recording medium includes blocks, each block includes a plurality of pages, the recording medium allows data to be written in units of pages, allows data to be erased in units of blocks, and allows access to a page corresponding to a sector specified by a sector number, and Among them, control is performed in the control step so that: (i) in a case where a plurality of files are to be recorded simultaneously, recording the directory entries of the plurality of files in the same sector by performing a recordable sector designation process for designating that the directory entries of the plurality of files are recordable sectors that are recordable simultaneously and determining the recording positions of the directory entries based on the designated recordable sectors, and (ii) When one file is to be recorded, by determining the recording position of the directory entry based on a predetermined position without performing the recordable sector designation process, the directory entry of the one file is to be recorded.

Citation Information

Patent Citations

  • Storage device

    JP2006018471A

  • Recording device

    JP2016015057A

  • Image capturing apparatus and control method therefor

    CN101371574A

  • Method and system for storing memory compressed data onto memory compressed disks

    CN1484151A

  • Semiconductor memory device and its control method

    CN1910558A