1. Technical Field
The present disclosure relates to data storages and, particularly, to a data storage management system and a data storing method thereof.
2. Description of the Related Art
Memory cards are more and more widely used in various types of devices. Such devices include digital music players, digital still cameras, personal digital assistants (PDAs), video cameras, cellular phones, and other digital consumer electronic products.
In a typical storage management system, image and voice data obtained by an image sensor and a microphone need to be temporarily stored in separate buffers. And then, each buffer needs a write operation to write the image data and the voice data into a memory card in turn. However, because each write operation includes an addressing process, the process of storing the image and voice data into the memory becomes very time-consuming.
What is needed, therefore, is a storage management system and a storing method thereof to overcome the above-described problem.
Many aspects of the present storage management system and storing method can be better understood with reference to the following drawings. The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the present storage management system and storing method.
Embodiments of the present disclosure will now be described in detail below, with reference to the accompanying drawings.
Referring to
The video data output module 11 is electrically coupled to the first buffer 13 and is configured for outputting video data to the first buffer 13. The audio data output module 12 is electrically coupled to the second buffer 14 and is configured for outputting audio data to the second buffer 14. The format of the audio and video data may be Audio Video Interleaved (AVI) or Moving Pictures Experts Group (MPEG). In the present embodiment, the format is AVI. In order that the video data output module 11 and the audio data output module 12 can output data synchronously, the first buffer 13 and the second buffer 14 need to store data synchronously. The first buffer 13 is used for temporarily storing the video data sent from the video data output module 11. The second buffer 14 is used for temporarily storing the audio data sent from the audio data output module 12.
The processor 15 is electrically coupled to the first buffer 13 and the second buffer 14, and is configured for managing the data in the first buffer 13 and the second buffer 14. The processor 15 includes a selecting module 150, a memory apportioning module 151, a copy module 152, and a writing module 153.
The selecting module 150 is electrically coupled to the first buffer 13 and the second buffer 14, and is configured for selecting one of the first buffer 13 and the second buffer 14 to be used as a combined buffer. The selecting module 150 can select any buffer as the combined buffer. In the present embodiment, when recording an AVI file, the amount of video data will be greater than that the amount of audio data, therefore the rate of copying the audio data into the first buffer 13 by the processor 15 is quicker than copying the video data into the second buffer 14. In the present embodiment, because it takes less time to copy the audio data stored in the second buffer 14 than into the first buffer 13, the selecting module 150 selects the first buffer 13 to be the combined buffer.
The memory apportioning module 151 is electrically coupled to the first buffer 13, and is configured for reserving a memory paragraph in the combined buffer. In the present embodiment, the memory apportioning module 151 reserves a memory paragraph in the first buffer 13. The capacity of the memory paragraph is substantially equal to amount of the audio data to be recorded in a second, and the format of the audio data is AVI. In the present embodiment, the amount of video data recorded in one second is 16008 bytes. Therefore, the capacity of the memory paragraph is 16008 bytes.
The copy module 152 is electrically coupled to the first buffer 13 and the second buffer 14, and configured for copying the data into reserved memory paragraph of the combined buffer from the remaining buffers, which in this embodiment is the second buffer 14. The copy module 152 can copy the data buffered for a predetermined period of time or until a predetermined amount of data is copied. In the present embodiment, the first buffer and second buffers 13, 14 both store one second worth of video and audio data a time, so the copy module 152 copies all of the one second worth of audio data in the second buffer 14 to the memory paragraph in the first buffer 13.
The writing module 153 is electrically coupled to the first buffer 13 and the memory 16, and configured for writing the data stored in the combined buffer into the memory 16. In the present embodiment, the writing module 153 can write the data stored in the first buffer 13 into the memory 16.
In accordance with the exemplary embodiment, the storage management system 10 copies the data from all but one buffer into a combined buffer first, then writes all the data stored in the combined buffer into a memory. Thus the number of write operations between the buffers and the memory are decreased, accordingly, the number of addressing processes corresponding to write operations are also decreased. As a result, it takes relatively less time to store audio and video data into the memory 16.
In a contrasting experiment, a general storage management system was used to store an AVI file in a 32 MB Toshiba SD card. The storing speed achieved was 1.0 MB/s. Whereas when the present exemplary storage management system was used to store the same AVI file using the same 32 MB Toshiba SD card, the storing speed achieved was 1.2 MB/s. The storing speed was observably improved.
Referring to
Step S401, storing data in the buffers respectively. In the present embodiment, the first buffer 13 is used for temporarily storing the video data sent from the video data output module 11. The second buffer 14 is used for temporarily storing the audio data sent from the audio data output module 12.
Step S403, selecting a buffer from the number of buffers to use as a combined buffer. In the present embodiment, the selecting module 150 selects the first buffer 13 for use as the combined buffer.
Step S405, reserving a memory paragraph in the combined buffer which is buffer 13. In the present embodiment, the amount of video data recorded in one second is 16008 bytes, therefore the capacity of the memory paragraph is 16008 bytes.
Step S407, copying the data into the combined buffer from the remaining buffers, which in this embodiment is the second buffer 14. The copy module 152 can copy the data by many modes. For example, the copy module 152 can copy the data recorded during a certain time period such as one second or until a predetermined amount of data has been copiedty.
Step S409, writing the data in the combined buffer to the memory. In the present embodiment, the writing module 153 writes the data stored in the first buffer 13 to the memory 16.
While certain embodiments have been described and exemplified above, various other embodiments will be apparent to those skilled in the art from the foregoing disclosure. The present disclosure is not limited to the particular embodiments described and exemplified, and the embodiments are capable of considerable variation and modification without departure from the scope of the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
200810304577.6 | Sep 2008 | CN | national |