CN109597775A - A kind of method and device using USB device - Google Patents

A kind of method and device using USB device Download PDF

Info

Publication number
CN109597775A
CN109597775A CN201811509270.XA CN201811509270A CN109597775A CN 109597775 A CN109597775 A CN 109597775A CN 201811509270 A CN201811509270 A CN 201811509270A CN 109597775 A CN109597775 A CN 109597775A
Authority
CN
China
Prior art keywords
usb device
data packet
detection data
host
console
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811509270.XA
Other languages
Chinese (zh)
Inventor
蒋晨晓
钱兵
刘洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201811509270.XA priority Critical patent/CN109597775A/en
Publication of CN109597775A publication Critical patent/CN109597775A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)

Abstract

The invention discloses a kind of methods using USB device, comprising: establishes and is connected to the network with the host where virtual machine;After the event for detecting insertion USB device, the related data packets that the USB device drives are sent to the host by installation USB device driving;The first detection data packet is sent to the host, after receiving the second detection data packet that the host returns, the second detection data packet is parsed and calls the USB device.Also disclose a kind of device using USB device.The USB device plug and play in virtual machine may be implemented in the method for the embodiment of the present invention, replace USB device as needed at any time, without removing the main hands- operation USB device of computer room every time, solve many restrictions of traditional application method, and simplify the operation and use of administrator.

Description

A kind of method and device using USB device
Technical field
The present invention relates to field of computer technology, espespecially a kind of method and device using USB device.
Background technique
USB (Universal Serial Bus, universal serial bus) is an external bus standard, is used for specification computer With being connected and communicate with for external equipment.USB is the interfacing applied in the field PC.As USB interface technology is sent out from 1.0 versions Open up 3.1 current versions, due to the popularity of its holding equipment type, transmission speed rapidity, and externally standby plug and play, The good support of warm connection function.Currently, in addition to the picture video card high data volume of this needs and some requirement of real-time are especially high Control equipment, almost all of PC peripheral hardware can be transplanted on USB, as USB device carry out using.
With the fast development and deployment of public cloud and private clound in enterprise, much more enterprise data centers can be incited somebody to action The practical business of oneself is deployed on virtual platform, and the diversity of different business events has a large amount of different USB devices Use demand.The application method of traditional USB device generally can carry out transparent transmission setting or USB to the USB port on host Network share equipment.But traditional application method has many restrictions, USB port transparent transmission is needed to restart physical host, be will affect The production environment of client also loses the characteristic of USB device plug and play;Secondly in virtual platform, virtual machine is often Because certain reason is migrated, need to reset USB port transparent transmission after migration;USB network shared device, It needs to put into additional hardware, improves customer using cost;All USB plugs require to be operated in computer room every time.
Summary of the invention
In order to solve the above-mentioned technical problems, the present invention provides a kind of method and devices using USB device, can be realized The USB device plug and play in virtual machine.
In order to reach the object of the invention, the present invention provides a kind of methods using USB device, comprising:
It establishes and is connected to the network with the host where virtual machine;
After the event for detecting insertion USB device, installation USB device driving, the related data that the USB device is driven Packet is sent to the host;
The first detection data packet is sent to the host, after receiving the second detection data packet that the host returns, solution It analyses the second detection data packet and calls the USB device.
Further, the parsing the second detection data packet and after calling the USB device, further includes:
After detecting the event for pulling out the USB device, the USB device driving is deleted, and pull out to host transmission Except the message of the USB device.
A kind of device using USB device, comprising: memory and processor;Wherein:
The memory, for saving the program being used for using USB device;
The processor executes the program for using USB device for reading, performs the following operations:
It establishes and is connected to the network with the host where virtual machine;
After the event for detecting insertion USB device, installation USB device driving, the related data that the USB device is driven Packet is sent to the host;
The first detection data packet is sent to the host, after receiving the second detection data packet that the host returns, solution It analyses the second detection data packet and calls the USB device.
Further, the parsing the second detection data packet and after calling the USB device, further includes:
After detecting the event for pulling out the USB device, the USB device driving is deleted, and pull out to host transmission Except the message of the USB device.
A method of using USB device, comprising:
It establishes and is connected to the network with console;
After the related data packets for receiving the USB device driving that the console is sent, installation USB device driving, virtually A virtual USB device out, and carry gives a designated virtual machine;
After receiving the first detection data packet of the console transmission, Xiang Suoshu console returns to the second detection data packet.
Further, after the second detection data packet of return to the console, further includes:
After receiving the message for pulling out the USB device that the console is sent, the USB device driving and institute are deleted State virtual USB device.
A kind of device using USB device, comprising: memory and processor;Wherein:
The memory, for saving the program being used for using USB device;
The processor executes the program for using USB device for reading, performs the following operations:
It establishes and is connected to the network with console;
After the related data packets for receiving the USB device driving that the console is sent, installation USB device driving, virtually A virtual USB device out, and carry gives a designated virtual machine;
After receiving the first detection data packet of the console transmission, Xiang Suoshu console returns to the second detection data packet.
Further, after Xiang Suoshu console returns to the second detection data packet, further includes:
After receiving the message for pulling out the USB device that the console is sent, the USB device driving and institute are deleted State virtual USB device.
The USB device plug and play in virtual machine may be implemented in the method for the embodiment of the present invention, at any time replacement as needed USB device solves many restrictions of traditional application method, and simplify without removing the main hands- operation USB device of computer room every time The operation and use of administrator.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by specification, right Specifically noted structure is achieved and obtained in claim and attached drawing.
Detailed description of the invention
Attached drawing is used to provide to further understand technical solution of the present invention, and constitutes part of specification, with this The embodiment of application technical solution for explaining the present invention together, does not constitute the limitation to technical solution of the present invention.
Fig. 1 is the flow chart that the console side of the embodiment of the present invention uses the method for USB device;
Fig. 2 is that host computer side uses the flow chart of the method for USB device where the virtual machine of the embodiment of the present invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application Feature can mutual any combination.
Step shown in the flowchart of the accompanying drawings can be in a computer system such as a set of computer executable instructions It executes.Also, although logical order is shown in flow charts, and it in some cases, can be to be different from herein suitable Sequence executes shown or described step.
Fig. 1 is the flow chart that the console side of the embodiment of the present invention uses the method for USB device, as shown in Figure 1, this implementation Example method include:
Host where step 101, console and virtual machine establishes network connection;
After step 102, console detect the event of insertion USB device, installation USB device driving, by the USB device The related data packets of driving are sent to the host;
Step 103, console send the first detection data packet to the host, receive the second inspection that the host returns After measured data packet, parses the second detection data packet and call the USB device.
The method of the present embodiment allows virtual machine available and using the USB device on administrator's console.The method The USB device plug and play in virtual machine may be implemented, USB device is replaced as needed at any time, without removing computer room host every time Upper operation USB device, solves many restrictions of traditional application method, and simplifies the operation and use of administrator.
Correspondingly, the embodiment of the invention also provides a kind of device using USB device, such as console, the present embodiment Device may include: memory and processor, wherein
The memory, for saving the program being used for using USB device;
The processor executes the program for using USB device for reading, performs the following operations:
It establishes and is connected to the network with the host where virtual machine;
After the event for detecting insertion USB device, installation USB device driving, the related data that the USB device is driven Packet is sent to the host;
The first detection data packet is sent to the host, after receiving the second detection data packet that the host returns, solution It analyses the second detection data packet and calls the USB device.
Fig. 2 is flow chart of the host computer side where the virtual machine of the embodiment of the present invention using the method for USB device, such as Fig. 2 institute Show, the method for the present embodiment includes:
Host where step 201, virtual machine and console, which are established, to be connected to the network;
Host where step 202, virtual machine receives the related data packets for the USB device driving that the console is sent Afterwards, installation USB device driving fictionalizes a virtual USB device, and carry gives a designated virtual machine;
After host where step 203, virtual machine receives the first detection data packet of the console transmission, to the control Platform returns to the second detection data packet.
The method of the present embodiment allows virtual machine available and using the USB device on administrator's console.The method The USB device plug and play in virtual machine may be implemented, USB device is replaced as needed at any time, without removing computer room host every time Upper operation USB device, solves many restrictions of traditional application method, and simplifies the operation and use of administrator.
Correspondingly, a kind of device using USB device, such as the host where virtual machine are additionally provided, the present embodiment Device may include: memory and processor, wherein
The memory, for saving the program being used for using USB device;
The processor executes the program for using USB device for reading, performs the following operations:
It establishes and is connected to the network with console;
After the related data packets for receiving the USB device driving that the console is sent, installation USB device driving, virtually A virtual USB device out, and carry gives a designated virtual machine;
After receiving the first detection data packet of the console transmission, Xiang Suoshu console returns to the second detection data packet.
In one embodiment, premise designs: one USB driving of design.Here USB driving can be divided into front-end and back-end Two parts are driven, front-end driven is mounted on administrator's console, can be identified the USB device on installation PC first, then may be used To realize the communication between the driving of front and back end;Where rear end driving is mounted on virtual machine on host, front and back end driving may be implemented Between communication, while realizing a vUSB equipment, virtual machine can identify the vUSB equipment and normal use, may include with Lower step:
Step 301: the connectivity of detection management person's console to network between the host of virtual machine place, if network is not Logical, the method terminates;
Step 302: the USB device on detection management person's console installs front-end driven, if USB driving can not be correct Installation, the method terminate;
Step 303: being driven installing rear end where virtual machine on host, if driving can not be installed correctly, the method is whole Only;
Step 304: rear end driving fictionalizes a vUSB equipment and carry is used to virtual machine, and virtual machine can positive common sense Not and the vUSB equipment is used, otherwise the method terminates;
Step 305: sending detection data packet to rear end from front-end driven and drive, rear end driving is forwarded to vUSB after receiving and sets Standby, virtual machine can be properly received and parse data by vUSB, if being unable to properly receive and parsing data, the method is whole Only;
Step 306: being driven from rear end and send detection data packet to front-end driven, front-end driven is transmitted to management control after receiving Platform processed, management console is properly received parsing data and calls physical USB device, if being unable to properly receive and parsing data, The method terminates;
Step 307: after the completion of detection data packet, virtual machine can be with the physics of carry on normal call administrator's console USB device;
Step 308: when pulling out physical USB device, while front-end driven is deleted, rear end driving, vUSB equipment.
The method of the embodiment of the present invention can be realized virtual machine using USB device, allows virtual machine available and uses USB device on administrator's console.The method solves many restrictions of conventional method, can under the premise of not adding hardware To realize the USB device plug and play in virtual machine, USB device is replaced as needed at any time, without being gone on computer room host every time USB device is operated, the operation and use of administrator are simplified.
The embodiment of the invention also provides a kind of computer readable storage mediums, are stored with computer executable instructions, The computer executable instructions, which are performed, realizes the method using USB device.
It will appreciated by the skilled person that whole or certain steps, system, dress in method disclosed hereinabove Functional module/unit in setting may be implemented as software, firmware, hardware and its combination appropriate.In hardware embodiment, Division between the functional module/unit referred in the above description not necessarily corresponds to the division of physical assemblies;For example, one Physical assemblies can have multiple functions or a function or step and can be executed by several physical assemblies cooperations.Certain groups Part or all components may be implemented as by processor, such as the software that digital signal processor or microprocessor execute, or by It is embodied as hardware, or is implemented as integrated circuit, such as specific integrated circuit.Such software can be distributed in computer-readable On medium, computer-readable medium may include computer storage medium (or non-transitory medium) and communication media (or temporarily Property medium).As known to a person of ordinary skill in the art, term computer storage medium is included in for storing information (such as Computer readable instructions, data structure, program module or other data) any method or technique in the volatibility implemented and non- Volatibility, removable and nonremovable medium.Computer storage medium include but is not limited to RAM, ROM, EEPROM, flash memory or its His memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storages, magnetic holder, tape, disk storage or other Magnetic memory apparatus or any other medium that can be used for storing desired information and can be accessed by a computer.This Outside, known to a person of ordinary skill in the art to be, communication media generally comprises computer readable instructions, data structure, program mould Other data in the modulated data signal of block or such as carrier wave or other transmission mechanisms etc, and may include any information Delivery media.

Claims (8)

1. a kind of method using USB device characterized by comprising
It establishes and is connected to the network with the host where virtual machine;
After the event for detecting insertion USB device, installation USB device driving, the related data packets that the USB device is driven are sent out Give the host;
The first detection data packet is sent to the host, after receiving the second detection data packet that the host returns, parses institute It states the second detection data packet and calls the USB device.
2. the method according to claim 1, wherein described in the parsing the second detection data packet and calling After USB device, further includes:
After detecting the event for pulling out the USB device, the USB device driving is deleted, and pull out institute to host transmission State the message of USB device.
3. a kind of device using USB device, comprising: memory and processor;It is characterized by:
The memory, for saving the program being used for using USB device;
The processor executes the program for using USB device for reading, performs the following operations:
It establishes and is connected to the network with the host where virtual machine;
After the event for detecting insertion USB device, installation USB device driving, the related data packets that the USB device is driven are sent out Give the host;
The first detection data packet is sent to the host, after receiving the second detection data packet that the host returns, parses institute It states the second detection data packet and calls the USB device.
4. device according to claim 3, which is characterized in that described to parse described in the second detection data packet and calling After USB device, further includes:
After detecting the event for pulling out the USB device, the USB device driving is deleted, and pull out institute to host transmission State the message of USB device.
5. a kind of method using USB device characterized by comprising
It establishes and is connected to the network with console;
After the related data packets for receiving the USB device driving that the console is sent, installation USB device driving fictionalizes one Platform virtual USB device, and carry gives a designated virtual machine;
After receiving the first detection data packet of the console transmission, Xiang Suoshu console returns to the second detection data packet.
6. according to the method described in claim 5, it is characterized in that, described return to the second detection data packet to the console Afterwards, further includes:
After receiving the message for pulling out the USB device that the console is sent, the USB device driving and the void are deleted Quasi- USB device.
7. a kind of device using USB device, comprising: memory and processor;It is characterized by:
The memory, for saving the program being used for using USB device;
The processor executes the program for using USB device for reading, performs the following operations:
It establishes and is connected to the network with console;
After the related data packets for receiving the USB device driving that the console is sent, installation USB device driving fictionalizes one Platform virtual USB device, and carry gives a designated virtual machine;
After receiving the first detection data packet of the console transmission, Xiang Suoshu console returns to the second detection data packet.
8. device according to claim 7, which is characterized in that after Xiang Suoshu console returns to the second detection data packet, also Include:
After receiving the message for pulling out the USB device that the console is sent, the USB device driving and the void are deleted Quasi- USB device.
CN201811509270.XA 2018-12-11 2018-12-11 A kind of method and device using USB device Pending CN109597775A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811509270.XA CN109597775A (en) 2018-12-11 2018-12-11 A kind of method and device using USB device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811509270.XA CN109597775A (en) 2018-12-11 2018-12-11 A kind of method and device using USB device

Publications (1)

Publication Number Publication Date
CN109597775A true CN109597775A (en) 2019-04-09

Family

ID=65960769

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811509270.XA Pending CN109597775A (en) 2018-12-11 2018-12-11 A kind of method and device using USB device

Country Status (1)

Country Link
CN (1) CN109597775A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523264A (en) * 2011-12-06 2012-06-27 北京航空航天大学 USB (Universal Serial Bus) equipment remote sharing method and system for virtual machine
CN104317759A (en) * 2014-10-15 2015-01-28 国云科技股份有限公司 Method for supporting hot plugging of virtual machine USB (universal serial bus) storage equipment
CN107357743A (en) * 2017-07-28 2017-11-17 郑州云海信息技术有限公司 A kind of method and device for controlling USB device
CN107943560A (en) * 2017-11-27 2018-04-20 郑州云海信息技术有限公司 The hanging method and carry device of a kind of universal serial bus device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523264A (en) * 2011-12-06 2012-06-27 北京航空航天大学 USB (Universal Serial Bus) equipment remote sharing method and system for virtual machine
CN104317759A (en) * 2014-10-15 2015-01-28 国云科技股份有限公司 Method for supporting hot plugging of virtual machine USB (universal serial bus) storage equipment
CN107357743A (en) * 2017-07-28 2017-11-17 郑州云海信息技术有限公司 A kind of method and device for controlling USB device
CN107943560A (en) * 2017-11-27 2018-04-20 郑州云海信息技术有限公司 The hanging method and carry device of a kind of universal serial bus device

Similar Documents

Publication Publication Date Title
US10986171B2 (en) Method for unified communication of server, baseboard management controller, and server
CN104954451B (en) The access control method of USB device under a kind of virtualized environment
EP2566286B1 (en) Wireless Internet Access Module, Communication Method for Host and Wireless Internet Access Module, and Data Card
CN106933753B (en) Control method and device of intelligent interface card
CN109358951B (en) SPICE protocol-based display method for intelligently supporting direct connection of display cards and virtual display cards
KR20140021677A (en) Method and apparatus for remote delivery of managed usb services via a mobile computing device
CN101493786B (en) Computer virtual machine system and equipment accessing method
CN109525515B (en) Management method and device for network card in cloud platform
US10499311B2 (en) Method and apparatus for implementing network sharing
CN107526616B (en) Method and device for writing and reading data of BMC by host
WO2016202102A1 (en) Message transmission method and device
CN107357743A (en) A kind of method and device for controlling USB device
CN107193521B (en) Data processing method, device and system
CN110069288B (en) USB equipment sharing method, device and system
WO2017177892A1 (en) Installation of operating system
CN106164871A (en) Aircraft is taken photo by plane data back up method, device, computer-readable recording medium and equipment
US20170078388A1 (en) Browser-based virtual media administration
CN110347474A (en) A kind of method and device managing virtual machine
US20210334229A1 (en) File transfer method, apparatus, device between bmcs and storage medium
CN109597775A (en) A kind of method and device using USB device
WO2012126214A1 (en) Mobile broadband device and use method thereof
CN111092765B (en) Intelligent driving method, system, electronic device and readable storage medium
CN114675932A (en) System and method for safely mounting distributed file system
EP3322130B1 (en) Communications device configuration method and communications device
US9390041B2 (en) Method for processing device connection, combination device and host device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190409

RJ01 Rejection of invention patent application after publication