WO2012152075A1 - 一种处理来自计算机的操作指令的方法和接口设备 - Google Patents

一种处理来自计算机的操作指令的方法和接口设备 Download PDF

Info

Publication number
WO2012152075A1
WO2012152075A1 PCT/CN2012/070152 CN2012070152W WO2012152075A1 WO 2012152075 A1 WO2012152075 A1 WO 2012152075A1 CN 2012070152 W CN2012070152 W CN 2012070152W WO 2012152075 A1 WO2012152075 A1 WO 2012152075A1
Authority
WO
WIPO (PCT)
Prior art keywords
instruction
storage
unit number
logical unit
storage medium
Prior art date
Application number
PCT/CN2012/070152
Other languages
English (en)
French (fr)
Inventor
林兵
段国刚
魏巍
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012152075A1 publication Critical patent/WO2012152075A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0685Hybrid storage combining heterogeneous device types, e.g. hierarchical storage, hybrid arrays

Definitions

  • the present invention relates to the field of operational instruction processing, and more particularly to a method and interface apparatus for processing operational instructions from a computer. Background technique
  • USB mass storage media has been widely accepted and loved by users because of its convenience and compactness.
  • the most common USB mass storage media are disk-based devices, such as common USB flash drives, USB mobile hard drives, etc., which provide users with the ability to store and transfer files.
  • Another common device is CDROM, which is generally used.
  • the operating system includes a USB mass storage medium control module 101 and a USB bus 102.
  • the USB device includes a storage function module 103 and a USB protocol stack module 104, and the USB mass storage medium is controlled.
  • the module 101 communicates with the storage function module 103 through a computer interface instruction protocol, and the storage function module 103 transmits the received computer interface instruction to the USB protocol stack module 104, and the USB protocol stack module 104 performs the USB device based on the computer interface instruction. Operations such as querying, data reading and writing, media ejection, etc., and interacting with the USB bus 102 with the USB interactive command, and the USB bus 102 communicates with the USB mass storage medium controller through computer interface instructions.
  • the USB device includes a storage medium, which may be a disk device or a CDROM.
  • the present invention provides a method and an interface device for processing an operation instruction from a computer.
  • a method and an interface device for processing an operation instruction from a computer since only a single storage medium is used in the USB device, when it is required to use a different storage medium, it is required to perform Technical issues with manual conversion.
  • a method of processing an operation instruction from a computer comprising: a communication interface protocol stack module connected to a computer, and at least one storage function module connected to the communication interface protocol stack module; Methods include:
  • the communication interface protocol stack module Receiving, by the communication interface protocol stack module, a first operation instruction issued by an operating system of the computer; the first operation instruction is configured to perform one or more storage function module units in the at least one storage function module Operation
  • a storage medium status bit of one or more of the at least one storage function module is operated based on the second operational instruction.
  • the second operation instruction is the load/unload instruction.
  • the process of performing operations based on the second operation instruction includes:
  • a first value of a media status flag bit of each of the at least one storage function module is modified to a second value based on the load/unload instruction.
  • the method further includes: the storage function module receiving a query instruction issued by the operating system, where the query instruction is used to query the corresponding storage function module unit Whether the storage medium is ready;
  • the storage function module unit returns a query value to the communication interface protocol stack based on the second value of the quality status flag bit; the query value is used to indicate whether the storage medium corresponding to the storage function module unit is ready;
  • the communication interface protocol stack Based on the query value, the communication interface protocol stack returns a value to the operating system, the value being a first value or a second value, the first value indicating that the storage medium is ready, and the second value indicating that the storage medium is not ready.
  • the method when the value is the second value, after returning the value to the operating system, the method further includes:
  • the process of processing the first operation instruction to obtain the second operation instruction includes:
  • the second operation instruction is the computer interface by using the communication interface protocol stack module
  • the first logical unit number and the second logical unit number correspond to the same storage medium
  • the first logic in the computer interface instruction is used by the communication interface protocol stack module
  • the unit number is modified to the second logical unit number, and the computer interface instruction whose logical unit number is the second logical unit number is obtained.
  • the first logical unit number and the second logical unit number correspond to the same storage medium.
  • the process of performing operations based on the second operation instruction includes:
  • the method further includes:
  • Obtaining a standard communication interface query instruction issued by the operating system if the computer interface instruction accesses a storage medium, returning, to the operating system, a message that only one storage medium exists in the communication interface device;
  • the computer interface instructions access a plurality of storage media, and return a message of the plurality of storage media in the communication interface device to the operating system.
  • the method further includes: after the first operation instruction is an instruction to convert the storage device combination, after the operation is performed based on the second operation instruction, the method further includes:
  • the first storage device combination is positive a combination of storage devices at work;
  • a communication interface device comprising at least two independent storage media
  • a communication interface protocol stack module configured to obtain a first operation instruction issued by a computer operating system, where the first operation instruction is used to operate one or more storage function module units of the at least two storage function modules; And configured to process the first operation instruction to obtain a second operation instruction;
  • a storage function module coupled to the communication interface protocol stack module and the at least two storage media, for using one of the at least one storage medium or based on the second operation instruction
  • the first operation instruction is a load/unload instruction
  • the second operation instruction is the load/unload instruction
  • the storage function module When the storage function module is operated based on the second operation instruction, configured to: set, according to the load/unload instruction, a media status flag of each of the at least one storage function module The first value is modified to the second value.
  • the storage function module is further configured to: after modifying the first value of the media status flag bit:
  • the query value is used to indicate whether the storage medium corresponding to the storage function module is ready;
  • triggering the communication interface protocol stack to return a value to the operating system, the value being a first value or a second value, the first value indicating that the storage medium is ready, and the second value indicating the storage medium Not ready.
  • the medium detailed status query module is further included;
  • the media detailed status query module is configured to: receive a storage medium status query instruction delivered by the operating system Returning a message to the operating system indicating that the storage medium is not accessed.
  • the communication interface protocol stack includes a logic unit number modification module.
  • the first operation instruction is a computer interface instruction for dynamically adjusting a storage device arrangement order, processing the first operation instruction to obtain a first
  • the two operation instructions are used,
  • the second operation is performed by the communication interface protocol stack module
  • the instruction is the computer interface instruction; wherein, the first logical unit number and the second logical unit number correspond to the same storage medium;
  • the first logic in the computer interface instruction is used by the communication interface protocol stack module
  • the unit number is modified to the second logical unit number, and the computer interface instruction whose logical unit number is the second logical unit number is obtained.
  • the storage function module is configured to: according to the logical unit number in the computer interface instruction, select a storage medium corresponding to the logical unit number, according to the storage function module
  • the operating system performs read or write operations.
  • a quantity query module configured to: when the first operation instruction is a computer interface instruction that implements a combination of a single or multiple different types of storage devices, obtain the first operation instruction issued by the operating system of the computer, a standard communication interface query instruction issued by the operating system, if the computer interface instruction accesses a storage medium, returning, to the operating system, a message that only one storage medium exists in the communication interface device; The computer interface instructions access a plurality of storage media, and return a message to the operating system that the plurality of storage media are present in the communication interface device.
  • the storage device combination conversion module is further configured to convert the storage device combination after the storage function module performs operations based on the second operation instruction.
  • a conversion command receiving module configured to receive an instruction sent by the operating system to convert the storage device combination
  • a data interaction interruption module configured to: according to the instruction for converting the storage device combination, lower a data voltage on an interface of a first storage device combination composed of a storage medium, and remove a port used by the first storage device combination
  • the first storage device combination refers to a storage that is working Equipment combination
  • An instruction modification module that adjusts a logical unit number in a computer interface instruction for implementing a combination of a single or a plurality of different types of storage devices to obtain a logical unit number corresponding to a second storage device combination composed of the storage medium;
  • a voltage recovery module configured to restore a voltage of the computer interface based on an instruction to convert the storage device combination, and establish the second storage device combination and the operating system based on a logical unit number corresponding to the second storage device combination Connecting, thereby converting the first storage device combination into the second storage device combination.
  • the loading/unloading instructions issued by the operating system on the interface protocol stack module are obtained and processed, and the prior art is required to use different types of storage media.
  • the technical problem of replacing the medium realizes the technical effect of being able to load/unload the storage medium when the interface device is connected to the operating system.
  • Determining the first logical unit in the computer interface instruction for dynamically adjusting the storage medium arrangement order by acquiring the computer interface instruction sent by the operating system on the interface protocol stack module for dynamically adjusting the storage medium arrangement order Whether the number is the same as the second logical unit number in the storage function module, if the same, the second operation instruction is the computer interface instruction for dynamically adjusting the storage medium arrangement order; if not, the use
  • the first logical unit number in the computer interface instruction that dynamically adjusts the storage medium arrangement order is modified to the second logical unit number, and the logical unit number is the second logical unit number, and the dynamic adjustment order of the storage medium is dynamically adjusted.
  • the computer interface instruction wherein the first logical unit number and the second logical unit number correspond to the same storage medium, which solves the problem that the storage medium is arranged in a fixed order and cannot be dynamically adjusted in the prior art, and the The order in which the storage media is arranged is dynamically adjusted.
  • the instruction acquisition module acquires the load/unload instruction issued by the operating system on the interface protocol stack module, and the instruction processing module processes the instruction, thereby solving the prior art,
  • the technical problem of replacing the storage media is required, and the technical effect of loading/unloading the storage media when the interface device is connected to the operating system is realized.
  • the instruction of the storage medium combination issued by the operating system on the interface protocol stack module is interrupted by the instruction acquisition module, and the connection of the storage medium combination and the operating system is disconnected by the data interaction interruption module, and is modified by the instruction modification module to implement a single or a logical unit number in a computer interface instruction of a combination of a plurality of different types of storage media, and establishing a connection between the second storage medium combination composed of the storage medium and the operating system by the voltage recovery module, which solves the prior art,
  • the technical problem of the combination conversion of the storage medium cannot be realized, and the technical effect of smoothly converting the combination of the storage medium is achieved.
  • 1 is a flow chart of communication between an operating system and an interface device in the prior art
  • FIG. 3 is a flowchart of a method for processing an operation instruction from a computer according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a method for processing an operation instruction from a computer according to Embodiment 1 of the present invention
  • FIG. 5 is a flowchart of a method for modifying an operation instruction from a computer according to a second embodiment of the present invention
  • FIG. 6 is a flowchart of a method for processing an operation instruction from a computer according to Embodiment 3 of the present invention
  • FIG. 7 is a structural diagram of an interface device according to Embodiment 4 of the present invention. detailed description
  • An interface device involved in the technical solution of the embodiment of the present invention includes: an interface protocol stack module connected to a computer, a storage function module connected to the interface protocol stack module (as a storage medium in actual application), and Two or more storage media connected to the storage function module.
  • the operating system communicates with the interface protocol stack module or the storage function module through a computer interface instruction protocol to implement the two or more storage media.
  • the operation of the embodiment of the present invention can be applied to other interfaces.
  • a USB storage medium will be described as a specific example. For the number of storage media connected to the storage function module in the USB storage medium, two specific examples will be described, one of which is stored.
  • the media is a disk device; the other storage medium is a CDROM. It is to be understood that the invention is not intended to limit the scope of the invention.
  • a method for processing an operation instruction from a computer is applied to a USB protocol stack module including a computer connected to the computer, and at least one storage function connected to the USB protocol stack module.
  • a USB protocol stack module including a computer connected to the computer, and at least one storage function connected to the USB protocol stack module.
  • the module's USB device include the steps:
  • Step 201 Receive, by using the USB protocol stack module, a first operation instruction issued by an operating system of the computer, where the first operation instruction is used to operate one or more storage media in the at least one storage medium .
  • Step 202 Process, by using the USB protocol stack module, the first operation instruction to obtain a second operation instruction.
  • Step 203 Perform, according to the second operation instruction, one of the at least one storage medium, in a specific implementation process, the first operation instruction may be various operation instructions from a computer operating system, and are implemented in the present invention.
  • the first operation instruction is respectively as follows: a load/unload instruction, a computer interface instruction for dynamically adjusting the storage medium arrangement order; or a computer for realizing a combination of single or multiple different types of storage media.
  • the interface command is an example and will be described in detail.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • a method for processing an operation instruction from a computer includes:
  • Step 3101 Obtain the loading/unloading instruction by using the USB protocol stack module.
  • Step 3102 Processing the load/unload instruction to obtain a second operation instruction, where the second operation instruction is the load/unload instruction.
  • Step 3103 Perform operation on the storage medium status bit corresponding to the storage medium based on the load/unload instruction.
  • step 3103 is specifically:
  • a first value of the media status flag bit is modified to a second value based on the load/unload instruction.
  • the first value and the second value are used to identify whether the storage medium is in a loaded or unloaded state.
  • the first value may be 0, and 0 may be used to indicate that the storage medium is uninstalled.
  • the second value is 1 when the first value is 0, and 1 indicates that the storage medium is in a loaded state.
  • the value and the second value are set to two other different values, as long as the two values can distinguish whether the storage medium is loaded or unloaded.
  • the technical solutions in this embodiment are described in detail by taking 0 and 1 as an example.
  • the second operation instruction is a load instruction
  • the first value is 0, that is, the storage If the medium is in the unloaded state
  • 0 is modified to 1. If the first value is 1, the first value is not modified. At this time, the first value is the same as the second value;
  • the second operation instruction is an unloading instruction, if the first value is 1, the 1 is modified to 0, and if the first value is 0, the first value is not modified, and the first value is Same as the second value.
  • Step 3104 Return a query value to the USB protocol stack module according to the second value of the quality status flag, where the query value is used to indicate that the storage medium corresponding to the storage function module is ready or not ready.
  • the query value is used to indicate that the storage medium corresponding to the storage function module is ready or not ready.
  • Step 3105 Return a value to the operating system based on the query value, where the value is a first value or a second value, the first value indicates that the storage medium is ready, and the second value indicates The storage medium is not ready.
  • the value is a first value or a second value
  • the first value indicates that the storage medium is ready
  • the second value indicates The storage medium is not ready.
  • Step 3106 Receive a storage medium detailed query command delivered by the operating system, and return a message to the operating system, where the message indicates that the storage medium is not accessed.
  • the storage medium status query instruction may be “0103”.
  • the returned message may be “No Media”.
  • Other instructions that can be conceived by those skilled in the art, and step 1107 may not be performed depending on the difference in the system environment.
  • the prior art is required to use different types of storage media.
  • the technical problem of replacing the medium realizes the technical effect of being able to load/unload the storage medium when the USB device is connected to the operating system.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • the first operation instruction is a computer interface instruction for dynamically adjusting the storage medium arrangement order:
  • Step 4101 Acquire the computer interface instruction for dynamically adjusting the order of the storage medium.
  • Processing the computer interface instructions for dynamically adjusting the order of the storage medium to obtain a second operation instruction specifically:
  • Step 41021 Determine the first logical unit number and the storage function module of the computer interface instruction for dynamically adjusting the storage medium arrangement order or the computer interface instruction for implementing a combination of single or multiple different types of storage media. Whether the second logical unit number is the same, wherein the first logical unit number and the second logical unit number correspond to the same storage medium.
  • Step 41022 when the first logical unit number is different from the second logical unit number, Modifying the first logical unit number in the computer interface instruction for dynamically adjusting the storage medium arrangement order to the second logical unit number, and obtaining the logical unit number in the computer interface instruction as the second logical unit number Computer interface instructions that dynamically adjust the order of storage media.
  • Step 4103 Select a storage medium corresponding to the logical unit number based on the logical unit number in the computer interface instruction for dynamically adjusting the storage medium arrangement order, according to which the operating system performs a read or write operation.
  • Step 4104 The combination of the storage medium combination is specifically as follows: Step 41041: Pull down a data voltage on an interface of the first storage medium combination composed of the storage medium, and remove a port used by the first storage medium combination, the first storage A media combination is a combination of storage media that is working.
  • Step 4105 Adjust a logical unit number in a computer interface instruction for implementing a combination of single or multiple different types of storage media to obtain a logical unit number corresponding to the second storage medium combination composed of the storage medium.
  • Step 4106 recovering the voltage of the computer interface, establishing a connection between the second storage medium combination and the operating system based on the logical unit number corresponding to the second storage medium combination, and converting the first storage medium combination Combined for the second storage medium.
  • the storage function module there are two types of storage media, namely a disk device and a CDROM, and the logical unit number of the disk device is set to 2, and the logical unit number of the CDROM is set to 1, which is used to implement a single Or a computer interface instruction of a combination of a plurality of different types of storage media, the logical unit number of the disk device is 1, and the logical unit number of the CDROM device is 2;
  • Step 5101 the USB protocol stack receives the single or multiple different A computer interface instruction that combines types of storage media.
  • Step 5102 Identify a logical unit number in the computer interface instruction for implementing a combination of single or multiple different types of storage media, and determine the computer interface instruction for implementing a combination of single or multiple different types of storage media.
  • the logical unit number of the disk device is 1.
  • the logical unit number of the CDROM is 2; the logical unit number of the disk device, the logical unit number of the CDROM, and the disk device in the storage function module are determined by the computer interface instruction for implementing the combination of single or multiple different types of storage media
  • the logical unit number of the CDROM is different.
  • the logical unit number of the disk device in the computer interface instruction for realizing the combination of the single or multiple different types of storage media is changed to 2, and the logical unit number of the CDROM is modified to 1.
  • Step 5103 Select, according to the logical unit number in the computer interface instruction for dynamically adjusting the storage medium arrangement order, a storage medium (a disk device and a CDROM, respectively) corresponding to the logical unit number, according to which the The operating system performs read or write operations.
  • a storage medium a disk device and a CDROM, respectively
  • Determining the first logical unit in the computer interface instruction for dynamically adjusting the storage medium arrangement order by acquiring the computer interface instruction issued by the operating system on the USB protocol stack module for dynamically adjusting the storage medium arrangement order Whether the number is the same as the second logical unit number in the storage function module, if the same, the second operation instruction is the computer interface instruction for dynamically adjusting the storage medium arrangement order; if not, the use
  • the first logical unit number in the computer interface instruction that dynamically adjusts the storage medium arrangement order is modified to the second logical unit number, and the logical unit number is the second logical unit number, and the dynamic adjustment order of the storage medium is dynamically adjusted.
  • the computer interface instruction wherein the first logical unit number and the second logical unit number correspond to the same storage medium, which solves the problem that the storage medium is arranged in a fixed order and cannot be dynamically adjusted in the prior art, and the The order in which the storage media is arranged is dynamically adjusted.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • the method includes: acquiring a standard USB query command issued by the operating system, If the computer interface instructions for implementing a combination of single or multiple different types of storage media access a storage medium, then to the operating system Returning a message that only one storage medium exists in the USB device, and if the computer interface instruction for implementing a combination of single or multiple different types of storage media accesses a plurality of storage media, returning the There are multiple storage media messages in the USB device. In this embodiment, the remaining steps are the same as those in the second embodiment.
  • the message may be digital, and 0 may be used to represent a storage medium in the USB device, 1 is used to represent two storage media in the USB device, and 2 is representative to exist in the USB device.
  • Three types of storage media, etc., of course, the number of storage media present in the USB device may also be represented by other means, where 0 represents that there is a storage medium in the USB device, and 1 represents the USB device. There are two storage media to illustrate.
  • the system when the operating system needs to access the two storage media, after receiving the standard USB query command of the operating system, the system returns a 1 to the operating system, indicating that there are two storage media in the USB device;
  • the operating system needs to access a storage medium, after receiving the standard USB query command of the operating system, it returns 0 to the operating system, and identifies that a storage medium exists in the USB device.
  • the following is taken as an example when the operating system only needs to access a storage medium. Referring to FIG.
  • the operating system accesses the CDROM, and the CDROM in the computer interface instruction for implementing a combination of single or multiple different types of storage media
  • the logical unit number is 1 and the logical unit number of the CDROM in the storage function module is the same, and the instruction is sent to the storage function module.
  • Step 6101 Receive an instruction that the operating system queries the number of storage media, and returns 0 to the operating system, and notify the operating system that only one storage medium is in the USB device.
  • Step 6102 the USB protocol stack module receives the computer interface instructions for implementing a combination of single or multiple different types of storage media.
  • Step 6103 Identify a logical unit number in the computer interface instruction for implementing a combination of single or multiple different types of storage media, and determine the computer interface instruction for implementing a combination of single or multiple different types of storage media.
  • the logical unit number of the disk device is 1.
  • the logical unit number of the CDROM is 2; the logical unit number of the disk device, the logical unit number of the CDROM, and the disk device in the storage function module are determined by the computer interface instruction for implementing the combination of single or multiple different types of storage media
  • the logical unit number of the CDROM is different.
  • the logical unit number of the disk device in the computer interface instruction for realizing the combination of the single or multiple different types of storage media is changed to 2, and the logical unit number of the CDROM is modified to 1.
  • Step 6104 Select, according to the logical unit number in the computer interface instruction for dynamically adjusting the storage medium arrangement order, a storage medium (a disk device and a CDROM, respectively) corresponding to the logical unit number, according to which the The operating system performs read or write operations.
  • a storage medium a disk device and a CDROM, respectively
  • the logical unit number of the disk device is 1, and the storage function module 702
  • the logical unit number of the disk device in the computer interface instruction for implementing the combination of the single or multiple different types of storage media is changed to 2, and the remaining steps are the same.
  • the number of storage media in the USB device determining whether the first logical unit number in the computer interface instruction for dynamically adjusting the storage medium arrangement order is the same as the second logical unit number in the storage function module, If the same, the second operation instruction is the computer interface instruction for dynamically adjusting the storage medium arrangement order; if not, the first of the computer interface instructions for dynamically adjusting the storage medium arrangement order Changing a logical unit number to a second logical unit number, and obtaining a computer interface instruction for dynamically adjusting the storage medium arrangement order with the logical unit number being the second logical unit number, wherein the first logical unit number,
  • the two logical unit numbers correspond to the same storage medium, and the prior art is solved.
  • the problem can not be achieved dynamic combination of storage media, reaching It is the effect that can be dynamic
  • a USB storage medium includes: at least two independent storage media, specifically, two storage media in the embodiment of the present invention, one is a disk device 703; One is CDROM 704;
  • a USB protocol stack module 701 configured to obtain a first operation instruction issued by the computer operating system 600, where the first operation instruction is used for one or more storage media or the storage function of the at least two storage media
  • the module 702 performs operations; and is further configured to process the first operation instruction to obtain a second operation instruction;
  • a storage function module 702 connected to the USB protocol stack module 701 and the at least two storage media, for one of the at least one storage medium based on the second operation instruction, the USB protocol stack module 701 Specifically, including:
  • the instruction is used to obtain a first operation instruction issued by a computer operating system, and the first operation instruction is used to store or store the one or more storage media of the at least two storage media
  • the function module 702 operates; further includes an instruction processing module 7012, configured to process the first operation instruction to obtain a second operation instruction.
  • the storage function module 702 operates the at least one storage based on the second operation instruction.
  • the first operation instruction may be various operation instructions from a computer operating system.
  • the first operation instruction is respectively: loading/unloading instructions; Computer interface instructions for dynamically adjusting the order of storage media; Or computer interface instructions for implementing a combination of single or multiple different types of storage media are described in detail as examples.
  • Embodiment 4 is a diagrammatic representation of Embodiment 4:
  • the instruction acquisition module acquires the load/unload instruction.
  • the instruction processing module processes the load/unload instruction to obtain the second operation instruction as the load/unload instruction.
  • the instruction processing module is coupled to the media status bit modification module in the storage function module 702, and the instruction processing module modifies the first value of the media status flag bit to a second value based on the load/unload instruction.
  • the first value and the second value are used to identify whether the storage medium is in a loaded or unloaded state. Specifically, the first value may be 0, and 0 may be used to indicate that the storage medium is uninstalled.
  • the second value is 1 when the first value is 0, and 1 indicates that the storage medium is in a loaded state.
  • the value and the second value are set to two other different values, as long as the two values can distinguish whether the storage medium is loaded or unloaded.
  • the storage function module 702 further includes:
  • the media status query module is connected to the USB protocol stack module 701, and is configured to return a query value to the USB protocol stack module 701, where the query value is used to indicate that the storage medium corresponding to the storage function module 702 is ready or not ready.
  • the query value is used to indicate that the storage medium corresponding to the storage function module 702 is ready or not ready.
  • the USB protocol stack module 701 returns a value to the operating system based on the query value, where the value is a first value or a second value, and the first value indicates that the storage medium is ready, the first The two values indicate that the storage medium is not ready. In the specific implementation process, when returning to 0, it means that the storage medium is in an unloading state, and when it returns 1, it represents the storage medium. The quality is loading.
  • the storage function module 702 further includes:
  • the medium detailed status query instruction processing module is configured to: when the value is the second value, receive a storage medium status query instruction sent by the operating system, and return a message to the operating system after returning the value to the operating system, The message indicates that the storage medium is not accessed.
  • the storage medium status query instruction may be “0x03”.
  • the returned message may be “No Media”, of course, Other instructions that can be conceived by those skilled in the art may also not set the media detailed status query instruction processing module according to the difference of the system environment.
  • the instruction acquisition module acquires the loading/unloading instruction issued by the operating system on the USB protocol stack module 701, and the instruction processing module processes the instruction, which solves the prior art.
  • the instruction processing module processes the instruction, which solves the prior art.
  • Embodiment 5 is a diagrammatic representation of Embodiment 5:
  • the USB protocol stack module 701 specifically includes: an instruction acquisition module, configured to acquire a computer interface instruction issued by the operating system for dynamically adjusting the order of the storage medium;
  • the instruction processing module specifically includes:
  • a logical unit number distinguishing module configured to distinguish a logical unit number in the second operating instruction
  • a determining module configured to: when the first operating instruction is a computer interface instruction for dynamically adjusting a storage medium sorting order, or used for When computing a computer interface instruction of a combination of single or multiple different types of storage media, determining the calculation for dynamically adjusting the order of storage media Whether the first logical unit number of the computer interface instruction or the computer interface instruction for implementing the combination of the single or multiple different types of storage media is the same as the second logical unit number of the storage function module 702, wherein the A logical unit number and a second logical unit number correspond to the same storage medium;
  • the instruction processing module further includes:
  • a logical unit number modification module configured to: when the first logical unit number is different from the second logical unit number, the first logical unit in the computer interface instruction for dynamically adjusting the storage medium arrangement order The number is modified to the second logical unit number, and the computer interface instruction for dynamically adjusting the storage medium arrangement order is obtained by the logical unit number in the computer interface instruction being the second logical unit number.
  • the storage function module 702 there are two logical unit numbers of the storage medium, which are the disk device 703 and the CDROM 704, respectively, and the logical unit number of the disk device 703 is set to 2, and the logical unit number of the CDROM 704 is set.
  • the logical unit number of the disk device is 1, and the logical unit number of the CDROM device is 2.
  • the logical unit number distinguishing module identifies the computer interface instructions for implementing a combination of single or multiple different types of storage media
  • the determining module determines the use
  • the logical unit number of the disk device of the disk interface that implements the combination of the single or multiple different types of storage media, the logical unit number of the CDROM is different from the logical unit number of the disk device 703 and the CDROM 704 in the storage function module 702;
  • the number modification module modifies the logical unit number of the disk device in the computer interface instruction for implementing the combination of single or multiple different types of storage media to 2, and modifies the logical unit number of the CDROM to 1.
  • the storage function module 702 includes: a storage medium selection module, configured to select a storage medium corresponding to the logical unit number based on the logical unit number in the computer interface instruction for dynamically adjusting the storage medium arrangement order, according to which Read or write operations for the operating system.
  • the method further includes: a device combination conversion module, configured to pull down a data voltage on the first storage medium combination interface, and remove a port used by the first storage medium combination, where the first storage medium combination refers to a working storage medium Combination
  • the operation instruction obtaining module the computer interface instruction issued by the operating system of the USB protocol stack module 701 for dynamically adjusting the storage medium arrangement order; determining, by the determining module, the dynamic adjustment for the storage medium arrangement order Whether the first logical unit number in the computer interface instruction is the same as the second logical unit number in the storage function module 702; by modifying the module, when the first logical unit number is different from the second logical unit number, The first logical unit number in the computer interface instruction for dynamically adjusting the storage medium arrangement order is modified to a second logical unit number, and the logical unit number is the second logical unit number for sorting the storage medium
  • the dynamically adjusted computer interface instruction wherein the first logical unit number and the second logical unit number correspond to the same storage medium.
  • the media quantity query module included in the USB device acquires a standard USB query instruction issued by the operating system, if the computer interface instruction for implementing a combination of single or multiple different types of storage media accesses a storage medium Returning, to the operating system, a message that only one storage medium exists in the USB device, and if the computer interface instruction for implementing a combination of single or multiple different types of storage media accesses a plurality of storage media, The operating system returns a message that multiple storage media exist in the USB device. In this embodiment, the remaining steps are the same as those in the second embodiment.
  • the message may be digital, and 0 may be used to represent a storage medium in the USB device, 1 is used to represent two storage media in the USB device, and 2 is representative to exist in the USB device.
  • Three types of storage media, etc., of course, the number of storage media present in the USB device may also be represented by other means, where 0 represents that there is a storage medium in the USB device, and 1 represents the USB device. There are two storage media to illustrate.
  • the operating system accesses the CDROM 704, and the logical unit number of the CDROM 704 in the computer interface instructions for implementing a combination of single or multiple different types of storage media is one and the logical unit number of the CDROM 704 in the storage function module 702 is the same
  • the computer interface instructions for implementing a combination of single or multiple different types of storage media are not modified; the operating system accesses the disk device 703 and the single or multiple different types of storage media are implemented
  • the logical unit number of the disk device is 1, and the logical unit number of the disk in the storage function module 702 is different, and the combination for implementing single or multiple different types of storage media is used.
  • the logical unit number of the disk device in the computer interface instruction is changed to 2.
  • the USB device further includes:
  • Storage medium combination conversion module for:
  • the storage function module 702 there are two types of storage media, namely a disk device 703 and a CDROM 704, respectively, a logical unit number of the disk device 703 is set to 2, and a logical unit number of the CDROM 704 is set to 1, which is used to implement In a computer interface instruction of a combination of a single or a plurality of different types of storage media, the logical unit number of the disk device is 1, and the logical unit number of the CDROM device is 2; receiving a standard USB query command issued by the operating system, and performing the operation The system returns 1 to indicate that there are two storage media in the storage function module 702; after the USB protocol stack receives the computer interface instructions for implementing a combination of single or multiple different types of storage media, the identification is used to implement single or multiple Logic unit number in a computer interface instruction of a combination of different types of storage media, determining that the logical unit number of the disk device in the computer interface instruction for implementing a combination of single or multiple different types of storage media is 1, CDROM logic The unit number
  • the logical unit number of the disk device of the computer interface instruction, the logical unit number of the CDROM, and the logical unit number of the disk device 703 and the CDROM 704 in the storage function module 702 are used to implement single or multiple different types of storage.
  • the logical unit number of the disk device in the computer interface instruction of the combination of media is changed to 2, and the logical unit number of the CDROM is changed to 1.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

一种处理来自计算机的操作指令的方法和接口设备 技术领域
本发明涉及操作指令处理领域, 尤其涉及一种处理来自计算机的操作 指令的方法和接口设备。 背景技术
USB 大容量存储介质以其方便、 小巧的特点, 已经广泛被用户所接受 和喜爱。最为常见的 USB大容量存储介质是磁盘类设备,比如常见的 U盘, USB移动硬盘等, 它们为用户提供了存储、 转移文件的功能; 另外一种较 常见的设备是 CDROM, 它一般被用于放置 USB设备的用户终端的安装程 序、 电子版说明书, 以及其他一些又厂商提供给客户的实用性工具、 文档。
如图 1所示, 现有技术中, 操作系统中包括 USB大容量存储介质控制 模块 101、 USB总线 102, USB设备包括存储功能模块 103、 USB协议栈模 块 104, 所述 USB大容量存储介质控制模块 101与存储功能模块 103通过 计算机接口指令协议进行通信, 存储功能模块 103将接收的计算机接口指 令发送给 USB协议栈模块 104, USB协议栈模块 104基于所述计算机接口 指令对所述 USB 设备进行查询、 数据读写、 介质弹出等操作, 并与所述 USB交互指令与所述 USB总线 102进行交互, USB总线 102通过计算机接 口指令与所述 USB大容量存储介质控制器进行通信, 在现有技术中, USB 设备中包含一种存储介质, 可以为磁盘设备或者为 CDROM等。
在实现本发明的过程中, 发现现有技术中至少存在如下技术问题: 现有技术中的 USB存储介质中只有一个存储介质, 所以, 当需要 USB 设备上使用不同类型存储介质时, 需要由用户更换存储介质, 这个过程中 一则需要花费大量的系统资源, 同时效率也不高, 转换过程中也不平滑。 在现有技术中, 由于 USB存储介质只配备单一存储介质, 所以, 不能 实现单个或者多个不同类型存储介质的组合, 不能满足用户在同一个 USB 存储介质中高效使用不同存储介质的需求。 发明内容
本发明提供了一种处理来自计算机的操作指令的方法和接口设备, 用 以解决现有技术中, 由于 USB设备中只有单一的存储介质, 所以在用于需 要使用不同的存储介质时, 需要进行手动转换的技术问题。
为了解决上述问题, 本发明的技术方案是这样实现的:
一种处理来自计算机的操作指令的方法, 应用于通信接口设备中, 该 设备包括与计算机连接的通信接口协议栈模块, 及与所述通信接口协议栈 模块连接的至少一个存储功能模块; 所述方法包括:
通过所述通信接口协议栈模块, 接收所述计算机的操作系统发出的第 一操作指令; 所述第一操作指令用于对所述至少一个存储功能模块中的一 个或多个存储功能模块单元进行操作;
对所述第一操作指令进行处理, 获得第二操作指令;
基于所述第二操作指令, 对所述至少一个存储功能模块中的一个或多 个存储功能模块单元的存储介质状态位进行操作。
其中, 当所述第一操作指令为加载 /卸载指令时, 所述第二操作指令为 所述加载 /卸载指令。
其中, 基于所述第二操作指令进行操作的过程包括:
基于所述加载 /卸载指令, 将所述至少一个存储功能模块中每个存储功 能模块单元的介质状态标志位的第一值修改为第二值。
其中, 修改所述介质状态标志位的第一值之后, 该方法还包括: 所述存储功能模块接收所述操作系统下发的查询指令, 所述查询指令 用于查询所述存储功能模块单元对应的存储介质是否就绪; 所述存储功能模块单元基于所述质状态标志位的第二值, 向通信接口 协议栈返回查询值; 所述查询值用于表示所述存储功能模块单元对应的存 储介质是否就绪;
基于所述查询值, 通信接口协议栈向所述操作系统返回数值, 该数值 为第一数值或第二数值, 所述第一数值表示存储介质就绪, 所述第二数值 表示存储介质未就绪。
其中, 所述数值为第二数值时, 向所述操作系统返回数值后, 该方法 还包括:
接收操作系统下发的存储介质状态查询指令, 向所述操作系统返回消 息, 该消息表明存储介质没有接入。
其中, 当所述第一操作指令为用于对存储设备排列顺序动态调整的计 算机接口指令时, 对所述第一操作指令进行处理, 获得第二操作指令的过 程包括:
当所述计算机接口指令中的第一逻辑单元号与所述存储功能模块中的 第二逻辑单元号相同时, 通过所述通信接口协议栈模块, 使所述第二操作 指令为所述计算机接口指令; 其中, 所述第一逻辑单元号、 第二逻辑单元 号对应于同一种存储介质;
当所述计算机接口指令中的第一逻辑单元号与所述存储功能模块中的 第二逻辑单元号不相同时, 通过所述通信接口协议栈模块, 将所述计算机 接口指令中的第一逻辑单元号修改为第二逻辑单元号, 得到逻辑单元号为 所述第二逻辑单元号的计算机接口指令; 其中, 所述第一逻辑单元号、 第 二逻辑单元号对应于同一种存储介质。
其中, 基于所述第二操作指令进行操作的过程包括:
基于所述计算机接口指令中的逻辑单元号, 选择与所述逻辑单元号对 应的存储介质, 据此供所述操作系统进行读或写操作。 其中, 当所述第一操作指令为用于实现单个或者多个不同类型存储设 备的组合的计算机接口指令时, 在接收所述计算机的操作系统发出的第一 操作指令之前, 该方法还包括:
获取所述操作系统下发的标准通信接口查询指令, 如果所述计算机接 口指令访问一种存储介质, 则向所述操作系统返回所述通信接口设备中只 存在一种存储介质的消息; 如果所述计算机接口指令访问多种存储介质, 则向所述操作系统返回所述通信接口设备中存在多个存储介质的消息。
其中, 当所述第一操作指令为转换存储设备组合的指令时, 基于所述 第二操作指令进行操作之后, 该方法还包括:
基于转换存储设备组合的所述指令, 拉低由存储介质组成的第一存储 设备组合的接口上的电压, 移除所述第一存储设备组合使用的端口; 所述 第一存储设备组合是指正在工作的存储设备组合;
调整用于实现单个或者多个不同类型存储设备的组合的计算机接口指 令中的逻辑单元号, 得到逻辑单元号对应于由存储介质组成的第二存储设 备组合的用于转换所述存储设备组合的指令;
恢复计算机接口的电压, 并基于对应于第二存储设备组合的逻辑单元 号, 建立所述第二存储设备组合与所述操作系统的连接, 进而将所述第一 存储设备组合转换为所述第二存储设备组合。
一种通信接口设备, 包括至少两个独立的存储介质, 以及,
通信接口协议栈模块, 用于获得计算机操作系统发出的第一操作指令, 所述第一操作指令用于对所述至少两个存储功能模块中的一个或多个存储 功能模块单元进行操作; 还用于对所述第一操作指令进行处理, 获得第二 操作指令;
存储功能模块, 与所述通信接口协议栈模块和所述至少两个存储介质 连接, 用于基于所述第二操作指令, 对所述至少一个存储介质中的一个或 其中, 当所述第一操作指令为加载 /卸载指令时, 所述第二操作指令为 所述加载 /卸载指令。
其中, 所述存储功能模块基于所述第二操作指令进行操作时, 用于: 基于所述加载 /卸载指令, 将所述至少一个存储功能模块中每个存储功 能模块单元的介质状态标志位的第一值修改为第二值。
其中, 所述存储功能模块修改所述介质状态标志位的第一值之后, 还 用于:
接收所述操作系统下发的查询指令, 所述查询指令用于查询所述存储 功能模块单元对应的存储介质是否就绪;
基于所述质状态标志位的第二值, 向通信接口协议栈返回查询值; 所 述查询值用于表示所述存储功能模块对应的存储介质是否就绪;
以及, 基于所述查询值, 触发通信接口协议栈向所述操作系统返回数 值, 该数值为第一数值或第二数值, 所述第一数值表示存储介质就绪, 所 述第二数值表示存储介质未就绪。
其中, 还包括介质详细状态查询模块; 其中,
当所述数据为第二数据时, 在所述通信接口协议栈向所述操作系统返 回所述数据后, 所述介质详细状态查询模块, 用于: 接收操作系统下发的 存储介质状态查询指令, 向所述操作系统返回消息, 该消息表明存储介质 没有接入。
其中, 所述通信接口协议栈包括逻辑单元号修改模块; 当所述第一操 作指令为用于对存储设备排列顺序动态调整的计算机接口指令时, 对所述 第一操作指令进行处理, 获得第二操作指令时, 用于:
当所述计算机接口指令中的第一逻辑单元号与所述存储功能模块中的 第二逻辑单元号相同时, 通过所述通信接口协议栈模块, 使所述第二操作 指令为所述计算机接口指令; 其中, 所述第一逻辑单元号、 第二逻辑单元 号对应于同一种存储介质;
当所述计算机接口指令中的第一逻辑单元号与所述存储功能模块中的 第二逻辑单元号不相同时, 通过所述通信接口协议栈模块, 将所述计算机 接口指令中的第一逻辑单元号修改为第二逻辑单元号, 得到逻辑单元号为 所述第二逻辑单元号的计算机接口指令。
其中, 所述存储功能模块基于所述第二操作指令进行操作时, 用于: 基于所述计算机接口指令中的逻辑单元号, 选择与所述逻辑单元号对 应的存储介质, 据此供所述操作系统进行读或写操作。
其中, 还包括:
数量查询模块, 用于当所述第一操作指令为实现单个或者多个不同类 型存储设备的组合的计算机接口指令时, 在所述接收所述计算机的操作系 统发出的第一操作指令之前, 获取所述操作系统下发的标准通信接口查询 指令, 如果所述计算机接口指令访问一种存储介质, 则向所述操作系统返 回所述通信接口设备中只存在一种存储介质的消息; 如果所述计算机接口 指令访问多种存储介质, 则向所述操作系统返回所述通信接口设备中存在 多个存储介质的消息。
其中, 还包括存储设备组合转换模块, 用于在所述存储功能模块基于 所述第二操作指令进行操作之后, 转换所述存储设备组合。
其中, 还包括:
转换命令接收模块, 用于接收所述操作系统下发的转换所述存储设备 组合的指令;
数据交互中断模块, 用于基于所述转换所述存储设备组合的指令, 拉 低由存储介质组成的第一存储设备组合的接口上的数据电压, 移除所述第 一存储设备组合使用的端口; 所述第一存储设备组合是指正在工作的存储 设备组合;
指令修改模块, 调整用于实现单个或者多个不同类型存储设备的组合 的计算机接口指令中的逻辑单元号, 得到对应于由存储介质组成的第二存 储设备组合的逻辑单元号;
电压恢复模块, 用于基于转换所述存储设备组合的指令, 恢复计算机 接口的电压, 并基于对应于第二存储设备组合的逻辑单元号, 建立所述第 二存储设备组合与所述操作系统的连接, 进而将所述第一存储设备组合转 换为所述第二存储设备组合。
本实施例中的技术方案至少实现了如下的技术效果:
本发明实施例的技术方案中, 通过对接口协议栈模块上操作系统下发 的加载 /卸载指令的获取, 并进行处理, 解决了现有技术中, 使用不同类型 的存储介质时, 需要对存储介质进行更换的技术问题, 实现了在所述接口 设备与操作系统连接时, 就能够对存储介质进行加载 /卸载的技术效果。
通过对接口协议栈模块上操作系统下发的用于对存储介质排列顺序动 态调整的计算机接口指令的获取, 判断所述用于对存储介质排列顺序动态 调整的计算机接口指令中的第一逻辑单元号与存储功能模块中的第二逻辑 单元号是否相同, 如果相同, 使所述第二操作指令为所述用于对存储介质 排列顺序动态调整的计算机接口指令; 如果不相同, 将所述用于对存储介 质排列顺序动态调整的计算机接口指令中的第一逻辑单元号修改为第二逻 辑单元号, 得到逻辑单元号为所述第二逻辑单元号的用于对存储介质排列 顺序动态调整的计算机接口指令, 其中, 所述第一逻辑单元号、 第二逻辑 单元号对应于同一种存储介质, 解决了现有技术中, 存储介质的排列顺序 固定, 不能动态调整的问题, 达到了可以对存储介质的排列顺序进行动态 调整的效果。
同时, 通过拉低电压, 调整逻辑单元号, 以及恢复电压, 解决了现有 技术中, 不能实现存储介质组合转换的技术问题, 达到了平滑转换存储介 质组合的技术效果。
本发明的实施例中的技术方案至少实现了如下的技术效果:
本发明实施例的技术方案中, 通过指令获取模块, 对接口协议栈模块 上操作系统下发的加载 /卸载指令的获取, 指令处理模块对所述指令进行处 理, 解决了现有技术中, 使用不同类型的存储介质时, 需要对存储介质进 行更换的技术问题, 实现了在所述接口设备与操作系统连接时, 就能够对 存储介质进行加载 /卸载的技术效果。
通过指令获取模块, 对接口协议栈模块上操作系统下发的用于对存储 介质排列顺序动态调整的计算机接口指令的获取; 通过逻辑单元号区分模 块, 区分所述用于对存储介质排列顺序动态调整的计算机接口指令中的逻 辑单元号; 通过判断模块判断所述用于对存储介质排列顺序动态调整的计 算机接口指令中的第一逻辑单元号与存储功能模块中的第二逻辑单元号是 否相同; 通过逻辑单元号修改模块, 在所述第一逻辑单元号与所述第二逻 辑单元号不相同时, 将所述用于对存储介质排列顺序动态调整的计算机接 口指令中的第一逻辑单元号修改为第二逻辑单元号, 得到逻辑单元号为所 述第二逻辑单元号的用于对存储介质排列顺序动态调整的计算机接口指 令, 其中, 所述第一逻辑单元号、 第二逻辑单元号对应于同一种存储介质。 解决了现有技术中, 存储介质的排列顺序固定, 不能动态调整的问题, 达 到了可以对存储介质的排列顺序进行动态调整的效果。
通过指令获取模块对接口协议栈模块上操作系统下发的转换所述存储 介质组合的指令, 通过数据交互中断模块断开存储介质组合与操作系统的 连接, 通过指令修改模块修改用于实现单个或者多个不同类型存储介质的 组合的计算机接口指令中的逻辑单元号, 并通过电压恢复模块建立由存储 介质组成的第二存储介质组合与所述操作系统的连接, 解决了现有技术中, 不能实现存储介质组合转换的技术问题, 达到了平滑转换存储介质组合的 技术效果。
同时, 通过存储介质转换模块, 拉低电压, 调整逻辑单元号, 以及恢 复电压, 解决了现有技术中, 不能实现存储介质组合转换的技术问题, 达 到了平滑转换存储介质组合的技术效果。 附图说明
图 1为现有技术中操作系统与接口设备的通信的流程图;
图 为本发明实施例中处理来自计算机的操作指令的方法流程图; 图 3为本发明实施例一中处理来自计算机的操作指令的方法流程图; 图 4为本发明实施例二中处理来自计算机的操作指令的方法流程图; 图 5 为本发明实施例二中修改处理来自计算机的操作指令的方法流程 图;
图 6为本发明实施例三中处理来自计算机的操作指令的方法流程图; 图 7为本发明实施例四中接口设备的结构图。 具体实施方式
下面对本发明实施例中的技术方案进行清楚、 完整的描述, 显然, 所 描述的实施例仅仅是本发明的一部分实施例, 而不是全部的实施例。 基于 本发明中的实施例, 本领域普通技术人员在没有做出创造性劳动的前提下 所获得的其他实施例, 均属于本发明的保护范围。
本发明实施例技术方案中涉及到的接口设备, 包括: 与计算机连接的 接口协议栈模块, 与所述接口协议栈模块连接的存储功能模块(在实际应 用时可作为存储介质 ), 及与所述存储功能模块连接的二个或二个以上的存 储介质。 具体参见图 1 ,操作系统通过计算机接口指令协议与所述接口协议 栈模块或存储功能模块进行通信, 以实现对所述二个或二个以上的存储介 质进行操作, 当然, 本发明实施例的技术方案还可以应用于其他接口。 在本发明下述的实施例中, 将以 USB存储介质为具体例子说明, 对于 与 USB存储介质中的存储功能模块连接的存储介质的数量, 将以两个为具 体例子进行说明, 其中一个存储介质为磁盘设备; 另一个存储介质为 CDROM。 当然此处以两个为例子, 仅用于说明和解释本发明, 并不用于限 定本发明的保护范围。
参见图 2,为本发明实施例中提供的一种处理来自计算机的操作指令的 方法,应用于包括有与计算机连接的 USB协议栈模块,及与所述 USB协议 栈模块连接的至少一个存储功能模块的 USB设备中, 包括步驟:
步驟 201 , 通过所述 USB协议栈模块, 接收所述计算机的操作系统发 出的第一操作指令, 所述第一操作指令用于对所述至少一个存储介质中的 一个或多个存储介质进行操作。
步驟 202, 通过所述 USB协议栈模块, 对所述第一操作指令进行处理, 获得第二操作指令。
步驟 203,基于所述第二操作指令,对所述至少一个存储介质中的一个 在具体实施过程中, 所述第一操作指令可以是来自计算机操作系统中 的各种操作指令, 在本发明实施例中, 下面将分别以所述第一操作指令为: 加载 /卸载指令,用于对存储介质排列顺序动态调整的计算机接口指令; 或用于实现单个或者多个不同类型存储介质的组合的计算机接口指令为例 子, 详细进行说明。
实施例一:
参见图 3, 当所述第一操作指令为加载 /卸载指令时, 一种处理来自计 算机的操作指令的方法, 具体包括:
步驟 3101 , 通过所述 USB协议栈模块, 获得所述加载 /卸载指令。 步驟 3102,对所述加载 /卸载指令进行处理,获得第二操作指令,其中, 所述第二操作指令即为所述加载 /卸载指令。
步驟 3103, 基于所述加载 /卸载指令, 对所述与所述存储介质对应的存 储介质状态位进行操作。
在具体实施过程中, 步驟 3103具体为:
基于所述加载 /卸载指令, 将所述介质状态标志位的第一值修改为第二 值。 其中, 所述第一值、 第二值用于标识所述存储介质是处于加载还是卸 载状态, 具体来讲, 所述第一值可以是 0, 此时可用 0来表示所述存储介质 在卸载状态; 显然在所述第一值为 0时, 所述第二值为 1 , 此时 1表示所述 存储介质在加载状态, 当然, 本发明所属技术领域的技术人员还可以将所 述第一值和第二值设置成其他两个不同的值, 只要通过这两个值能区分所 述存储介质是加载还是卸载状态就可以。
在本实施例中, 就以 0和 1作为例子来对本实施例中的技术方案进行 详细描述, 当所述第二操作指令为加载指令时, 如所述第一值为 0, 即所述 存储介质处于卸载状态, 则将 0修改为 1 , 如所述第一值为 1 , 则不修改所 述第一值, 此时, 所述第一值与所述第二值相同; 当所述第二操作指令为 卸载指令时, 如所述第一值为 1 , 则将 1修改为 0, 如所述第一值为 0, 则 不修改所述第一值, 此时, 所述第一值与所述第二值相同。
步驟 3104, 基于所述质状态标志位的第二值, 向所述 USB协议栈模块 返回查询值, 所述查询值用于表示所述存储功能模块对应的存储介质就绪 或者未就绪。 在具体实施过程中, 当返回 0时, 代表所述存储介质处于卸 载状态, 当返回 1时, 代表所处存储介质处于加载状态。
步驟 3105, 基于所述查询值, 向所述操作系统返回数值, 其中, 所述 数值为第一数值或第二数值, 所述第一数值表示所述存储介质就绪, 所述 第二数值表示所述存储介质未就绪。 在具体实施过程中, 当返回 0时, 代 表所述存储介质处于卸载状态, 当返回 1 时, 代表所处存储介质处于加载 状态。
步驟 3106, 接收操作系统下发的存储介质状详细态查询指令, 向所述 操作系统返回消息, 所述消息表明存储介质没有接入。
在具体实施过程中, 所处存储介质状态查询指令可以为 "0103" , 当然, 也可以为本领域技术人员可以想到的其他指令,所述返回的消息可以为" No Media" , 当然, 也可以为本领域技术人员可以想到的其他指令, 同时, 也 可以根据系统环境的差异, 不执行步驟 1107。
本实施例中的技术方案至少实现了如下的技术效果:
本发明实施例的技术方案中, 通过对 USB协议栈模块上操作系统下发 的加载 /卸载指令的获取, 并进行处理, 解决了现有技术中, 使用不同类型 的存储介质时, 需要对存储介质进行更换的技术问题, 实现了在所述 USB 设备与操作系统连接时, 就能够对存储介质进行加载 /卸载的技术效果。
实施例二:
参见图 4,当所述第一操作指令为用于对存储介质排列顺序动态调整的 计算机接口指令时:
步驟 4101 , 获取所述用于对存储介质排列顺序动态调整的计算机接口 指令。
对所述用于对存储介质排列顺序动态调整的计算机接口指令进行处 理, 获得第二操作指令, 具体为:
步驟 41021 ,判断所述用于对存储介质排列顺序动态调整的计算机接口 指令或用于实现单个或者多个不同类型存储介质的组合的计算机接口指令 中的第一逻辑单元号与所述存储功能模块中的第二逻辑单元号是否相同, 其中, 所述第一逻辑单元号、 第二逻辑单元号对应于同一种存储介质。
步驟 41022, 当所述第一逻辑单元号与所述第二逻辑单元号不相同时, 将所述用于对存储介质排列顺序动态调整的计算机接口指令中的第一逻辑 单元号修改为第二逻辑单元号, 得到计算机接口指令中的逻辑单元号为所 述第二逻辑单元号的用于对存储介质排列顺序动态调整的计算机接口指 令。
步驟 4103, 基于所述用于对存储介质排列顺序动态调整的计算机接口 指令中的逻辑单元号, 选择与所述逻辑单元号对应的存储介质, 据此供所 述操作系统进行读或写操作。
步驟 4104对存储介质组合转换具体为: 步驟 41041 , 拉低由存储介质 组成的第一存储介质组合的接口上的数据电压, 移除所述第一存储介质组 合使用的端口, 所述第一存储介质组合是指正在工作的存储介质组合。
步驟 4105, 调整用于实现单个或者多个不同类型存储介质的组合的计 算机接口指令中的逻辑单元号, 得到对应于由存储介质组成的第二存储介 质组合的逻辑单元号。
步驟 4106, 恢复计算机接口的电压, 基于所述对应于第二存储介质组 合的逻辑单元号, 建立所述第二存储介质组合与所述操作系统的连接, 进 而将所述第一存储介质组合转换为所述第二存储介质组合。
参见图 5, 在存储功能模块中, 存在两种存储介质, 分别为磁盘设备和 CDROM, 将磁盘设备的逻辑单元号设置为 2, 将 CDROM的逻辑单元号设 置为 1 ,所述用于实现单个或者多个不同类型存储介质的组合的计算机接口 指令中, 磁盘设备的逻辑单元号为 1 , CDROM设备的逻辑单元号为 2; 步驟 5101 , USB协议栈接收所述用于实现单个或者多个不同类型存储 介质的组合的计算机接口指令。
步驟 5102, 识别所述用于实现单个或者多个不同类型存储介质的组合 的计算机接口指令中的逻辑单元号, 确定所述用于实现单个或者多个不同 类型存储介质的组合的计算机接口指令中磁盘设备的逻辑单元号为 1、 CDROM的逻辑单元号为 2;判断所述用于实现单个或者多个不同类型存储 介质的组合的计算机接口指令的磁盘设备的逻辑单元号、 CDROM 的逻辑 单元号, 与存储功能模块中的磁盘设备、 CDROM 的逻辑单元号不同, 将 所述用于实现单个或者多个不同类型存储介质的组合的计算机接口指令中 磁盘设备的逻辑单元号修改为 2, 将 CDROM的逻辑单元号修改为 1。
步驟 5103, 基于所述用于对存储介质排列顺序动态调整的计算机接口 指令中的逻辑单元号, 选择与所述逻辑单元号对应的存储介质 (分别为磁 盘设备和 CDROM ), 据此供所述操作系统进行读或写操作。
本实施例中的技术方案至少实现了如下的技术效果:
通过对 USB协议栈模块上操作系统下发的用于对存储介质排列顺序动 态调整的计算机接口指令的获取, 判断所述用于对存储介质排列顺序动态 调整的计算机接口指令中的第一逻辑单元号与存储功能模块中的第二逻辑 单元号是否相同, 如果相同, 使所述第二操作指令为所述用于对存储介质 排列顺序动态调整的计算机接口指令; 如果不相同, 将所述用于对存储介 质排列顺序动态调整的计算机接口指令中的第一逻辑单元号修改为第二逻 辑单元号, 得到逻辑单元号为所述第二逻辑单元号的用于对存储介质排列 顺序动态调整的计算机接口指令, 其中, 所述第一逻辑单元号、 第二逻辑 单元号对应于同一种存储介质, 解决了现有技术中, 存储介质的排列顺序 固定, 不能动态调整的问题, 达到了可以对存储介质的排列顺序进行动态 调整的效果。
实施例三:
当第一操作指令为用于实现单个或者多个不同类型存储介质的组合的 计算机接口指令时, 则在实施例二的步驟 202之前, 包括: 获取所述操作 系统下发的标准 USB查询指令, 如果所述用于实现单个或者多个不同类型 存储介质的组合的计算机接口指令访问一种存储介质, 则向所述操作系统 返回所述 USB设备中只存在一种存储介质的消息, 如果所述用于实现单个 或者多个不同类型存储介质的组合的计算机接口指令访问多种存储介质, 则向所述操作系统返回所述 USB设备中存在多个存储介质的消息, 本实施 例中, 其余步驟与实施例二相同。
在具体实施过程中, 所述消息可以数字, 可以用 0代表所述 USB设备 中存在一种存储介质, 用 1代表所述 USB设备中存在两种存储介质, 用 2 代表所述 USB设备中存在三种存储介质等, 当然, 也可以用其他方式表示 所述 USB设备中存在的存储介质的数量,下面以用 0代表所述 USB设备中 存在一种存储介质, 用 1代表所述 USB设备中存在两种存储介质来说明。
在具体是实施过程中, 当操作系统需要访问两种存储介质时, 则接收 到操作系统的标准 USB查询指令后,向所述操作系统回复 1 ,表示所述 USB 设备中存在两种存储介质; 当操作系统需要访问一种存储介质时, 则接收 到操作系统的标准 USB查询指令后,向所述操作系统返回 0,标识所述 USB 设备中存在一种存储介质。 下面以当操作系统仅需要访问一种存储介质时 作为例子说明, 参见图 6, 所述操作系统访问 CDROM, 且所述用于实现单 个或者多个不同类型存储介质的组合的计算机接口指令中 CDROM的逻辑 单元号为 1与所述存储功能模块中的 CDROM的逻辑单元号相同, 则将所 述指令发送给存储功能模块。
步驟 6101 , 接收操作系统查询存储介质数量的指令, 并向所述操作系 统回复 0, 告知操作系统所述 USB设备中只有一种存储介质。
步驟 6102, USB协议栈模块接收所述用于实现单个或者多个不同类型 存储介质的组合的计算机接口指令。
步驟 6103, 识别所述用于实现单个或者多个不同类型存储介质的组合 的计算机接口指令中的逻辑单元号, 确定所述用于实现单个或者多个不同 类型存储介质的组合的计算机接口指令中磁盘设备的逻辑单元号为 1、 CDROM的逻辑单元号为 2;判断所述用于实现单个或者多个不同类型存储 介质的组合的计算机接口指令的磁盘设备的逻辑单元号、 CDROM 的逻辑 单元号, 与存储功能模块中的磁盘设备、 CDROM 的逻辑单元号不同, 将 所述用于实现单个或者多个不同类型存储介质的组合的计算机接口指令中 磁盘设备的逻辑单元号修改为 2, 将 CDROM的逻辑单元号修改为 1。
步驟 6104, 基于所述用于对存储介质排列顺序动态调整的计算机接口 指令中的逻辑单元号, 选择与所述逻辑单元号对应的存储介质 (分别为磁 盘设备和 CDROM ), 据此供所述操作系统进行读或写操作。
当然, 当所述操作系统访问磁盘设备, 且所述用于实现单个或者多个 不同类型存储介质的组合的计算机接口指令中, 磁盘设备的逻辑单元号为 1 , 与所述存储功能模块 702中磁盘设的逻辑单元号不相同时, 则将所述用 于实现单个或者多个不同类型存储介质的组合的计算机接口指令中磁盘设 备的逻辑单元号修改为 2, 其余步驟相同。
本实施例中的技术方案至少实现了, 以下的技术效果:
通过回复操作系统的标准 USB指令,以及获取对 USB协议栈模块上操 作系统下发的用于实现单个或者多个不同类型存储介质的组合的计算机接 口指令的, 根据操作系统的需求, 向所述操作系统返回所述 USB设备中存 储介质的数量, 判断所述用于对存储介质排列顺序动态调整的计算机接口 指令中的第一逻辑单元号与存储功能模块中的第二逻辑单元号是否相同, 如果相同, 使所述第二操作指令为所述用于对存储介质排列顺序动态调整 的计算机接口指令; 如果不相同, 将所述用于对存储介质排列顺序动态调 整的计算机接口指令中的第一逻辑单元号修改为第二逻辑单元号, 得到逻 辑单元号为所述第二逻辑单元号的用于对存储介质排列顺序动态调整的计 算机接口指令, 其中, 所述第一逻辑单元号、 第二逻辑单元号对应于同一 种存储介质, 解决了现有技术中, 不能实现存储介质动态组合的问题, 达 到了可以对存储介质动态组合的效果。
同时, 通过拉低电压, 调整逻辑单元号, 以及恢复电压, 解决了现有 技术中, 不能实现存储介质组合转换的技术问题, 达到了平滑转换存储介 质组合的技术效果。
参见图 7, 为本发明实施例中提供的一种 USB存储介质, 包括: 至少两个独立的存储介质, 具体来讲在本发明实施例中为两个存储介 质, 一个是磁盘设备 703; 另一个是 CDROM 704;
USB协议栈模块 701 , 用于获得计算机操作系统 600发出的第一操作 指令, 所述第一操作指令用于对所述至少两个存储介质中的一个或多个存 储介质或对所述存储功能模块 702进行操作; 还用于对所述第一操作指令 进行处理, 获得第二操作指令;
存储功能模块 702, 与所述 USB协议栈模块 701和所述至少两个存储 介质连接, 用于基于所述第二操作指令, 对所述至少一个存储介质中的一 其中, USB协议栈模块 701 , 具体包括:
指令获耳 4莫块 7011 , 用于获得计算机操作系统发出的第一操作指令, 所述第一操作指令用于对所述至少两个存储介质中的一个或多个存储介质 或对所述存储功能模块 702进行操作; 还包括指令处理模块 7012, 用于对 所述第一操作指令进行处理, 获得第二操作指令。
其中, 存储功能模块 702, 基于所述第二操作指令, 对所述至少一个存 进行操作。
在具体实施过程中, 所述第一操作指令可以是来自计算机操作系统中 的各种操作指令, 在本发明实施例中, 下面将分别以所述第一操作指令为: 加载 /卸载指令;用于对存储介质排列顺序动态调整的计算机接口指令; 或用于实现单个或者多个不同类型存储介质的组合的计算机接口指令为例 子, 详细进行说明。
实施例四:
当所述第一操作指令为加载 /卸载指令时, 所述指令获取模块获取所述 加载 /卸载指令。
所述指令处理模块处理所述加载 /卸载指令, 得到所述第二操作指令为 所述加载 /卸载指令。
所述指令处理模块与存储功能模块 702 中的介质状态位修改模块相连 接, 所述指令处理模块基于所述加载 /卸载指令将所述介质状态标志位的第 一值修改为第二值。 其中, 所述第一值、 第二值用于标识所述存储介质是 处于加载还是卸载状态, 具体来讲, 所述第一值可以是 0, 此时可用 0来表 示所述存储介质在卸载状态; 显然在所述第一值为 0时, 所述第二值为 1 , 此时 1表示所述存储介质在加载状态, 当然, 本发明所属技术领域的技术 人员还可以将所述第一值和第二值设置成其他两个不同的值, 只要通过这 两个值能区分所述存储介质是加载还是卸载状态就可以。
所述存储功能模块 702还包括:
介质状态查询模块与所述 USB 协议栈模块 701 相连接, 用于向所述 USB协议栈模块 701返回查询值, 所述查询值用于表示所述存储功能模块 702对应的存储介质就绪或者未就绪, 在具体实施过程中, 当返回 0时, 代 表所述存储介质处于卸载状态, 当返回 1 时, 代表所处存储介质处于加载 状态。
所述 USB协议栈模块 701基于所述查询值,向所述操作系统返回数值, 其中, 所述数值为第一数值或第二数值, 所述第一数值表示所述存储介质 就绪, 所述第二数值表示所述存储介质未就绪, 在具体实施过程中, 当返 回 0时, 代表所述存储介质处于卸载状态, 当返回 1时, 代表所处存储介 质处于加载状态。
所述存储功能模块 702还包括:
介质详细状态查询指令处理模块, 用于当所述数值为第二数值时, 在 向所述操作系统返回数值后, 接收操作系统下发的存储介质状态查询指令, 向所述操作系统返回消息, 所述消息表明存储介质没有接入。
在具体实施过程中, 所处存储介质状态查询指令可以为 "0x03" , 当然, 也可以为本领域技术人员可以想到的其他指令,所述返回的消息可以为" No Media" , 当然, 也可以为本领域技术人员可以想到的其他指令, 同时, 也 可以根据系统环境的差异, 不设置介质详细状态查询指令处理模块。
本发明的实施例中的技术方案至少实现了如下的技术效果:
本发明实施例的技术方案中, 通过操作指令获得模块, 对 USB协议栈 模块 701上操作系统下发的加载 /卸载指令的获取, 指令处理模块对所述指 令进行处理, 解决了现有技术中, 使用不同类型的存储介质时, 需要对存 储介质进行更换的技术问题, 实现了在所述 USB设备与操作系统连接时, 就能够对存储介质进行加载 /卸载的技术效果。
实施例五:
当所述第一操作指令为用于当所述第一操作指令为用于对存储介质排 列顺序动态调整的计算机接口指令时,所述 USB协议栈模块 701具体包括: 指令获取模块, 用于获取操作系统下发的用于对存储介质排列顺序动 态调整的计算机接口指令;
指令处理模块, 具体包括:
逻辑单元号区分模块, 用于区分所述第二操作指令中的逻辑单元号; 判断模块, 用于当所述第一操作指令为用于对存储介质排列顺序动态 调整的计算机接口指令或用于实现单个或者多个不同类型存储介质的组合 的计算机接口指令时, 判断所述用于对存储介质排列顺序动态调整的计算 机接口指令或用于实现单个或者多个不同类型存储介质的组合的计算机接 口指令中的第一逻辑单元号与所述存储功能模块 702 中的第二逻辑单元号 是否相同, 其中, 所述第一逻辑单元号、 第二逻辑单元号对应于同一种存 储介质;
可选的, 所述指令处理模块还包括:
逻辑单元号修改模块, 用于当所述第一逻辑单元号与所述第二逻辑单 元号不相同时, 将所述用于对存储介质排列顺序动态调整的计算机接口指 令中的第一逻辑单元号修改为第二逻辑单元号, 得到计算机接口指令中的 逻辑单元号为所述第二逻辑单元号的用于对存储介质排列顺序动态调整的 计算机接口指令。
在具体实施过程中, 在存储功能模块 702 中, 存在两种存储介质的逻 辑单元号, 分别为磁盘设备 703和 CDROM704, 将磁盘设备 703的逻辑单 元号设置为 2, 将 CDROM704的逻辑单元号设置为 1 , 所述用于实现单个 或者多个不同类型存储介质的组合的计算机接口指令中, 磁盘设备的逻辑 单元号为 1 , CDROM设备的逻辑单元号为 2。 USB协议栈接收所述用于实 现单个或者多个不同类型存储介质的组合的计算机接口指令后, 逻辑单元 号区分模块识别所述用于实现单个或者多个不同类型存储介质的组合的计 算机接口指令中的逻辑单元号, 确定所述用于实现单个或者多个不同类型 存储介质的组合的计算机接口指令中磁盘设备的逻辑单元号为 1、 CDROM 的逻辑单元号为 2;判断模块判断所述用于实现单个或者多个不同类型存储 介质的组合的计算机接口指令的磁盘设备的逻辑单元号、 CDROM 的逻辑 单元号, 与存储功能模块 702中的磁盘设备 703、 CDROM704的逻辑单元 号不同; 逻辑单元号修改模块则将所述用于实现单个或者多个不同类型存 储介质的组合的计算机接口指令中磁盘设备的逻辑单元号修改为 2, 将 CDROM的逻辑单元号修改为 1。 存储功能模块 702 中包括: 存储介质选择模块, 用于基于所述用于对 存储介质排列顺序动态调整的计算机接口指令中的逻辑单元号, 选择与所 述逻辑单元号对应的存储介质, 据此供所述操作系统进行读或写操作。
还包括: 设备组合转换模块, 用于拉低第一存储介质组合接口上的数 据电压, 移除所述第一存储介质组合使用的端口, 所述第一存储介质组合 是指正在工作的存储介质组合;
调整用于实现单个或者多个不同类型存储介质的组合的计算机接口指 令中的逻辑单元号, 得到对应于第二存储介质组合的逻辑单元号;
恢复计算机接口的电压, 基于所述对应于第二存储介质组合的逻辑单 元号, 建立所述第二存储介质组合与所述操作系统的连接, 进而将所述第 一存储介质组合转换为所述第二存储介质组合。
本发明的实施例中的技术方案至少实现了如下的技术效果:
通过操作指令获得模块, 对 USB协议栈模块 701上操作系统下发的用 于对存储介质排列顺序动态调整的计算机接口指令的获取; 通过判断模块 判断所述用于对存储介质排列顺序动态调整的计算机接口指令中的第一逻 辑单元号与存储功能模块 702 中的第二逻辑单元号是否相同; 通过修改模 块, 在所述第一逻辑单元号与所述第二逻辑单元号不相同时, 将所述用于 对存储介质排列顺序动态调整的计算机接口指令中的第一逻辑单元号修改 为第二逻辑单元号, 得到逻辑单元号为所述第二逻辑单元号的用于对存储 介质排列顺序动态调整的计算机接口指令, 其中, 所述第一逻辑单元号、 第二逻辑单元号对应于同一种存储介质。 解决了现有技术中, 存储介质的 排列顺序固定, 不能动态调整的问题, 达到了可以对存储介质的排列顺序 进行动态调整的效果。
实施例六:
当所述第一操作指令为用于实现单个或者多个不同类型存储介质的组 合的计算机接口指令时:
所述 USB设备中包括的介质数量查询模块, 获取所述操作系统下发的 标准 USB查询指令, 如果所述用于实现单个或者多个不同类型存储介质的 组合的计算机接口指令访问一种存储介质, 则向所述操作系统返回所述 USB设备中只存在一种存储介质的消息, 如果所述用于实现单个或者多个 不同类型存储介质的组合的计算机接口指令访问多种存储介质, 则向所述 操作系统返回所述 USB设备中存在多个存储介质的消息, 本实施例中, 其 余步驟与实施例二相同。
在具体实施过程中, 所述消息可以数字, 可以用 0代表所述 USB设备 中存在一种存储介质, 用 1代表所述 USB设备中存在两种存储介质, 用 2 代表所述 USB设备中存在三种存储介质等, 当然, 也可以用其他方式表示 所述 USB设备中存在的存储介质的数量,下面以用 0代表所述 USB设备中 存在一种存储介质, 用 1代表所述 USB设备中存在两种存储介质来说明。
当操作系统需要访问两种存储介质时, 则接收到操作系统的标准 USB 查询指令后, 向所述操作系统回复 1 , 表示所述 USB设备中存在两种存储 介质; 下面以当操作系统仅需要访问一种存储介质时作为例子说明。 所述 操作系统访问 CDROM704, 且所述用于实现单个或者多个不同类型存储介 质的组合的计算机接口指令中 CDROM704的逻辑单元号为 1与所述存储功 能模块 702中的 CDROM704的逻辑单元号相同,则不对所述用于实现单个 或者多个不同类型存储介质的组合的计算机接口指令做出修改; 所述操作 系统访问磁盘设备 703 ,且所述用于实现单个或者多个不同类型存储介质的 组合的计算机接口指令中,磁盘设备的逻辑单元号为 1 , 与所述存储功能模 块 702 中磁盘设的逻辑单元号不相同, 则将所述用于实现单个或者多个不 同类型存储介质的组合的计算机接口指令中磁盘设备的逻辑单元号修改为 2。 所述 USB设备还包括:
存储介质组合转换模块, 用于:
拉低第一存储介质组合接口上的数据电压, 移除所述第一存储介质组 合使用的端口, 所述第一存储介质组合是指正在工作的存储介质组合; 恢 复计算机接口的电压, 基于所述对应于第二存储介质组合的逻辑单元号, 建立所述第二存储介质组合与所述操作系统的连接, 进而将所述第一存储 介质组合转换为所述第二存储介质组合。
在具体实施过程中, 调整用于实现单个或者多个不同类型存储介质的 组合的计算机接口指令中的逻辑单元号, 得到对应于第二存储介质组合的 逻辑单元号;
在所述存储功能模块 702中,存在两种存储介质, 分别为磁盘设备 703 和 CDROM704, 将磁盘设备 703 的逻辑单元号设置为 2, 将 CDROM704 的逻辑单元号设置为 1 ,所述用于实现单个或者多个不同类型存储介质的组 合的计算机接口指令中, 磁盘设备的逻辑单元号为 1 , CDROM设备的逻辑 单元号为 2; 接收操作系统下发的标准 USB查询指令, 并向所述操作系统 返回 1 , 表示存储功能模块 702中存在两种存储介质; USB协议栈接收所 述用于实现单个或者多个不同类型存储介质的组合的计算机接口指令后, 识别所述用于实现单个或者多个不同类型存储介质的组合的计算机接口指 令中的逻辑单元号, 确定所述用于实现单个或者多个不同类型存储介质的 组合的计算机接口指令中磁盘设备的逻辑单元号为 1、 CDROM的逻辑单元 号为 2,判断所述用于实现单个或者多个不同类型存储介质的组合的计算机 接口指令的磁盘设备的逻辑单元号、 CDROM 的逻辑单元号, 与存储功能 模块 702中的磁盘设备 703、 CDROM704的逻辑单元号不同, 则将所述用 于实现单个或者多个不同类型存储介质的组合的计算机接口指令中磁盘设 备的逻辑单元号修改为 2, 将 CDROM的逻辑单元号修改为 1。 本实施例中的技术方案至少实现了一下的技术效果:
通过操作指令获得模块对 USB协议栈模块 701上操作系统下发的转换 所述存储介质组合的指令, 通过数据交互中断模块断开存储介质组合与操 作系统的连接, 通过指令修改模块修改用于实现单个或者多个不同类型存 储介质的组合的计算机接口指令中的逻辑单元号。
同时, 通过存储介质转换模块, 拉低电压, 调整逻辑单元号, 以及恢 复电压, 解决了现有技术中, 不能实现存储介质组合转换的技术问题, 达 到了平滑转换存储介质组合的技术效果。
尽管已描述了本发明的优选实施例, 但本领域内的技术人员一旦得知 了基本创造性概念, 则可对这些实施例作出另外的变更和修改。 所以, 所 附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和 修改。
以上所述, 仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围。

Claims

权利要求书
1、 一种处理来自计算机的操作指令的方法, 应用于通信接口设备中, 该设备包括与计算机连接的通信接口协议栈模块, 及与所述通信接口协议 栈模块连接的至少一个存储功能模块; 所述方法包括:
通过所述通信接口协议栈模块, 接收所述计算机的操作系统发出的第 一操作指令; 所述第一操作指令用于对所述至少一个存储功能模块中的一 个或多个存储功能模块单元进行操作;
对所述第一操作指令进行处理, 获得第二操作指令;
基于所述第二操作指令, 对所述至少一个存储功能模块中的一个或多 个存储功能模块单元的存储介质状态位进行操作。
2、 如权利要求 1所述的方法, 其中, 当所述第一操作指令为加载 /卸载 指令时, 所述第二操作指令为所述加载 /卸载指令。
3、 如权利要求 2所述的方法, 其中, 基于所述第二操作指令进行操作 的过程包括:
基于所述加载 /卸载指令, 将所述至少一个存储功能模块中每个存储功 能模块单元的介质状态标志位的第一值修改为第二值。
4、 如权利要求 3所述的方法, 其中, 修改所述介质状态标志位的第一 值之后, 该方法还包括:
所述存储功能模块接收所述操作系统下发的查询指令, 所述查询指令 用于查询所述存储功能模块单元对应的存储介质是否就绪;
所述存储功能模块单元基于所述质状态标志位的第二值, 向通信接口 协议栈返回查询值; 所述查询值用于表示所述存储功能模块单元对应的存 储介质是否就绪;
基于所述查询值, 通信接口协议栈向所述操作系统返回数值, 该数值 为第一数值或第二数值, 所述第一数值表示存储介质就绪, 所述第二数值 表示存储介质未就绪。
5、 如权利要求 4所述的方法, 其中, 所述数值为第二数值时, 向所述 操作系统返回数值后, 该方法还包括:
接收操作系统下发的存储介质状态查询指令, 向所述操作系统返回消 息, 该消息表明存储介质没有接入。
6、 如权利要求 1至 5任一项所述的方法, 其中, 当所述第一操作指令 为用于对存储设备排列顺序动态调整的计算机接口指令时, 对所述第一操 作指令进行处理, 获得第二操作指令的过程包括:
当所述计算机接口指令中的第一逻辑单元号与所述存储功能模块中的 第二逻辑单元号相同时, 通过所述通信接口协议栈模块, 使所述第二操作 指令为所述计算机接口指令; 其中, 所述第一逻辑单元号、 第二逻辑单元 号对应于同一种存储介质;
当所述计算机接口指令中的第一逻辑单元号与所述存储功能模块中的 第二逻辑单元号不相同时, 通过所述通信接口协议栈模块, 将所述计算机 接口指令中的第一逻辑单元号修改为第二逻辑单元号, 得到逻辑单元号为 所述第二逻辑单元号的计算机接口指令; 其中, 所述第一逻辑单元号、 第 二逻辑单元号对应于同一种存储介质。
7、 如权利要求 6所述的方法, 其中, 基于所述第二操作指令进行操作 的过程包括:
基于所述计算机接口指令中的逻辑单元号, 选择与所述逻辑单元号对 应的存储介质, 据此供所述操作系统进行读或写操作。
8、 如权利要求 1至 5任一项所述的方法, 其中, 当所述第一操作指令 为用于实现单个或者多个不同类型存储设备的组合的计算机接口指令时, 在接收所述计算机的操作系统发出的第一操作指令之前, 该方法还包括: 获取所述操作系统下发的标准通信接口查询指令, 如果所述计算机接 口指令访问一种存储介质, 则向所述操作系统返回所述通信接口设备中只 存在一种存储介质的消息; 如果所述计算机接口指令访问多种存储介质, 则向所述操作系统返回所述通信接口设备中存在多个存储介质的消息。
9、 如权利要求 1至 5任一项所述的方法, 其中, 当所述第一操作指令 为转换存储设备组合的指令时, 基于所述第二操作指令进行操作之后, 该 方法还包括:
基于转换存储设备组合的所述指令, 拉低由存储介质组成的第一存储 设备组合的接口上的电压, 移除所述第一存储设备组合使用的端口; 所述 第一存储设备组合是指正在工作的存储设备组合;
调整用于实现单个或者多个不同类型存储设备的组合的计算机接口指 令中的逻辑单元号, 得到逻辑单元号对应于由存储介质组成的第二存储设 备组合的用于转换所述存储设备组合的指令;
恢复计算机接口的电压, 并基于对应于第二存储设备组合的逻辑单元 号, 建立所述第二存储设备组合与所述操作系统的连接, 进而将所述第一 存储设备组合转换为所述第二存储设备组合。
10、 一种通信接口设备, 包括至少两个独立的存储介质, 以及, 通信接口协议栈模块, 用于获得计算机操作系统发出的第一操作指令, 所述第一操作指令用于对所述至少两个存储功能模块中的一个或多个存储 功能模块单元进行操作; 还用于对所述第一操作指令进行处理, 获得第二 操作指令;
存储功能模块, 与所述通信接口协议栈模块和所述至少两个存储介质 连接, 用于基于所述第二操作指令, 对所述至少一个存储介质中的一个或
11、 如权利要求 10 所述的设备, 其中, 当所述第一操作指令为加载 / 卸载指令时, 所述第二操作指令为所述加载 /卸载指令。
12、 如权利要求 11所述的设备, 其中, 所述存储功能模块基于所述第 二操作指令进行操作时, 用于:
基于所述加载 /卸载指令, 将所述至少一个存储功能模块中每个存储功 能模块单元的介质状态标志位的第一值修改为第二值。
13、 权利要求 12所述的设备, 其中, 所述存储功能模块修改所述介质 状态标志位的第一值之后, 还用于:
接收所述操作系统下发的查询指令, 所述查询指令用于查询所述存储 功能模块单元对应的存储介质是否就绪;
基于所述质状态标志位的第二值, 向通信接口协议栈返回查询值; 所 述查询值用于表示所述存储功能模块对应的存储介质是否就绪;
以及, 基于所述查询值, 触发通信接口协议栈向所述操作系统返回数 值, 该数值为第一数值或第二数值, 所述第一数值表示存储介质就绪, 所 述第二数值表示存储介质未就绪。
14、如权利要求 13所述的设备,其中,还包括介质详细状态查询模块; 其中,
当所述数据为第二数据时, 在所述通信接口协议栈向所述操作系统返 回所述数据后, 所述介质详细状态查询模块, 用于: 接收操作系统下发的 存储介质状态查询指令, 向所述操作系统返回消息, 该消息表明存储介质 没有接入。
15、 如权利要求 10至 14任一项所述的设备, 其中, 所述通信接口协 议栈包括逻辑单元号修改模块; 当所述第一操作指令为用于对存储设备排 列顺序动态调整的计算机接口指令时, 对所述第一操作指令进行处理, 获 得第二操作指令时, 用于:
当所述计算机接口指令中的第一逻辑单元号与所述存储功能模块中的 第二逻辑单元号相同时, 通过所述通信接口协议栈模块, 使所述第二操作 指令为所述计算机接口指令; 其中, 所述第一逻辑单元号、 第二逻辑单元 号对应于同一种存储介质;
当所述计算机接口指令中的第一逻辑单元号与所述存储功能模块中的 第二逻辑单元号不相同时, 通过所述通信接口协议栈模块, 将所述计算机 接口指令中的第一逻辑单元号修改为第二逻辑单元号, 得到逻辑单元号为 所述第二逻辑单元号的计算机接口指令。
16、 如权利要求 10至 14任一项所述的设备, 其中, 所述存储功能模 块基于所述第二操作指令进行操作时, 用于:
基于所述计算机接口指令中的逻辑单元号, 选择与所述逻辑单元号对 应的存储介质, 据此供所述操作系统进行读或写操作。
17、 如权利要求 16所述的设备, 其中, 还包括:
数量查询模块, 用于当所述第一操作指令为实现单个或者多个不同类 型存储设备的组合的计算机接口指令时, 在所述接收所述计算机的操作系 统发出的第一操作指令之前, 获取所述操作系统下发的标准通信接口查询 指令, 如果所述计算机接口指令访问一种存储介质, 则向所述操作系统返 回所述通信接口设备中只存在一种存储介质的消息; 如果所述计算机接口 指令访问多种存储介质, 则向所述操作系统返回所述通信接口设备中存在 多个存储介质的消息。
18、 如权利要求 10至 14任一项所述的设备, 其中, 还包括存储设备 组合转换模块, 用于在所述存储功能模块基于所述第二操作指令进行操作 之后, 转换所述存储设备组合。
19、 如权利要求 18所述的设备, 其中, 还包括:
转换命令接收模块, 用于接收所述操作系统下发的转换所述存储设备 组合的指令;
数据交互中断模块, 用于基于所述转换所述存储设备组合的指令, 拉 低由存储介质组成的第一存储设备组合的接口上的数据电压, 移除所述第 一存储设备组合使用的端口; 所述第一存储设备组合是指正在工作的存储 设备组合;
指令修改模块, 调整用于实现单个或者多个不同类型存储设备的组合 的计算机接口指令中的逻辑单元号, 得到对应于由存储介质组成的第二存 储设备组合的逻辑单元号;
电压恢复模块, 用于基于转换所述存储设备组合的指令, 恢复计算机 接口的电压, 并基于对应于第二存储设备组合的逻辑单元号, 建立所述第 二存储设备组合与所述操作系统的连接, 进而将所述第一存储设备组合转 换为所述第二存储设备组合。
PCT/CN2012/070152 2011-10-24 2012-01-09 一种处理来自计算机的操作指令的方法和接口设备 WO2012152075A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110325271.0 2011-10-24
CN201110325271.0A CN102360279B (zh) 2011-10-24 2011-10-24 一种处理来自计算机的操作指令的方法和一种接口设备

Publications (1)

Publication Number Publication Date
WO2012152075A1 true WO2012152075A1 (zh) 2012-11-15

Family

ID=45585613

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/070152 WO2012152075A1 (zh) 2011-10-24 2012-01-09 一种处理来自计算机的操作指令的方法和接口设备

Country Status (2)

Country Link
CN (1) CN102360279B (zh)
WO (1) WO2012152075A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102360279B (zh) * 2011-10-24 2017-08-25 南京中兴软件有限责任公司 一种处理来自计算机的操作指令的方法和一种接口设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1938670A (zh) * 2004-02-04 2007-03-28 桑迪士克股份有限公司 双媒体存储装置
CN101385004A (zh) * 2006-02-14 2009-03-11 特科2000国际有限公司 使用两种类型的存储介质的数据存储装置
CN101893999A (zh) * 2010-06-08 2010-11-24 孟智平 一种将存储设备虚拟划分为多个设备的系统
CN102360279A (zh) * 2011-10-24 2012-02-22 中兴通讯股份有限公司 一种处理来自计算机的操作指令的方法和一种接口设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1938670A (zh) * 2004-02-04 2007-03-28 桑迪士克股份有限公司 双媒体存储装置
CN101385004A (zh) * 2006-02-14 2009-03-11 特科2000国际有限公司 使用两种类型的存储介质的数据存储装置
CN101893999A (zh) * 2010-06-08 2010-11-24 孟智平 一种将存储设备虚拟划分为多个设备的系统
CN102360279A (zh) * 2011-10-24 2012-02-22 中兴通讯股份有限公司 一种处理来自计算机的操作指令的方法和一种接口设备

Also Published As

Publication number Publication date
CN102360279A (zh) 2012-02-22
CN102360279B (zh) 2017-08-25

Similar Documents

Publication Publication Date Title
US7958299B2 (en) Hard disk system state monitoring method
CN102750238B (zh) 存储器管理系统以及管理存储器的方法
CN105204969B (zh) 异常日志处理方法以及异常日志处理装置
TW200846920A (en) Interfacing an external attachment device to a computing device
TW200929258A (en) A storage device coordinator and a host device that includes the same
US20170220506A1 (en) Modular Software Defined Storage Technology
CN107092835B (zh) 一种虚拟存储盘的计算机数据加密装置及方法
CN104407933A (zh) 一种数据的备份方法及装置
US20090327295A1 (en) Maintenance of exo-file system metadata on removable storage device
US20150160886A1 (en) METHOD AND SYSTEM FOR PROGRAMMABLE SEQUENCER FOR PROCESSING I/O FOR VARIOUS PCIe DISK DRIVES
CN103984662A (zh) 一种读、写数据的方法及设备、存储系统
US7409477B2 (en) Memory card having a processor coupled between host interface and second interface wherein internal storage code provides a generic interface between host interface and processor
US20040054827A1 (en) Large volume storage device with a memory card adapting interface
JP2007035024A (ja) ローカルユーザ装置との接続を有するネットワーク接続ストレージ装置
CN114185826A (zh) 一种用于外接存储设备的接口适配器
WO2008134973A1 (fr) Procédé d'exploitation d'un équipement périphérique, équipement périphérique et hôte
WO2012152075A1 (zh) 一种处理来自计算机的操作指令的方法和接口设备
US10645166B2 (en) Network interface card
CN201654772U (zh) 一种存储介质接口转换装置
US7831741B2 (en) Indexing device and method for data storage system
CN115543185A (zh) 数据存储管理方法及系统、装置、计算机可读存储介质
US8856389B1 (en) Efficient data transfers over serial data streams
US20150301764A1 (en) Hard Disk and Methods for Forwarding and Acquiring Data by Hard Disk
CN107590049B (zh) 基于独立运行模式的数据处理方法及客户端
US20060106752A1 (en) Apparatus and method to provide an operation to an information storage device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12782632

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12782632

Country of ref document: EP

Kind code of ref document: A1