Summary of the invention
Because prior art exists new data need write the problem that could use behind the storage area that is defined as read-only zones in the storage device again, the present invention provides a kind of storage device and method thereof that is written into extended function to different storage area then, wherein:
The storage device that is written into extended function to different storage area provided by the present invention comprises at least: Storage Media, comprise first storage area and second storage area, and store master routine in first storage area; Connecting interface is used for being connected with computer, and transmits master routine to computer and carry out; Wherein, master routine more comprises: the file detection module is used for judging by connecting interface whether second storage area stores the expansion enactment document; The setting item read module is used for reading the expansion enactment document by connecting interface, and obtaining and expand the expansion setting item that is write down in the enactment document after the enactment document detection module judges that second storage area stores the expansion enactment document; File insmods, and is used for being written into file destination by connecting interface after the file detection module judges that second storage area stores the file destination of corresponding expansion setting item.
The storage device that is written into extended function to different storage area provided by the present invention, wherein, first storage area is a read-only zones.
The storage device that is written into extended function to different storage area provided by the present invention, file insmods and more is used for being written into the file destination that is stored in first storage area by connecting interface after the file detection module judges that second storage area does not store file destination.The setting item read module more is used for after the file detection module judges that second storage area does not store the expansion enactment document, by reading basic enactment document in connecting interface to the first storage area.
The storage device that is written into extended function to different storage area provided by the present invention, the setting item read module more is used for reading basic enactment document by connecting interface to the first storage area, file insmods and more is used for the basic setting item that the basic enactment document of foundation is write down, be written into by connecting interface and be stored in first storage area basic document corresponding with basic setting item.
The method that is written into extended function to different storage area provided by the present invention, its step comprises at least: connect computer and storage device, storage device comprises first storage area and second storage area; Computer is carried out master routine stored in first storage area; Master routine is judged when storing the expansion enactment document in second storage area, reads the expansion enactment document, and obtains and expand the expansion setting item that is write down in the enactment document; Master routine is written into file destination after judging the file destination that stores corresponding expansion setting item in second storage area.
The method that is written into extended function to different storage area provided by the present invention, more comprise master routine judge do not store file destination in second storage area after, be written into the step that is stored in the file destination in first storage area.
The method that is written into extended function to different storage area provided by the present invention, after computer is carried out master routine stored in first storage area, more comprise and read basic enactment document in master routine to the first storage area, and, be written into the step that is stored in the basic document in first storage area according to the basic setting item that basic enactment document is write down.In addition, in master routine to the first storage area, read basic enactment document before, more comprise and judge that master routine is judged and store the step that expands enactment document in second storage area.
The method that is written into extended function to different storage area provided by the present invention after the step that connects computer and storage device, more comprises computer and defines the step that first storage area is a read-only zones.
Storage device provided by the present invention and method thereof are as above, and after the difference between the prior art is that the present invention carries out the master routine that is stored in first storage area by computer, if judging to exist in second storage area, master routine expands enactment document, then can further judge exist in second storage area be recorded in the expansion enactment document in the corresponding file destination of expansion setting item the time, be written into file destination, use solving the existing problem of prior art, and can reach and reduce the technology effect that the burden that writes data is provided.
Embodiment
Below will cooperate graphic and embodiment to describe the present invention's feature and embodiment in detail, content is enough to make any related art techniques person of haveing the knack of can fully understand the applied technological means of technical solution problem of the present invention easily and implements according to this, realizes the attainable effect of the present invention by this.
The master routine that the present invention carried after being performed, can provide the basic function that the user uses except meeting is written into, and also can be written into file destination when judging file destination and exist.
The file destination that the present invention carried, comprise the program that basic function or extended function are provided or dynamically link file (Dynamic Linking Library, DLL), the files such as database of particular data are provided, but not as limit.After master routine is written into file destination, master routine can provide the function corresponding with the file destination that is written into to use to the user.Wherein, when file destination was program file, master routine was written into file destination and in fact is the master routine execution, made that file destination begins to carry out, and when file destination was data file, master routine was written into file destination and is actually content in the master routine read data files.
The present invention be applied in can with storage device 100 that computer 400 is connected in, after computer 400 is carried out the master routine that is stored on the storage device 100, be written into the file destination that is stored on the storage device 100 by master routine, use to expand offering the function that the user uses.Wherein, shown in the storage device connection layout of " Fig. 1 ", storage device 100 comprises connecting interface 110 and Storage Media 120 at least.
Connecting interface 110 provides storage device 100 to be connected with computer 400, be responsible for to receive the control signal that computer 400 is transmitted, and is responsible for transmission and is stored in files such as program in the Storage Media 120 and data.Connecting interface 110 be generally USB (universal serial bus) (Universal Serial Bus, USB), but the present invention is as limit, other are the connecting interface 110 that also can be carried by the present invention of IEEE 1934 for example.
Storage Media 120 is responsible for storing the file that offers computer 400 uses, for example allow program that computer 400 carries out, allow the program in the computer 400 of being executed in carry out the data of particular procedure and the data that store voluntarily by the user etc., but the present invention is not as limit.
What deserves to be mentioned is, Storage Media 120 is divided into two storage areas at least, the master routine 200 that the present invention comprises can be deposited in certain specific storage area in the Storage Media 120, and master routine 200 is after being carried out by computer 400, and the present invention's system will carry out in computer 400.
On practice, the specific storage zone that stores master routine can be set to read-only zones, but the present invention is not as limit.That is to say; if Storage Media 120 is divided into first storage area 121 and second storage area 122; when storing master routine in first storage area 121; in order to protect master routine; the user can't carry out write operation to first storage area 121; can only read the data of first storage area 121, and access second storage area 122.
After computer 400 is carried out the stored master routine 200 of Storage Media 120, master routine 200 will be written into the system shown in the system architecture diagram of extended function with " Fig. 2 " the extremely different storage area that the present invention was carried and operate in computer 400.Shown in " Fig. 2 ", the master routine 200 that the present invention carried contains file detection module 210, setting item read module 220 and file and insmods 230.
File detection module 210 is responsible for by connecting interface 110 judging whether second storage area 122 stores the expansion enactment document to Storage Media 120.Generally speaking, the file name of the expansion enactment document that second storage area 122 is stored and deposit the path for predetermined, 210 of file detection modules need judge depositing the file whether path exist predetermined file name and can finishing judgement of being scheduled in second storage area 122, but file detection module 210 is judged second storage area 122 and whether is stored the mode of expansion enactment document not as limit, other modes are outside for example file detection module 210 to the storing directory that is defined voluntarily by the user and file name judges whether expand enactment document exists, also can open each stored file of second storage area 122 one by one, and judge whether the file that is unlocked is to expand enactment document, so, whether file detection module 210 also can be judged and expand enactment document and exist.
Expanding the enactment document record provides the expansion setting item of the function that the user uses, it is corresponding with one or more file destinations respectively to be recorded in each expansion setting item that expands in the enactment document, each expands setting item and comprises the file name of corresponding file destination and deposit the path, but expands setting item not with file name and deposit the path and exceed.Wherein, owing to can't predict the drive of second storage area 122, be necessary for relative path so expand the path of depositing of the file destination that enactment document write down, and can not think absolute path.
What deserves to be mentioned is, expanding the expansion setting item that enactment document write down might not only comprise the file name of the file destination that expands the master routine function and deposit the path, more can comprise the file name of the file destination that the master routine basic function is provided and deposit the path, that is to say, expand the setting item (comprise basic setting item and expand setting item) that enactment document also can write down all functions (basic function and extended function) that master routine is provided.
In addition, file detection module 210 also is responsible for by connecting interface 110 to Storage Media 120, according to the file name of setting item read module 220 file destination corresponding with expanding setting item that read and deposit the path and judge in second storage area 122 whether store file destination.
Setting item read module 220 be responsible for file detection module 210 judge store in second storage area 122 expand enactment document after, by reading out the expansion enactment document in connecting interface 110 to second storage areas 122, so, setting item read module 220 just can be obtained the expansion setting item by expanding in the enactment document.
Setting item read module 220 also can be by reading basic enactment document in connecting interface 110 to first storage areas 121.The stored expansion enactment document in the stored basic enactment document in first storage area 121 and second storage area 122 is similar, each the basic setting item that is recorded in the basic enactment document is corresponding with one or more basic document respectively, each basic setting item comprises the file name of corresponding basic document and deposits the path, but basic setting item is not with file name and deposit the path and exceed.Basic enactment document is with the difference that expands enactment document, and basic enactment document only writes down the basic setting item that the basic function that the user uses is provided, and can not write down the expansion setting item.Wherein, owing to can't predict the drive of first storage area 121, so the path of depositing of the basic document that basic enactment document write down is necessary for relative path.
In addition, setting item read module 220 can also pass through connecting interface 110, read and be not recorded in the expansion enactment document that is stored in second storage area 122, but be recorded in the basic enactment document that is stored in first storage area 121, and by playback record in the basic enactment document in basic setting item wherein.
File insmod 230 be responsible for file detection module 210 judge in second storage area 122 store the file destination corresponding with the expansion setting item after, the file name of the file destination that the expansion setting item of obtaining according to setting item read module 220 is comprised and deposit the path, by reading file destination in connecting interface 110 to second storage areas 122, and after reading file destination, be written into file destination.
If expanding the expansion setting item that enactment document write down also comprises the file name of the file destination that the master routine basic function is provided and deposits the path, then file insmod 230 file detection module 210 judge in second storage area 122 store the file destination corresponding with the expansion setting item after, the file name of the file destination of obtaining according to setting item read module 220 and deposit the path, by reading file destination in connecting interface 110 to first storage areas 121, and after reading file destination, be written into file destination.
File insmod 230 file names of also being responsible in the setting item read module 220 basic enactment document stored, obtaining the pairing basic document of basic setting item by first storage area 121 with deposit the path after, the file name of the basic document that obtain according to setting item read module 220 and deposit the path, by reading basic document in connecting interface 110 to first storage areas 121, and after reading basic document, be written into basic document.
Then explain orally operation system of the present invention and method, and please refer to " Fig. 3 A " method flow diagram that is written into extended function to different storage area that the present invention carried with first embodiment.In the present embodiment, suppose that master routine 200 is translation software, storage device 100 is the carry-on dish of USB, but master routine 200 that the present invention carried and storage device 100 be not as limit.
After in the USB slot of the user's insertion of the USB joint (connecting interface 110) on the carry-on dish (storage device 100) computer 400 with USB, the carry-on dish of USB is finished be connected (step 301) with computer 400.Suppose that in the present embodiment the carry-on dish of USB comprises two storage areas such as first storage area 121 and second storage area 122, but the storage device 100 that the present invention carried does not exceed with two storage areas.
At the carry-on dish of USB with after computer 400 is connected (step 301), computer 400 can definition first storage area 121 be read-only CD drive (step 309), and configuration drive, be assumed to be " M ", simultaneously, also can define second storage area is general Winchester disk drive, and the drive of configuration is " N ", but the drive that computer 400 is disposed does not exceed with " M ", " N ".
After being each storage area configuration drive of the carry-on dish of USB at computer 400, computer 400 can be by first storage area 121 in the Storage Media 120 of the carry-on dish of USB interface access USB, use and read translation program (master routine 200), and carry out the translation program of being read by USB interface to the first storage area 121 (step 312).
Then, the file detection module in the translation program 210 can be by judging in USB interface to the second storage area 122 whether expand enactment document exists (step 330).Suppose in the present embodiment, the expansion enactment document is the file " plugin.cfg " in the root directory, then file detection module 210 can judge in the root directory of " N " hdd slot whether have file " plugin.cfg ", uses to judge second storage area 122 and whether store the expansion enactment document.If have file " plugin.cfg " really in the root directory of " N " hdd slot, then file detection module 210 can be judged second storage area 122 and store expansion enactment document " plugin.cfg ".
File detection module 210 in translation program judge second storage area 122 store expand enactment document after, setting item read module 220 in the translation program can read by USB interface to the second storage area 122 and expand enactment document " plugin.cfg ", and finish expand the reading of enactment document after, obtain and be recorded in the expansion setting item (step 350) that expands in the enactment document.Suppose in the present embodiment the file destination that the expansion expansion setting item that enactment document write down comprises the file destination of extended function and basic function is provided.
After setting item read module 220 in translation program is obtained and is expanded setting item, file detection module 210 in the translation program can according to the obtained expansion setting item of setting item read module 220 correspondence file destination file name and deposit the path, judge in second storage area 122 whether store file destination (step 370) by USB interface.
The hypothetical target file is for providing the file of basic function, file name is " translation.dll ", deposit the path is root directory, then file detection module 210 can judge whether the root directory of " N " hdd slot exists file destination " translation.dll ", if file destination " translation.dll " does not exist in the root directory of " N " hdd slot, then file detection module 210 can be judged second storage area 122 and not store file destination " translation.dll ".
After file detection module 210 in translation program is judged second storage area 122 and is not stored file destination, file in the translation program insmods and 230 can and deposit path " root directory " according to the file name " translation.dll " of file destination, read file destination " translation.dll " by USB interface to the first storage area 121, file insmods 230 can be after finishing the reading of file destination, be written into file destination " translation.dll ", just carry out file destination " translation.dll " (step 390), so, translation program provides the user basic interpretative function.
The file name of hypothetical target file is " voice.dll ", deposits the path and be " plugin voice " again, after then hunting out file destination " voice.dll " in file detection module 210 " plugin voice " catalogue by " N " hdd slot, file detection module 210 can be judged second storage area 122 and store file destination " voice.dll ".
After file detection module 210 in translation program is judged second storage area 122 and is stored file destination, file in the translation program insmods and 230 can and deposit path " plugin voice " according to the file name " voice.dll " of file destination, read file destination " voice.dll " by USB interface to the second storage area 122, file insmods 230 can be after finishing the reading of file destination, carry out file destination " voice.dll " (step 380), so, by the present invention, translation program can also increase the function of voice pronunciation except basic interpretative function is provided.
In the above-described embodiments, if the file detection module 210 in the translation program is judged second storage area 122 and is not stored the expansion enactment document, the expression translation program is without any the file that can expand, basic functions can only be provided, and then the setting item read module in the translation program 220 can read basic enactment document " system.cfg " (step 341) by USB interface to the first storage area 121.And then, file insmods 230 meetings according to being recorded in the file name of the pairing basic document of basic setting item in the basic enactment document and depositing the path, read basic document (step 342) by USB interface to the first storage area 121.Suppose basic setting item correspondence basic document file name and deposit the path and be respectively " translation.dll " and root directory, then insmod 230 can read " translation.dll " to the root directory of " M " hdd slot for file, and read the back and carry out " translation.dll " finishing, use the interpretative function that provides the most basic.
Below explain orally operation system of the present invention and method with second embodiment again, and please refer to the method flow diagram that " Fig. 3 B " another kind that the present invention carried to different storage area is written into extended function.In the present embodiment, suppose that equally master routine 200 is translation software, storage device 100 is for comprising the carry-on dish of USB of two storage areas such as first storage area 121 and second storage area 122.
After in the USB slot of the user's insertion of the USB joint (connecting interface 110) on the carry-on dish (storage device 100) computer 400 with USB, the carry-on dish of USB is finished be connected (step 301) with computer 400.Then, computer 400 can be respectively first storage area 121 and second storage area, 122 configuration drives, is assumed to be " P ", " Q ".And then, computer 400 can be by first storage area 121 in the Storage Media 120 of the carry-on dish of USB interface access USB, use and read translation program (master routine 200), and carry out the translation program of being read by USB interface to the first storage area 121 (step 312).
After translation program is carried out by computer 400, setting item read module 220 in the translation program can read basic enactment document " system.cfg " (step 341) by USB interface to the first storage area 121, afterwards, the file detection module in the translation program 210 can be by judging in USB interface to the second storage area 122 whether expand enactment document " plugin.cfg " exists (step 330).If exist really in the root directory of " Q " hdd slot and expand enactment document " plugin.cfg ", then file detection module 210 can be judged second storage area 122 and store expansion enactment document " plugin.cfg ", and reads expansion enactment document " plugin.cfg " (step 350) by the setting item read module 220 in the translation program by USB interface to the second storage area 122.
The setting item read module 220 of translation program read basic enactment document " system.cfg " (step 341) respectively to first storage area 121 by USB interface and read to second storage area 122 expand enactment document " plugin.cfg " (step 350) after, setting item read module 220 except the meeting reading and recording in the expansion setting item that expands enactment document " plugin.cfg ", also can be shown in the flow process of " Fig. 3 C ", read not to be recorded in and expand in the enactment document " plugin.cfg ", but be recorded in basic setting item (step 361) in the basic enactment document " system.cfg ".
After setting item read module 220 in translation program is obtained and is expanded setting item and basic setting item, file detection module 210 in the translation program can according to obtained the expansions setting item of setting item read module 220 (or setting item) substantially correspondence file destination file name and deposit the path, judge whether store file destination (step 362, step 370) in second storage area 122 by USB interface.
If file destination does not exist in " Q " hdd slot, then file detection module 210 can be judged second storage area 122 and not store file destination, so the file in the translation program insmods and 230 can and deposit the path according to the file name of file destination, read file destination by USB interface to " P " hdd slot (first storage area 121), use and be written into file destination (step 390), so, translation program just can provide the user basic interpretative function.
If file destination exists in " Q " hdd slot, then file detection module 210 can be judged second storage area 122 and store file destination, so the file in the translation program insmods and 230 can and deposit the path according to the file name of file destination, read file destination by USB interface to the second storage area 122, use being written into file destination (step 380), so, by the present invention, translation program can also increase the function of voice pronunciation except basic interpretative function is provided.
In sum, difference between the present invention and the prior art is after computer is carried out the master routine 200 that is stored in first storage area 121 as can be known, master routine 200 can judge in second storage area 122 whether have the expansion enactment document earlier, whether exist in second storage area 122 and be recorded in the corresponding file destination of expansion setting item that expands in the enactment document if then further judge again, if, just be written into the technological means of file destination, can solve the existing new data of prior art by this technological means and need write the problem that to use behind the storage area that is defined as read-only zones in the storage device again, and then reach and reduce the technology effect that the burden that writes data is provided.
Moreover the present invention's the method that is written into extended function to different storage area can be implemented in the combination of hardware, software or hardware and software.
Though embodiment provided by the present invention as above, holding within thought is described is not the scope of patent protection that is used for directly limiting the present invention.Any persond having ordinary knowledge in the technical field of the present invention under the prerequisite that does not break away from spirit and scope provided by the present invention, does a little change retouching to the present invention's reaching of enforcement in form on the details, all belong to the present invention's scope of patent protection.The present invention's scope of patent protection, still must with appended claim scope the person of being defined be as the criterion.