CN1304959C - Method of reading -writing data using disk file virtual flash - Google Patents

Method of reading -writing data using disk file virtual flash Download PDF

Info

Publication number
CN1304959C
CN1304959C CNB031468756A CN03146875A CN1304959C CN 1304959 C CN1304959 C CN 1304959C CN B031468756 A CNB031468756 A CN B031468756A CN 03146875 A CN03146875 A CN 03146875A CN 1304959 C CN1304959 C CN 1304959C
Authority
CN
China
Prior art keywords
flash memory
file
disk file
reading
flash
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Lifetime
Application number
CNB031468756A
Other languages
Chinese (zh)
Other versions
CN1598789A (en
Inventor
宋强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen New Greennet Technologies Co ltd
Shenzhen Xin'aoke Cable Co ltd
Original Assignee
SHENZHEN GREENNET COMMUNICATION TECHNOLOGIES Co Ltd
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
Application filed by SHENZHEN GREENNET COMMUNICATION TECHNOLOGIES Co Ltd filed Critical SHENZHEN GREENNET COMMUNICATION TECHNOLOGIES Co Ltd
Priority to CNB031468756A priority Critical patent/CN1304959C/en
Publication of CN1598789A publication Critical patent/CN1598789A/en
Application granted granted Critical
Publication of CN1304959C publication Critical patent/CN1304959C/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention discloses a virtual flash memory technique, more specifically to a method for reading the data of virtual flash memories by using a magnetic disk file. The present invention comprises the steps that in the first step, a corresponding magnetic disk file is generated according to required flash memory capacity; in the second step, a mapping relationship from flash memory addresses to the magnetic disk file and offset which is relative to the head of the magnetic disk file is established according to the first step so that the effective addresses of each flash memory can be mapped to the magnetic disk file and the offset of the head of the magnetic disk file; in the third step, a flash memory address interval that an application module needs to access is converted into an interval of the magnetic disk file and the offset according to the mapping relationship in the second step to carry out reading/writing access; in the fourth step, reading/writing operation in the third step is encapsulated into an input-output parameter which is the same with a flash memory reading/writing function. In an environment in which magnetic disk equipment exists, and flash memory equipment does not exist, the present invention makes upper layer software which reads/writes the data of the flash memory achieve smooth migration and compatible development, raises development efficiency, enhances data security and shortens time for migration.

Description

Method with the virtual flash reading and writing data of disk file
Technical field;
The invention discloses a kind of virtual flash memory technology.
Background technology
In the realization of some electronic equipments (including but not limited to the network equipment, industrial computer equipment etc.), be used to store and the carrier of reading of data flash memory often, the flash memory using method of current industrywide standard is: 1) be divided into polylith according to a certain size, the every capacity that certain byte number is arranged, absolute or relative address (following unification is called the address) are adopted in visit during flash memory, and address and piece number are relevant.2) read operation: in the internal memory of specifying start address and identical size size, the read operation of true flash memory can be at random with the data read of an address section of flash memory; 3) write operation: the data of an address section of internal memory are write in the flash memory of specifying start address and identical size, if the address section of flash memory is to cross over different masses, just require to resolve into polylith, be respectively that unit is operated with the piece, will earlier this piece content all be read into one is based upon buffering in the internal memory (size of this buffering is the same with piece, be complete map), all wipe this piece content, according to this buffering of content update (may be part) that will write, will cushion again and all write this piece then; If relate to polylith, carry out aforesaid operations by piece successively; 4) erase operation: mainly being because the physical characteristics of flash memory will be wiped earlier before writing, can certainly be to do pure wiping for secret the needs.5) driving of general device software has all been done such encapsulation to flash disk operation: reading and writing, wipe.
Along with the development of technology, some equipment begin to adopt disk as storer, use the read-write operation of disk file system to visit data.
Because the data access of the software of these two kinds of equipment partly is incoherent, thereby, for the data visit, formed two kinds of different equipment platforms.
There is following shortcoming in above-mentioned prior art: 1) for the equipment platform of direct use flash memory, before write operation, must wipe corresponding flash block, and then write operation, speed is slow; 2) for the equipment platform of direct use disk file system, to distinguish according to filename or record during with some significant datas storages, more complicated in structure organization, for upper layer software (applications) not as direct visit absolute or relative address come conveniently; 3) in the time of on the application software module of direct read flash memory need being transplanted to the equipment platform that uses disk, need to rewrite the data access mode of upper layer software (applications), the application module that involves is a lot, needs redesign to realize relevant portion, and very big rewriting workload is arranged; 4) when new software of exploitation on the equipment platform that uses disk at or module, look ahead simultaneously if desired and can be transplanted on the equipment platform of direct use flash memory, whether so, wherein having the application module of reading and writing data to need to rewrite is a problem.
Summary of the invention
Purpose of the present invention is intended to overcome above-mentioned the deficiencies in the prior art, provides that a kind of data read-write operation that makes application software is can be on above-mentioned two kinds of different equipment platforms level and smooth pellucidly to be transplanted and the method for the virtual flash reading and writing data of usefulness disk file of compatible exploitation.
Realize the technical scheme of above-mentioned purpose: a kind of method with the virtual flash reading and writing data of disk file may further comprise the steps:
A, the configuration of the flash capacity of needs is produced corresponding disk file;
B, set up the mapping relations of flash memory address, make the effective address of each flash memory can be mapped to the side-play amount of disk file and relative file head to the side-play amount of file and relative file head according to step a);
C, the flash memory address interval that application module need be visited convert file to and with respect to the interval of the side-play amount of top of file, again read and write access are carried out in the interval that converts to according to the mapping relations of step b;
D, the read-write operation of step c read and write access is packaged into virtual flash reading and writing function, this virtual flash reading and writing function has the same input with actual flash reading and writing function.
Adopt technique scheme, the technical progress that the present invention gives prominence to is: the application software module that 1) originally used direct flash disk operation does not need to revise the operation of its reading and writing data on being transplanted to the equipment platform that uses disk file system the time, can directly use.2) on the equipment platform that uses disk file system, if there is application module need be transplanted in the future on the equipment platform of direct flash disk operation, this application module can design according to virtual flash memory technology, and transplanting does not later on have problems.3) on the equipment platform that uses disk file system, even for not transplanting possible application module, use virtual flash memory technology to read and write data, the algorithm of visit can more convenient, safety.Because the specific address of the organizational form of data and storage all has been fixed up like this, even representing the true disk file of virtual flash memory also is to be fixed up from the beginning, and on file size and the disk space position (a plurality of sector) that occupies, can not change, what change is wherein content, for disk file, when change the size situation the time, may make a mistake.This succession for some modular designs in the network equipment is used, and is even more important.4) along with development of computer, disk is compared flash memory that speed is fast, capacity is big, cheap, removable, change characteristics such as convenient.5) by becoming different files, can find to cause the operation of crossing the border of read-write flash memory address easily, improve the measurability and the maintainability of software because of program error according to single or a plurality of maps; 6) can easily under disk file operating system,, back up flash data easily by file is duplicated.
Embodiment
The present invention is described in further detail below by embodiment:
Embodiment: a kind of method with the virtual flash reading and writing data of disk file may further comprise the steps
A, the configuration of flash capacity as required produce corresponding disk file.Can be the corresponding file (first kind) of a flash block, also can be a plurality of groupings, the corresponding file (second kind) of each group, the corresponding file (the third) of perhaps all pieces; For core algorithm, realize that according to second kind packet mode first kind is two special cases of second kind with the third, a group can have only one, or whole piece, perhaps part piece.
B, set up the mapping relations of flash memory address, make the effective address of each flash memory can be mapped to the side-play amount of disk file and relative file head to the side-play amount of file and relative file head according to step a).Side-play amount can be to be unit with the byte, and the perhaps minimum visit unit's byte number of regulation perhaps according to 2 or 4 or a plurality of byte-aligned etc., is decided according to the operating feature of actual flash memory.
C, according to the flash memory address interval of application module needs visits, carry out read and write access according to step b) by the interval that mapping relations convert the side-play amount of file and relative file head to.The operation of its response is: 1) read operation, if a plurality of different grouping of the interval leap of the flash memory address of appointment can be opened the corresponding image file of each grouping so successively and carry out read operation, data are read in successively the internal memory of appointment; 2) write operation: cross over a plurality of different grouping if the flash memory address of appointment is interval, can open the corresponding image file of each grouping so successively and carry out write operation, data are write file position between the corresponding file offset field successively.Because disk file system, can omit at this monoblock is duplicated out earlier, wipes, upgraded the method that writes again, there be not explicit wiping, but directly can write operation, thereby write operation speed is quick and easy.Certainly, maintain secrecy and add an erase operation if original true flash drive has by the function of piece obliterated data or is necessary for, can according to the application scenario set up and truly the flash memory erase operation have one of the same parameter to wipe function.
D, the read-write operation of step c) is packaged into the flash reading and writing function has the same input,, then can adopt heavily loaded mode if virtual flash disk operation function and actual flash disk operation function are of the same name; If not of the same name, can finish with simple unified replacement function name.Perhaps in the virtual flash disk operation function of described encapsulation, make the switch of a judgement, if use the equipment platform of disk then to select, if use the equipment platform of flash memory then to select to use true flash disk operation with the virtual flash disk operation of disk.
After finishing according to above-mentioned steps, on disk file system, utilize the read-write operation of disk is changed by certain mapping, be modeled to operation to flash memory, application module can be according to the mode visit data of direct visit flash memory, all the other related algorithm flow processs need not change, and whether make the algorithm that reads and writes data of upper application software exist on the equipment platform of true flash memory is the same.Original upper application software module of flash memory of using can smoothly be transplanted on the equipment platform that uses disk file system, perhaps just operates in seemingly by present technique on the platform that uses flash memory at the application module newly developed on the platform of disk file.
Virtual flash memory technology of the present invention has been realized on the network equipment of the AS8208 of Green Nai Te company and use disk file systems such as AS8826 and NATXP1000.The part of module that these products use is to transplant from other networking products of company to come, and application module originally uses the mode of direct flash disk operation to read and write data, used virtual flash memory technology after, the relevant portion of application module need not to change; And some functions of modules that newly realize on the equipment platform of virtual flash memory can be transplanted back again and use on the flash memory ground equipment platform easily.Thereby improved the development efficiency of company largely, saved cost of development.

Claims (5)

1, a kind of method with the virtual flash reading and writing data of disk file is characterized in that may further comprise the steps:
A, the configuration of flash capacity as required produce corresponding disk file;
B, set up the mapping relations of flash memory address, make the effective address of each flash memory can be mapped to the side-play amount of disk file and relative file head to the side-play amount of file and relative file head according to step a;
C, the flash memory address interval that application module need be visited convert file to and with respect to the interval of the side-play amount of top of file, again read and write access are carried out in the interval that converts to according to the mapping relations of step b;
D, the read-write operation of step c read and write access is packaged into virtual flash reading and writing function, this virtual flash reading and writing function has the same input with actual flash reading and writing function.
2, the method with the virtual flash reading and writing data of disk file as claimed in claim 1, it is characterized in that: among the step a or the corresponding file of flash block, or a plurality of groupings, the corresponding file of each group, or the corresponding file of all pieces.
3, the method with disk file virtual flash reading and writing data as claimed in claim 2 is characterized in that: a group or have only, or whole pieces, or part piece.
4, the method with disk file virtual flash reading and writing data as claimed in claim 1 is characterized in that: side-play amount or be unit with the byte, the perhaps minimum visit unit's byte number of regulation is perhaps according to 2 or a plurality of byte-aligned.
5, the method with the virtual flash reading and writing data of disk file as claimed in claim 1, it is characterized in that: the switch of in the virtual flash reading and writing function of encapsulation, doing a judgement, if use the equipment platform of disk then to select, if use the equipment platform of flash memory then to select to use true flash disk operation with the virtual flash memory of disk file.
CNB031468756A 2003-09-16 2003-09-16 Method of reading -writing data using disk file virtual flash Expired - Lifetime CN1304959C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB031468756A CN1304959C (en) 2003-09-16 2003-09-16 Method of reading -writing data using disk file virtual flash

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB031468756A CN1304959C (en) 2003-09-16 2003-09-16 Method of reading -writing data using disk file virtual flash

Publications (2)

Publication Number Publication Date
CN1598789A CN1598789A (en) 2005-03-23
CN1304959C true CN1304959C (en) 2007-03-14

Family

ID=34659701

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB031468756A Expired - Lifetime CN1304959C (en) 2003-09-16 2003-09-16 Method of reading -writing data using disk file virtual flash

Country Status (1)

Country Link
CN (1) CN1304959C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101825995A (en) * 2010-05-11 2010-09-08 太仓市同维电子有限公司 Method for supporting reading and writing of files on small flash memory partitions

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101676885B (en) * 2008-09-17 2013-08-21 群联电子股份有限公司 Data management method and storage device and controller thereof
CN102736858A (en) * 2011-04-01 2012-10-17 柴可 Realization method for embedded virtual USB disk
CN103226505B (en) * 2013-04-22 2016-08-03 华为技术有限公司 A kind of method and apparatus verifying basic input-output system BIOS
CN110287128B (en) * 2019-05-21 2021-06-04 北京融芯微科技有限公司 CPU virtual DRAM controller fusing flash memory

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5717886A (en) * 1995-06-06 1998-02-10 Mitsubishi Denki Kabushiki Kaisha Semiconductor disk device and memory management method
JPH10326227A (en) * 1997-05-23 1998-12-08 Nec Corp System for managing storage device using flash memory as storage medium
US6507885B2 (en) * 1996-10-29 2003-01-14 Micron Technology, Inc. Memory system, method and predecoding circuit operable in different modes for selectively accessing multiple blocks of memory cells for simultaneous writing or erasure

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5717886A (en) * 1995-06-06 1998-02-10 Mitsubishi Denki Kabushiki Kaisha Semiconductor disk device and memory management method
US6507885B2 (en) * 1996-10-29 2003-01-14 Micron Technology, Inc. Memory system, method and predecoding circuit operable in different modes for selectively accessing multiple blocks of memory cells for simultaneous writing or erasure
JPH10326227A (en) * 1997-05-23 1998-12-08 Nec Corp System for managing storage device using flash memory as storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101825995A (en) * 2010-05-11 2010-09-08 太仓市同维电子有限公司 Method for supporting reading and writing of files on small flash memory partitions
CN101825995B (en) * 2010-05-11 2011-08-03 太仓市同维电子有限公司 Method for supporting reading and writing of files on small flash memory partitions

Also Published As

Publication number Publication date
CN1598789A (en) 2005-03-23

Similar Documents

Publication Publication Date Title
CN102508784B (en) Data storage method of flash memory card in video monitoring equipment, and system thereof
US11249664B2 (en) File system metadata decoding for optimizing flash translation layer operations
CN1223945C (en) Improved flash file system
JP4155463B2 (en) System having flash management system using only sequential writing and method thereof
JP3347015B2 (en) Adaptive localization method and apparatus for frequently accessed and randomly addressed data
CN102667740B (en) Boundary alignment by data storage device subregion Yu physical data sector
US7480766B2 (en) Interfacing systems operating through a logical address space and on a direct data file basis
US8650379B2 (en) Data processing method for nonvolatile memory system
CN105843753B (en) Logical block address for hard disk drive maps
CN103838853B (en) Mixed file system based on different storage media
KR20020080458A (en) A method for repartitioning physical sectors of a storage system with use of virtual disc drives, a data processing apparatus and a data storage apparatus
CN103186350A (en) Hybrid storage system and hot spot data block migration method
KR20110056276A (en) A portable storage device with an accelerated access speed
CN108334277B (en) A kind of log write-in and synchronous method, device, system, computer storage medium
CN103049224A (en) Method, device and system for importing data into physical tape
CN106528443B (en) FLASH management system and method suitable for spaceborne data management
CN102520885B (en) Data management system for hybrid hard disk
CN1304959C (en) Method of reading -writing data using disk file virtual flash
US11500822B2 (en) Virtualized append-only interface
CN107632779A (en) Data processing method and device, server
CN106055269A (en) Realm partitioning in hard drives
CN109656834A (en) It is related to the data managing method and data storage system of NameSpace planning
CN105404591B (en) Processor system and its memory control methods
CN109727629B (en) Method and system for wear leveling using multiple gap progress fields
CN101339490A (en) Flash memory drive apparatus and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: SHENZHEN CITY NEW GREEN KNIGHT ICT CO., LTD.

Free format text: FORMER OWNER: SHENZHEN GELIN NAITONG COMMUNICATION TECHNOLOGY CO., LTD.

Effective date: 20071109

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20071109

Address after: 518057, second, fourth floor, No. 10, Qiong Yu Road, Nanshan District Science Park, Shenzhen, Guangdong

Patentee after: SHENZHEN NEW GREENNET TECHNOLOGIES Co.,Ltd.

Address before: 518057 No. 10, Qiong Yu Road, Shenzhen science and Technology Park, Guangdong, China

Patentee before: SHENZHEN GELINNAITE COMM TECHN

C57 Notification of unclear or unknown address
DD01 Delivery of document by public notice

Addressee: Dai Chang

Document name: Notification to Pay the Fees

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200108

Address after: Shenzhen Nanshan District City, Guangdong province 518000 North Ring Road North Song Ping Road No. 2 Sumitomo fiber cable plant on the eastern side of two yuan

Co-patentee after: SHENZHEN XIN'AOKE CABLE Co.,Ltd.

Patentee after: SHENZHEN NEW GREENNET TECHNOLOGIES Co.,Ltd.

Address before: 518057 second and fourth floors, No.10 Qiongyu Road, Science Park, Nanshan District, Shenzhen City, Guangdong Province

Patentee before: SHENZHEN NEW GREENNET TECHNOLOGIES Co.,Ltd.

CX01 Expiry of patent term
CX01 Expiry of patent term

Granted publication date: 20070314