Summary of the invention
Applicant of the present invention is in order to have solved in multimedia player and PC communication; The user can't operate the problem of multimedia player; Carried out improving research, proposed a kind of method and device of realizing multiple main interfaces for embedded memory, supported PC and multimedia player to operate same storer simultaneously through many main memory interface; Make when handheld device is followed the connection of Mass Storage agreement with PC through USB interface; Player need not to get into standby mode, and the user still can operate the storer in the player, carries out the operation that picture, music, video playback etc. need read storer.
Technical scheme of the present invention is following:
A kind of method that realizes multiple main interfaces for embedded memory, through writing down of the operation of each main frame to storer, the file that is updated in the detection of stored device related bunch; Generate each main frame synchronous bunch of table separately; When each host service function storer, judge whether that according to synchronous bunch of table needs read the clustering architecture information of file again, if file is modified; Then need utilize new clustering architecture to read file, make each main frame synchronous operation memory file system.
A host modifications behind the partial data in the file system, all can be rejected and be apprised of these data during these data that are modified of other host accesss and be modified.
When many main frames repeated accesses file structure resource is arranged, to file structure resource in the file system latching operation protection is provided, and informs that main frame this document infrastructure resource of repeated accesses is unavailable.
Nonsynchronous file between main frame is carried out read operation, and concrete steps are following:
1) file system as the application call storer of the multimedia player of main frame drives, and reads the content of a file;
2) file system drive accepted to obtain in the file system table cache from the file system protective seam after the request of reading of this file file bunch chained list information, through read the operation that file is read in corresponding bunch of completion to storer;
3) after the file system protective seam of storer receives the request of reading bunch; With the file system table cache that is kept at this main frame in the file system protective seam relatively; The cluster linking relation of judging this file is by other host modifications; This main frame need read bunch information of file again, and the file system protective seam sends lastest imformation to the file system table updating interface;
4) the file system table updating interface informs that the file system table cache needs to upgrade after receiving the notice of file system protective seam;
5) the file system table cache reads bunch chained list information of new file from storer;
6) obtain the new bunch information of file after, the file system protective seam of file system table updating interface notice storer has upgraded fileinfo, can allow to read file;
7) file system drives and reads file according to new document cluster information to storer;
8) file system drives the file that obtains is submitted to application program.
A kind of device of realizing multiple main interfaces for embedded memory comprises that host file system drives and memory file system drives; Said host file system drives, and is arranged in the host computer system, is used for accomplishing the file on the read-write memory through calling the storage drive interface; Memory file system drives, and is arranged in the system at storer place, is responsible for providing to the upper strata main frame driving interface of operational store, is responsible for the multihost operation protection based on file system simultaneously;
Said memory file system drives and comprises a file system protective seam; Be used to write down the sequencing of each host service function storer; Set up the file system table cache for each main frame, deposit the synchronous situation of the file of the file system on the current storage for the file system table cache on each main frame;
Said host file system drives and comprises a file system table updating interface; Be used to receive the synchronizing information of said file system protective seam; Upgrade the file system table cache that host file system drives, and the file system protective seam renewal that the notice memory file system drives is accomplished.
Comprise with lower module in the said file system protective seam:
The file system table cache is deposited the synchronous situation of the file of the file system on the current storage for the file system table cache on each main frame;
The module that accepts request is used to accept the read request of application program to file;
Judge comparison module; Whether the cluster linking relation that is used to judge file is by other host modifications, and whether this main frame need read bunch information of file again;
The denied access module has been used for when a host modifications refusing these data that are modified of other host accesss behind the partial data of file system, and has informed that these data of other main frames are modified;
The latching operation protection module is used for when many main frames repeated accesses file structure resource, to file structure resource in the file system latching operation protection is provided, and informs that main frame this document infrastructure resource of repeated accesses is unavailable.
In the technique scheme:
Said file system is meant the method and the data structure of storage file on the storer, i.e. the method for constituent act on storer.
Useful technique effect of the present invention is:
The coordinated management of the file system table updating interface that file system protective seam that the present invention drives through memory file system and host file system drive, realized a plurality of main frames during to same memory device operation file structure synchronously.Multimedia player is connected and when following USB Mass Storage agreement through the USB transmission line with PC; Multimedia player can be operated the storer on the multimedia player simultaneously with personal host computer, and multimedia player need not to get into USB pattern (being data-transmission mode).Be that PC is when reading, revise, deleting the file on the storer; Multimedia player is also simultaneously in running order; Can read the file on the storer, carry out operations such as music video broadcast, picture demonstration, but multimedia player can not be revised the file on the deletion storer.
Embodiment
Further specify below in conjunction with the accompanying drawing specific embodiments of the invention.
When using storer, generally the memory block with storer is divided into one or more subregion, and each subregion all is formatted into certain file system with it, through file system management and use memory partition.
At a plurality of main frames; Present embodiment middle finger built-in multimedia player and PC; When operating same storer simultaneously; The form that main frame can be deferred to the file system of storer uses storage space, and is the synchronous operation storer between each main frame, guarantees operation simultaneously and does not destroy file system.
Fig. 1 is a device schematic block diagram of realizing multiple main interfaces for embedded memory.
As shown in Figure 1, the device of realization multiple main interfaces for embedded memory comprises that host file system drives and memory file system drives; Host file system drives, and is arranged in the host computer systems such as PC or media player, is used for accomplishing the file on the read-write memory through calling the storage drive interface.Memory file system drives, and is arranged in the system at storer place, is responsible for providing to the upper strata main frame driving interface of operational store, is responsible for the multihost operation protection based on file system simultaneously.
The present invention adds one deck file system protective seam 101 on storer bottom layer driving layer 103 upper strata of the memory file system driving of multimedia player; Add file system table updating interface 102 in the host file system Drive Layer of multimedia player simultaneously, accomplish the interface management of supporting many main frames by these two parts jointly.
Storer bottom layer driving layer 103 among Fig. 1 is responsible for to the upper strata memory read/write interface based on the sector being provided.Memory interface 104 is in charge of various hardware interface standards, offers the unified operation-interface of storer bottom layer driving layer 103.
The implementation method of the file system protective seam 101 that memory file system drives is through the file system table on the supervisory memory.The file system table record chain structure of the document cluster on the storer.
File system table is such for the membership credentials of file; A list item in the file system table has been represented one bunch, and the attribute of clear this bunch of the numerical tabular of list item: with the FAT16 file system format is example, unappropriated bunch of 0000 representative; 0002-FFEF representative distributed bunch; The FFF0-FFF6 representative system keeps bunch, bad bunch of FFF7 representative, FFF8-FFFF representation file ending cluster.Value in the file system list item is that the value between the 0002-FFEF is indicated as occupied bunch, and this value shows the position of the next one bunch of file, at last with the ending of FFFF representation file bunch.Therefore the composition of a file is made up of this bunch chain, and file system table has promptly been preserved the relation of the cluster linking of all files, is the core of file system.
Said FAT16 is meant a kind of disk file system by Microsoft's exploitation of the U.S..
Said bunch of minimum unit that is meant the operating system management storer that the adjacent a plurality of sectors on the storer (2,4,8,16,32 or 64 sectors) are formed.
Said sector is meant the physical memory cell of the minimum of storer.
Fig. 2 is the detailed schematic block diagram of Fig. 1.
As shown in Figure 2, wherein the file system api 201 that drives of host file system provides the api interface based on file to operating system, like reading of file, the sequence of operations based on file such as writes.FAT32 bunch of read/write 202 then is responsible for the read-write based on disk cluster, and it at first reads bunch table information of the file of desiring to read in the upper strata, sends read-write sector request through bottom IO interface to disk according to the chain structure of bunch table.203 of FAT basic functions are in charge of various structures involved in the FAT standard, constituent act cluster linking relation.204 of FAT table caches read and preserve file structure commonly used (like bibliographic structure) and the nearest file table information that reads in advance.205 bottom IO interfaces provide the disk read-write interface based on the sector.208 on storer bottom layer driving layer is responsible for to the upper strata memory read/write interface based on the sector being provided.Memory interface 209 is in charge of various hardware interface standards, offers the unified operation-interface of storer bottom layer driving layer 208.Above-mentioned each piece is all write by prior art, and its invoked procedure is also identical with process of the prior art.
Difference of the present invention is following structure.
Memory file system drives and comprises a file system protective seam 207; Be arranged on the upper strata of storer bottom layer driving layer 208; Be used to write down the sequencing of each host service function storer; Set up file system table cache 210 for each main frame, deposit the synchronous situation of the file of the file system on the current storage for the file system table cache 210 on each main frame.
The host file system of multimedia player drives and comprises a file system table updating interface 206; Itself and bottom IO interface 205 are listed in one deck; Be used to receive the protection information of sending from the file system protective seam; If the file that multimedia player read is revised by other main frames (like PC), then the file system protective seam informs that the file system table updating interface reads failure, need read the document cluster structure again; This moment, multimedia player was abandoned reading file content; Then read file system table information, and reading and upgrade layer by file system table after accomplishing and inform that the file system protective seam accomplished the renewal of file system table, the file system protective seam allows player operation before to desire the file that reads at this moment.
Comprise in the file system protective seam with lower module:
The file system table cache is deposited the synchronous situation of the file of the file system on the current storage for the file system table cache on each main frame;
The module that accepts request is used to accept the read request of application program to file;
Judge comparison module; Whether the cluster linking relation that is used to judge file is by other host modifications, and whether this main frame need read bunch information of file again;
The denied access module has been used for when a host modifications refusing these data that are modified of other host accesss behind the partial data of file system, and has informed that these data of other main frames are modified;
The latching operation protection module is used for when many main frames repeated accesses file structure resource, to file structure resource in the file system latching operation protection is provided, and informs that main frame this document infrastructure resource of repeated accesses is unavailable.
Through the synergy of said apparatus, the method for the realization multiple main interfaces for embedded memory that obtains is following:
Through writing down of the operation of each main frame to storer; The file that is updated in the detection of stored device related bunch, generate each main frame synchronous bunch of table separately, when each host service function storer; Judge whether that according to synchronous bunch of table needs read the clustering architecture information of file again; If file is modified, then need utilize new clustering architecture to read file, make each main frame synchronous operation memory file system.
A host modifications behind the partial data in the file system, all can be rejected and be apprised of these data during these data that are modified of other host accesss and be modified.
When many main frames repeated accesses file structure resource is arranged, to file structure resource in the file system latching operation protection is provided, and informs that main frame this document infrastructure resource of repeated accesses is unavailable.
Fig. 3 is a schematic flow sheet of realizing the method for multiple main interfaces for embedded memory.
Below in conjunction with concrete elaboration of Fig. 3 is how to realize many main memory interface through the file system protective seam of storer and the file system table updating interface of multimedia player.
From figure, can see that we will once have the file conflict, promptly the nonsynchronous read operation of file is divided into following 8 steps between main frame:
1) application program 301 of multimedia player is called the file system driving 302 of storer, reads the content of a file;
2) file system drive 302 accepted to obtain in the file system table cache 304 from file system protective seam 303 after the request of reading of this file file bunch chained list information, through read the operation that file is read in corresponding bunch of completion to storer;
3) after the file system protective seam 303 of storer receives the request of reading bunch; With the file system table cache that is kept at this main frame in the file system protective seam 303 304 relatively; The cluster linking relation of judging this file is by other host modifications; This main frame need read bunch information of file again, and file system protective seam 303 sends lastest imformation to file system table updating interface 305;
4) file system table updating interface 305 informs that file system table cache 304 needs to upgrade after receiving the notice of file system protective seam 303;
5) file system table cache 304 reads the cluster linking information of new file from storer;
6) obtain the new bunch information of file after, the file system protective seam 303 of file system table updating interface 305 notice storeies has upgraded fileinfo, can allow to read file;
7) file system drives 302 and reads file according to new document cluster information to storer;
8) file system drives 302 the file that obtains is submitted to application program 301.
Accomplished the once read operation of asynchronous file through above 8 steps.
Describe in a sequential manner although it should be noted that treatment step described herein, these are handled the order that also can be configured to change and carry out work.In other words, the order of any step of description or order all are not to indicate these steps to carry out with this kind order.Treatment step described herein can be carried out with any feasible order.Further, some step can be carried out simultaneously.
The personal host computer that in design, relates to adopts the Mass Storage agreement of USB interface to carry out data communication with multimedia player.This kind communication mode is because the restriction of the agreement of being followed; Can't pass on the synchronizing information of file system to main frame; Therefore in this type of design; The multimedia player of this locality at storer place only limits to read operation for the operation of storer, and what the file system protective seam was done is reading synchronously local multimedia player synchronously.And PC can read-write memory as main frame, and does not receive the restriction of other main frames.In the total system main frame of ignoring synchronous protection information like this only can be arranged simultaneously.
Above-described only is preferred implementation of the present invention, the invention is not restricted to above embodiment.Be appreciated that other improvement and variation that those skilled in the art directly derive or associate under the prerequisite that does not break away from spirit of the present invention and design, all should think to be included within protection scope of the present invention.