CN101493844B - Method and apparatus for implementing multiple main interfaces for embedded memory - Google Patents

Method and apparatus for implementing multiple main interfaces for embedded memory Download PDF

Info

Publication number
CN101493844B
CN101493844B CN 200910116305 CN200910116305A CN101493844B CN 101493844 B CN101493844 B CN 101493844B CN 200910116305 CN200910116305 CN 200910116305 CN 200910116305 A CN200910116305 A CN 200910116305A CN 101493844 B CN101493844 B CN 101493844B
Authority
CN
Grant status
Grant
Patent type
Prior art keywords
file
file system
memory
host
cluster
Prior art date
Application number
CN 200910116305
Other languages
Chinese (zh)
Other versions
CN101493844A (en )
Inventor
佴立峰
张善文
张振辉
戴辉
Original Assignee
无锡紫芯集成电路系统有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Grant date

Links

Abstract

The invention relates to a method and a device for realizing an embedded memory multi-master interface. The method updates the collaborative management of the interface through a file system protection layer driven by a memory file system and a file system table driven by a host file system and realizes the structure synchronization of the file system when a plurality of hosts operates on a same storage device. The invention leads a multimedia player to be connected with a personal computer by a USB transmission wire, the multimedia player and the host personal computer can simultaneously operate the memory on the multimedia player when the USB Mass Storage Protocol is followed, the multimedia player does not enter the USB mode, and the user can still operates the memory in the multimediaplayer and carry out operations which need memory read and write like images, music and video play and the like.

Description

实现嵌入式存储器多主接口的方法及装置 Method and device to realize the embedded memory interface multimaster

技术领域 FIELD

[0001 ] 本发明涉及实现存储器多主接口的方法及装置,具体是一种实现在嵌入式系统环境下提供多个主机同时操作同一个存储器的方法及装置。 [0001] The present invention relates to a method and apparatus to realize multi-master memory interface, a particular implementation provides a plurality of host environments in the embedded system device and a method of operating simultaneously with a memory.

背景技术 Background technique

[0002] 现有的嵌入式多媒体播放设备对于NAND Flash (非易失闪存)或者SD/MMC/CF卡等存储设备的操作都仅仅提供了单主机的支持,而不支持多个主机同时操作同一个存储设备。 [0002] The conventional embedded multimedia playing apparatus for operating NAND Flash (non-volatile flash memory) or SD / MMC / CF cards and other storage devices are provided only to support a single master, and does not support multiple hosts simultaneously with operation a storage device. 比如当前国内外各大移动多媒体设备厂商生产的设备在同个人电脑进行连接时,一般通过USB传输线连接,且遵循USB MassStorage协议,而在使用个人电脑操作多媒体播放器上的存储器时,多媒体播放器是无法同时操作此存储器从而迫使多媒体播放器进入待机模式。 When such current major domestic manufacturers of mobile multimedia devices connected with the apparatus when a personal computer, typically via a USB cable connection, and follows MassStorage USB protocol, and the use of memory in the personal computer operating multimedia player, multimedia player this memory can not be operated simultaneously to force the multimedia player enters standby mode. 在该模式下,用户除了能够断开同个人电脑的联接外无法操作多媒体播放器,直到中断个人电脑和设备的联接,用户才重新获得对于多媒体播放器的控制权。 In this mode, the user can disconnect except with an outer join PC's multimedia player can not be operated until to disconnect the PC and the device, the user only to regain control over the media player.

[0003] 所述USB,即Universal Serial Bus(通用串行总线)的缩写,是指一种电子设备间串行通信的标准。 [0003] The USB, i.e. Acronym Universal Serial Bus (USB) refers to the standard serial communication between an electronic device.

[0004] 所述USB Mass Storage协议,是指通过USB接口使PC同外设之间进行大数据传输的标准,艮口USB Implementers Forum 组织的《Universal Serial BusMass Storage Class Specification Overview》文件标准。 [0004] The USB Mass Storage protocol standard refers to large data transfer between the PC through the USB interface so that the same peripherals, "Universal Serial BusMass Storage Class Specification Overview" standard document Gen port USB Implementers Forum tissue.

发明内容 SUMMARY

[0005] 本发明的申请人为了解决了在多媒体播放器和个人电脑通讯的同时,用户无法操作多媒体播放器的问题,进行了改进研究,提出了一种实现嵌入式存储器多主接口的方法及装置,通过多主存储器接口来支持个人电脑和多媒体播放器同时操作同一个存储器,使得在手持设备同个人电脑通过USB接口遵循Mass Storage协议连接时,播放器无需进入待机模式,用户仍可以操作播放器内的存储器,进行图片、音乐、视频播放等需要读取存储器的操作。 [0005] The applicant of the present invention to solve the problems in the multimedia player and a personal computer communication, while the user can not operate the multimedia player, improvement has been studied, a method for implementing a multi-master interface of embedded memory and means through a multi-main memory interface supports personal computers and multimedia players simultaneously operate on the same memory, such that when the handheld device with a personal computer interface follows Mass storage protocol connection via USB, the player without going into standby mode, the user can still operate the player memory within the device, a picture, music, video playback operation of the memory to be read.

[0006] 本发明的技术方案如下: [0006] aspect of the present invention is as follows:

[0007] —种实现嵌入式存储器多主接口的方法,通过记录各个主机对存储器的操作,检测存储器中被更新的文件所涉及的簇,生成各个主机各自的同步簇表,在各个主机操作存储器时,根据同步簇表判断是否需要重新读取文件的簇结构信息,如果文件已被修改,则需要利用新的簇结构读取文件,使各个主机同步操作存储器文件系统。 [0007] - Method of implementations multimaster embedded memory interface, by recording the individual operating the host to the memory, the memory is updated cluster detection files involved, each host generates a respective cluster table synchronization, memory in each of the host operating when determining whether to synchronize the cluster table need to be reread according to the cluster configuration information file, if the file has been modified, need to be used to read the file structure of the new cluster, so that each host file system synchronization memory.

[0008] 一个主机修改了文件系统中的部分数据后,其他主机访问此被修改的数据时都会被拒绝且被告知此数据已被修改。 After [0008] the modified host a portion of the data in the file system, access to this other hosts modified data will be rejected and be told the data has been modified.

[0009] 有多主机重复访问文件结构资源时,对文件系统内文件结构资源提供锁操作保护,并告知重复访问的主机该文件结构资源不可用。 [0009] repeated multiple hosts to access resource file structure, there is provided a lock protection operation of the file structure within the file system resources, and inform the host repeatedly accessed the file structure is not available.

[0010] 对主机间不同步的文件进行读取操作,具体步骤如下: [0010] The file is not synchronized between the host read operation, the following steps:

[0011] 1)作为主机的多媒体播放器的应用程序调用存储器的文件系统驱动,读取一个文件的内容; [0011] 1) call memory as a multimedia player application host file system driver, reads the contents of a file;

[0012] 2)文件系统驱动接受了这个文件读取请求之后从文件系统保护层中的文件系统表缓存中得到文件的簇的链表信息,通过向存储器读取相应的簇完成读取文件的操作; After [0012] 2) the file system driver accepts this file read request to obtain the file from the file system in the protective layer in a linked list file system information table cache cluster, cluster by reading the appropriate memory read operation to the file is completed ;

[0013] 3)存储器的文件系统保护层接收到读取簇的请求后,同保存在文件系统保护层中的此主机的文件系统表缓存比较,判断此文件的簇链接关系已经被其他主机修改,此主机需要重新读取文件的簇信息,文件系统保护层向文件系统表更新接口发出更新信息; After the file system protection layer [0013] 3) receives a request to read memory clusters, compared with the protective layer in the file system in this host file system table cache determination cluster the link relation file has been modified from other hosts this host needs to re-read cluster information file, the file system protection layer table updates to the file system interface that the update information;

[0014] 4)文件系统表更新接口接到文件系统保护层的通知之后告知文件系统表缓存需要更新; [0014] 4) informing the file system interface to the file system table update table cache needs to be updated after receiving the notification file system protection layer;

[0015] 5)文件系统表缓存从存储器上读取新的文件的簇链表信息; [0015] 5) cluster file system table cache reads the new file list information from the memory;

[0016] 6)得到文件的新的簇信息后,文件系统表更新接口通知存储器的文件系统保护层已经更新了文件信息,可以允许读取文件; After [0016] 6) to give the new cluster information file, the file system interface to the table update notification protective layer memory file system information file has been updated, may be allowed to read the file;

[0017] 7)文件系统驱动根据新的文件簇信息向存储器读取文件; [0017] 7) reads the file system driver file to the storage cluster information according to the new file;

[0018] 8)文件系统驱动将得到的文件提交给应用程序。 [0018] 8) The resulting file system driver files submitted to the application.

[0019] 一种实现嵌入式存储器多主接口的装置,包括主机文件系统驱动和存储器文件系统驱动;所述主机文件系统驱动,设置于主机系统内,用于通过调用存储器驱动接口完成读写存储器上的文件;存储器文件系统驱动,设置于存储器所在的系统内,负责向上层主机提供操作存储器的驱动接口,同时负责基于文件系统的多主机操作保护; [0019] A multi-master interface implemented embedded memory, file system driver includes a host and a memory file system drivers; the host file system driver, provided in the host system, by calling for the completion of the memory read-write memory drive interface files; a memory file system driver, is provided within the system where the memory, the memory interface operation is responsible for providing the drive to the upper layer host while the host is responsible for operation of multiple file-based protection system;

[0020] 所述存储器文件系统驱动包括一个文件系统保护层,用于记录各个主机操作存储器的先后顺序,为每个主机建立文件系统表缓存,存放当前存储器上的文件系统的文件对于各个主机上的文件系统表缓存的同步情况; [0020] The file system driver includes a memory file system protection layer for recording the sequence of the respective host operating memory, a file system table cache for each host, over each host file stored on the system for the current memory the file system cache table synchronization situation;

[0021] 所述主机文件系统驱动包括一个文件系统表更新接口,用于接收所述文件系统保护层的同步信息,更新主机文件系统驱动上的文件系统表缓存,并通知存储器文件系统驱动的文件系统保护层更新完成。 [0021] The host file system driver includes a table update file system interface for receiving the synchronization information file system protection layer, update the file system on the host file system driver table cache, and notifies the memory file system driver file The protective layer system update is completed.

[0022] 所述文件系统保护层中包含以下模块: [0022] The file system protection layer contains the following modules:

[0023] 文件系统表缓存,存放当前存储器上的文件系统的文件对于各个主机上的文件系统表缓存的同步情况; [0023] file system table cache to store the current synchronous file system on the file system on the memory for each host table cache;

[0024] 接受请求模块,用于接受应用程序对文件的读取请求; [0024] The request accepting means for accepting a read request to the file application;

[0025] 判断比较模块;用于判断文件的簇链接关系是否已经被其他主机修改,此主机是否需要重新读取文件的簇信息; [0025] comparative judgment module; for determining whether a cluster link relationship file has been modified from other hosts, whether the host needs to re-read cluster information file;

[0026] 拒绝访问模块,用于当一个主机修改了文件系统中的部分数据后,拒绝其他主机访问此被修改的数据,且告知其他主机此数据已被修改; After [0026] deny access module, configured to modify a part of the host system in the data file, this access is denied other hosts modified data, and informing the other host that data has been modified;

[0027] 锁操作保护模块,用于当有多主机重复访问文件结构资源时,对文件系统内文件结构资源提供锁操作保护,并告知重复访问的主机该文件结构资源不可用。 [0027] The protection module lock operation, when multiple hosts to access the file structure duplicate resources to provide protection for the lock operation file structure file system resources, and inform the host repeatedly accessed the file structure is not available.

[0028] 上述技术方案中: [0028] The technical solution:

[0029] 所述文件系统是指存储器上存储文件的方法和数据结构,即在存储器上组织文件的方法。 The [0029] file system is a method for the memory storage method and the data structure of the file, i.e. a file on the memory organization.

[0030] 本发明的有益技术效果是: [0030] Advantageous effects of the invention are:

[0031] 本发明通过存储器文件系统驱动的文件系统保护层以及主机文件系统驱动的文件系统表更新接口的协同管理,实现了在多个主机对同一个存储设备操作时文件结构的同步。 [0031] The present invention is driven by the memory file system and the file system protection layer system host file system driver tables updated synchronously cooperative management interface, to achieve the file structure when a plurality of hosts on the same storage device operation. 使多媒体播放器同个人电脑通过USB传输线连接且遵循USB Mass Storage协议时,多媒体播放器同个人电脑主机能够同时操作多媒体播放器上的存储器,而多媒体播放器无需进入USB模式(即数据传输模式)。 That the media player with a personal computer through a USB cable connected to and follows the USB Mass Storage protocol, a multimedia player with the personal computer is capable of simultaneously operating a memory on the multimedia player, the multimedia player without entering USB mode (i.e., data transfer mode) . 即个人电脑读取、修改、删除存储器上的文件时,多媒体播放器也同时处于工作状态,能够读取存储器上的文件,进行音乐视频播放、图片显示等操作,但多媒体播放器不能修改删除存储器上的文件。 That PC to read, modify, delete the file on the memory, a multimedia player also in working condition, be able to read the files on the memory, a music video playback, photo display and other operations, but can not modify delete multimedia player memory files on.

附图说明 BRIEF DESCRIPTION

[0032] 图1是实现嵌入式存储器多主接口的装置示意框图。 [0032] FIG. 1 is a schematic block diagram of an embedded memory device to realize multi-master interface.

[0033] 图2是图1的详细示意框图。 [0033] FIG. 2 is a detailed schematic block diagram of Fig.

[0034] 图3是实现嵌入式存储器多主接口的方法的流程示意图。 [0034] FIG. 3 is a schematic flow diagram of a multi-primary method of embedded memory interface implementation. 具体实施方式 detailed description

[0035] 下面结合附图对本发明的具体实施方式做进一步说明。 [0035] The accompanying drawings further illustrate specific embodiments of the present invention binds.

[0036] 在使用存储器时,一般将存储器的存储区划分为一个或者多个分区,每个分区都将其格式化成某个文件系统,通过文件系统管理和使用存储器分区。 [0036] When using a memory, the memory typically stores division into one or more partitions, each partition can be formatted as a file system, and used by the file system management memory partitions.

[0037] 在多个主机,本实施例中指嵌入式多媒体播放器和个人电脑,同时操作同一个存储器时,主机会遵从存储器的文件系统的格式使用存储器空间,而各个主机之间是同步操作存储器,保证同时操作且不破坏文件系统。 [0037] In various hosts, for example, the middle finger and the embedded media player personal computer of the present embodiment, when the simultaneous operation of the same memory, the host memory space is a file system compliant format memory, and each host is a synchronous operation between the memory , while ensuring the operation does not destroy the file system.

[0038] 图1是实现嵌入式存储器多主接口的装置示意框图。 [0038] FIG. 1 is a schematic block diagram of an embedded memory device to realize multi-master interface.

[0039] 如图1所示,实现嵌入式存储器多主接口的装置,包括主机文件系统驱动和存储器文件系统驱动;主机文件系统驱动,设置于个人电脑或者媒体播放器等主机系统内,用于通过调用存储器驱动接口完成读写存储器上的文件。 [0039] As shown in FIG 1, the multi-primary device interface embedded memory implementations, including the host file system driver and a memory file system drivers; host file system driver, the host system is provided in a personal computer or a media player or the like, for by calling the file memory driver interface to complete the read-write memory. 存储器文件系统驱动,设置于存储器所在的系统内,负责向上层主机提供操作存储器的驱动接口,同时负责基于文件系统的多主机操作保护。 The memory file system driver, set within the system memory is located, is responsible for providing operating memory driver interface to the upper layer host, it is also responsible for protecting multi-host file-based operating system.

[0040] 本发明是在多媒体播放器的存储器文件系统驱动的存储器底层驱动层103上层添加一层文件系统保护层101,同时在多媒体播放器的主机文件系统驱动层添加文件系统表更新接口102,由这两部分共同完成支持多主机的接口管理。 [0040] The present invention is a memory storage file system in the underlying multimedia player and a drive layer 103 adds a layer upper protective layer 101 is a file system while the host file system drive layer of the multimedia player add a file system table update interface 102, the two parts by a complete support for multi-host management interfaces together.

[0041] 图1中的存储器底层驱动层103负责向上层提供基于扇区的存储器读写接口。 Memory bottom layer [0041] FIG 1 is responsible for driving the upper layer 103 to provide read and write interfaces on a memory sector. 存储器接口104负责管理各种硬件接口标准,提供给存储器底层驱动层103统一的操作接口。 The memory interface 104 is responsible for managing a variety of hardware interface standards, to the memory layers 103 underlying drive unified user interface.

[0042] 存储器文件系统驱动的文件系统保护层101的实现方法是通过监视存储器上的文件系统表。 [0042] Implementation file system protection layer memory file system driver 101 through the file system table on the monitoring memory. 文件系统表记录了存储器上的文件簇的链式结构。 File system table records the file on the memory cluster chain structure.

[0043] 文件系统表对于文件的组织关系是这样的,文件系统表中的一个表项代表了一个簇,表项的数值表明了此簇的属性:以FAT16文件系统格式为例,0000代表未分配的簇, 0002-FFEF代表已分配的簇,FFF0-FFF6代表系统保留簇,FFF7代表坏簇,FFF8-FFFF代表文件结束簇。 [0043] file system table file for the organization relationship is such that a file system table entry represents a cluster, the value entry shows the properties of this cluster: A Case Study of FAT16 file system format, not on behalf of 0000 distribution of clusters, 0002-FFEF representatives assigned cluster, FFF0-FFF6 reservation system on behalf of the cluster, FFF7 behalf bad clusters, FFF8-FFFF represents the end of file clusters. 文件系统表项内的值为0002-FFEF之间的值表明为被占用的簇,且此值表明文件的下一个簇的位置,最后以FFFF代表文件簇的结尾。 Is a value between 0002-FFEF entries within a file system clusters shown to be occupied, and this value indicates the position of the next cluster of the file, and finally ending FFFF represents the file clusters. 因此一个文件的组成是由这个簇链组成的,而文件系统表即保存了所有的文件的簇链接的关系,是文件系统的核心。 Therefore, the composition of a file is determined by the cluster chains, and the file system table that is to save the relationship of all the cluster link file is the core of the file system.

[0044] 所述FAT16是指由美国的微软公司开发的一种磁盘文件系统。 [0044] The FAT16 refers to a disk file system developed by Microsoft Corporation of the United States.

[0045] 所述簇是指存储器上的相邻的多个扇区0、4、8、16、32或64个扇区)组成的操作系统管理存储器的最小单元。 [0045] The cluster is a plurality of memory sectors on adjacent sectors 0,4,8,16,32 or 64) a minimum unit of the operating system memory management thereof.

[0046] 所述扇区是指存储器的最小的物理存储单元。 The [0046] The sector is the smallest physical storage unit memory.

[0047] 图2是图1的详细示意框图。 [0047] FIG. 2 is a detailed schematic block diagram of Fig.

[0048] 如图2所示,其中主机文件系统驱动的文件系统API 201向操作系统提供基于文件的API接口,如文件的读,写等基于文件的一系列操作。 [0048] 2, wherein the host file system driver of the file system API 201 provides an interface to the API file-based operating system, such as reading a file, writing a file based on a series of other operations. 而FAT32簇读/写202则负责基于磁盘簇的读写,它首先读取上层欲读取的文件的簇表信息,根据簇表的链式结构通过底层IO接口向磁盘发出读写扇区请求。 FAT32 cluster and the read / write 202 is responsible for reading and writing on the disk clusters, it first reads the upper cluster information file to be read, an interface issue read and write to the disk sector according to the cluster table chain structure underlying the IO request by . FAT基本功能203则负责管理FAT规范中所涉及到的各种结构,组织文件簇链接关系。 FAT basic function 203 is responsible for managing a variety of structures FAT specifications involved, organizing files cluster-linking relationship. FAT表缓存204则预先读取和保存常用的文件结构(如目录结构)以及最近所读取的文件表信息。 FAT table cache 204 and read previously stored common file structure (e.g., directory structure) and the read latest file information table. 底层IO接口205则提供基于扇区的磁盘读写接口。 IO interface 205 provides the bottom of the sector-based disk read and write interfaces. 存储器底层驱动层208则负责向上层提供基于扇区的存储器读写接口。 The memory layer 208 is responsible for the underlying drive provides read and write interfaces to an upper layer based memory sectors. 存储器接口209负责管理各种硬件接口标准,提供给存储器底层驱动层208统一的操作接口。 The memory interface 209 is responsible for managing a variety of hardware interface standards, to the memory layers 208 underlying drive unified user interface. 上述各块均按现有技术编写,其调用过程也与现有技术中的过程相同。 Prepared by the prior art described above are by each block, which calls the process is the same as the prior art process.

[0049] 本发明的不同之处在于如下结构。 [0049] is different from the structure of the present invention is as follows.

[0050] 存储器文件系统驱动包括一个文件系统保护层207,设置在存储器底层驱动层208的上层,用于记录各个主机操作存储器的先后顺序,为每个主机建立文件系统表缓存210,存放当前存储器上的文件系统的文件对于各个主机上的文件系统表缓存210的同步情况。 [0050] The file system driver includes a memory file system protection layer 207, the memory is provided in the upper bottom drive layer 208, the recording sequence for each host operating a memory, a file system cache table 210 for each host, storing the current memory file system on the file system table for each host on the 210 cache synchronization situation.

[0051] 多媒体播放器的主机文件系统驱动包括一个文件系统表更新接口206,其与底层IO接口205并列于一层,用于接收来自文件系统保护层发送的保护信息,如果多媒体播放器所读取的文件已被其他主机(如个人电脑)修改,则文件系统保护层告知文件系统表更新接口读取失败,需要重新读取文件簇结构,此时多媒体播放器放弃对文件内容的读取,转而读取文件系统表信息,读取完成之后由文件系统表更新层告知文件系统保护层已经完成文件系统表的更新,文件系统保护层此时允许播放器操作先前欲读取的文件。 [0051] The multimedia player of the host file system driver includes a table update file system interface 206, which is the underlying layer in parallel IO interface 205, for receiving protection information from the transmission protective layer of the file system, if the read multimedia player documents have been taken to other hosts (such as a personal computer) to modify, the file system protection layer to inform the file system table update interface read failure, need to re-read the file cluster structure, this time multimedia player to give up reading the content of the document, after the turn, read the file system information tables, file system informs the completion of reading the protective layer by a file system layer table update file system table has been updated, the file system allows the protective layer in this case the previous playback operation to be read.

[0052] 文件系统保护层中包含以下模块: [0052] The file system protection layer contains the following modules:

[0053] 文件系统表缓存,存放当前存储器上的文件系统的文件对于各个主机上的文件系统表缓存的同步情况; [0053] The file system table cache to store the current synchronous file system on the file system on the memory for each host table cache;

[0054] 接受请求模块,用于接受应用程序对文件的读取请求; [0054] The request accepting means for accepting a read request to the file application;

[0055] 判断比较模块;用于判断文件的簇链接关系是否已经被其他主机修改,此主机是否需要重新读取文件的簇信息; [0055] comparative judgment module; for determining whether a cluster link relationship file has been modified from other hosts, whether the host needs to re-read cluster information file;

[0056] 拒绝访问模块,用于当一个主机修改了文件系统中的部分数据后,拒绝其他主机访问此被修改的数据,且告知其他主机此数据已被修改; After [0056] deny access module, configured to modify a part of the host system in the data file, this access is denied other hosts modified data, and informing the other host that data has been modified;

[0057] 锁操作保护模块,用于当有多主机重复访问文件结构资源时,对文件系统内文件结构资源提供锁操作保护,并告知重复访问的主机该文件结构资源不可用。 [0057] The protection module lock operation, when multiple hosts to access the file structure duplicate resources to provide protection for the lock operation file structure file system resources, and inform the host repeatedly accessed the file structure is not available.

[0058] 通过上述装置的协同作用,得到的实现嵌入式存储器多主接口的方法如下: Method [0058] The above-described apparatus synergistically to achieve a multi-primary embedded memory interface are as follows:

[0059] 通过记录各个主机对存储器的操作,检测存储器中被更新的文件所涉及的簇,生成各个主机各自的同步簇表,在各个主机操作存储器时,根据同步簇表判断是否需要重新读取文件的簇结构信息,如果文件已被修改,则需要利用新的簇结构读取文件,使各个主机同步操作存储器文件系统。 [0059] By recording various operations on the memory of the host, the memory is updated cluster detection files involved, each generating respective synchronization master cluster table, during each host operating memory, determines whether or not the synchronization cluster table need to be reread cluster configuration information file, if the file has been modified, it needs to be used to read the file structure of the new cluster, so that each host file system synchronization memory.

[0060] 一个主机修改了文件系统中的部分数据后,其他主机访问此被修改的数据时都会被拒绝且被告知此数据已被修改。 After [0060] the modified host a portion of the data in the file system, access to this other hosts modified data will be rejected and be told the data has been modified.

[0061] 有多主机重复访问文件结构资源时,对文件系统内文件结构资源提供锁操作保护,并告知重复访问的主机该文件结构资源不可用。 [0061] repeated multiple hosts to access resource file structure, there is provided a lock protection operation of the file structure within the file system resources, and inform the host repeatedly accessed the file structure is not available.

[0062] 图3是实现嵌入式存储器多主接口的方法的流程示意图。 [0062] FIG. 3 is a schematic flow diagram of a multi-primary method of embedded memory interface implementation.

[0063] 下面结合图3具体阐述是如何通过存储器的文件系统保护层以及多媒体播放器的文件系统表更新接口来实现多主存储器接口的。 [0063] specifically set forth below in connection with FIG. 3 is a main memory to implement multiple how the file system table memory file system protection layer and the multimedia player interface update interface.

[0064] 从图中可以看到,我们将一次有文件冲突,即主机间文件不同步的读取操作分为以下8个步骤: [0064] can be seen from the figure, we have a file conflict, i.e., between the host file is not synchronized reading operation is divided into the following eight steps:

[0065] 1)多媒体播放器的应用程序301调用存储器的文件系统驱动302,读取一个文件的内容; Application [0065] 1) of the multimedia player 301 calls the file system driver memory 302, read the contents of a file;

[0066] 2)文件系统驱动302接受了这个文件读取请求之后从文件系统保护层303中的文件系统表缓存304中得到文件的簇的链表信息,通过向存储器读取相应的簇完成读取文件的操作; [0066] 2) the file system driver 302 after receiving this read request file table cache 304 of cluster chain information file obtained from the file system protection layer 303 in the file system, the completion of the reading by reading the appropriate cluster to the memory file operations;

[0067] 3)存储器的文件系统保护层303接收到读取簇的请求后,同保存在文件系统保护层303中的此主机的文件系统表缓存304比较,判断此文件的簇链接关系已经被其他主机修改,此主机需要重新读取文件的簇信息,文件系统保护层303向文件系统表更新接口305 发出更新信息; After the file system protection layer [0067] 3) memory 303 receives a request to read the clusters, the file system saved in comparison with the protective layer 303 in this host file system table cache 304 determines a cluster the link relation file has been other modifications host, the host needs to re-read this cluster information file, the file system protection layer 303 meter interface updates to the file system 305 issues the update information;

[0068] 4)文件系统表更新接口305接到文件系统保护层303的通知之后告知文件系统表缓存304需要更新; Inform the file system table 304 to update the cache after the [0068] 4) Update the file system table interface 305 notified file system protection layer 303;

[0069] 5)文件系统表缓存304从存储器上读取新的文件的簇链接信息; [0069] 5) file system 304 reads the cluster link table cache information of the new file from the memory;

[0070] 6)得到文件的新的簇信息后,文件系统表更新接口305通知存储器的文件系统保护层303已经更新了文件信息,可以允许读取文件; After the new cluster information [0070] 6) to give the file, the file system interface 305 notifies the table updating memory file system protection layer 303 has been updated file information, may be allowed to read the file;

[0071] 7)文件系统驱动302根据新的文件簇信息向存储器读取文件; [0071] 7) The file system driver 302 reads the document file to the memory according to the new cluster information;

[0072] 8)文件系统驱动302将得到的文件提交给应用程序301。 [0072] 8) The file system driver 302 to obtain the document submitted to the application program 301.

[0073] 通过以上8个步骤完成了一次非同步文件的读取操作。 [0073] completion of a read operation the asynchronous file by 8 or more steps.

[0074] 需要注意的是,尽管此处所述的处理步骤是以顺序的方式描述的,但是这些处理也可以配置成以变幻的次序进行工作。 [0074] It is noted that, although the process steps described herein in a sequential manner described, these processes may also be configured to work in a changing order. 换句话说,描述的任何步骤的顺序或次序都并非必然指示这些步骤应当以该种次序执行。 In other words, any sequence or order of steps described herein are not necessarily indicate that these steps should be performed in this kind of order. 此处所述的处理步骤可以以任何可行的次序来执行。 The processing steps described herein may be performed in any feasible order. 进一步,有些步骤可以同时执行。 Further, some steps may be performed simultaneously.

[0075] 在设计中涉及到的个人电脑主机采用USB接口的Mass Storage协议同多媒体播放器进行数据通讯。 [0075] involved in the design of the personal computer using the USB interface of Mass Storage protocol for data communication with a multimedia player. 此种通信方式由于所遵循的协议的限制,无法向主机传达文件系统的同步信息,因此在此类设计中,存储器所在的本地的多媒体播放器对于存储器的操作仅限于读操作,文件系统保护层所作的同步是对本地多媒体播放器的读取同步。 Because of this limitation of communication protocols followed, not, so such designs, where the local memory of the multimedia player for the operation of the memory read operation is limited to the host to communicate synchronization information to the file system, the file system protection layer synchronization is made to synchronize the read local multimedia player. 而个人电脑作为主机可以读写存储器,而不受其他主机的限制。 The PC as the host can read and write memory, without restrictions other hosts. 同时整个系统中仅能有一个这样无视同步保护信息的主机。 At the same time the overall system only has to ignore such a synchronization master information protection.

[0076] 以上所述的仅是本发明的优选实施方式,本发明不限于以上实施例。 [0076] The above embodiment is merely a preferred embodiment of the present invention, the present invention is not limited to the above embodiments. 可以理解,本领域技术人员在不脱离本发明的精神和构思的前提下直接导出或联想到的其他改进和变化,均应认为包含在本发明的保护范围之内。 It will be appreciated that those skilled in the art, or derived directly associate other modifications and variations without departing from the spirit and concept of the invention is the premise shall be deemed to be included within the scope of the present invention.

Claims (2)

  1. 1. 一种实现嵌入式存储器多主接口的方法,其特征在于通过记录各个主机对存储器的操作,检测存储器中被更新的文件所涉及的簇,生成各个主机各自的同步簇表,在各个主机操作存储器时,根据同步簇表判断是否需要重新读取文件的簇结构信息,如果文件已被修改,则需要利用新的簇结构读取文件,使各个主机同步操作存储器文件系统;一个主机修改了文件系统中的部分数据后,其他主机访问此被修改的数据时都会被拒绝且被告知此数据已被修改;有多主机重复访问文件结构资源时,对文件系统内文件结构资源提供锁操作保护,并告知重复访问的主机该文件结构资源不可用;对主机间不同步的文件进行读取操作,具体步骤如下:1)作为主机的多媒体播放器的应用程序调用存储器的文件系统驱动,读取一个文件的内容;2)文件系统驱动接受了这个文 1. A method for multi-master interface implemented embedded memory, wherein each cluster through the recording operation of the main memory, the memory is updated in the detection of document involved, the host generates a respective synchronizing each cluster table, in each of the host when the operation of the memory, determines whether to synchronize the cluster table need to be reread according to the cluster configuration information file, if the file has been modified, need to be used to read the file structure of the new cluster, so that each host file system synchronization memory; a host modified will be rejected and be told the data has been modified during the data portion of the file system, access to this other hosts modified data; when repeated multiple hosts to access the file resource structure, the file structure of the file system providing the resource lock protection operation , and inform the host repeatedly accessed the resource is unavailable file structure; file not synchronized between the host read operation, the following steps: 1) call memory as a multimedia player application host file system driver, the read contents of a file; 2) file system driver accepted this article 件读取请求之后从文件系统保护层中的文件系统表缓存中得到文件的簇的链表信息,通过向存储器读取相应的簇完成读取文件的操作;3)存储器的文件系统保护层接收到读取簇的请求后,同保存在文件系统保护层中的此主机的文件系统表缓存比较,判断此文件的簇链接关系已经被其他主机修改,此主机需要重新读取文件的簇信息,文件系统保护层向文件系统表更新接口发出更新信息;4)文件系统表更新接口接到文件系统保护层的通知之后告知文件系统表缓存需要更新;5)文件系统表缓存从存储器上读取新的文件的簇链表信息;6)得到文件的新的簇信息后,文件系统表更新接口通知存储器的文件系统保护层已经更新了文件信息,可以允许读取文件;7)文件系统驱动根据新的文件簇信息向存储器读取文件;8)文件系统驱动将得到的文件提交给应用程序。 Member list information obtained after the read request file from the cluster file system protection layer file system table cache, the read operation is completed by reading the file corresponding to the memory clusters; file system protection layer 3) received memory after the cluster of requests to read, compared with the cache table stored in the file system protection layer for this host file system to determine the relationship between cluster link to this file has been modified other hosts, the host needs to re-read cluster information file, the file the protective layer system updates to the file system interface that the table update information; 4) to inform the file system interface to the file system table update table cache needs to be updated after receiving the notification file system protection layer; 5) the new file system table cache read from the memory cluster list information file; after 6) to give the new cluster file information, file system table update notification interfaces protective layer memory file system information file has been updated, may be allowed to read the file; 7) according to the new file system driver file cluster information read file to the memory; filed 8) the resulting file system driver file to the application.
  2. 2. 一种实现嵌入式存储器多主接口的装置,包括主机文件系统驱动和存储器文件系统驱动;所述主机文件系统驱动,设置于主机系统内,用于通过调用存储器驱动接口完成读写存储器上的文件;存储器文件系统驱动,设置于存储器所在的系统内,负责向上层主机提供操作存储器的驱动接口,同时负责基于文件系统的多主机操作保护;其特征在于:所述存储器文件系统驱动包括一个文件系统保护层,用于记录各个主机操作存储器的先后顺序,为每个主机建立文件系统表缓存,存放当前存储器上的文件系统的文件对于各个主机上的文件系统表缓存的同步情况;所述主机文件系统驱动包括一个文件系统表更新接口,用于接收所述文件系统保护层的同步信息,更新主机文件系统驱动上的文件系统表缓存,并通知存储器文件系统驱动的文件系统保护层更新完 An embedded memory device to realize multi-master interface, file system driver includes a host and a memory file system drivers; the host file system driver, provided in the host system, by calling for driving the memory interface to read and write the memory file; memory file system driver, is provided within the system where the memory, the memory operation is responsible for providing the upper layer host driver interface, is also responsible for multiple host operating system file-based protection; characterized in that: said memory comprises a file system driver file system protection layer for recording the sequence of operation of each host memory, a file system table cache for each host, the current file system stored on a memory for each file on the host system where the cache table synchronization; the host file system driver includes a table update file system interface for receiving synchronization information of the file system protection layer, update the file system on the host file system driver table cache, and notifies the memory file system driver update file system protection layer End ;所述文件系统保护层中包含以下模块:文件系统表缓存,存放当前存储器上的文件系统的文件对于各个主机上的文件系统表缓存的同步情况;接受请求模块,用于接受应用程序对文件的读取请求;判断比较模块;用于判断文件的簇链接关系是否已经被其他主机修改,此主机是否需要重新读取文件的簇信息;拒绝访问模块,用于当一个主机修改了文件系统中的部分数据后,拒绝其他主机访问此被修改的数据,且告知其他主机此数据已被修改;锁操作保护模块,用于当有多主机重复访问文件结构资源时,对文件系统内文件结构资源提供锁操作保护,并告知重复访问的主机该文件结构资源不可用。 ; The file system protection layer contains the following modules: system file table cache, the current file system stored on a memory for each file on the host system where the cache table synchronization; accept the request module, for receiving the application file the read request; determining a comparison module; for determining whether a link relation cluster file has been modified by another host, whether the host needs to re-read cluster information file; denied access module, configured to, when a file system is modified in the host after partial data, denied access this other hosts modified data, and informing the other host that data has been modified; lock operation protection module, configured to, when duplicate multiple hosts to access the resource file structure, the file structure of the file system resource lock operation to provide protection, repeat visits and inform the hosts file structure resource is not available.
CN 200910116305 2009-03-06 2009-03-06 Method and apparatus for implementing multiple main interfaces for embedded memory CN101493844B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200910116305 CN101493844B (en) 2009-03-06 2009-03-06 Method and apparatus for implementing multiple main interfaces for embedded memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200910116305 CN101493844B (en) 2009-03-06 2009-03-06 Method and apparatus for implementing multiple main interfaces for embedded memory

Publications (2)

Publication Number Publication Date
CN101493844A true CN101493844A (en) 2009-07-29
CN101493844B true CN101493844B (en) 2012-06-06

Family

ID=40924446

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200910116305 CN101493844B (en) 2009-03-06 2009-03-06 Method and apparatus for implementing multiple main interfaces for embedded memory

Country Status (1)

Country Link
CN (1) CN101493844B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105208267A (en) * 2015-08-25 2015-12-30 豪威科技(上海)有限公司 USB camera and USB camera identification method and system

Also Published As

Publication number Publication date Type
CN101493844A (en) 2009-07-29 application

Similar Documents

Publication Publication Date Title
US7496493B1 (en) External memory device to provide disk device and optical functionality
US6799226B1 (en) Hot unpluggable media storage device
US7206875B2 (en) Expander device capable of persistent reservations and persistent affiliations
US6665747B1 (en) Method and apparatus for interfacing with a secondary storage system
US20050228963A1 (en) Defragmenting objects in a storage medium
US20100049895A1 (en) Providing a Connection Between a Memory Medium of a Mobile Device and an External Device
JPH05346879A (en) Data filing device
US20090175075A1 (en) Flash memory storage apparatus, flash memory controller, and switching method thereof
US20050198425A1 (en) Combined optical storage and flash card reader using single ide or sata port and method thereof
US20080222348A1 (en) File system for managing files according to application
US20080229046A1 (en) Unified support for solid state storage
JP2001325128A (en) Method for managing file and recording or reproducing device
US20060277326A1 (en) Data transfer system and method
CN1945537A (en) Method for realizing high speed solid storage device based on storage region network
CN102541475A (en) The method of data storage and data storage means
US7996631B1 (en) System and method for accessing storage devices attached to a stateless client
US20070266203A1 (en) Storage control method and system for performing backup and/or restoration
US8290911B1 (en) System and method for implementing data deduplication-aware copying of data
US20110167049A1 (en) File system management techniques for computing environments and systems
US20110219048A1 (en) Multiple File System and/or Multi-Host Single Instance Store Techniques
US20120066422A1 (en) Method and system for transferring high-speed data within a portable device
US20060041702A1 (en) Controller apparatus and method for improved data transfer
JP2004199420A (en) Computer system, magnetic disk device, and method for controlling disk cache
US20060112184A1 (en) Adapter card for on-demand formatting of data transfers between network devices
CN202009402U (en) Portable storage device and system supporting cloud storage

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
C14 Grant of patent or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 214028 WUXI, JIANGSU PROVINCE TO: 213000 CHANGZHOU, JIANGSU PROVINCE

C41 Transfer of patent application or patent right or utility model
ASS Succession or assignment of patent right

Owner name: GUANGZHOU XINULTRA ELECTRONIC TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: WUXI ALPSCALE INTEGRATED CIRCUITS CO., LTD.

Effective date: 20150319

CF01