CN101882058A - Method for virtually dividing storage device into a plurality of devices - Google Patents

Method for virtually dividing storage device into a plurality of devices Download PDF

Info

Publication number
CN101882058A
CN101882058A CN2010101832647A CN201010183264A CN101882058A CN 101882058 A CN101882058 A CN 101882058A CN 2010101832647 A CN2010101832647 A CN 2010101832647A CN 201010183264 A CN201010183264 A CN 201010183264A CN 101882058 A CN101882058 A CN 101882058A
Authority
CN
China
Prior art keywords
configuration information
memory device
virtual
information table
main frame
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.)
Pending
Application number
CN2010101832647A
Other languages
Chinese (zh)
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN2010101832647A priority Critical patent/CN101882058A/en
Publication of CN101882058A publication Critical patent/CN101882058A/en
Pending legal-status Critical Current

Links

Images

Abstract

The preferable embodiment of the invention provides a method for virtually dividing one storage device into a plurality of devices, which adds a middle device between the existing host machine and the storage device, the virtual division of the existing physical storage device can be realized through the middle device, and the existing physical storage device can be divided into a plurality of logic devices. After the implementation of the method, the existing storage devices in different types can be integrated, and users can realize the functions of a plurality of different storage devices through one storage device. The invention has the advantages that in the aspect of use, users can carry out arbitrary virtual division on the storage device according to the requirement through the method provided by the invention for meeting the individualized requirements of different users; and in the aspect of volume production, the invention shields the volume production methods of different producers, constructs a unified platform, and greatly reduces the production cost of the volume production, at the same time, the functions of the storage device can be widely used, and market application prospects of the invention are beyond measure.

Description

A kind of method that memory device is virtually divided into a plurality of equipment
Technical field
The present invention relates to the memory device technical field, be specifically related to a kind of method that memory device is virtually divided into a plurality of equipment.
Background technology
The generation of computing machine and its develop fast, for modern humans's file maintenance and resource sharing provides great convenience.But; in the actual life; through regular meeting office appears leaving or family is gone on business, handled official business to another place; need to carry the file of a large amount of files, data or individual secret simultaneously; and no matter be traditional desktop PC; the luggable computer that also is of portable form, it is big all to exist volume, the shortcoming that inconvenience is carried.
For this reason, removable movable storage device has just produced, and it makes the great mass of data that is stored in the memory storage be able to move with the user.For example CD, DVD, portable hard drive, USB flash disk, MP3, MP4, digital camera etc., these memory devices usually the interface by separately and computing machine indirectly or directly link to each other, the realization data alternately.
USB flash disk is a computer peripheral unit part at present commonly used, is made of the Flash storage circuit of USB interface, shell and the inside, and volume is little, is easy to carry, and is easy to use, is usually used in storing important data.In addition, storage card can provide the extension storage function for various mobile devices.For example, can pass through storage card extension storage space in the portable terminal, common storage card comprises SD, MMC, TF card etc.For example a lot of again digital cameras, digital equipments such as MP3, MP4 also can pass through storage card extension storage space.
Manufacturer needs that also USB flash disk or storage card are carried out the volume production program and just can put goods on the market after USB flash disk or storage card are finished hardware production and assembling.Prior art comprises the method that storage card carries out volume production: adopt special-purpose volume production machine, send the privately owned order that scans bad piece in USB flash disk or the storage card to USB flash disk or storage card; The bad block message that scans and relevant information are write Flash in USB flash disk or the storage card by privately owned order by special-purpose volume production machine hidden area.Wherein relevant information comprises specification, physical parameter, configuration information, interface type information of chip etc.
Yet, because therefore the differences such as command type of USB flash disk that different manufacturers produce or storage card chips type, employing, send bad block command of scanning, write bad block message and correlation parameter in USB flash disk or storage card, the privately owned order that must employing adapts with it.And the different needed volume production machine of privately owned order differences.For example, when the manufacturer that has carries out volume production to USB flash disk or storage card,, need special programmable gate array according to its distinctive privately owned order, or CPLD, or custom-designed central processing unit.The volume production machine of the equipment correspondence that these are special also is special-purpose.So, need to adopt the special-purpose volume production machine corresponding to carry out this method with privately owned order.Like this, not only do not have unified USB flash disk or storage card mass production method, versatility is poor, and causes existing mass production method cost higher because special-purpose volume production machine price is high.
CN200710128445.8 discloses a kind of mass production method of storage card, adopt common card reader can implement scanning to bad piece of storage card, and the bad block message that will scan and relevant information write the hidden area in the storage card, reduced the cost of storage card volume production.
CN200810170863.8 discloses a kind of independently USB flash disk of two physical disks that has, and USB flash disk inside comprises that two overlap independently storage circuit, and two cover storage circuits are connected to same USB interface by a HUB, have improved the reliability of USB flash disk.
CN200710135056.8 provides composite set and the method that starts multiple operating system from movable storage device, make the user move multiple operating system from a portable memory device, generate, manage and revise disk partition, move multi-language environment like a cork, setting and management simulation or test environment are not needing to shut down and are closing under the situation of application program and carry out switching between operating system.
The appearance of numerous memory devices, though enriched the means that people store data, also for the user brings inconvenience, user's have to carry as required memory device of different medium, to satisfy function corresponding, as carrying DVD video disc, portable hard drive etc. simultaneously.Therefore, people press for a kind of technology, make the user only need carry an equipment, just can substitute other memory devices and realize function corresponding.
Summary of the invention
The problem that the embodiment of the invention will solve provides a kind of method and system that memory device are virtually divided into a plurality of equipment, to solve the defective that can't realize substituting other dissimilar memory devices in the prior art, finish the due function of dissimilar memory devices with a kind of memory device.For example, the user can be as required with functions such as CD, DVD, ZIP, fdisks by self-defined configuration, be integrated in the USB flash disk, after finishing, the user only need carry the function that this USB flash disk can be realized other memory device correspondences.
To achieve these goals, embodiments of the invention provide the method for the virtual division of a kind of memory device, may further comprise the steps:
By intermediate equipment a physical storage device is divided into one or more subregions, each subregion is virtual to be an independently logical device;
The type and the attribute information of each logical device are set, formation logic device configuration information table;
The logical device information table is stored in this physical storage device,, can realizes change the logical device function by revising the logical device configuration information table.
When carrying out virtual division, mainly be to realize by virtual LUN.The full name of LUN is LogicalUnit Number, just logical unit number.The number of devices that can articulate on the SCSI bus of microcomputer or single chip computer architecture is limited, we can describe these equipment with Target ID (also have and be called SCSI ID's), equipment is as long as an adding system, a code name is just arranged, we are in difference equipment, and which is just passable as long as which is said.But along with increasing of memory device kind, the equipment that needs to describe is considerably beyond this numeral, so introduced the notion of LUN, the effect that is to say LUN ID is exactly to have expanded Target ID.A plurality of LUN Device can be arranged under each Target, abbreviate LUN Device as LUN usually, the description of each equipment has just become Target x LUN y by original T arget x like this, and apparent, the ability of system description equipment has strengthened.
In fact, LUN ID is not equal to certain equipment, and just a number is not represented any entity attribute, and in actual applications, the LUN that we run into may be a disk space, may be magnetic tape station, or media changer or the like.
Method provided by the invention promptly is by the virtual LUN of intermediate equipment, an equipment is virtually divided into a plurality of logical device, for each logical device distribute one LUN number, more meaningfully, can be provided with and revise by the LUN attribute information of intermediate equipment of the present invention simultaneously the logical device of virtual division, after the virtual division of user finishes and is provided with the logical device configuration information, a physical storage device just can be shown as a plurality of equipment in host side, be equivalent to have simultaneously a plurality of dissimilar equipment in the use, greatly improved work efficiency, save user's use cost, improved work efficiency and production efficiency.
Beneficial effect of the present invention is:
(1) by intermediate equipment provided by the invention, production firm can be integrated in it on mainboard or be integrated in the memory device or make stand-alone product;
(2) user can carry out virtual arbitrarily division to memory device as required by method provided by the invention, to satisfy the individual demand of different user;
(3) aspect volume production, the present invention will shield different manufacturers' mass production method, make up a uniform platform, greatly reduce the production cost of volume production, and the function of memory device is more widely used, and its market application foreground is beyond measure.
Description of drawings
Fig. 1 is the present invention carries out virtual division with the USB mobile device a principle assumption diagram;
Fig. 2 is the present invention carries out virtual division with the USB mobile device a process flow diagram;
Fig. 3 is that the present invention is the principle assumption diagram that example is carried out virtual division with the storage card;
Fig. 4 is the data structure diagram that the inventive method virtual partition is stored on disk;
Fig. 5 is the process flow diagram of query logic device configuration information of the present invention;
Fig. 6 is a kind of process flow diagram of revising configuration information table by the READ/WRITE order of the present invention.
Embodiment
The preferred embodiments of the present invention provide a kind of method that memory device is virtually divided into a plurality of equipment.This method is added an intermediate equipment between existing main frame and memory device, can realize existing physical storage device is carried out virtual division by this intermediate equipment, and it is divided into a plurality of logical device.The enforcement of this method can be carried out the memory device of existing and heterogeneous integrated, makes the user only need a memory device just can have the function of a plurality of different memory devices.For example, a USB flash disk is virtually divided into several equipment such as floppy drive, CD-ROM drive, hard disk, this moment, user's computer need not floppy drive, CD-ROM drive, did not more need medium apparatus such as laser disc, only just can realize the function of above-mentioned various device by USB flash disk.For the manufacturer, the volume production cost of USB mobile device and storage card is very high always, need special volume production instrument to produce, and the privately owned order of each manufacturer's volume production is all different, also brings great inconvenience for user's use.The enforcement of patent of the present invention then can address this problem well, the manufacturer can be integrated in host side with intermediate equipment of the present invention or be integrated in the memory device end or as autonomous device production, by this intermediate equipment, just can mask the information of each production firm's different command, different agreement structure, make the user can easily physical storage device be virtually divided into a plurality of logical device.Beneficial effect of the present invention is: the user can carry out virtual arbitrarily division to memory device as required by method provided by the invention, to satisfy the individual demand of different user; In addition, the present invention will shield different manufacturers' mass production method, make up a uniform platform, greatly reduce the production cost of volume production, and the function of memory device is more widely used, and its market application foreground is beyond measure.
When manufacturing, intermediate equipment can be made a separate equipment, also can be integrated in main frame or the memory device, and intermediate equipment links to each other with main frame or memory device by interface protocol such as USB, IEEE1393, bluetooth etc.If the user wants its memory device is carried out logical partitioning, then memory device to be divided can be linked to each other with main frame by intermediate equipment of the present invention, finish virtual division; Certainly, the user can not divide yet, and can also make amendment or restores the logical device of having divided.If the user does not need memory device is divided, then can directly link to each other with main frame, dirigibility is provided.
Intermediate equipment is responsible for receiving and resolve control command that main frame sends to logical device, receive simultaneously and information that resolution logic equipment returns to main frame.In addition, memory device is not limited to movable storage device, can be fixed memory device and movable storage device.
Fixed memory device includes but not limited to the Fixed disk by ATA, SATA, PATA, SCSI protocol transmission data;
Movable storage device includes but not limited to be undertaken by MMC, SD, TF, USB, IEEE1394, Bluetooth protocol USB flash disk, storage card, mobile phone, the digital equipment of data transmission.
In that being carried out, memory device carries out according to following steps in the specific implementation process of virtual division:
At first, by intermediate equipment a physical storage device is divided into one or more subregions, each subregion is virtual to be an independently logical device.When carrying out virtual division, mainly be to realize by virtual LUN.The full name of LUN is Logical Unit Number, just logical unit number.An equipment is virtually divided into a plurality of logical device, for each logical device distribute one LUN number;
Secondly, the type and the attribute information of each logical device is set, formation logic device configuration information table.This process promptly is that the LUN attribute information to the logical device of virtual division is provided with and revises, after the virtual division of user finishes and is provided with the logical device configuration information, a physical storage device just can be shown as a plurality of equipment in host side, is equivalent to have simultaneously a plurality of dissimilar equipment in the use.For example, the user is virtually divided into USB flash disk 3 logical device as required, and the type of logical device is distinguished called after floppy drive, CD-ROM drive, hard disk; The attribute information of CD-ROM drive is set to read-only, and the user only need operate the function that this USB flash disk just has been equivalent to have simultaneously floppy drive, CD-ROM drive and hard disk like this.
Then, the logical device information table is stored in the described physical storage device,, realizes change the logical device function by revising described logical device configuration information table.After the information to logical device is configured, for can remaining unchanged after outage, the information that makes configuration forever preserves, therefore, the present invention generates a logical device configuration information table with user configured logical device information when design, and it is stored on the memory device, when this memory device links to each other with main frame by intermediate equipment of the present invention, intermediate equipment can automatically be resolved the logical device configuration information table in this memory device, and the relevant information with logical device after the parsing is shown in host side.Certainly, the user also can make amendment to this logical device configuration information table, as floppy drive being changed to the encryption disk region, will be saved to the memory device end again after modification finishes.
The present invention can have two kinds of mode of operations, i.e. raw mode and Virtualization Mode.
Raw mode is a programming mode, and the raw data at this moment can accessing storage device writes the logical device configuration information by software program to memory device.
Virtualization Mode is a mode of operation, and at this moment memory device is virtual is a plurality of equipment, the configuration information inaccessible.
The conversion of raw mode and Virtualization Mode can perhaps realize by inserting/remove intermediate equipment by the switch of physics/software.
Usually realize that by specific software its job step is as follows when writing the logical device configuration information:
Be set to raw mode by the specific software physical storage device;
Specific software is from the physical storage device certain location, and existing configuration information table is read in 0 sector or other sectors, and the information of described configuration information table is shown to main frame;
Main frame is by specific software, increases, deletes or revise existing information table;
Specific software writes back physical storage device to new information;
Physical storage device is set to mode of operation then.
When carrying out the logical device configuration, the type of logical device includes but not limited to: TVTRAN1, floppy disk, hard disk drive, CD drive, different operating system subregion, encrypted partition, compression subregion etc.; TVTRAN1 is that a kind of virtual video adds equipment, is used to realize the interaction function between user and the video.
The attribute of logical device includes but not limited to: read-only, only write, readablely write, encrypt, compression etc.
The present invention is a preferred embodiment with the USB movable storage device, and method of the present invention is described in detail.
Fig. 1 is the present invention carries out virtual division with the USB movable storage device a principle assumption diagram; In this structure, intermediate equipment links to each other with memory device with main frame respectively as separate equipment.
Main frame 101 is connected with intermediate equipment by USB port 102, and intermediate equipment is resolved the order of main frame 101 transmissions and the information that USB memory device 106 returns by USB interface engine 103; Concrete mechanism for resolving is finished by input command filtering module 104 and return results filtering module 105.
Input command filtering module 104 and return results filtering module 105 are nucleus modules of intermediate equipment of the present invention, input command filtering module 104 is responsible for the order that main frame 101 sends is resolved, and the order that can be as required main frame 101 be sent make amendment, and is sent to USB memory device 106 again after generating new order; Return results filtering module 105 is responsible for the information of USB memory device 106 responses are filtered, as the model of chip, version, production firm, storage device type etc.; If the user has carried out virtual division to this equipment, then this module will filter out the original device information that USB memory device 106 returns, and the logical device configuration information that the user is provided with is back to main frame, make the user host side see be to divide after logical device rather than the raw information of this USB memory device.
The process flow diagram of Fig. 2 when to be the present invention with the USB mobile device carry out virtual the division, the step of its enforcement is as follows:
Memory device links to each other with main frame by intermediate equipment;
Intermediate equipment receives the order that main frame sends to memory device, and it is passed to memory device;
Some order also can directly be finished in intermediate equipment, and does not need through memory device, such as, when certain LUN equipment of host asks big or small, intermediate equipment can be according to the virtual partition information table at internal memory, directly return results.Again for example, write fashionablely, directly return error message if main frame attempts being designated as read-only LUN equipment to certain.
Intermediate equipment also may be made amendment the order that main frame is sent, and just passes to memory device then.For example, when main frame was attempted reading the information of certain LUN equipment, intermediate equipment obtained the true sector number on memory device beginning the displacement that the sector adds virtual partition.
Memory device receives the order that main frame sends, and according to the communication protocol between memory device and main frame, returns result; The result that described memory device returns comprises memory device chip information, defect block addresses, storage device type;
Intermediate equipment is handled the result that memory device returns, and filters out the raw information that memory device returns, according to the logical device configuration information that sets in advance, with memory device virtual be one or more logical unit number LUN;
One or more logical unit number LUN information after intermediate equipment will be handled are back to main frame;
Memory device is shown as one or more dissimilar equipment in host side.
Wherein, transmit data by interface protocol between intermediate equipment and main frame, intermediate equipment and the memory device; Interface protocol includes but not limited to: ATA, SATA, PATA, SCSI, MMC, SD, TF, USB, IEEE1394, bluetooth;
Intermediate equipment is responsible for resolving the chip information of different storage device, and judges the initial form of memory device; Described initial form is meant that described memory device is not by the device type before the virtual division.
Intermediate equipment to the virtual division of memory device after, formation logic device configuration information table, and this table is stored in the memory device;
Intermediate equipment is operated the logical device after the virtual division by reading the logical device configuration information table.
Intermediate equipment reads configuration information table from memory device.Configuration information table is by special software, write storage device under raw mode.
Intermediate equipment utilizes configuration information table that memory device is carried out virtual division.
When main frame by intermediate equipment with after the USB movable storage device is connected, main frame then sends the USB control command by 201, intermediate equipment then receives the USB order that main frame sends by 202, after receiving this order, intermediate equipment goes to 104 input command filtering modules by the USB interface engine with it, the order that main frame sends is handled, judged by 203 during processing.If some function can realize in intermediate equipment, then need not order is reached the USB memory device, intermediate equipment directly returns to main frame with the result after handling; If intermediate equipment can't be handled, then order is passed to the USB memory device.204 further judge, if relate in the order that main frame sends at this moment the USB memory device is not carried out virtual division, revises logical device configuration information etc., then intermediate equipment directly is sent to the USB movable storage device with the order that main frame sends by 206; If comprise in the order that main frame sends at this moment the USB memory device is carried out virtual division, revises logical device configuration information etc., then intermediate equipment need be made amendment by the order that 205 pairs of main frames send, generation can be carried out the order of virtual division to the USB movable storage device, is sent to USB device by 206 again.
207 for USB device receive original directive that main frame sends or the order revised through intermediate equipment after, the USB memory device is handled accordingly, and is returned corresponding results.
208 for intermediate equipment receives the result that USB device is returned, and the result who returns by 209 couples of USB judges.If the result who returns does not need to revise, then the result who directly USB device is returned is sent to main frame by 211; If desired the result who returns is made amendment, then the result who USB device is returned by 105 return results filtering modules filters, and the result by 210 modification USB return is back to main frame by 211 with the result after filtration finishes again.
Final host computer obtains the operation result that the USB movable storage device shows by 212.
Fig. 3 is another preferred embodiment of the present invention, and this figure is to be the principle assumption diagram that example is carried out virtual division with the storage card, and it still is as standalone module with intermediate equipment that its structure constitutes.
In actual applications, user's storage terminal is not limited to the equipment of USB interface, also has a lot of storage cards, and these storage cards can provide the extension storage function for various mobile devices.For example, can pass through storage card extension storage space in the portable terminal, common storage card comprises SD, MMC, TF card etc.For example a lot of again digital cameras, digital equipments such as MP3, MP4 also can pass through storage card extension storage space.
Along with the continuous increase of memory card capacity, how to make full use of the space of these storage cards, it is virtually divided into a plurality of equipment, also can user friendly widely needs.For example, have only the SD card in user's hand, but need finish the DVD correlation function, and do not have DVD drive in user's the laptop computer, at this moment, just the virtual division of SD card can be virtually divided into the DVD driver with the one segment space.
Still set up being connected between main frame and the storage card by intermediate equipment when the present invention specifically implements, main frame is connected with intermediate equipment one end by USB port in this embodiment, and the intermediate equipment other end is connected with storage card by memory card interface.Intermediate equipment is handled the order that main frame sends by 303USB end points control module, by 301 virtual partition processing modules the storage space of storage card is carried out virtual division, and the data between main frame and the storage card are transmitted by 302USB end-point data transport module.
For example, the user need use the function that the SD card is realized DVD drive, and this moment, the user can be inserted into the SD card on the intermediate equipment of the present invention, and intermediate equipment is connected on the main frame by USB interface.After the successful connection, the user can stick into the virtual division of row to the SD that connects by desktop PC or mobile PC or embedded device etc.In the process of dividing, the user earlier is divided into several subregions with the SD card as required, as 3 subregions, and then the device type and the attribute information of each subregion is set, division is preserved after finishing, and the logical device information of the virtual division of user's this moment just is kept on the SD card.Host operating system can alphabetically be carried out series arrangement to the newly-installed subregion of user according to existing subregion sign.For example, what main frame moved is Windows operating system, and C, D, E subregion have been arranged, after the user sets up, system just can be shown as C, D, E, F, G, H, and the type of the logical device of explicit user setting simultaneously is that CD-ROM, G are DVD-ROM, H hard-disc storage district as F.
After setting completed, the user just can be with relative program or data storage to the logical device of SD card correspondence, as must be to DVD-ROM from the program copy of optical disk start-up, when the user needs, just the SD cartoon can be crossed intermediate equipment and be connected on the main frame, move installation procedure or other programs among the SD card DVD-ROM then.
The type that the user also can be arranged to certain subregion of SD card to encrypt, the data storage that the user just can be important with some is to the encryption device of SD card, to improve safety of data like this.
Fig. 4 is the data structure diagram that the inventive method virtual partition is stored on disk
401 are the data head sign, promptly transmit the leader of data and know.The data head sign is used to identify the existence of configuration information.If sign does not match, just illustrate that this equipment is not also correctly disposed, the field of back also just can not have been used.In data transfer procedure, except will passing the data that we wish to transmit originally, in order to guarantee that we wish orderly, reliable, the complete transmission of data energy that transmits, we want design system can automatically insert some extra data, and these data are referred to as data head.Therefore, in the data structure that transmits, just need data head is identified, make the take over party know which is a raw data, and which is an identification data.
402 is version number, i.e. the current version of the inventive method designed system number, and version number is made up of two to four parts: major version number, inferior version number, build number and revisions number.Major version number and time version number are essential; Build number and revisions number are optionally, if but defined the revisions number part, then build number is exactly essential.The part of all definition all must be the integer more than or equal to 0.
403 is the displacement of first partition data, and it points to the starting position of virtual partition table.Promptly check the physical storage device for the treatment of virtual division, setting according to the user, check that it effectively can use the space, and remember the physical space size of each subregion of virtual division, especially the address displacement of first subregion be to remember, the address of first subregion and the first address of other subregions determined by this displacement.
404 is the number of subregion, i.e. the number of partitions to be divided of user's setting.
405 is data CRC identifying code, i.e. CRC, and English name is CyclicalRedundancy Check, is called for short CRC.It is to utilize the principle of division and remainder to make error detection (Error Detecting).During practical application, virtual partition program calculates crc value and together sends to memory device with data, and memory device recomputates CRC to the data of receiving and compares with the CRC that receives, if two crc value differences illustrate that then mistake appears in data communication.
In actual applications, CRC can be divided into following several standard again: 1. CRC-12 sign indicating number; 2. CRC-16 sign indicating number; 3. CRC-CCITT sign indicating number; 4. CRC-32 sign indicating number.The CRC-12 sign indicating number is commonly used to transmit the 6-bit character string.CRC-16 and CRC-CCITT sign indicating number are then with transmitting the 8-bit character, and wherein CRC-16 is that the U.S. adopts, and CRC-CCITT is adopted by European countries.The CRC-32 sign indicating number mostly is employed in the synchronous transmission of a kind of Point-to-Point of being called.
Be that example illustrates its generative process with the most frequently used CRC-16 below.The CRC-16 sign indicating number is made of two bytes, each of CRC register all is predisposed to 1 in when beginning, then the data of CRC register and 8-bit are carried out XOR, afterwards the CRC register is shifted from high to low, in the position zero padding of most significant digit (MSB), and lowest order (LSB, be moved out of the CRC register after the displacement) if be 1, then register and predefined polynomial code are carried out XOR, LSB is zero else if, then need not to carry out XOR.Repeat above-mentioned displacement from high to low 8 times, first 8-bit data processing finishes, with this moment the CRC register value and next 8-bit data XOR and carry out as being shifted for 8 times the previous data.Value after all characters are finished dealing with in the CRC register is final crc value.
Be the computation process of CRC below:
1. the CRC register is set, and gives its assignment FFFF (hex).
2. first 8-bit character of data and the least-significant byte of 16 CRC registers are carried out XOR, and the result is deposited in the CRC register.
3.CRC register moves right one, LSB is shifted out and checks in the MSB zero padding.
4., repeated for the 3rd step if LSB is 0; If LSB is 1, CRC register and polynomial code be XOR mutually.
5. repeating for the 3rd and the 4th step all finishes up to 8 displacements.This moment, a 8-bit data processing finished.6. repeating for the 2nd to the 5th step all finishes dealing with up to all data.
7. the content of final CRC register is crc value.
CRC cyclic redundancy check (CRC) standard polynomial commonly used is as follows:
CRC (16)=X16+X15+X2+1
CRC(CCITT)=X16+X12+X5+1
CRC (32)=X32+X26+X23+X16+X12+X11+X10+X8+X7+X5+X4+X2+X+1
With CRC (16) polynomial expression is example, and its corresponding verification binary digit classifies 1 1,000 00,000,000 0101 as.
The standard check polynomial of listing among the present invention all contains the factor of a polynomial of (X+1); Each polynomial coefficient is binary number, and the operation rule to two deliverys is still followed in related arithmetic.
Two binary numbers that the arithmetic of two deliverys is referred to participate in computing are all XOR XORs that all carries out when relating to plus and minus calculation between everybody, that is: 1XOR 1=0,0XOR 0=0,1XOR 0=1)
406 is other extend informations, and some that promptly are used in the inventive method behind Product Renewal and the method improvement are reserved extend informations.
407 is the virtual partition device type, this field description the device type of the virtual partition that is provided with of user, as floppy drive, CD-ROM, DVD-ROM, ZIP etc., when being provided with, the user selects by device type intuitively, but the device type that replaces the user to be provided with by numeral or character in this field after setting completed.For example can be expressed as floppy drive, 010 with 001 is expressed as CD-ROM, 011 and is expressed as DVD-ROM, 100 and is expressed as ZIP.
408 for virtual partition begins the LBA value of sector, and LBA (Logical Block Addressing) is the LBA (Logical Block Addressing) pattern.Under the LBA pattern, we know that a data zone on the hard disk is unique definite by magnetic head, cylinder (magnetic track just) and the sector institute at its place.In the LBA address, the actual physical address (cylinder, magnetic head and sector) of memory device is not represented in the address, the LBA addressing mode changes the three-dimensional addressing mode of CHS into the linear addressing of one dimension, the C/H/S numbering of the physical sector that memory device is all changes the numbering of a linearity into by certain rule, system effectiveness is greatly enhanced, and has avoided the addressing mode of loaded down with trivial details magnetic head/cylinder/sector.When accessing storage device, more this logical address is converted to the physical address of physical storage devices.
Conversion between LBA and the C/H/S:
If NS is every magnetic track sector number, NH is the magnetic head number, and C, H, S represent cylinder, magnetic head and the sector number of disk respectively, LBA presentation logic sector number, and div is for dividing exactly calculating, and mod is that complementation is calculated, then:
LBA=NH×NS×C+NS×H+S-1;
C=(LBA?div?NS)div?NH;
H=(LBA?div?NS)mod?NH;
S=(LBA?mod?NS)+1
LBA=0 CHS=0/0/1 then for example
Computing formula from C/H/S to LBA:
LBA=(C-CS)*PH*PS+(H-HS)*PS+(S-SS)
409 is the sector number of virtual partition, after the user sets up first virtual partition, and the sector sum that calculates.
410 is the virtual partition extend information, and this field is used for other application of virtual partition.
411 is second virtual partition, and the data structure of this subregion is identical with the data structure of first subregion.
412 is N virtual partition, if the user is provided with N virtual partition, then this N virtual partition has identical data structure.
Fig. 5 is the method for query logic device configuration information of the present invention, may further comprise the steps:
501 main frames send the INQUERY order;
502 check configuration information table in buffer memory;
Whether 503 judge configuration information table buffer memory;
If configuration information table does not have buffer memory, then by 504 from the physical storage device ad-hoc location, this ad-hoc location is generally 0 sector, other sectors also can, read configuration information table;
And get up by 505 configuration information table caches;
If configuration information table is buffer memory, 506 according to configuration information table, generates the INQUERY information table;
507 return to main frame with the result;
508 are main frame acquisition operation result.
Fig. 6 is a kind of method by READ/WRITE order modification configuration information table of the present invention, may further comprise the steps:
601 main frames send the READ/WRITE order;
602 check configuration information table in buffer memory;
Whether 603 judge configuration information buffer memory;
If configuration information table does not have buffer memory, then 604 from the physical storage device ad-hoc location, is generally 0 sector, other sectors also can, read configuration information table;
And get up by 605 configuration information table caches;
If configuration information table is buffer memory, then revise original READ/WRITE order by 606;
Be added to the beginning sector of READ/WRITE order then by the displacement of 607 virtual LUN;
Issue physical storage device by 608 orders;
609 is physical store return result;
Return to main frame by 610 results at last.
The present invention describes by specific embodiment, it will be appreciated by those skilled in the art that, without departing from the present invention, can also carry out various conversion and be equal to alternative the present invention.In addition, at particular condition or concrete condition, can make various modifications to the present invention, and not depart from the scope of the present invention.Therefore, the present invention is not limited to disclosed specific embodiment, and should comprise the whole embodiments that fall in the claim scope of the present invention.

Claims (10)

1. the method for the virtual division of memory device is characterized in that, may further comprise the steps:
By intermediate equipment a physical storage device is virtually divided into one or more subregions, each subregion is virtual to be an independently logical device; The mode of operation of described virtual division is divided into raw mode and Virtualization Mode;
The type and the attribute information of each logical device are set, formation logic device configuration information table;
The logical device configuration information table is stored in the described physical storage device,, realizes change the logical device function by revising described logical device configuration information table.
2. the method for the virtual division of a kind of according to claim 1 memory device is characterized in that:
Described raw mode is a programming mode, and the raw data on the memory device allows accessed, writes the logical device configuration information by software program to memory device;
Described Virtualization Mode is a mode of operation, and memory device is virtual to be a plurality of equipment, and configuration information does not allow accessed;
The conversion of described raw mode and Virtualization Mode perhaps realizes by inserting/remove intermediate equipment by the switch of physics/software.
3. the method for the virtual division of a kind of according to claim 1 memory device is characterized in that:
Transmit data by interface protocol between described intermediate equipment and main frame, intermediate equipment and the memory device; Described interface protocol includes but not limited to: ATA, SATA, PATA, SCSI, MMC, SD, TF, USB, IEEE1394, bluetooth;
The type of described logical device includes but not limited to: TVTRAN1, floppy disk, hard disk drive, CD drive, different operating system subregion;
The attribute of described logical device includes but not limited to: read-only, only write, readablely write, encrypt, compress;
Described TVTRAN1 is that a kind of virtual video adds equipment, is used to realize the interaction function between user and the video.
4. a method of filtering the memory device protocol information is characterized in that, may further comprise the steps:
Memory device links to each other with main frame by intermediate equipment;
Intermediate equipment receives the order that main frame sends to memory device, and it is passed to memory device;
Memory device receives the order that main frame sends, and according to the communication protocol between memory device and main frame, returns result; The result that described memory device returns comprises memory device chip information, defect block addresses, storage device type;
Intermediate equipment is handled the result that memory device returns, and filters out the raw information that memory device returns, according to the logical device configuration information that sets in advance, with memory device virtual be one or more logical unit number LUN;
One or more logical unit number LUN information after intermediate equipment will be handled are back to main frame;
Memory device is shown as one or more dissimilar equipment in host side.
5. as described in the claim 4, a kind of method of filtering the memory device protocol information is characterized in that:
Transmit data by interface protocol between described intermediate equipment and main frame, intermediate equipment and the memory device; Described interface protocol includes but not limited to: ATA, SATA, PATA, SCSI, MMC, SD, TF, USB, IEEE1394, bluetooth;
Described intermediate equipment is responsible for resolving the chip information of different storage device, and judges the initial form of memory device; Described initial form is meant that described memory device is not by the device type before the virtual division.
6. as described in the claim 4, a kind of method of filtering the memory device protocol information is characterized in that:
Described intermediate equipment to the virtual division of memory device after, formation logic device configuration information table, and this table is stored in the memory device;
Described intermediate equipment is operated the logical device after the virtual division by reading the logical device configuration information table.
7. the data structure expression method of a logical device configuration information is characterized in that:
The content of described logical device configuration information comprises Back ground Information and partition information;
The field of described Back ground Information includes but not limited to:
The data head sign is used to identify the existence of configuration information;
Version number is used for the current version number of marking equipment, and version number is made up of two to four parts: major version number, inferior version number, build number and revisions number;
The displacement of first partition data is used in reference to the starting position to virtual partition table;
The number of subregion, the number of partitions to be divided of setting;
Data CRC identifying code, i.e. CRC;
Other extend informations, some that are used for behind Product Renewal and the method improvement are reserved extend informations;
The field of described partition information includes but not limited to:
The virtual partition device type is used to describe the device type of the virtual partition of setting;
Virtual partition begins the LBA value of sector, and described LBA (Logical Block Addressing) is the LBA (Logical Block Addressing) pattern, determines that by the LBA value virtual partition begins the address of sector;
The sector number of virtual partition, set up first virtual partition after, the sector sum that calculates;
The virtual partition extend information is used for other expanded application of virtual partition;
The information of described each virtual partition has identical structure and field, and the number of virtual partition is by the number decision of the subregion that is provided with.
8. a method that writes the logical device configuration information is characterized in that, may further comprise the steps:
Be set to raw mode by the specific software physical storage device;
Specific software is from the physical storage device certain location, and existing configuration information table is read in 0 sector or other sectors, and the information of described configuration information table is shown to main frame;
Main frame is by specific software, increases, deletes or revise existing information table;
Specific software writes back physical storage device to new information;
Physical storage device is set to mode of operation then.
9. the method for a query logic device configuration information is characterized in that, may further comprise the steps:
Main frame sends the INQUERY order;
Check whether buffer memory of configuration information table;
If configuration information table does not have buffer memory, from the physical storage device ad-hoc location, configuration information table is read in 0 sector or other sectors, and the configuration information table cache is got up;
If configuration information table is buffer memory,, generate the INQUERY information table according to configuration information table;
The result is returned to main frame.
10. the method by READ/WRITE order modification configuration information table is characterized in that, may further comprise the steps:
Main frame sends the READ/WRITE order;
Check whether buffer memory of configuration information table;
If configuration information table does not have buffer memory, from the physical storage device ad-hoc location, configuration information table is read in 0 sector or other sectors, and the configuration information table cache is got up;
If configuration information table is buffer memory, revise original READ/WRITE order, the displacement of virtual LUN is added to the beginning sector of READ/WRITE order;
Then physical storage device is issued in order;
Physical storage device return result;
The result is returned to main frame.
CN2010101832647A 2010-05-26 2010-05-26 Method for virtually dividing storage device into a plurality of devices Pending CN101882058A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010101832647A CN101882058A (en) 2010-05-26 2010-05-26 Method for virtually dividing storage device into a plurality of devices

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010101832647A CN101882058A (en) 2010-05-26 2010-05-26 Method for virtually dividing storage device into a plurality of devices

Publications (1)

Publication Number Publication Date
CN101882058A true CN101882058A (en) 2010-11-10

Family

ID=43054081

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010101832647A Pending CN101882058A (en) 2010-05-26 2010-05-26 Method for virtually dividing storage device into a plurality of devices

Country Status (1)

Country Link
CN (1) CN101882058A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101893999A (en) * 2010-06-08 2010-11-24 孟智平 System for virtually partitioning storage device into multiple devices
CN102662881A (en) * 2012-03-26 2012-09-12 深圳市朗科科技股份有限公司 USB (Universal serial bus) interconnection device and USB interconnection system
CN105389129A (en) * 2015-11-11 2016-03-09 北京汉柏科技有限公司 Virtual cloud disk implementation method in cloud computing system
CN107315699A (en) * 2017-06-12 2017-11-03 记忆科技(深圳)有限公司 A kind of TF cards
WO2018028321A1 (en) * 2016-08-09 2018-02-15 中兴通讯股份有限公司 Method and apparatus for managing virtual external storage device, and terminal
CN109254724A (en) * 2018-07-17 2019-01-22 中国航空无线电电子研究所 The embedded type virtual stored on-board system of configurable multi partition

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1690984A (en) * 2004-03-16 2005-11-02 钟巨航 Virtual partition method and device for external memory
CN1690946A (en) * 2004-04-22 2005-11-02 钟巨航 External memory interface switching device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1690984A (en) * 2004-03-16 2005-11-02 钟巨航 Virtual partition method and device for external memory
CN1690946A (en) * 2004-04-22 2005-11-02 钟巨航 External memory interface switching device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101893999A (en) * 2010-06-08 2010-11-24 孟智平 System for virtually partitioning storage device into multiple devices
CN102662881A (en) * 2012-03-26 2012-09-12 深圳市朗科科技股份有限公司 USB (Universal serial bus) interconnection device and USB interconnection system
CN105389129A (en) * 2015-11-11 2016-03-09 北京汉柏科技有限公司 Virtual cloud disk implementation method in cloud computing system
WO2018028321A1 (en) * 2016-08-09 2018-02-15 中兴通讯股份有限公司 Method and apparatus for managing virtual external storage device, and terminal
CN107315699A (en) * 2017-06-12 2017-11-03 记忆科技(深圳)有限公司 A kind of TF cards
CN109254724A (en) * 2018-07-17 2019-01-22 中国航空无线电电子研究所 The embedded type virtual stored on-board system of configurable multi partition

Similar Documents

Publication Publication Date Title
JP5603997B2 (en) Storage apparatus and data control method
TWI486767B (en) Data storing method, and memory controller and memory storage apparatus using the same
TWI435219B (en) Data protecting method, memory controller and portable memory storage device
CN101676882B (en) Built-in mapping message of memory device
TWI423026B (en) Data writing method, memory controller and memory storage apparatus
TWI768763B (en) Method for performing storage control in a storage server, associated memory device and memory controller thereof, and associated storage server
CN101882058A (en) Method for virtually dividing storage device into a plurality of devices
US7245539B2 (en) Memory card, semiconductor device, and method of controlling semiconductor memory
US9772937B2 (en) Data processing method, memory controller and memory storage apparatus
TW201706848A (en) Valid data merging method, memory controller and memory storage apparatus
US8255656B2 (en) Storage device, memory controller, and data protection method
JP4460967B2 (en) MEMORY CARD, NONVOLATILE SEMICONDUCTOR MEMORY, AND SEMICONDUCTOR MEMORY CONTROL METHOD
US7519876B2 (en) Memory card using flash memory and method of controlling the same
TWI506438B (en) Data storage apparatus and management method thereof
CN102200946B (en) Data access method, memory controller and storage system
CN103218300B (en) Data processing method, Memory Controller and memorizer memory devices
CN103106148B (en) Block management method, storage controller and storage storing device
CN102375781B (en) Data protecting method, memory controller and portable memory storage device
CN101893999A (en) System for virtually partitioning storage device into multiple devices
CN112463055A (en) Method, system, equipment and medium for optimizing and using L2P table of solid state disk
CN101908007A (en) Storage system and computer system
CN101872318B (en) Data access method for flash memory and storage system and controller thereof
TWI396090B (en) Flash memory apparatus, data storage system, and method for sending special instructions to a flash memory apparatus
CN103389941A (en) Memorizer formatting method, memorizer controller and memorizer memory device
US11934264B2 (en) ECC parity biasing for Key-Value data storage devices

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20101110

DD01 Delivery of document by public notice

Addressee: Chen Zhuqing

Document name: Notification of Passing Examination on Formalities