1. Field of the Invention
The present invention generally relates to removable memories, and more particularly to a multiple adapter for flash drives and an access method for reading data from or writing data to the flash drives through the multiple adapter.
2. Description of Related Art
Universal serial bus (USB) flash drives are very popular because of its low cost, low power consumption, and small size. A USB flash drive is a flash memory integrated with a USB connector. Referring to
When the memory of the USB flash drive is full the user must swap or remove the USB flash drive and replace it with a USB drive with free memory. If the memory of this replacement USB drive is also full the user must swap this replacement USB drive and replace it with another USB drive with free memory. This process is inconvenient. Also, the replacement USB flash drive and the new USB flash drive cannot be incorporated together to be used at the same time.
Therefore, improvements for a multiple adapter for flash drives and an access method are needed in the industry to address the aforementioned deficiency.
A multiple adapter is used for assembling a plurality of flash drives. The multiple adapter includes a multiple expansion port, a detector, a file manager, and a controller. The multiple expansion port coupled to the flash drives. The detector is coupled to the multiple expansion port for detecting store information of the flash drives. The file manager is coupled to the multiple expansion port and the detector for receiving the store information and calculating total memory capacity and total spare capacity of the flash drives. The controller is used for controlling the detector and the file manager. A writing procedure and a reading procedure of an access method are also provided.
Other advantages and novel features of the present invention will become more apparent from the following detailed description of preferred embodiment when taken in conjunction with the accompanying drawings.
Reference will now be made to the drawings to describe a preferred embodiment of the present multiple adapter and a preferred embodiment of the present access method.
Referring to
When a write operation is being performed, the computer 2 sends a write command and the to-be-written data to the multiple adapter 4. The multiple adapter 4 receives the write command, and selects one of the plurality of USB flash drives 70 to store the to-be-written data according to the management table. When a read operation is being performed, the computer 2 sends a read command to the multiple adapter 4. The multiple adapter 4 receives the read command, and reads stored data from a destination drive of the USB flash drives 70 according to the management table, and sends the stored data to the computer 2.
Referring to
In the embodiment, a USB flash drive 73 and a USB flash drive 75 are coupled to the multiple expansion port 47 for exemplary purposes. When the multiple adapter 4 is coupled to the computer 2, the computer 2 supplies power to the multiple adapter 4 and the USB flash drives 73, 75. The controller 41 controls the detector 44 to detect store information of the plurality USB flash drives 73 and 75, and to send the store information to the file manager 45. The store information includes identifiers, memory capacities, spare capacities, logical addresses to spare capacities, file names, and logical addresses to files. The file manager 45 calculates total memory capacity, total spare capacity of the USB flash drives 73 and 75, and generates a file management table and a file information table. The memory 42 stores the total memory capacity, the total spare capacity, the file management table, and the file information table.
Before accessing the USB flash drives 73 and 75 through the multiple adapter 4, the computer 2 sends an access signal to the controller 41. The controller 41 controls the file manager 45 to generate the file management table and the file information table.
Referring to
Referring to
In writing operation, the computer 2 sends the write command and a size of the to-be-written data to the multiple adapter 4. The controller 41 sends a command to the comparer 43 to compare the capacity of the to-be-written data with the total spare capacity of the USB flash drives 73 and 75 stored in the memory 42. If the capacity of the to-be-written data is larger than the total spare capacity, the comparer 43 notifies the computer 2 that the total spare capacity of the USB flash drives 73 and 75 is not enough to store the to-be-written data. If the capacity of the to-be-written data is smaller than the total spare capacity, the comparer 3 sends a write command to the controller 41. The controller 41 controls the file manager 45 to write the to-be-written data to the USB flash drives 73 and 75 sequentially.
After completing the write operation, the controller 41 controls the detector 44 to detect the newly store information of the USB flash drives 73 and 75, and to send the newest store information to the file manager 45. The file manager 45 updates the file management table and the file information table.
For example, referring to
Take the aforementioned for example to explain a reading operation, the computer 2 sends the read command to the multiple adapter 4 to read the file C. The controller 41 controls the file manager 45 to read the file C from the USB flash drives 73 and 75 in turn according to the logical addresses Addr5 and Addr6.
Therefore, the multiple adapter 4 can help the computer 2 to substantially utilize the USB flash drives 73 and 75 to do the writing and reading operation.
Referring to
Block 802, the access signal is sent to the controller 41.
Block 804, the store information of the USB flash drives 70 is detected by the detector 44.
Block 806, the total spare capacity of the USB flash drives 70 is calculated by the file manager 45 based on the store information.
Block 808, the file management table and the file information table are generated by the file manager 45 based on the store information.
Block 810, the write command and the capacity of the to-be-written data are sent to the multiple adapter 4.
Block 812, the capacity of the to-be-written data is compared with the total spare capacity of the USB flash drives. If the capacity of the to-be-written data is larger than the total spare capacity, the procedure goes to block 822. If the capacity of the to-be-written data is smaller than the total spare capacity, the procedure goes to block 814.
Block 814, the write command is received by the controller 41.
Block 816, the to-be-written data is written into the USB flash drives 70 in turn by the file manager 45.
Block 818, the newest store information is detected by the detector 44.
Block 820, the file management table and the file information table are updated by the file manager 45.
Block 822, the computer 2 is notified that the total spare capacity is not enough to store the to-be-written data.
Referring to
Block 902, the access signal is sent to the controller 41.
Block 904, the store information of the USB flash drives 70 is detected by the detector 44.
Block 906, the file management table and the file information table are generated by the file manager 45 based on the store information.
Block 908, the read command is sent to the multiple adapter 4.
Block 910, the stored data is read from the USB flash drives 70 in turn according to the read command.
Block 912, the newest store information is detected by the detector 44.
Block 914, the file management table and the file information table are updated by the file manager 45.
It is to be understood, however, that even though numerous characteristics and advantages of the present invention have been set forth in the foregoing description, together with details of the structure and function of the invention, the disclosure is illustrative only, and changes may be made in detail, especially in matters of shape, size, and arrangement of parts within the principles of the invention to the full extent indicated by the broad general meaning of the terms in which the appended claims are expressed.
Number | Date | Country | Kind |
---|---|---|---|
200710200914.2 | Jun 2007 | CN | national |