The present invention relates to a method of data management, and more particularly, to a method and a system for managing data from a host to an optical disc.
In Microsoft Windows FAT32 file system, write commands are transmitted by a host to the DVD-RAM (Digital Versatile Disc Random Access Memory) disc with random LBA (Logic Block Address) sequence. In other words, data of sequential write commands from the host may be write-address-discontinuous. The “write-address-discontinuous” here means that two data written into the disc and their ECC LBA are discontinuous. Similarly, “write-address-continuous” means that two data written into the disc and their ECC LBA are continuous. For example, a first data is needed to be written into the disc at ECC LBA 00DA34-00DA53, and when a second data is needed to be written into the disc at an ECC LBA 00DA54-XXXXXX, the second data and the first data are write-address-continuous; otherwise the second data and the first data are write-address-discontinuous.
For an optical storage system having a single write buffer mechanism, when the data of sequential write commands from the host is write-address-continuous, these data are temporally stored into the write buffer, and when a size of the data stored in the write buffer satisfies a predetermined value, the stored data are written to the optical disc.
However, when the data of incoming write commands from the host is write-address-discontinuous with the data stored in the write buffer, the data stored in the write buffer needs to be written to the optical disc no matter whether the size of the data exceeds the predetermined value or not, and then the data of a next write command is stored into the write buffer.
Please refer to
Furthermore, beginning write addresses of the data of write commands CMD1-CMD5 are not aligned with ECC blocks as showed in
In addition, because the beginning write addresses of the data of write commands CMD1-CMD5 are not aligned with ECC blocks, when the data of each write command CMD2-CMD5 needs to be written into the optical disc, a tail of the previous write-address-continuous data needs to be read from the optical disc first. For example, when the data of write command CMD3 needs to be written into the optical disc, a tail (i.e., address 00DA50-00DA54) is read from the optical disc, and then, this tail and the data of the write command CMD3 are written into the optical disc. Therefore, in
As mentioned above, before writing CMD1-CMD5 into the optical disc, the data which has been written on the optical disc needs to be read out, and then written into the optical disc again. Therefore, the related art method of writing data into the optical disc is inefficient.
It is therefore an objective of the present invention to provide a method and a system for managing data from a host to an optical disc efficiently, in order to solve the above-mentioned problem.
According to one embodiment of the present invention, a method for managing data from a host to an optical disc comprises: storing data into a write data queue (WDQ) when the data of sequential write commands from the host are write-address-discontinuous; and transferring specific data from the WDQ to a write buffer when an available memory space in the WDQ is lower than a first threshold value or an available memory space in the write buffer exceeds a second threshold value.
An optical storage system according to the embodiment of the present invention comprises a write buffer, a processor and a decision unit. The decision unit is coupled to the processor and the write buffer, and is utilized for storing the data into a write data queue (WDQ) when data of sequential write commands from the host are write-address-discontinuous, and for transferring specific data from the WDQ to a write buffer when an available memory space in the WDQ is lower than a first threshold value or an available memory space in the write buffer exceeds a second threshold value.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Certain terms are used throughout the following description and claims to refer to particular system components. As one skilled in the art will appreciate, manufacturers may refer to a component by different names. This document does not intend to distinguish between components that differ in name but not function. In the following discussion and in the claims, the terms “including” and “comprising” are used in an open-ended fashion, and thus should be interpreted to mean “including, but not limited to . . . ” The terms “couple” and “couples” are intended to mean either an indirect or a direct electrical connection. Thus, if a first device couples to a second device, that connection may be through a direct electrical connection, or through an indirect electrical connection via other devices and connections.
In the optical storage system 300, the host 310 sequentially transmits write commands to the decision unit 340. Then, the decision unit 340 determines if data of the write command is write-address-continuous with the data stored in the write buffer 350. If the data of the incoming write command is write-address-continuous with the data stored in the write buffer 350, the decision unit 340 stores the data of the incoming write command to the write buffer 350; and if the data of the incoming write command is write-address-discontinuous with the data stored in the write buffer 350, the decision unit 340 stores the data of the incoming write command to the WDQ 360.
Then, when an available memory space in the WDQ 360 is lower than a threshold value or the write buffer 350 is empty, the decision unit 340 transfers the leading data stored in the WDQ 360 and its write-address-continuous data to the write buffer 350. After that, the data stored in the write buffer 350 are transmitted to the encoder 370 to output encoded data to the optical pick-up head 380. Thus, the optical pick-up head 380 writes the encoded data to an optical disc.
Taking the sequential write commands shown in
Compared with the prior art method of writing data into the optical disc, the optical storage system 300 only writes the data into the optical disc twice, and is therefore more efficient.
Please refer to
Please refer to
In addition, in
In addition, the data of the write command in the WDQ 360 corresponds to a WDQ data structure WDQ_Info, and each WDQ data structure WDQ_Info includes a WDQ-Memory pointer bDramPtr, a stream pointer dStrmHdrAddr, a sequential number bQorder of the data stored in the WDQ 360, a link-up pointer bLinkUp, a link-down pointer bLinkDn, a data length bULen, and a write address of a next write-address-continuous data dNxAddr.
Please refer to
In
In practice, the host 310 shown in
In addition, the WDQ 360 and the write buffer 350 can be integrated as a single memory, wherein sizes of the WDQ 360 and the write buffer 350 can be determined according to the designer's consideration.
However, for an optical disc drive having a fixed memory size, applying the WDQ of the present invention enables the size of the write buffer to be decreased (originally all the memory can be used as the write buffer); that is, the amount of data from the write buffer written to the optical disc is also decreased. Therefore, the above-mentioned method for managing the data from the host is more efficient when the incoming data from the host are write-address-discontinuous. However, when the incoming data are write-address-continuous over a long period, the incoming data are all stored into the write buffer, and the WDQ is idle. To solve this problem, the present invention further provides a method for efficiently managing data when the incoming data are write-address-continuous.
Please refer to
Similarly, assuming that the WDQ 360 is initially at state WDQ0 in the WDQ mode, when an amount of write-address-continuous data during a predetermined period is greater than a predetermined value, the WDQ 360 is changed to be at state WDQ1. Then, if the following incoming data are write-address-discontinuous, the WDQ 360 goes back to state WDQ0; if the following incoming data are still write-address-continuous during a period, the WDQ 360 is switched to the sequential write mode and is at state SWBF0.
It is noted that the above switch state machine shown in
In addition, transition conditions of the switch state machine described above are merely examples, and not limitations of the present invention. For example, the switch state machine can be designed so that the state WDQ0 is switched to the state WDQ1 under the condition that all data over the predetermined period are write-address-continuous data. For simplicity, as long as the WDQ is switched between the WDQ mode and the sequential write mode according to divergence of the data of the sequential write commands, these alternative designs all lie within the scope of the present invention.
Briefly summarized, the WDQ in the present invention is used to store the write-address-discontinuous data transmitted from the host, and when the available memory space in the WDQ is lower than the threshold value or the write buffer is empty, the leading data stored in the WDQ and its write-address-continuous data in the WDQ are transferred to the write buffer. According to the method of the present invention, a number of times of writing the data to the optical disc and a number of times of verifying the data on the optical disc can be decreased, and the recording time of the optical disc can thereby be reduced.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention.
This application claims the priority of U.S. Provisional Application No. 60/991,771, filed Dec. 3, 2007, which is included herein by reference.
Number | Name | Date | Kind |
---|---|---|---|
5408654 | Barry | Apr 1995 | A |
5848050 | Nagasawa et al. | Dec 1998 | A |
6798599 | Dykes et al. | Sep 2004 | B2 |
7706221 | Ando et al. | Apr 2010 | B2 |
20010006211 | Choi | Jul 2001 | A1 |
20020080691 | Cho | Jun 2002 | A1 |
20040202073 | Lai et al. | Oct 2004 | A1 |
20050105320 | Suh | May 2005 | A1 |
20050162990 | Murata | Jul 2005 | A1 |
20060067191 | Jin | Mar 2006 | A1 |
20070002699 | Suh | Jan 2007 | A1 |
20070028040 | Sinclair | Feb 2007 | A1 |
20070164241 | Nakano | Jul 2007 | A1 |
20070183272 | Yamada | Aug 2007 | A1 |
20080013416 | Van Rompaey | Jan 2008 | A1 |
20080151722 | Hara | Jun 2008 | A1 |
20080198706 | Wu et al. | Aug 2008 | A1 |
20080205229 | Li | Aug 2008 | A1 |
20080285425 | Ichihara | Nov 2008 | A1 |
20110128833 | Nishiyama | Jun 2011 | A1 |
Number | Date | Country |
---|---|---|
1992046 | Jul 2007 | CN |
460832 | Oct 2001 | TW |
I238991 | Sep 2005 | TW |
Number | Date | Country | |
---|---|---|---|
20090141606 A1 | Jun 2009 | US |
Number | Date | Country | |
---|---|---|---|
60991771 | Dec 2007 | US |