CN100419620C - Method for command interaction and two-way data transmission on USB mass storage equipment by program and USB mass storage equipment - Google Patents
Method for command interaction and two-way data transmission on USB mass storage equipment by program and USB mass storage equipment Download PDFInfo
- Publication number
- CN100419620C CN100419620C CNB2005100125417A CN200510012541A CN100419620C CN 100419620 C CN100419620 C CN 100419620C CN B2005100125417 A CNB2005100125417 A CN B2005100125417A CN 200510012541 A CN200510012541 A CN 200510012541A CN 100419620 C CN100419620 C CN 100419620C
- Authority
- CN
- China
- Prior art keywords
- command
- usb mass
- memory unit
- mass memory
- data
- 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 - Fee Related
Links
Images
Landscapes
- Storage Device Security (AREA)
Abstract
The present invention relates to a method for carrying out command interaction and two-way data transmission between an application program on a USB mass storage device and the USB mass storage device, and particularly to an operation system with privilege management. The present invention provides a method for unauthorized users to use a created application program to send a command to the USB mass storage device so as to carry out command interaction and two-way data transmission between the application program and the USB mass storage device. The present invention realizes the command interaction and the two-way data transmission between the application program and the USB moveable mass storage device by using the characteristic that any user can create new files in a readable-writable region of a USB movable storage device by using the operation system and can write data into the readable-writable region and read data from the readable-writable region, and by specifying the data of data format, data length, the read-write position of a new file, etc. of a read-write data buffer region. The present invention provides a moveable, convenient and reliable operating environment for many application programs to make the USB mass storage device with the application program achieve the purpose of plug-and-play.
Description
Technical field
The present invention relates to realize between a kind of a kind of upper application software of USB mass memory unit technical field and the equipment method of two-way data communication.Particularly a kind of user of having logins the operating system of safety certification and rights management such as Windows2000, the above version of Windows XP, how unauthorized user makes Application Software Program that the USB mass memory unit is sent order, thereby realizes that USB mass memory unit application program and USB mass memory unit carry out the method for command interaction and bidirectional data transfers.
Background technology
Understanding relational language for ease of the present invention is explained as follows:
1, USB mass memory unit: a kind of removable mass memory unit of supporting USB mass memory unit agreement.As common flash disk (USB Flash Disk), portable hard drive equipment such as (USB Hard Disk).
2, operating system unauthorized user: be meant the operating system login user because operating system is managed user's default privilege, make with its identity create or the application software of operation to system equipment not read-write or write permission, thereby interface that can not provide by operating system and method realize command interaction and bidirectional data transfers with system equipment.
3, SCSI: being small computer system interface (Small Computer System Interface) abbreviation, is order control and the Data Transport Protocol between computer logic block device and the main frame.
4, RBC: being the english abbreviation of simplifying block command (Reduced Block Command), is the scsi command of simplifying, and is to simplify control command and Data Transport Protocol between computer logic block device and the main frame.
5, WRITE10: be to simplify block command to concentrate the write order sign indicating number of main frame, be sexadecimal 0x2A to block device.
6, READ10: be to simplify block command to concentrate the read command sign indicating number of main frame, be sexadecimal 0x28 to block device.
7, LUN: apparatus logic unit number.
8, LBA: the LBA (Logical Block Addressing) of equipment read-write.
Current, along with popularizing of USB mass memory unit, many application demands also constantly combine with it, so that characteristics such as movability, convenience and practicality are provided for application.The many special applications of needs have just appearred in (USB Flash Disk) as flash disk.Theoretically, all movably the USB mass memory unit can develop various special applications.When developing various application program on the USB mass memory unit, upper application software need and be carried out command interaction and data transmission between the USB mass memory unit, so that application program can correctly and be discerned the USB mass memory unit of being supported.On various operating systems, system all provides the communication port based on the USB mass memory unit, and most operating systems all are to adopt the scsi command agreement to remove visit and control USB mass memory unit.Such as in Windows 2000 above NT kernel platform operating systems, by equipment input, output control interface access means, as long as bidding protocol is RBC agreement and formal definition according to SCSI, then the proprietary protocol of the order of protocol definition and user oneself definition can send to the USB mass memory unit by this command channel, as flash disk logical block equipment such as (USB Flash Disk).
Concentrate at scsi command, the command code of WRITE10 and READ10 is respectively sexadecimal 0x2A and 0x28, and the command parameter of WRITE10 is apparatus logic unit number (LUN), the LBA (Logical Block Addressing) (LBA) of equipment read-write, and data write length.
When the main control chip of USB mass memory unit receives the scsi command of WRITE10, by analyzing LBA (Logical Block Addressing) (LBA) and apparatus logic unit number (LUN) and the data length that above-mentioned parameter obtains writing, after receiving data, the Data Receiving port just writes this data then to the address of appointment.If data length surpasses the length restriction that chip once can hold, then can receive in batches and write.
The command parameter of READ10 is the same with WRITE10, also be apparatus logic unit number (LUN, the LBA (Logical Block Addressing) (LBA) of equipment read-write, data read length, when the main control chip of the removable mass memory unit of USB receives the scsi command of READ10, by analyzing LBA (Logical Block Addressing) (LBA) and the apparatus logic unit number (LUN) and the data length of the equipment read-write that above-mentioned parameter obtains writing, then to data sending terminal mouth transmission data, up to sending data designated length.If data length surpasses the length restriction that chip once can hold, then can send in batches.
Although various operating systems provide above-mentioned identical or close SCSI logical block device command send mode, but for secure operating system with user authority management, if, then be not all right in this way if the establishment of application program or operator do not have relevant device access authority.Be typically, the NT kernel operations system more than Windows2000 if send order for logical block equipment by equipment input and output control interface, then needs the access limit of this equipment.If but the user is common guest (Guest) or common group of (User) user, operating system acquiescence is what not authorized the access limit of logical device, therefore, need the keeper that these users are added the equipment access limit, otherwise application program will be failed to the visit of equipment.
Along with popularizing of USB mass memory unit, its convenience, movability and practicality obtain the favor of users and software vendor, and various application programs based on this kind equipment plug and play are also constantly increasing.This class application program with carrying out command interaction and data transmission between the equipment, generally just needs by above-mentioned RBC agreement and scsi command passage if desired.If but the user of the equipment of giving is equipment unauthorized read-write user or non-administrative users when the register system, although built-in programs menu or order user by operating system can realize the data file of moveable magnetic disc equipment is stored, but but can't in the application program that the third party creates, send scsi command control and access means, therefore also just can not normally run application, perhaps function of application is subjected to certain limitation.And the system login user is non-administrator's a situation is very general, computer operating system as Internet bar, public place, each office worker of large enterprises, the use of government work department, the network manager only provides domestic consumer's account number to the user in order to guarantee the safe handling of operating system.Therefore, the various application programs on the USB mass memory unit need solve how to visit under the unauthorized user with opertaing device be very important, also be very urgent.At present, common solution has following several:
1, writes specialized apparatus filtration drive or system's backstage service routine.The shortcoming of this method be drive or service routine must be earlier by can the installation system driving or the user such as the keeper of service routine authority install.Therefore, it is unacceptable needing can normally be used by driving of user installation such as keeper or service routine earlier for the application program on the USB magnanimity movable memory equipment.
2, with keeper's identity its application program is installed earlier, creates special user's account number simultaneously.When non-administrative users was logined, application program was still with this special user's identity access means.Such shortcoming is still apparent in view, does not still accomplish plug and play for the application program on the such movable memory equipment of USB, is inconvenient to the user.
Summary of the invention
The purpose of this invention is to provide a kind of method: based on the application software of USB mass memory unit when carrying out the order communication with equipment, even the login user identity is also can pass through this method to the non-administrative users that this equipment does not have an access limit, realize the mutual and bidirectional data transfers of control command.That is to say that upper application software can send order by this method, realize to the equipment transmitting control commands or write private data, also can slave unit related data be read to supply and use and analyze with program.
The present invention solves the technical scheme that its technical matters takes: application program and USB mass memory unit carry out the method for command interaction and bidirectional data transfers on the USB mass memory unit, be to utilize the operating system Any user can create new file in the read-write district of USB mass memory unit also can write and this characteristic of reading of data to it by communications protocol, read-write Logical Disk at the USB mass memory unit is created a unrepeatable new file, then the parameter of scsi command and deposit data in the write command data buffer of new file, when the main control chip application program of USB mass memory unit receives the SCSI write order WRITE10 that writes of new file and data that appointment writes length, it is not common data that the data that analysis writes are found, but the scsi command that contains prescribed form identifies and parameter, then unactual these data that write, but carry out its specified command, if command execution is correct, then return application layer and write success, otherwise return error message, application layer is being received the file of deleting firm establishment after write command is finished immediately, from USB mass memory unit reading of data, then needed to adopt two steps to realize, the first step is to create new file, the back writes the prescribed form data that contain order to new file, when receiving the scsi command WRITE10 of this file, the main control chip software of USB mass memory unit finds by analyzing, be need be to the special command of upper strata return data, therefore will keep the LBA (Logical Block Addressing) (LBA) that apparatus logic unit number (LUN) and equipment are read and write in this WRITE10 command parameter and return and be finished, second step was that and then upper level applications sends a scsi command READ10, this order must guarantee that the apparatus logic unit number (LUN) of this command parameter is the same with the WRITE10 of the first step with the LBA (Logical Block Addressing) (LBA) of equipment read-write, the main control chip software of USB mass memory unit is receiving the READ10 order like this, the LBA (Logical Block Addressing) (LBA) of finding the apparatus logic unit number (LUN) of its parameter and reading and writing is the same with last WRITE10 order, then return the data of the scsi command needs of appointment in last the WRITE10 data buffer, above-mentioned normal read write order can guarantee that the main control chip software of USB mass memory magnanimity equipment is when analyzing scsi command WRITE10 and READ10, both can realize the normal read write order of equipment, realized simultaneously under the operating system unauthorized user, application program can be by the read-write operation of file, other scsi commands of carrying and data in its read write command WRITE10 and READ10 data buffer, the command interaction of realization application program and USB mass memory magnanimity equipment.
The method that USB mass memory unit application program and USB mass memory unit carry out command interaction and bidirectional data transfers also comprises:
The new file of creating in the read-write Logical Disk of USB mass memory unit, filename is to adopt each sequence number character string of calculating global unique 16 bytes of the variation of obtaining, and new file is made as non-shared read-write properties, at the new file that the read-write Logical Disk of USB mass memory unit is created, file extension adopts the extension name of definition separately or random variation.
The new files specify form of creating in the read-write Logical Disk of USB mass memory unit, wherein WRITE10 command specifies form is in proper order: command id head, command sequence number, command operation sign indicating number, command parameter district, unnecessary byte regions, order write the data field, and READ10 command specifies form is in proper order: command id head, command sequence number, unnecessary byte regions, order write the data field.
The command id head of the described new file of creating in the read-write Logical Disk of USB mass memory unit of new files specify form is 0xx55aa55aa555342.
The command sequence of the new files specify form of creating in the read-write Logical Disk of USB mass memory unit number is the unique sequence numbers of 16 bytes.
Odd-multiple, 512 bytes, 1536 bytes or 2560 bytes that the new files specify length of the new files specify form of creating in the read-write Logical Disk of USB mass memory unit is 512 bytes.
If the new files specify length of the new files specify form of creating in the read-write Logical Disk of USB mass memory unit is 1536 bytes, then when sending the WRITE10 order, byte allocation is: command id head, command sequence number, command operation sign indicating number, command parameter district, unnecessary byte regions account for 512 bytes altogether, unnecessary byte regions is a unappropriated unnecessary byte in 512 bytes, can be made as zero, order writes the data field and takies 1024 bytes; Sending the READ10 order, byte allocation is: the command id head, command sequence number, unnecessary byte regions accounts for 512 bytes, unnecessary byte regions is a unappropriated unnecessary byte in 512 bytes, can be made as zero, order reading of data district takies 1024 bytes, USB mass memory unit master chip application logic flow process write order is: receive that WRITE10 order total data---judges whether to be that specified length data---judged result "No"--enter normal data write operation flow process, the judged result "Yes"---judge the command id head, command sequence number, the command operation sign indicating number, in whole bytes in command parameter district whether the command id head is arranged, the command operation sign indicating number, the judged result "No"---enter normal data and write flow process, judged result: "Yes"---analyze command parameter, preserve its apparatus logic number and address and command sequence number, receive remaining byte data then---handle this command request, and reservation command parameter information, use in order to next bar read command---judge command process whether correct---judged result "No"---enters and the command process error message is set, the judged result "Yes"---the execution result data are set for correctly.Read command is: receive that READ10 order total data---judges whether to be that specified length data---judged result "No"---enter normal data and read flow process, whether judged result "Yes"---judgment device logic number and address be number identical with the address with the write order apparatus logic of preserving, the judged result "No"---enter normal data read operation flow process, the judged result "Yes"---is carried out last and is had the command request that identical apparatus logic number and address read order are preserved---and sends and contain the command id head, whole bytes in command sequence number and the unnecessary byte regions send to the data equipment port, and---the remaining byte data that warning order need be returned also sends to the designated equipment port---is provided with the execution result data for correct, USB mass memory unit main control chip application program is when treatment S CSI order WRITE10, to needing the special control command of return data, should be with the apparatus logic unit number (LUN) of this WRITE10 order indication, equipment read-write LBA (Logical Block Addressing) (LBA), command sequence number and command parameter are saved in one or more special-purpose data variable, during USB mass memory unit reading of data, the apparatus logic unit number (LUN) of the READ10 order that the apparatus logic unit number (LUN) and second of the WRITE10 order of the then necessary assurance first step goes on foot is identical, and the read-write LBA (Logical Block Addressing) (LBA) of the READ10 order that the read-write LBA (Logical Block Addressing) (LBA) that the WRITE10 of the first step orders and second goes on foot is identical or exist fixed function to concern.
After the command process that USB mass memory unit main control chip is carried out is finished, close and delete the new file of creating in the read-write Logical Disk of USB mass memory unit immediately.
The invention has the beneficial effects as follows: solved on the operating system with the management of user log-in authentication and security permission, the user of unauthorized device visit creates or how the third party application of operation carries out this key issue of command interaction of bidirectional data transfers with the USB mass memory unit.The most important effect of the present invention is to have avoided the user of unauthorized device visit no longer to need the administrator special driving is installed or other application programs can start the operation third party application, realize that itself and USB mass memory unit carry out the mutual and bidirectional data transmission function of various command, for this class application program provides removable, convenient and reliable running environment, has " plug and play " characteristic of running software.Simultaneously also greatly facilitate the use of user, reduced the software installation administration difficulty of keeper computing machine to this class application program.
Description of drawings
Accompanying drawing 1 is a method embodiment USB mass memory unit application software treatment scheme of the present invention.
Accompanying drawing 2 is a method embodiment USB mass memory unit application program scsi command WRITE10 flow processing of the present invention.
Accompanying drawing 3 is a method embodiment USB mass memory unit application program scsi command READ10 flow processing of the present invention.
Embodiment
Describe the present invention below in conjunction with accompanying drawing:
The invention has been to utilize operating system can allow Any user create new file in the read-write district of USB mass memory unit and also can have write and this characteristic of reading of data to it, the data such as the data layout, length of buffer zone and new file read-write position that read and write data by the regulation agreement have realized that application program and USB mass memory unit carry out various command alternately and bidirectional data transfers.
In the operating system of Windows2000 and above version, Any user all is to create new file on the USB mass memory unit, as long as disk space is enough, simultaneously also not by write-protect.The read-write of new file is all summed up in the point that scsi command WRITE10 and READ10 at last after handling through operating system.
When needs when the USB mass memory unit sends scsi command and concentrates the WRITE10 order, on the read-write Logical Disk of USB mass memory unit, create a new file earlier, then the parameter of scsi command and deposit data in the WRITE10 order data buffer zone of new file, when the scsi command that the main control chip software of USB mass memory unit receives new file concentrates WRITE10 order and regulation to write the data of length, find it is not common data if analyze the data that write, but the scsi command that contains prescribed form identifies and parameter, then unactual these data that write, but carry out its specified command, if command execution is correct, then return application layer and write success, otherwise return error message, application layer is being received the new file of deleting establishment after write command is finished immediately.As not deleting the new file of creating immediately, the main control chip of USB mass memory unit needs constantly to analyze the WRITE10 order, have a strong impact on for normal file storage efficient like this, simultaneously, also can't be by the WRITE10 order from USB mass memory unit reading of data.
When needs when the USB mass memory unit sends scsi command and concentrates the READ10 order, then needed to adopt two steps to realize, the first step is to create a new file earlier on the read-write Logical Disk of USB mass memory unit, writing the prescribed form data that contain order to the new file of creating, when receiving the scsi command WRITE10 of this file, the main control chip software of USB mass memory unit finds by analyzing, be therefore will keep the LBA (Logical Block Addressing) (LBA) and the apparatus logic unit number (LUN) of equipment read-write in this WRITE10 command parameter and to return being finished to the special command of upper strata return data.Second step was that and then upper level applications sends a scsi command READ10, this order must guarantee that the LBA (Logical Block Addressing) (LBA) of equipment read-write of this command parameter is the same with the WRITE10 of the first step with apparatus logic unit number (LUN), the main control chip software of USB memory device is receiving the READ10 order like this, it is the same to find that the LBA (Logical Block Addressing) (LBA) of equipment read-write of its parameter and apparatus logic unit number (LUN) and last WRITE10 order, and then returns the data of the scsi command needs of appointment in last the WRITE10 data buffer.
Above-mentioned two operations can guarantee that the main control chip software of USB mass memory magnanimity equipment is when analyzing concentrated WRITE10 of scsi command and READ10, both can realize the normal read write order of equipment, realized simultaneously under the operating system unauthorized user, application program can be by the read-write operation of new file, concentrate other scsi commands of carrying and data in WRITE10 and the READ10 order data buffer zone at its scsi command, realize that application program and the device command of USB mass memory magnanimity are mutual.
In order to guarantee that method of the present invention can be efficient, reliability service, guarantee upper level applications software can and the USB mass memory unit between the correct command interaction of realizing, when needs send scsi command, on the read-write Logical Disk of USB mass memory unit, create a new file, should guarantee it is original and unrepeatable new file on the equipment, and prevent that other application program from also creating same file, guarantee the exclusiveness of new file read-write operation, the new filename of creating adopts each sequence number character string of calculating global unique 16 bytes of the variation of obtaining, the file extension of new file adopts the extension name of definition separately or random variation, and new file is made as non-shared read-write properties.
Method of the present invention is fixing as far as possible at concentrated WRITE10 of its scsi command and READ10 order data buffer data length, and the reading and writing data length that adopts operating system to be of little use, being convenient to USB mass memory unit main control chip software can be efficient as far as possible when analyzing, accurately with normally equipment WRITE10 and READ10 command area separate, in order to guarantee that method of the present invention reduces the normal read-write effectiveness affects of equipment as far as possible and when guaranteeing the handling capacity of data transmission, can guarantee that also its normal read-write effectiveness affects to equipment is minimum.Reading and writing data length adopts the odd-multiple 512,1536 or 2560 bytes of 512 bytes, and above-mentioned data are to be of little use in the file WRITE10 of operating system and READ10 order, and can guarantee the handling capacity of data transmission.
Method embodiment WRITE10 order data buffer zone of the present invention adopts 1536 bytes, and prescribed form is:
Method embodiment READ10 order data buffer zone of the present invention adopts 1536 bytes, and prescribed form is:
Above-mentioned formal definition of method embodiment of the present invention and data length as can be known, the data that each WRITE10 and READ10 order can be transmitted are 1024 bytes to the maximum except command code and parameter, if surpass this byte, must circulate several times and finish.
Method embodiment of the present invention is in above-mentioned WRITE10 and READ10 order data buffer zone prescribed form, WRITE10 and READ10 order data buffer zone head contain special command Data Identification head, its objective is that being convenient to USB mass memory unit main control chip software can accurately distinguish buffer zone and whether contain special command when analyzing the WRITE10 order.Application program is when reading of data, and USB mass memory unit main control chip software also should be filled in special command marking head data at return data buffer zone head.
Method embodiment of the present invention is in above-mentioned WRITE10 and READ10 order data buffer zone prescribed form, the globally unique command sequence number of 16 bytes is contained in the data buffer of WRITE10 and READ10 order, its objective is and be convenient to USB magnanimity in order further to protect the reliability of method just of the present invention the time to the equipment reading of data, can be when the new file of creating writes data transmission WRITE10 order in the first step, in the data buffer, insert global unique command sequence number of 16 bytes, USB mass memory unit main control chip software is being analyzed this sequence number of WRITE10 order back preservation, like this when second step of following sends READ10 order fetch equipment specific data, USB mass memory unit main control chip software also inserts the unique sequence number in this 16 byte whole world simultaneously in the return data buffer zone, whether be data that USB mass memory unit main control chip software return to upper level applications software if can discern like this.
Method embodiment of the present invention is when USB mass memory unit reading of data, the apparatus logic unit number (LUN) of READ10 with next step of WRITE10 order that guarantees the first step is the same, and the LBA (Logical Block Addressing) of read-write (LBA) exists certain calculable functions to concern.This logical relation is defined as follows: if the LBA (Logical Block Addressing) (LBA) of read-write of supposing the second step READ10 for y, the LBA (Logical Block Addressing) of the read-write of first step WRITE10 (LBA) be x, y=f (x) then, f is that the calculable functions between x and the y concerns.The simplest funtcional relationship is y=x described above, and promptly the LBA (Logical Block Addressing) of two read-writes (LBA) is the same.
Method embodiment USB mass memory unit main control chip application program of the present invention is when treatment S CSI order WRITE10, to needing the special control command of return data, the command sequence of the LBA (Logical Block Addressing) (LBA) of the apparatus logic unit number (LUN) of this WRITE10 order indication, read-write, 16 bytes number and command parameter should be saved in one or more special-purpose data variable, being used to find is the special control command of the data that need return, as judging whether it is special WRITE10, subsidiary condition of READ10 order.
Claims (11)
1. application program and USB mass memory unit carry out the method for command interaction and bidirectional data transfers on the USB mass memory unit, it is characterized in that: the method for described command interaction and bidirectional data transfers is, utilizing the operating system Any user to create new file in the read-write district of USB mass memory unit by communications protocol also can write and this characteristic of reading of data to it, read-write Logical Disk at the USB mass memory unit is created a unrepeatable new file, then the parameter of scsi command and data in accordance with regulations form leave in the write command data buffer of new file, when the main control chip application program of USB mass memory unit receives the SCSI write order WRITE10 that writes of new file and data that appointment writes length, it is not common data that the data that analysis writes are found, but the scsi command that contains prescribed form identifies and parameter, then unactual these data that write, but carry out its specified command, if command execution is correct, then return application layer and write success, otherwise return error message, application layer is being received the file of deleting firm establishment after write command is finished immediately, from USB mass memory unit reading of data, then needed to adopt two steps to realize, the first step is to create new file, the back writes the prescribed form data that contain order to new file, when receiving the scsi command WRITE10 of this file, the main control chip software of USB mass memory unit finds by analyzing, be need be to the special command of upper strata return data, therefore will keep the LBA (Logical Block Addressing) (LBA) that apparatus logic unit number (LUN) and equipment are read and write in this WRITE10 command parameter and return and be finished, second step was that and then upper level applications sends a scsi command READ10, this order must guarantee that the apparatus logic unit number (LUN) of this command parameter is the same with the WRITE10 of the first step with the LBA (Logical Block Addressing) (LBA) of equipment read-write, the main control chip software of USB mass memory unit is receiving the READ10 order like this, the LBA (Logical Block Addressing) (LBA) of finding the apparatus logic unit number (LUN) of its parameter and reading and writing is the same with last WRITE10 order, then return the data of the scsi command needs of appointment in last the WRITE10 data buffer, above-mentioned normal read write order can guarantee that the main control chip software of USB mass memory magnanimity equipment is when analyzing scsi command WRITE10 and READ10, both can realize the normal read write order of equipment, realized simultaneously under the operating system unauthorized user, application program can be by the read-write operation of file, other scsi commands of carrying and data in its read write command WRITE10 and READ10 data buffer, the command interaction of realization application program and USB mass memory magnanimity equipment.
2. application program and USB mass memory unit carry out the method for command interaction and bidirectional data transfers on a kind of USB mass memory unit according to claim 1, it is characterized in that: the described new file of creating in the read-write Logical Disk of USB mass memory unit, filename is to adopt each sequence number character string of calculating global unique 16 bytes of the variation of obtaining, and new file is made as non-shared read-write properties, new file, file extension adopt the extension name of definition separately or random variation.
3. application program and USB mass memory unit carry out the method for command interaction and bidirectional data transfers on a kind of USB mass memory unit according to claim 1 and 2, it is characterized in that: the described prescribed form of creating new file in the read-write Logical Disk of USB mass memory unit, wherein WRITE10 command specifies form is in proper order: the command id head, command sequence number, the command operation sign indicating number, the command parameter district, unnecessary byte regions, order writes the data field, and READ10 command specifies form is in proper order: the command id head, command sequence number, unnecessary byte regions, order writes the data field.
4. application program and USB mass memory unit carry out the method for command interaction and bidirectional data transfers on a kind of USB mass memory unit according to claim 3, it is characterized in that: the command id head of the described new files specify form of creating in the read-write Logical Disk of USB mass memory unit is 0xx55aa55aa555342.
5. application program and USB mass memory unit carry out the method for command interaction and bidirectional data transfers on a kind of USB mass memory unit according to claim 3, it is characterized in that: the command sequence of the described new files specify form of creating in the read-write Logical Disk of USB mass memory unit number is the unique sequence numbers of 16 bytes.
6. application program and USB mass memory unit carry out the method for command interaction and bidirectional data transfers on a kind of USB mass memory unit according to claim 3, it is characterized in that: the specified length of the described new files specify form of creating in the read-write Logical Disk of USB mass memory unit is the odd-multiple of 512 bytes, 512 bytes, 1536 bytes or 2560 bytes.
7. application program and USB mass memory unit carry out the method for command interaction and bidirectional data transfers on a kind of USB mass memory unit according to claim 3, it is characterized in that: the specified length of the described new files specify form of creating in the read-write Logical Disk of USB mass memory unit is 1536 bytes, then when sending the WRITE10 order, byte allocation is: the command id head, command sequence number, the command operation sign indicating number, the command parameter district, unnecessary byte regions accounts for 512 bytes altogether, unnecessary byte regions is a unappropriated unnecessary byte in 512 bytes, can be made as zero, order writes the data field and takies 1024 bytes; Sending the READ10 order, byte allocation is: command id head, command sequence number, and unnecessary byte regions accounts for 512 bytes, and unnecessary byte regions is a unappropriated unnecessary byte in 512 bytes, can be made as zero, and order reading of data district takies 1024 bytes.
8. application program and USB mass memory unit carry out the method for command interaction and bidirectional data transfers on a kind of USB mass memory unit according to claim 3, it is characterized in that: USB mass memory unit master chip application logic flow process write order is: receive that WRITE10 order total data---judges whether to be that specified length data---judged result "No"---enter normal data write operation flow process, the judged result "Yes"---judge the command id head, command sequence number, the command operation sign indicating number, in whole bytes in command parameter district whether the command id head is arranged, the command operation sign indicating number, the judged result "No"---enter normal data and write flow process, judged result: "Yes"---analyze command parameter, preserve its apparatus logic number and address and command sequence number, receive remaining byte data then---handle this command request, and reservation command parameter information, use in order to next bar read command and---judge command process whether correct---judged result "No"---enters the command process error message is set, the judged result "Yes"---the execution result data are set for correct, read command is: receive that READ10 order total data---judges whether to be that specified length data---judged result "No"---enter normal data and read flow process, whether judged result "Yes"---judgment device logic number and address be number identical with the address with the write order apparatus logic of preserving,------carry out last and have the command request that identical apparatus logic number and address read order are preserved---sends and contains the command id head judged result "No" to enter normal data read operation flow process, the judged result "Yes", whole bytes in command sequence number and the unnecessary byte regions send to the data equipment port, and---the remaining byte data that warning order need be returned also sends to the designated equipment port---is provided with the execution result data for correct.
9. application program and USB mass memory unit carry out the method for command interaction and bidirectional data transfers on a kind of USB mass memory unit according to claim 3, it is characterized in that: USB mass memory unit main control chip application program is when treatment S CSI order WRITE10, to needing the special control command of return data, the apparatus logic unit number (LUN) of this WRITE10 order indication, equipment read-write LBA (Logical Block Addressing) (LBA), command sequence number and command parameter should be saved in one or more special-purpose data variable.
10. application program and USB mass memory unit carry out the method for command interaction and bidirectional data transfers on a kind of USB mass memory unit according to claim 3, it is characterized in that: during USB mass memory unit reading of data, the apparatus logic unit number (LUN) of the READ10 order that the apparatus logic unit number (LUN) and second of the WRITE10 order of the then necessary assurance first step goes on foot is identical, and the read-write LBA (Logical Block Addressing) (LBA) of the READ10 order that the read-write LBA (Logical Block Addressing) (LBA) that the WRITE10 of the first step orders and second goes on foot is identical or exist fixed function to concern.
11. application program and USB mass memory unit carry out the method for command interaction and bidirectional data transfers on a kind of USB mass memory unit according to claim 3, it is characterized in that: after the command process that USB mass memory unit main control chip is carried out is finished, close and delete the new file of creating in the read-write Logical Disk of USB mass memory unit immediately.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2005100125417A CN100419620C (en) | 2005-05-23 | 2005-05-23 | Method for command interaction and two-way data transmission on USB mass storage equipment by program and USB mass storage equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2005100125417A CN100419620C (en) | 2005-05-23 | 2005-05-23 | Method for command interaction and two-way data transmission on USB mass storage equipment by program and USB mass storage equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1869855A CN1869855A (en) | 2006-11-29 |
CN100419620C true CN100419620C (en) | 2008-09-17 |
Family
ID=37443533
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2005100125417A Expired - Fee Related CN100419620C (en) | 2005-05-23 | 2005-05-23 | Method for command interaction and two-way data transmission on USB mass storage equipment by program and USB mass storage equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100419620C (en) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101789019B (en) * | 2010-02-11 | 2012-05-30 | 株洲南车时代电气股份有限公司 | Method for controlling removable disk under Windows |
CN102262600B (en) * | 2010-05-25 | 2013-12-25 | 安凯(广州)微电子技术有限公司 | Method and system for recognizing USB (Universal Serial Bus) equipment |
CN102487395B (en) * | 2010-12-01 | 2014-11-05 | 北京闪联云视信息技术有限公司 | Method, device and system for realizing data access |
CN102203753B (en) * | 2011-05-23 | 2014-04-16 | 华为技术有限公司 | Data writing processing method, apparatus and terminal equipment |
CN103617389A (en) * | 2013-11-08 | 2014-03-05 | 上海天奕达网络科技有限公司 | Terminal rights management method and terminal device |
CN109165481B (en) * | 2018-06-22 | 2020-11-10 | 芯启源(上海)半导体科技有限公司 | IP soft core property protection and infringement identification method based on USB3.0 protocol TS2 training sequence |
CN109214143B (en) * | 2018-08-01 | 2020-11-10 | 芯启源(上海)半导体科技有限公司 | IP soft core property protection and infringement identification method based on USB3.2 protocol TS1 training sequence |
CN109214144B (en) * | 2018-08-01 | 2020-11-10 | 芯启源(上海)半导体科技有限公司 | IP soft core property protection and infringement identification method based on USB3.2 protocol TS2 training sequence |
CN110737483B (en) * | 2019-10-12 | 2023-02-24 | 重庆邮电大学 | Signaling and data transmission method based on Windows USB MassStorage class |
CN112231246A (en) * | 2020-10-31 | 2021-01-15 | 王志平 | Method for realizing processor cache structure |
CN113032854A (en) * | 2021-03-30 | 2021-06-25 | 杭州华澜微电子股份有限公司 | Electronic data safety transfer method |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN2522936Y (en) * | 2002-01-22 | 2002-11-27 | 茂杰国际有限公司 | Data safety device of USB storage medium read-write device |
CN1514342A (en) * | 2002-12-31 | 2004-07-21 | ���ǵ�����ʽ���� | Personal handset terminal capable of alternating information with host machine and its method |
CN1595381A (en) * | 2003-08-29 | 2005-03-16 | 得州仪器公司 | High speed and flexible control for bridge controllers |
-
2005
- 2005-05-23 CN CNB2005100125417A patent/CN100419620C/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN2522936Y (en) * | 2002-01-22 | 2002-11-27 | 茂杰国际有限公司 | Data safety device of USB storage medium read-write device |
CN1514342A (en) * | 2002-12-31 | 2004-07-21 | ���ǵ�����ʽ���� | Personal handset terminal capable of alternating information with host machine and its method |
CN1595381A (en) * | 2003-08-29 | 2005-03-16 | 得州仪器公司 | High speed and flexible control for bridge controllers |
Also Published As
Publication number | Publication date |
---|---|
CN1869855A (en) | 2006-11-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100419620C (en) | Method for command interaction and two-way data transmission on USB mass storage equipment by program and USB mass storage equipment | |
US6336187B1 (en) | Storage system with data-dependent security | |
KR100371124B1 (en) | Storing data objects in a smart card memory | |
EP1946238B1 (en) | Operating system independent data management | |
CN100468343C (en) | Control method of application program and apparatus therefor | |
CA2623141A1 (en) | Content cryptographic firewall system | |
US20090193524A1 (en) | Electronic computer data management method, program, and recording medium | |
US20080229041A1 (en) | Electrical Transmission System in Secret Environment Between Virtual Disks and Electrical Transmission Method Thereof | |
CN104484625B (en) | A kind of computer and its implementation with dual operating systems | |
CN101593252B (en) | Method and system for controlling access of computer to USB equipment | |
US7818567B2 (en) | Method for protecting security accounts manager (SAM) files within windows operating systems | |
US8429424B2 (en) | Method and system for encrypting files based on security rules | |
TW200837602A (en) | Cryptographic key containers on a USB token | |
CN110138767B (en) | Transaction request processing method, device, equipment and storage medium | |
US20090293058A1 (en) | Virtual system and method of restricting use of contents in the virtual system | |
JP2004158007A (en) | Computer access authorization | |
CN1702591A (en) | Hand disk locking and de-locking control scheme based on USB key apparatus | |
CN114329366B (en) | Network disk file control method and device, network disk and storage medium | |
CN102663313B (en) | Method for realizing information security of computer system | |
CN110543775B (en) | Data security protection method and system based on super-fusion concept | |
CN107391028B (en) | Virtual volume authority control method and device | |
KR101227187B1 (en) | Output control system and method for the data in the secure zone | |
CN101350034A (en) | Mobile memory apparatus and method for visiting file | |
US20220326863A1 (en) | Data storage apparatus with variable computer file system | |
CN112559982A (en) | Copyright protection method for application program |
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 | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20080917 Termination date: 20140523 |