WO2017185954A1 - Method, host, and system for implementing usb device management - Google Patents

Method, host, and system for implementing usb device management Download PDF

Info

Publication number
WO2017185954A1
WO2017185954A1 PCT/CN2017/079456 CN2017079456W WO2017185954A1 WO 2017185954 A1 WO2017185954 A1 WO 2017185954A1 CN 2017079456 W CN2017079456 W CN 2017079456W WO 2017185954 A1 WO2017185954 A1 WO 2017185954A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
usb device
virtual machine
usb
host
Prior art date
Application number
PCT/CN2017/079456
Other languages
French (fr)
Chinese (zh)
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 WO2017185954A1 publication Critical patent/WO2017185954A1/en

Links

Images

Classifications

    • 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
    • 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
    • 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

Definitions

  • This document relates to, but is not limited to, the field of computer technology, and in particular, to a method, a host and a system for implementing USB device management.
  • Virtual machine technology was proposed in the 1960s and 1970s. It is a simulation simulation of hardware devices. The proposal of virtual machine technology provides more implementation methods for users to share resources and access each other between different terminals.
  • USB flash drive USB flash drive
  • USB flash drive USB flash drive
  • USB redirection technology is required to insert the user.
  • the U disk on the terminal is redirected to the virtual machine, so that the user can directly read and write the file on the U disk on the virtual machine.
  • the main problems of this technology are: complicated steps, cumbersome command execution, error-prone, and when a virtual machine is required to read and write to multiple remote USB devices, a pair of each USB device is required to be cumbersome. USB redirection, which greatly increases the management time and management complexity of USB devices in a virtual environment.
  • USB device management is time consuming and complicated.
  • the embodiments of the present invention provide a method, a host, and a system for implementing USB device management, which can simplify the process of managing a USB disk.
  • An embodiment of the present invention provides a method for implementing USB device management, including:
  • the USB device is managed according to the management information.
  • the management information includes a mounting indication and an uninstallation indication
  • managing the USB device according to the management information includes: writing the device information into the configuration file of the virtual machine according to the mount indication, so that the virtual machine simulates the device according to the device information in the configuration file.
  • a virtual USB device a USB device is mounted on a virtual machine;
  • managing the USB device according to the management information includes: deleting the device information from the configuration file of the virtual machine according to the uninstallation instruction, or deleting the virtual USB device simulated according to the device information from the virtual machine.
  • the management information further includes: deleting the indication; managing the USB device according to the management information, including: determining, according to the deletion indication, whether the USB device is mounted on the virtual machine, if it is determined that the USB device is mounted to the virtual device On the machine, the USB device is uninstalled from the virtual machine.
  • the method further includes: determining, when the USB device on the virtual machine is abnormal, the USB device that is removed from the terminal according to the device information of the USB device on the virtual machine and the device information of the USB device on the terminal, Unmount the removed USB device from the virtual machine.
  • the device information includes a USB device name uniformly generated by the terminal.
  • the USB device name is uniformly generated by the USB server on the terminal, and is forwarded by the USB server to the USB client through a communication link established with the USB client of the host.
  • the device information includes: identifier information configured to uniquely identify the USB device.
  • the identification information includes: a manufacturer, a product number, a bus, a port, and an agreement (IP) for interconnection between the source networks.
  • IP agreement
  • determining, according to the device information and the virtual machine information, the management information of the USB device includes: receiving management information determined by the external virtualization center according to the device information and the virtual machine information.
  • the embodiment of the invention further provides a host for implementing USB device management, comprising: a first obtaining module, a second acquiring module, a determining module and a management module;
  • the first obtaining module is configured to: acquire device information of the USB device on the terminal by using a communication link established with the terminal;
  • the second obtaining module is configured to: obtain virtual machine information on the host;
  • the determining module is configured to: determine management information of the USB device according to the device information and the virtual machine information;
  • the management module is set to: manage the USB device according to the management information.
  • the management information includes a mounting indication or an uninstallation indication;
  • the management module includes a mounting unit and an unloading unit;
  • the mount unit is configured to: according to the mount indication, write the device information into the configuration file of the virtual machine, so that the virtual machine simulates the virtual USB device according to the device information in the configuration file; a USB device is mounted on a virtual machine. on;
  • the uninstallation unit is configured to: delete the device information from the configuration file of the virtual machine according to the uninstallation instruction, or delete the virtual USB device simulated according to the device information from the virtual machine.
  • the management information further includes a deletion indication.
  • the management module further includes a deleting unit, configured to determine, according to the deletion indication, whether the USB device is mounted on the virtual machine, if it is determined that the USB device is mounted to the virtual machine. On, the USB device is uninstalled from the virtual machine.
  • the exception processing module is further configured to: when the USB device on the virtual machine is abnormal, determine the USB removed from the terminal according to the device information of the USB device on the virtual machine and the device information of the USB device on the terminal. Device, uninstalls the unplugged USB device from the virtual machine.
  • the device information acquired by the first acquiring module includes a USB device name uniformly generated by the terminal.
  • the USB device name is uniformly generated by the USB server on the terminal, and is forwarded by the USB server to the USB client through a communication link established with the USB client of the host.
  • the device information acquired by the first acquiring module includes: identifier information configured to uniquely identify the USB device.
  • the identifier information obtained by the first obtaining module includes: a manufacturer, a product number, a bus, a port, and a source IP.
  • the determining module includes a receiving unit configured to receive management information determined by the external virtualization center according to the device information and the virtual machine information.
  • the present invention also provides a system for implementing USB device management, including a virtualization center and a host;
  • the virtualization center is configured to: obtain the virtual machine information on the host, obtain the device information of the USB device on the terminal, and determine the management information of the USB device according to the device information and the virtual machine information, and send the management information to the host;
  • the host is configured to: obtain the device information of the USB device on the terminal through the communication link established with the terminal, and forward the device information to the virtualization center, receive the management information sent by the virtualization center, and manage the USB device according to the management information.
  • the technical solution provided by the embodiment of the present invention includes: acquiring device information of a USB device on a terminal by using a communication link established with the terminal; acquiring virtual machine information on the host; and obtaining device information and virtual machine information according to the device information Determine management information for the USB device; manage the USB device according to the management information.
  • the embodiment of the invention simplifies the complexity of USB device management and saves the management time of the USB device.
  • FIG. 1 is a flowchart of a method for implementing USB device management according to Embodiment 1 of the present invention
  • FIG. 2 is a schematic diagram of a module of a host for implementing USB device management according to Embodiment 2 of the present invention
  • FIG. 3 is a schematic structural diagram of a system for implementing USB device management according to Embodiment 3 of the present invention.
  • FIG. 4 is a flowchart of a method for acquiring device information of a USB device by using the system in Embodiment 3 of the present invention
  • FIG. 5 is a flowchart of a method for mounting a USB device by using a dynamic mounting method in a system according to Embodiment 3 of the present invention
  • FIG. 6 is a flowchart of a method for uninstalling a USB device by using a dynamic uninstall method in the third embodiment of the present invention
  • FIG. 7 is a flowchart of a method for deleting a USB device by using the system in Embodiment 3 of the present invention.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • the embodiment provides a method for implementing USB device management, and the USB redirection technology is used to direct the USB device to the virtual machine for operation, which simplifies the management steps and improves the management efficiency.
  • the method in this embodiment is particularly applicable to The USB device of the remote terminal is managed.
  • the method is shown in Figure 1, and includes:
  • Step (S) 101 Obtain device information of the USB device on the terminal by using a communication link established with the terminal;
  • S103 Determine management information about the USB device according to the device information and the virtual machine information.
  • the terminal in this embodiment may include a terminal such as a computer, a mobile phone, or a tablet computer.
  • a terminal such as a computer, a mobile phone, or a tablet computer.
  • the terminal is a mobile phone or a tablet computer, there is generally no universal USB device interface.
  • an interface conversion line may be utilized. Tools such as USB devices can be connected to your phone or tablet.
  • the method for obtaining the device information of the USB device on the terminal is different.
  • the query command is sent to the terminal through the communication link, and the terminal is instructed to report the device information of the USB device, and the receiving terminal sends the information through the communication link.
  • the device information of the USB device that is periodically reported by the receiving terminal itself.
  • the number of USB devices on the terminal may be multiple.
  • the acquired device information may be multiple.
  • obtaining virtual machine information on the host may determine which virtual machines are available. It can be understood that multiple virtual machines can be run simultaneously on the host, that is, the obtained virtual machine information may be multiple.
  • the management information of the USB device can be understood as information indicating that the management of the USB device is completed by the virtual machine, and there are many specific management types, such as mounting, uninstalling, deleting, and the like.
  • the management information of the USB device can be determined according to the device information and the virtual machine information. The determination includes at least two meanings. One is to determine a virtual machine from at least one virtual machine as a virtual machine for managing the USB device, and from the plurality of USB devices. One of the device information The USB device acts as a managed USB device; the second is to determine the specific type of management, such as mounting, uninstalling, deleting, and the like.
  • the process of determining the management information may be completed on the host, and the virtual machine on the host is controlled according to the management information to complete management of the USB device, or may be received externally sent management information, according to the management information. Virtual machine management of USB devices.
  • the management information in S103 and S104 includes a mount indication and an uninstall indication, respectively configured to indicate that the USB device to be mounted is mounted on the virtual machine and the USB device is instructed to be unmounted from the mounted virtual machine. .
  • the S104 may be, according to the mount indication, the device information is written into the configuration file of the virtual machine, so that the virtual machine simulates the virtual USB device according to the device information in the configuration file.
  • a USB device can only be mounted to a virtual machine.
  • the USB device can be mounted and unloaded (ie, not mounted). Separately displayed to the user, the simpler way is to display the unmounted and mounted USB devices in two columns on the page that manages the device information of the USB device. One column is unmounted and one column is hung. Loaded.
  • different status flag bits are set for the unmounted and mounted USB devices to identify the mounting and unloading status of the USB device, for example, set to 1. Indicates that it is mounted. If it is set to 0, it is not mounted. When the USB device is mounted on the virtual machine, its corresponding status flag changes from 0 to 1, indicating that it is mounted.
  • the present embodiment can also display the mounted and unmounted status of the USB device to the user in other feasible manners.
  • the mounting may select two mounting modes, static mounting and dynamic mounting.
  • the static mounting includes: writing the device information of the USB device to the virtual state when the virtual machine is in the shutdown state.
  • the configuration file of the machine when the virtual machine is powered on, the virtual USB device can be directly simulated by using the device information in the configuration file to complete the mounting of the USB device;
  • the dynamic mounting includes: when the virtual machine is powered on, Write the device information to the configuration file of the virtual machine, and then invoke the dynamic mount command to control the virtual machine to simulate the virtual USB device according to the device information in the configuration file. It can be understood that, when the device is mounted, the device information used is the device information of the USB device corresponding to the mounting indication.
  • the S104 may include: deleting the device information from the configuration file of the virtual machine according to the uninstallation instruction, or deleting the virtual USB device simulated according to the device information from the virtual machine.
  • a clear operation is performed on its status flag.
  • the uninstallation of this embodiment is also divided into static unloading and dynamic unloading.
  • the static uninstallation includes: deleting the device information of the USB device from the configuration file of the virtual machine in the state of the virtual machine; the dynamic uninstalling includes: in the power-on state of the virtual machine, calling the dynamic uninstall command, and deleting the USB device according to the virtual machine Device information is simulated by virtual USB. It can be understood that when the USB device is uninstalled, the USB device that is uninstalled is a USB device corresponding to the uninstall indication.
  • libvirt (libvirt is a set of existing, free, open source C language library supporting the mainstream virtualization tool under Linux) dynamic mount command and dynamic uninstall command provided by the function library can be called to complete the dynamic hung. Load and static mount process.
  • the USB device on the virtual machine After the USB device is mounted on the virtual machine, the user can read and write the USB device mounted on the virtual machine on the host to read and write the USB device on the terminal. When there is no need to read or write the USB of the terminal on the virtual machine, the USB device on the virtual machine has no meaning and needs to be deleted.
  • the device information and the virtual machine information The determined management information for the USB device further includes a deletion indication. It can be understood that, according to the deletion indication, the USB device to be deleted and the virtual machine in which it is located can be determined.
  • S104 is specifically determining, according to the deletion indication, whether the USB device is mounted on the virtual machine, and if it is determined that the USB device is mounted on the virtual machine, uninstalling the virtual device from the virtual machine. USB device.
  • the management information in S103 may include: the host determines the external information according to the device information and the virtual machine information, and may specifically include: receiving the external virtualization center according to the device information and the virtual Management information determined by machine information.
  • the virtualization center obtains device information and obtains virtual machine information. It can be understood that the virtualization center can obtain multiple virtual machine information, and control the virtual machine to complete management of the USB device by determining the management information and sending it to the host for execution, such as uninstalling, mounting, deleting, etc. Wait.
  • the management information is generated by the virtualization center, the embodiment must have a step of the virtualization center sending management information such as an uninstall indication, a mount indication, and a deletion indication to the host.
  • the virtual machine will not know.
  • the unplugging behavior occurs before the virtual machine is started, and the device information of the extracted USB device is written in the configuration file in the virtual machine, the startup of the virtual machine may be affected or even the virtual machine cannot be started; if the extraction behavior is In the process of using a virtual machine, and the unplugged USB device is already mounted on the virtual machine, when the user reads and writes the USB device on the virtual machine, there will be problems of read/write errors or read/write failures. Will bring a very poor experience to users.
  • the USB device on the virtual machine when the USB device on the virtual machine is abnormal, it is determined according to the device information of the USB device on the virtual machine and the device information of the USB device on the terminal.
  • the USB device that was removed from the terminal unloads the removed USB device from the virtual machine.
  • the device information of the USB device on the terminal may be periodically obtained, and compared with the device information of the USB device on the virtual machine, to determine that the terminal is removed. USB device, then unmount the removed device from the virtual machine.
  • the USB device of different manufacturers has a VENDOR ID (producer) that is inconsistent with the PRODUCT ID (product number). These two values can be used to distinguish USB devices of different manufacturers plugged into the same terminal. However, for the same batch of USB devices of the same manufacturer, VENDOR is consistent with PRODUCT. If two USB devices of the same batch are inserted in the terminal, it is more troublesome to distinguish.
  • the device information of the USB device acquired in the S101 includes the identifier information configured to uniquely identify the USB device, in order to solve the problem of the conflict between the USB device and the device.
  • the device information includes not only the VENDOR ID (manufacturer) and the PRODUCT ID (product number) of the USB device, but also the slot location of the USB device, for example, remote_usb_192.168.1.10_1_0, where 1 is the BUS. Value, 0 is the value of PORT
  • the identification information of this embodiment includes the manufacturer, the product number, the bus, the port, and the source network.
  • Interconnected Protocol IP
  • the manufacturer and product number are the identifiers that come with the USB device shipped from the factory.
  • the port and bus can characterize which slot of the USB device the USB device is in.
  • the source IP can be used to determine the terminal plugged into the USB device. This information is sufficient to uniquely identify any USB device.
  • the device information acquired in S101 includes a USB device name uniformly generated by the terminal.
  • the USB device name may be uniformly generated by the USB server on the terminal, and forwarded by the USB server to the USB client through a communication link established with the USB client of the host.
  • the device information of the USB device on the terminal can be obtained through the communication link established with the terminal; the virtual machine information on the host is obtained; and the USB device is determined according to the device information and the virtual machine information.
  • the method of the embodiment determines the management information of the USB device by acquiring the device information of the USB device of the terminal and the obtained virtual machine information of the host, and completes management of the USB device by the virtual machine, that is, acquiring device information and virtual
  • the machine information can complete the management of the USB device by the virtual machine according to the method. Therefore, the method of the embodiment can implement the management of the USB device by the virtual machine without complicated operation instructions, and has the advantages of simple, effective, and easy to implement management.
  • the device information of the embodiment includes the identifier information that is uniquely identified by the USB device, which can help solve the conflict problem caused by the same batch information of the USB device, and is beneficial to avoid repeated mounting of the USB device. appear.
  • the device name of the USB device in this embodiment is uniformly generated by the terminal, and the problem that the virtual machine cannot be started across the host due to the host device arranging the USB device name may be solved.
  • the embodiment can process the abnormal situation of the USB device on the virtual machine, and can solve the problem that the virtual device fails to be booted when the USB device is removed from the terminal.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the foregoing method for implementing USB device management.
  • the embodiment of the invention further provides a host for managing a USB device, comprising: a memory and a processor; wherein
  • a processor is configured to execute program instructions in the memory
  • the USB device is managed according to the management information.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • the host 2 of the present embodiment includes a first obtaining module 21, a second obtaining module 22, a determining module 23, and a management module 24.
  • the first acquiring module 21 is configured.
  • the device information of the USB device on the terminal is obtained through the communication link established with the terminal;
  • the second obtaining module 22 is configured to: obtain the virtual machine information on the host;
  • the determining module 23 determines the USB device according to the device information and the virtual machine information.
  • the management module 24 is configured to: manage the USB device according to the management information.
  • the terminal in this embodiment may include: a terminal such as a computer, a mobile phone, or a tablet computer.
  • a terminal such as a computer, a mobile phone, or a tablet computer.
  • the terminal is a mobile phone or a tablet computer, there is generally no universal USB device interface.
  • an interface conversion line may be utilized. Tools such as USB devices can be connected to a phone or tablet.
  • the first obtaining module 21 obtains the device information of the USB device on the terminal, and optionally sends an inquiry command to the terminal through the communication link, and instructs the terminal to report the device information of the USB device.
  • the number of USB devices on the terminal may be multiple.
  • the acquired device information may be multiple.
  • the virtual machine information obtained by the second obtaining module 22 can be used to determine which virtual machines are available. It can be understood that multiple virtual machines can be simultaneously run on the host, that is, the virtual machine information acquired by the second obtaining module 22 can be obtained. There are multiple.
  • the management information acquired by the first obtaining module 21 of the embodiment includes a mounting indication or an uninstalling instruction; the management module 24 includes a mounting unit 241 and an unloading unit 242; and the mounting unit 241 is configured to, according to the mounting indication,
  • the device information is written into the configuration file of the virtual machine, so that the virtual machine can simulate the virtual USB device according to the device information in the configuration file; one USB device can only be mounted on one virtual machine at the same time.
  • the mounting manner of the mounting unit 241 includes: static mounting and dynamic mounting.
  • the static mounting includes: the mounting unit 241 sets the device information of the USB device when the virtual machine is in the shutdown state. Write to the configuration file of the virtual machine, so that when the virtual machine is powered on, the virtual USB device can be directly simulated by using the device information in the configuration file to complete the mounting of the USB device; and the dynamic mounting includes: the mounting unit When the virtual machine is powered on, the device information is written into the configuration file of the virtual machine, and then the dynamic mount command is invoked to control the virtual machine to simulate the virtual USB device according to the device information in the configuration file. It can be understood that, when the device is mounted, the device information used is the device information of the USB device corresponding to the mounting indication.
  • the unloading unit 242 is configured to: delete the device information from the configuration file of the virtual machine according to the uninstallation instruction, or delete the virtual USB device simulated according to the device information from the virtual machine.
  • the unloading manner of the unloading unit 242 of this embodiment also includes static unloading and dynamic unloading, corresponding to the two methods of mounting.
  • the static uninstallation includes: the unloading unit 242 deletes the device information of the USB device from the configuration file of the virtual machine in the virtual machine state;
  • the dynamic uninstallation includes: the unloading unit 242 invokes the dynamic uninstall command in the virtual state of the virtual machine, from the virtual The virtual USB simulated according to the device information of the USB device is deleted in the machine. It can be understood that when the USB device is uninstalled, the USB device that is uninstalled is a USB device corresponding to the uninstall indication.
  • the mount unit 241 and the unload unit 242 can invoke the dynamic mount command and the dynamic unload command provided by the libvirt function library to complete the process of dynamic mount and static mount.
  • the management information of the embodiment further includes a deletion indication
  • the management module 24 further includes a deleting unit 243, configured to determine the USB setting according to the deletion indication. Whether the device is mounted on the virtual machine. If it is determined that the USB device is mounted on the virtual machine, the USB device is uninstalled from the virtual machine.
  • the USB device on the terminal is unplugged, the virtual machine is not known.
  • the unplugging behavior occurs before the virtual machine is started, and the device information of the extracted USB device is written in the configuration file in the virtual machine, the startup of the virtual machine may be affected or even the virtual machine cannot be started; if the extraction behavior is In the process of using a virtual machine, and the unplugged USB device is already mounted on the virtual machine, when the user reads and writes the USB device on the virtual machine, there will be problems of read/write errors or read/write failures. Will bring a very poor experience to users.
  • the host 2 of the embodiment further includes an exception processing module 25 configured to be based on the USB on the virtual machine when the USB device on the virtual machine is abnormal.
  • the device information of the device and the device information of the USB device on the terminal determine the USB device that is removed from the terminal, and uninstall the extracted USB device from the virtual machine.
  • the determining module 23 may include a receiving unit 231 configured to receive management information determined by the external virtualization center according to the device information and the virtual machine information.
  • a scheme in which the virtualization center acquires device information and acquires virtual machine information is implied.
  • the virtualization center can obtain multiple virtual machine information, and by sending the management information to the receiving unit 231, the management module 24 controls the virtual machine to complete management of the USB device according to the management information, as described above. Uninstall, mount, delete, etc. management.
  • the embodiment must have a step of the virtualization center sending management information such as an uninstallation instruction, a mount indication, and a deletion indication to the host.
  • the USB device of different manufacturers has a VENDOR ID (producer) that is inconsistent with the PRODUCT ID (product number). These two values can be used to distinguish USB devices of different manufacturers plugged into the same terminal. However, for the same batch of USB devices of the same manufacturer, VENDOR is consistent with PRODUCT. If two USB devices of the same batch are plugged into the terminal, it is troublesome for the host to obtain the virtualization center. In order to solve the same batch USB device feature information, it leads to conflicts.
  • the device information of the USB device acquired by the first obtaining module 21 includes identifier information configured to uniquely identify the USB device.
  • the device information includes not only the VENDOR ID (manufacturer) and the PRODUCT ID (product number) of the USB device, but also the slot position of the USB device.
  • VENDOR ID manufacturer
  • PRODUCT ID product number
  • the same batch of USB devices of the same manufacturer can be distinguished, so that the identification information of this embodiment includes the manufacturer. , product number, bus, port, source IP.
  • the manufacturer and product number are the identifiers that come with the USB device shipped from the factory.
  • the port and bus can characterize which slot of the USB device the USB device is in.
  • the source IP can be used to determine the terminal plugged into the USB device. This information is sufficient to uniquely identify any USB device.
  • the device information acquired by the first obtaining module 21 includes a USB device name uniformly generated by the terminal.
  • the USB device name may be uniformly generated by the USB server on the terminal, and forwarded by the USB server to the USB client through a communication link established with the USB client of the host.
  • the first acquiring module is configured to obtain device information of the USB device on the terminal by using a communication link established with the terminal; and the second acquiring module is configured to obtain virtual machine information on the host;
  • the determining module is configured to determine management information for the USB device according to the device information and the virtual machine information;
  • the management module is configured to manage the USB device according to the management information.
  • the host of the embodiment obtains the device information and the virtual machine information by using the first and second acquiring modules respectively, and determines the management information for managing the USB device by using the determining module, and the management module completes the management of the USB device by the virtual machine according to the management information pair.
  • the management of the USB device is performed based on the acquired device information and the virtual machine information, and the management method is simple and effective, and does not need to execute cumbersome instructions, and is not prone to errors.
  • the abnormality caused by the USB device being removed from the terminal may be exhausted, and the management effect of the USB device on the virtual machine by the host in this embodiment may be improved, and the user experience is improved.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • this embodiment provides a system for implementing USB device management, including virtualization.
  • the core 31 and the host 32; the virtualization center 31 is configured to: obtain virtual machine information on the host, obtain device information of the USB device on the terminal through the host, and determine management information of the USB device according to the device information and the virtual machine information,
  • the management information is sent to the host;
  • the host 32 is configured to: obtain the device information of the USB device on the terminal through the communication link established with the terminal 33, receive the management information, and manage the USB device according to the management information.
  • the virtualization center can implement centralized management of the entire virtualized resource, including host information, virtual machine information, and the like.
  • the virtualization center may obtain device information of the USB device on the terminal and virtual machine information on the host, and the two pieces of information are managed by the virtual machine to the USB device.
  • the management information sent by the virtual machine in this embodiment may include a mount indication, an uninstall indication, and a delete indication, respectively configured to control the virtual machine to mount the USB device, uninstall the USB device from the virtual machine, and delete the USB device from the virtual machine.
  • the host 32 of the embodiment may include a host proxy module 321 , which may implement the functions of the first and second acquisition modules, the determination module, and the management module on the host in the second embodiment.
  • the communication between the host and the terminal can be implemented by setting the USB client 323 on the host, and setting the USB server 331 on the terminal 33.
  • the USB client 323 and the USB server 331 can establish a communication link to implement communication.
  • the virtualization center obtains the device information of the USB device on the terminal by using the host, and the information may include:
  • the virtualization center initiates a USB query request to the host proxy module, and indicates the IP of the terminal.
  • the host proxy module receives the USB query request and forwards the request to the USB client on the host.
  • the USB client establishes a TCP communication link with the USB server on the designated terminal, and forwards the USB query request to the USB server on the terminal through the communication link.
  • USB server on the terminal executes the USB query information, reads the USB device list on the terminal, and returns the USB device list to the US client on the host through the communication link;
  • the USB client on the host returns a list of USB devices to the host agent module.
  • the host proxy module converts the returned USB device list into an internal response and sends the list to the virtualization center.
  • the virtualization center receives the internal response, saves it to the database, and displays it on the USB management page.
  • the virtualization center After the virtualization center obtains the device information of the USB device, it can store it in the database. In order to facilitate the user to view and operate the USB device information, the virtualization center can also be used to display the USB device information on its USB management page.
  • the virtualization center may determine the mount indication according to the USB device to be mounted selected by the user and the virtual machine on which the USB device is mounted, send the mount indication to the host proxy module, and write the device information to the virtual machine through the host proxy module.
  • the virtual machine simulates the virtual USB device according to the device information in the configuration file.
  • the virtualization center can mount the USB device to the virtual machine in two ways: static mount and dynamic mount.
  • Statically mount The virtualized center writes the device information of the USB device to be mounted to the configuration file of the virtual machine in the state of the virtual machine. This facilitates the virtual machine to simulate virtual USB based on the device information in the configuration file. device.
  • Dynamically mount In the virtual machine, the virtualized center writes the device information of the USB device to be mounted to the configuration file of the virtual machine, and sends a mount indication to the host proxy module, so that it can be called according to the mount indication.
  • the dynamic mount command controls the virtual machine to simulate a virtual USB device based on the device information in the configuration file.
  • the virtualization center of the embodiment may also display the virtual machine and the USB device corresponding to the virtual machine on the USB device management page. Shows the terminal where these USB devices are located, as well as the model and size of the USB device. It is convenient for users to know the status, correspondence, and other information of the virtual machine and USB device when viewing the USB device management page, and then according to their own needs. Manage different USB devices.
  • the state of the virtual machine of this embodiment may include a state of a physical machine such as power on, power off, standby, and the like.
  • the virtualization center of the embodiment controls the uninstallation of the USB device by the virtual machine, including: in the virtual machine state, the device information of the USB device to be uninstalled is configured from the configuration file of the virtual machine. Delete the device; or send a dynamic uninstallation indication to the host agent module when the virtual machine is powered on, so that it can invoke the dynamic uninstall command according to the dynamic uninstallation instruction, and delete the virtual USB device simulated on the virtual machine according to the device information in the configuration file.
  • the dynamic mount command and the dynamic unload command invoked by the host proxy module can be implemented by using existing software.
  • the host proxy module can invoke the dynamic mount and dynamic uninstall commands provided by the libvirt function library.
  • the following is an example of libvirt providing dynamic mount and dynamic unload commands, and an example of the detailed process of dynamic mount and dynamic unload.
  • FIG. 5 it is a flowchart of a method for mounting a USB device by using a dynamic mounting manner in the system of the embodiment.
  • the dynamic mounting process includes:
  • the virtualization center sends a mount indication to the host proxy module.
  • the host agent module receives the mounting instruction, writes the device information of the USB device to be mounted into the configuration file of the corresponding virtual machine, invokes a mount command provided by libvirt, and simulates to be mounted in the virtual machine.
  • USB device
  • the host agent sends a command response to the virtualization center.
  • FIG. 6 is a flowchart of a method for uninstalling a USB device by using a dynamic uninstall method in the system of the embodiment, the process of dynamic uninstallation is as follows;
  • the virtualization center sends an uninstallation instruction to the host proxy module.
  • the host agent module receives the uninstallation instruction, deletes the device information of the USB device to be uninstalled from the configuration file of the corresponding virtual machine, invokes an uninstall command provided by libvirt, and deletes the simulated USB device to be uninstalled in the virtual machine.
  • the host agent module sends a command response to the virtualization center.
  • the USB device can be deleted from the corresponding virtual machine.
  • the virtualization center of the embodiment may send a deletion indication to the host proxy module, and the host proxy module determines, according to the indication, whether the USB device to be deleted is mounted on the virtual machine, and if it is mounted, the virtual machine is removed from the virtual machine. Uninstall, delete the corresponding device information stored in the virtualization center, and complete the complete deletion of the USB device. If not To mount, you only need to delete the device information stored in the virtualization center.
  • FIG. 7 is a flowchart of a method for deleting a USB device by using the system of the embodiment, the specific process of deleting is as follows:
  • the virtualization center acquires the USB device to be deleted selected by the user on the USB device management page.
  • the virtualization center checks whether the USB device to be deleted is mounted, if it has been mounted to the virtual machine, proceeds to S703, otherwise proceeds to S704;
  • the virtual machine center of the embodiment is further configured to set the mounting identifier information for each USB device, and the mounting identifier information is configured to be used for the USB device, in order to ensure the user's understanding of the mounting and unloading status of the USB device.
  • the mount status and the uninstall status are identified.
  • the virtualization center may set the mount identification information to a mount flag FLAG. If the USB device is mounted, the flag is 1; if not, the flag is cleared to 0; or The virtualization center is used to illuminate the icon or text information corresponding to the mounted USB device on the USB management page, and to extinguish the icon or text information of the unmounted or unmounted USB device. This allows you to react to the current state of the USB device in real time.
  • the mount identifier information set by the virtualization center may be displayed on the USB management page of the virtualization center to be displayed to the user, or may be displayed to the user in other manners.
  • the virtualization center of the embodiment may be used to process an abnormal condition of the USB device on the virtual machine. Therefore, the virtualization center of the embodiment may be used to periodically send a USB query request, obtain device information on the terminal, compare it with device information in the database, and determine the USB device that is removed from the terminal, from the corresponding virtual machine.
  • the device information of the standby device can be compared with the device information in the configuration file of the virtual machine that cannot be started, and the device information on the terminal is determined, and the USB device that is removed from the terminal is deleted, and the configuration file of the virtual machine that cannot be started is deleted.
  • Device Information is included in the configuration file of the virtual machine that cannot be started.
  • the USB device of different manufacturers has a VENDOR ID (producer) that is inconsistent with the PRODUCT ID (product). These two values can be used to distinguish USB devices of different manufacturers plugged into the same terminal. However, for the same batch of USB devices of the same manufacturer, VENDOR is consistent with PRODUCT. If two USB devices of the same batch are inserted in the terminal, the virtualization center is more troublesome to distinguish.
  • the device information acquired by the virtualization center of the embodiment includes the identifier information configured to uniquely identify the USB device.
  • the identification information may include a manufacturer, a product number, a bus, a port, and a source IP.
  • the manufacturer and product number are the identifiers that come with the USB device shipped from the factory.
  • the port and bus can characterize which slot of the USB device the USB device is in.
  • the source IP can be used to determine the terminal plugged into the USB device. This information is sufficient to uniquely identify any USB device.
  • the virtual machine on which the USB is mounted can only be started on this host, and cannot be started across the host.
  • the reason for this problem is that the host The name of the USB device obtained on the host is self-programmed by the host's USB client. This causes the name of the same USB device acquired by each host to be inconsistent, resulting in the virtual machine mounting the wrong USB device when booting across the host.
  • the solution may be that the device information acquired by the host includes the USB device name uniformly generated by the terminal.
  • the USB device name is generated by the USB server on the terminal, and the client on the host acquires the device name through the communication link for use by the host.
  • the virtualization center can obtain the virtual machine information on the host, obtain the device information of the USB device on the terminal through the host, and determine the management of the USB device according to the device information and the virtual machine information.
  • the information is sent to the host by the management information.
  • the host can obtain the device information of the USB device on the terminal through the communication link established with the terminal, receive the management information sent by the virtualization center, and manage the USB device according to the management information.
  • the system of the embodiment has a simple structure. The interaction between the virtualization center and the host and the control of the virtual machine by the host according to the indication of the virtualization center can complete the USB setting on the virtual machine to the terminal on the host. In the management and management process, there is no need to execute complicated commands, no complicated steps, simple and effective management, and bring a good experience to users.
  • modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices.
  • they may be implemented by program code executable by the computing device such that they may be stored in a storage medium (ROM/RAM, diskette, optical disk) by a computing device, and in some cases
  • the steps shown or described may be performed in an order different than that herein, or they may be separately fabricated into individual integrated circuit modules, or a plurality of the modules or steps may be implemented as a single integrated circuit module. Therefore, the invention is not limited to any particular combination of hardware and software.
  • each module/unit in the foregoing embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, being executed by a processor and stored in a memory. Programs/instructions to implement their respective functions.
  • the invention is not limited to any specific form of combination of hardware and software.
  • the embodiment of the invention simplifies the complexity of USB device management and saves the management time of the USB device.

Abstract

A method, host, and system for implementing USB device management. The method comprises: acquiring device information of a USB device on a terminal via a communication link established with the terminal (S101); acquiring virtual machine information on a host (S102); determining management information with respect to the USB device on the basis of the device information and of the virtual machine information (S103); and managing the USB device on the basis of the management information (S104). The method simplifies the complexity of USB device management and reduces the length of time spent on USB device management.

Description

一种实现USB设备管理的方法、主机和系统Method, host and system for implementing USB device management 技术领域Technical field
本文涉及但不限于计算机技术领域,尤其涉及一种实现USB设备管理的方法、主机和系统。This document relates to, but is not limited to, the field of computer technology, and in particular, to a method, a host and a system for implementing USB device management.
背景技术Background technique
虚拟机技术在上世纪六七十年代被提出,它是一种硬件设备的仿真模拟实现。虚拟机技术的提出为用户在不同终端之间的资源共享、互相访问等提供了更多的实现方式。Virtual machine technology was proposed in the 1960s and 1970s. It is a simulation simulation of hardware devices. The proposal of virtual machine technology provides more implementation methods for users to share resources and access each other between different terminals.
在虚拟环境下,用户使用的虚拟机是运行在远程机房的主机上的。对于物理机,通用串行总线闪存盘(USB闪存盘,简称U盘)可以直接插在物理机上的插槽内,物理机的系统可以直接访问U盘。但是对于虚拟机而言,其只是软件程序,不具备实体的接口,在相关技术中,为了保证用户能在虚拟机里实现对U盘的读写等操作,需要使用USB重定向技术将用户插在终端上的U盘重定向到虚拟机中,使得用户可以在虚拟机上直接读、写U盘上的文件。这种技术存在的主要问题是:步骤复杂,命令执行繁琐,容易出错,且当需要通过虚拟机实现对多个远程USB设备的读写等操作的时候,需要一一对每个USB设备进行繁琐的USB重定向,这大大地增加了在虚拟环境下对USB设备的管理时间和管理的复杂度。In a virtual environment, the virtual machine used by the user is running on the host in the remote room. For a physical machine, a universal serial bus flash drive (USB flash drive, referred to as a USB flash drive) can be directly inserted into a slot on a physical machine, and the physical machine system can directly access the USB flash drive. However, for a virtual machine, it is only a software program, and does not have a physical interface. In the related technology, in order to ensure that the user can perform operations such as reading and writing to the USB disk in the virtual machine, the USB redirection technology is required to insert the user. The U disk on the terminal is redirected to the virtual machine, so that the user can directly read and write the file on the U disk on the virtual machine. The main problems of this technology are: complicated steps, cumbersome command execution, error-prone, and when a virtual machine is required to read and write to multiple remote USB devices, a pair of each USB device is required to be cumbersome. USB redirection, which greatly increases the management time and management complexity of USB devices in a virtual environment.
综上,在虚拟环境下,USB设备管理费时、复杂。In summary, in a virtual environment, USB device management is time consuming and complicated.
发明概述Summary of invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本发明实施例提供一种实现USB设备管理的方法、主机和系统,能够简化对U盘进行管理的过程。The embodiments of the present invention provide a method, a host, and a system for implementing USB device management, which can simplify the process of managing a USB disk.
本发明实施例提供一种实现USB设备管理的方法,包括:An embodiment of the present invention provides a method for implementing USB device management, including:
通过与终端建立的通信链路获取终端上的USB设备的设备信息; Obtaining device information of the USB device on the terminal by using a communication link established with the terminal;
获取主机上的虚拟机信息;Obtain virtual machine information on the host;
根据设备信息和虚拟机信息确定对USB设备的管理信息;Determining management information for the USB device according to the device information and the virtual machine information;
根据管理信息对USB设备进行管理。The USB device is managed according to the management information.
可选的,管理信息包括挂载指示和卸载指示;Optionally, the management information includes a mounting indication and an uninstallation indication;
当管理信息为挂载指示时,根据管理信息对USB设备进行管理包括:根据挂载指示,将设备信息写入虚拟机的配置文件中,以供虚拟机根据配置文件中的设备信息,模拟出虚拟USB设备;一个USB设备挂载在一个虚拟机上;When the management information is the mount indication, managing the USB device according to the management information includes: writing the device information into the configuration file of the virtual machine according to the mount indication, so that the virtual machine simulates the device according to the device information in the configuration file. a virtual USB device; a USB device is mounted on a virtual machine;
当管理信息为卸载指示时,根据管理信息对USB设备进行管理包括:根据卸载指示,从虚拟机的配置文件中删除设备信息,或将根据设备信息模拟的虚拟USB设备从虚拟机上删除。When the management information is the uninstallation indication, managing the USB device according to the management information includes: deleting the device information from the configuration file of the virtual machine according to the uninstallation instruction, or deleting the virtual USB device simulated according to the device information from the virtual machine.
可选地,管理信息还包括删除指示;根据管理信息对USB设备进行管理包括:根据删除指示,确定USB设备是否已挂载到虚拟机上,若确定所述USB设备已挂载到所述虚拟机上,则从虚拟机上卸载USB设备。Optionally, the management information further includes: deleting the indication; managing the USB device according to the management information, including: determining, according to the deletion indication, whether the USB device is mounted on the virtual machine, if it is determined that the USB device is mounted to the virtual device On the machine, the USB device is uninstalled from the virtual machine.
可选的,所述方法还包括:当虚拟机上的USB设备出现异常时,根据虚拟机上的USB设备的设备信息和终端上的USB设备的设备信息,确定终端上被拔除的USB设备,从虚拟机上卸载被拔除的USB设备。Optionally, the method further includes: determining, when the USB device on the virtual machine is abnormal, the USB device that is removed from the terminal according to the device information of the USB device on the virtual machine and the device information of the USB device on the terminal, Unmount the removed USB device from the virtual machine.
可选的,设备信息包括终端统一产生的USB设备名称。Optionally, the device information includes a USB device name uniformly generated by the terminal.
可选的,USB设备名称由终端上的USB服务端统一产生,并由USB服务端通过与主机的USB客户端建立的通信链路转发给USB客户端。Optionally, the USB device name is uniformly generated by the USB server on the terminal, and is forwarded by the USB server to the USB client through a communication link established with the USB client of the host.
可选的,设备信息包括:配置为对USB设备进行唯一标识的标识信息。Optionally, the device information includes: identifier information configured to uniquely identify the USB device.
可选的,标识信息包括:生产商、产品编号、总线、端口、源网络之间互连的协议(IP)。Optionally, the identification information includes: a manufacturer, a product number, a bus, a port, and an agreement (IP) for interconnection between the source networks.
可选的,根据设备信息和虚拟机信息确定对USB设备的管理信息包括:接收外部的虚拟化中心根据设备信息和虚拟机信息确定的管理信息。Optionally, determining, according to the device information and the virtual machine information, the management information of the USB device includes: receiving management information determined by the external virtualization center according to the device information and the virtual machine information.
本发明实施例还提供一种实现USB设备管理的主机,包括:第一获取模块,第二获取模块,确定模块以及管理模块; The embodiment of the invention further provides a host for implementing USB device management, comprising: a first obtaining module, a second acquiring module, a determining module and a management module;
第一获取模块设置为:通过与终端建立的通信链路获取终端上的USB设备的设备信息;The first obtaining module is configured to: acquire device information of the USB device on the terminal by using a communication link established with the terminal;
第二获取模块设置为:获取主机上的虚拟机信息;The second obtaining module is configured to: obtain virtual machine information on the host;
确定模块设置为:根据设备信息和虚拟机信息确定对USB设备的管理信息;The determining module is configured to: determine management information of the USB device according to the device information and the virtual machine information;
管理模块设置为:根据管理信息对USB设备进行管理。The management module is set to: manage the USB device according to the management information.
可选的,管理信息包括挂载指示或卸载指示;管理模块包括挂载单元和卸载单元;Optionally, the management information includes a mounting indication or an uninstallation indication; the management module includes a mounting unit and an unloading unit;
挂载单元设置为:根据挂载指示,将设备信息写入虚拟机的配置文件中,以供虚拟机根据配置文件中的设备信息,模拟出虚拟USB设备;一个USB设备挂载在一个虚拟机上;The mount unit is configured to: according to the mount indication, write the device information into the configuration file of the virtual machine, so that the virtual machine simulates the virtual USB device according to the device information in the configuration file; a USB device is mounted on a virtual machine. on;
卸载单元设置为:根据卸载指示,从虚拟机的配置文件中删除设备信息,或将根据设备信息模拟的虚拟USB设备从虚拟机上删除。The uninstallation unit is configured to: delete the device information from the configuration file of the virtual machine according to the uninstallation instruction, or delete the virtual USB device simulated according to the device information from the virtual machine.
可选的,管理信息还包括删除指示;管理模块还包括删除单元,设置为根据删除指示,确定USB设备是否已挂载到虚拟机上,若确定所述USB设备已挂载到所述虚拟机上,则从虚拟机上卸载USB设备。Optionally, the management information further includes a deletion indication. The management module further includes a deleting unit, configured to determine, according to the deletion indication, whether the USB device is mounted on the virtual machine, if it is determined that the USB device is mounted to the virtual machine. On, the USB device is uninstalled from the virtual machine.
可选的,还包括异常处理模块,设置为当虚拟机上的USB设备出现异常时,根据虚拟机上的USB设备的设备信息和终端上的USB设备的设备信息,确定终端上被拔除的USB设备,从虚拟机上卸载被拔除的USB设备。Optionally, the exception processing module is further configured to: when the USB device on the virtual machine is abnormal, determine the USB removed from the terminal according to the device information of the USB device on the virtual machine and the device information of the USB device on the terminal. Device, uninstalls the unplugged USB device from the virtual machine.
可选的,第一获取模块获取的设备信息包括终端统一产生的USB设备名称。Optionally, the device information acquired by the first acquiring module includes a USB device name uniformly generated by the terminal.
可选的,USB设备名称由终端上的USB服务端统一产生,并由USB服务端通过与主机的USB客户端建立的通信链路转发给USB客户端。Optionally, the USB device name is uniformly generated by the USB server on the terminal, and is forwarded by the USB server to the USB client through a communication link established with the USB client of the host.
可选的,第一获取模块获取的设备信息包括:配置为对USB设备进行唯一标识的标识信息。Optionally, the device information acquired by the first acquiring module includes: identifier information configured to uniquely identify the USB device.
可选的,第一获取模块获取的标识信息包括:生产商、产品编号、总线、端口、源IP。 Optionally, the identifier information obtained by the first obtaining module includes: a manufacturer, a product number, a bus, a port, and a source IP.
可选的,确定模块包括接收单元,设置为接收外部的虚拟化中心根据设备信息和虚拟机信息确定的管理信息。Optionally, the determining module includes a receiving unit configured to receive management information determined by the external virtualization center according to the device information and the virtual machine information.
本发明还提供一种实现USB设备管理的系统,包括虚拟化中心和主机;The present invention also provides a system for implementing USB device management, including a virtualization center and a host;
虚拟化中心设置为:获取主机上的虚拟机信息,通过主机获取终端上的USB设备的设备信息,以及根据设备信息和虚拟机信息确定对USB设备的管理信息,将管理信息发送给主机;The virtualization center is configured to: obtain the virtual machine information on the host, obtain the device information of the USB device on the terminal, and determine the management information of the USB device according to the device information and the virtual machine information, and send the management information to the host;
主机设置为:通过与终端建立的通信链路获取终端上的USB设备的设备信息并将其转发给虚拟化中心,接收虚拟化中心发送的管理信息,根据管理信息对USB设备进行管理。The host is configured to: obtain the device information of the USB device on the terminal through the communication link established with the terminal, and forward the device information to the virtualization center, receive the management information sent by the virtualization center, and manage the USB device according to the management information.
与相关技术相比,本发明实施例提供的技术方案,包括:通过与终端建立的通信链路获取终端上的USB设备的设备信息;获取主机上的虚拟机信息;根据设备信息和虚拟机信息确定对USB设备的管理信息;根据管理信息对USB设备进行管理。本发明实施例简化了USB设备管理的复杂度,节省了USB设备的管理时长。Compared with the related art, the technical solution provided by the embodiment of the present invention includes: acquiring device information of a USB device on a terminal by using a communication link established with the terminal; acquiring virtual machine information on the host; and obtaining device information and virtual machine information according to the device information Determine management information for the USB device; manage the USB device according to the management information. The embodiment of the invention simplifies the complexity of USB device management and saves the management time of the USB device.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
附图概述BRIEF abstract
图1为本发明实施例一提供的实现USB设备管理的方法的流程图;1 is a flowchart of a method for implementing USB device management according to Embodiment 1 of the present invention;
图2为本发明实施例二提供的实现USB设备管理的主机的模块示意图;2 is a schematic diagram of a module of a host for implementing USB device management according to Embodiment 2 of the present invention;
图3为本发明实施例三提供的实现USB设备管理的系统的结构示意图;3 is a schematic structural diagram of a system for implementing USB device management according to Embodiment 3 of the present invention;
图4为利用本发明实施例三中的系统获取USB设备的设备信息的方法流程图;4 is a flowchart of a method for acquiring device information of a USB device by using the system in Embodiment 3 of the present invention;
图5为利用本发明实施例三中的系统采用动态挂载方式挂载USB设备的方法流程图;5 is a flowchart of a method for mounting a USB device by using a dynamic mounting method in a system according to Embodiment 3 of the present invention;
图6为利用本发明实施例三中系统采用动态卸载方式卸载USB设备的方法流程图;6 is a flowchart of a method for uninstalling a USB device by using a dynamic uninstall method in the third embodiment of the present invention;
图7为利用本发明实施例三中系统删除USB设备的方法流程图。FIG. 7 is a flowchart of a method for deleting a USB device by using the system in Embodiment 3 of the present invention.
详述 Detailed
下文中将结合附图对本申请的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。Embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
实施例一:Embodiment 1:
本实施例提供一种实现USB设备管理的方法,利用USB重定向技术将USB设备定向到虚拟机上进行操作的方案,简化了管理步骤、提升了管理效率,本实施例的方法尤其适用于对远程终端的USB设备进行管理。该方法参见图1所示,包括:The embodiment provides a method for implementing USB device management, and the USB redirection technology is used to direct the USB device to the virtual machine for operation, which simplifies the management steps and improves the management efficiency. The method in this embodiment is particularly applicable to The USB device of the remote terminal is managed. The method is shown in Figure 1, and includes:
步骤(S)101、通过与终端建立的通信链路获取终端上的USB设备的设备信息;Step (S) 101: Obtain device information of the USB device on the terminal by using a communication link established with the terminal;
S102、获取主机上的虚拟机信息;S102. Obtain virtual machine information on the host.
S103、根据设备信息和虚拟机信息确定对USB设备的管理信息;S103. Determine management information about the USB device according to the device information and the virtual machine information.
S104、根据管理信息对USB设备进行管理。S104. Manage the USB device according to the management information.
本实施例的终端可以包括:电脑、手机、平板电脑等类型的终端,当终端为手机或者平板电脑时,一般不存在通用的USB设备接口,为了实现USB设备的插拔,可以利用接口转换线等工具将USB设备连接到手机或平板电脑上。The terminal in this embodiment may include a terminal such as a computer, a mobile phone, or a tablet computer. When the terminal is a mobile phone or a tablet computer, there is generally no universal USB device interface. In order to implement USB device insertion and removal, an interface conversion line may be utilized. Tools such as USB devices can be connected to your phone or tablet.
S101中,获取终端上的USB设备的设备信息的方式有多种,可选的,通过通信链路向终端发送查询指令,指示终端上报自身的USB设备的设备信息,接收终端通过通信链路发送的设备信息;还可以是接收终端自身定时上报的USB设备的设备信息。终端上的USB设备可以是多个,相应的,获取的设备信息可以是多个。S102中,获取主机上的虚拟机信息可以确定哪些虚拟机可用,可以理解的是,主机上的可以同时运行多台虚拟机,即获取的虚拟机信息可以是多个。In S101, the method for obtaining the device information of the USB device on the terminal is different. Optionally, the query command is sent to the terminal through the communication link, and the terminal is instructed to report the device information of the USB device, and the receiving terminal sends the information through the communication link. The device information of the USB device that is periodically reported by the receiving terminal itself. The number of USB devices on the terminal may be multiple. Correspondingly, the acquired device information may be multiple. In S102, obtaining virtual machine information on the host may determine which virtual machines are available. It can be understood that multiple virtual machines can be run simultaneously on the host, that is, the obtained virtual machine information may be multiple.
在实施例中,在本实施例中,对USB设备的管理信息可以理解为指示完成虚拟机对USB设备的管理的信息,具体的管理类型有很多,例如挂载、卸载、删除等等。根据设备信息和虚拟机信息可以确定对USB设备的管理信息,该确定至少包含了两层意思,一是从至少一个虚拟机中确定一个虚拟机作为管理USB设备的虚拟机,从多个USB设备的设备信息中确定一个 USB设备作为被管理的USB设备;二是确定管理的具体类型,例如挂载、卸载、删除等。可以理解的是,确定管理信息的过程可以是在主机上完成,根据管理信息控制主机上的虚拟机完成对USB设备的管理,也可以是接收的外部发来的管理信息,根据该管理信息实现虚拟机对USB设备的管理。In the embodiment, in this embodiment, the management information of the USB device can be understood as information indicating that the management of the USB device is completed by the virtual machine, and there are many specific management types, such as mounting, uninstalling, deleting, and the like. The management information of the USB device can be determined according to the device information and the virtual machine information. The determination includes at least two meanings. One is to determine a virtual machine from at least one virtual machine as a virtual machine for managing the USB device, and from the plurality of USB devices. One of the device information The USB device acts as a managed USB device; the second is to determine the specific type of management, such as mounting, uninstalling, deleting, and the like. It can be understood that the process of determining the management information may be completed on the host, and the virtual machine on the host is controlled according to the management information to complete management of the USB device, or may be received externally sent management information, according to the management information. Virtual machine management of USB devices.
可选的,S103和S104中的管理信息包括挂载指示和卸载指示,分别配置为指示将待挂载的USB设备挂载到虚拟机上以及指示将USB设备从其挂载的虚拟机上卸载。Optionally, the management information in S103 and S104 includes a mount indication and an uninstall indication, respectively configured to indicate that the USB device to be mounted is mounted on the virtual machine and the USB device is instructed to be unmounted from the mounted virtual machine. .
当管理信息为挂载指示时,S104可以是,根据挂载指示,将设备信息写入虚拟机的配置文件中,以供虚拟机根据配置文件中的设备信息,模拟出虚拟USB设备。When the management information is the mount indication, the S104 may be, according to the mount indication, the device information is written into the configuration file of the virtual machine, so that the virtual machine simulates the virtual USB device according to the device information in the configuration file.
在本实施例中,一个USB设备只能挂载到一个虚拟机上,为了避免出现USB设备被虚拟机重复挂载的情况,可以将USB设备的挂载和卸载(也即未挂载)状态区分开来展示给用户,比较简单的方式是可以在管理USB设备的设备信息的页面上,将未挂载和已挂载的USB设备分成两列显示,一列是未挂载,一列是已挂载的。可选的,还可以在管理USB设备的设备信息的页面上,为未挂载和已挂载的USB设备设置不同的状态标志位,来标识USB设备的挂载和卸载状态,例如设置为1表示已挂载,设置为0表示未挂载,当USB设备已经挂载在虚拟机上之后,其对应的状态标志位从0变为1,表示其已挂载。In this embodiment, a USB device can only be mounted to a virtual machine. In order to avoid the USB device being repeatedly mounted by the virtual machine, the USB device can be mounted and unloaded (ie, not mounted). Separately displayed to the user, the simpler way is to display the unmounted and mounted USB devices in two columns on the page that manages the device information of the USB device. One column is unmounted and one column is hung. Loaded. Optionally, on the page for managing device information of the USB device, different status flag bits are set for the unmounted and mounted USB devices to identify the mounting and unloading status of the USB device, for example, set to 1. Indicates that it is mounted. If it is set to 0, it is not mounted. When the USB device is mounted on the virtual machine, its corresponding status flag changes from 0 to 1, indicating that it is mounted.
除此之外,本实施例还可以采用其他可行的方式将USB设备的挂载、未挂载状态展示给用户。In addition, the present embodiment can also display the mounted and unmounted status of the USB device to the user in other feasible manners.
可选的,在本实施例中的挂载可以选择两种挂载方式,静态挂载和动态挂载,静态挂载包括:在虚拟机处于关机状态下,将USB设备的设备信息写入虚拟机的配置文件中,这样,虚拟机在开机的时候,就可以直接利用配置文件中的设备信息模拟出虚拟USB设备,完成USB设备的挂载;而动态挂载包括:在虚拟机开机时,将设备信息写入到虚拟机的配置文件中,再调用动态挂载命令,控制虚拟机根据配置文件中的设备信息模拟出虚拟USB设备。可以理解的是,挂载时,使用的设备信息是挂载指示对应的USB设备的设备信息。 Optionally, in the embodiment, the mounting may select two mounting modes, static mounting and dynamic mounting. The static mounting includes: writing the device information of the USB device to the virtual state when the virtual machine is in the shutdown state. In the configuration file of the machine, when the virtual machine is powered on, the virtual USB device can be directly simulated by using the device information in the configuration file to complete the mounting of the USB device; and the dynamic mounting includes: when the virtual machine is powered on, Write the device information to the configuration file of the virtual machine, and then invoke the dynamic mount command to control the virtual machine to simulate the virtual USB device according to the device information in the configuration file. It can be understood that, when the device is mounted, the device information used is the device information of the USB device corresponding to the mounting indication.
当管理信息为挂载指示时,S104可以包括:根据卸载指示,从虚拟机的配置文件中删除设备信息,或将根据设备信息模拟的虚拟USB设备从虚拟机上删除。相应的,当USB设备从虚拟机上卸载后,对其状态标识位执行清0操作。When the management information is a mount indication, the S104 may include: deleting the device information from the configuration file of the virtual machine according to the uninstallation instruction, or deleting the virtual USB device simulated according to the device information from the virtual machine. Correspondingly, when the USB device is unloaded from the virtual machine, a clear operation is performed on its status flag.
对应于挂载的两种方式,本实施例的卸载也分为静态卸载和动态卸载。静态卸载包括,在虚拟机关机状态下,从虚拟机的配置文件中删除USB设备的设备信息;动态卸载包括,在虚拟机的开机状态下,调用动态卸载命令,从虚拟机中删除根据USB设备的设备信息模拟的虚拟USB。可以理解的是,卸载USB设备时,被卸载的USB设备是对应于卸载指示的USB设备。Corresponding to the two ways of mounting, the uninstallation of this embodiment is also divided into static unloading and dynamic unloading. The static uninstallation includes: deleting the device information of the USB device from the configuration file of the virtual machine in the state of the virtual machine; the dynamic uninstalling includes: in the power-on state of the virtual machine, calling the dynamic uninstall command, and deleting the USB device according to the virtual machine Device information is simulated by virtual USB. It can be understood that when the USB device is uninstalled, the USB device that is uninstalled is a USB device corresponding to the uninstall indication.
在本实施例中,可以调用libvirt(libvirt是一套已有的额、免费、开源的支持Linux下主流虚拟化工具的C函数库)函数库提供的动态挂载命令和动态卸载命令完成动态挂载和静态挂载的过程。In this embodiment, libvirt (libvirt is a set of existing, free, open source C language library supporting the mainstream virtualization tool under Linux) dynamic mount command and dynamic uninstall command provided by the function library can be called to complete the dynamic hung. Load and static mount process.
当虚拟机上挂载了USB设备后,用户在主机上对虚拟机挂载的USB设备进行读写,即可达到对终端上的USB设备进行读写的目的。当不需要在虚拟机上对终端的USB进行读写等操作时,虚拟机上的USB设备就没有存在的意义,需要对其进行删除,可选的,在S103中根据设备信息和虚拟机信息确定的对USB设备的管理信息还包括删除指示,可以理解的是,根据删除指示,可以确定待删除的USB设备和其所在的虚拟机。当管理信息为删除指示时,S104具体为根据删除指示,确定USB设备是否已挂载到虚拟机上,若确定所述USB设备已挂载到所述虚拟机上,则从虚拟机上卸载该USB设备。After the USB device is mounted on the virtual machine, the user can read and write the USB device mounted on the virtual machine on the host to read and write the USB device on the terminal. When there is no need to read or write the USB of the terminal on the virtual machine, the USB device on the virtual machine has no meaning and needs to be deleted. Optionally, in S103, according to the device information and the virtual machine information. The determined management information for the USB device further includes a deletion indication. It can be understood that, according to the deletion indication, the USB device to be deleted and the virtual machine in which it is located can be determined. When the management information is the deletion indication, S104 is specifically determining, according to the deletion indication, whether the USB device is mounted on the virtual machine, and if it is determined that the USB device is mounted on the virtual machine, uninstalling the virtual device from the virtual machine. USB device.
在本实施例中,S103中的管理信息可以包括:主机根据设备信息和虚拟机信息确定的,也可以是接收的外部的信息,具体可以包括:接收的外部的虚拟化中心根据设备信息和虚拟机信息确定的管理信息。这种方案中是隐藏了虚拟化中心获取设备信息和获取虚拟机信息的方案。可以理解的是,虚拟化中心可以获取多个虚拟机信息,通过确定管理信息,将其发给主机执行的方式,控制虚拟机完成对USB设备的管理,如上述的卸载、挂载、删除等等。当管理信息是由虚拟化中心产生时,本实施例必定存在虚拟化中心发送卸载指示、挂载指示、删除指示等管理信息给主机的步骤。 In this embodiment, the management information in S103 may include: the host determines the external information according to the device information and the virtual machine information, and may specifically include: receiving the external virtualization center according to the device information and the virtual Management information determined by machine information. In this solution, the virtualization center obtains device information and obtains virtual machine information. It can be understood that the virtualization center can obtain multiple virtual machine information, and control the virtual machine to complete management of the USB device by determining the management information and sending it to the host for execution, such as uninstalling, mounting, deleting, etc. Wait. When the management information is generated by the virtualization center, the embodiment must have a step of the virtualization center sending management information such as an uninstall indication, a mount indication, and a deletion indication to the host.
可以理解的是,如果终端上的USB设备被拔除,虚拟机是不会知道的。当该拔除行为发生在虚拟机启动前,且虚拟机中的配置文件中已写入被拔除的USB设备的设备信息,会对虚拟机的启动造成影响甚至导致虚拟机无法启动;如果该拔除行为发生在使用虚拟机的过程中,且被拔除的USB设备已经挂载在该虚拟机上,则用户在虚拟机上读写USB设备的时候,会出现读写错误或读写失效的问题,这些都会给用户带来极差的体验。为了避免终端上USB设备被拔除带来的上述问题,可选的,当虚拟机上的USB设备出现异常时,根据虚拟机上的USB设备的设备信息和终端上的USB设备的设备信息,确定终端上被拔除的USB设备,从虚拟机上卸载被拔除的USB设备。在本实施例中,为了避免异常情况给用户带来的不良体验,可以定时获取终端上的USB设备的设备信息,将其与虚拟机上的USB设备的设备信息进行比较,确定终端上被拔除的USB设备,然后从虚拟机上卸载被拔除的设备。It can be understood that if the USB device on the terminal is unplugged, the virtual machine will not know. When the unplugging behavior occurs before the virtual machine is started, and the device information of the extracted USB device is written in the configuration file in the virtual machine, the startup of the virtual machine may be affected or even the virtual machine cannot be started; if the extraction behavior is In the process of using a virtual machine, and the unplugged USB device is already mounted on the virtual machine, when the user reads and writes the USB device on the virtual machine, there will be problems of read/write errors or read/write failures. Will bring a very poor experience to users. In order to avoid the above problems caused by the USB device being removed from the terminal, optionally, when the USB device on the virtual machine is abnormal, it is determined according to the device information of the USB device on the virtual machine and the device information of the USB device on the terminal. The USB device that was removed from the terminal unloads the removed USB device from the virtual machine. In this embodiment, in order to avoid the bad experience brought by the abnormal situation to the user, the device information of the USB device on the terminal may be periodically obtained, and compared with the device information of the USB device on the virtual machine, to determine that the terminal is removed. USB device, then unmount the removed device from the virtual machine.
对于USB设备而言,不同厂家的USB设备,其VENDOR ID(生产商)与PRODUCT ID(产品编号)不一致,可以利用这两个值来区分插在同一个终端上的不同厂家的USB设备。但对于同一厂家的同一批次的USB设备,VENDOR与PRODUCT是一致的,如果两个同批次的USB设备插在终端上,区分起来就比较麻烦。为了解决同批次USB设备特征信息一致,导致冲突的问题,可选地,S101中获取的USB设备的设备信息包括配置为对USB设备进行唯一标识的标识信息。For USB devices, the USB device of different manufacturers has a VENDOR ID (producer) that is inconsistent with the PRODUCT ID (product number). These two values can be used to distinguish USB devices of different manufacturers plugged into the same terminal. However, for the same batch of USB devices of the same manufacturer, VENDOR is consistent with PRODUCT. If two USB devices of the same batch are inserted in the terminal, it is more troublesome to distinguish. The device information of the USB device acquired in the S101 includes the identifier information configured to uniquely identify the USB device, in order to solve the problem of the conflict between the USB device and the device.
可以理解的是,如果在设备信息中不仅包含USB设备的VENDOR ID(生产商)与PRODUCT ID(产品编号),还包含USB设备的插槽位置,例如remote_usb_192.168.1.10_1_0,其中1为BUS的值,0为PORT的值,就可以将同一批次的同一厂家的USB设备区分开来,所以可选的,本实施例的标识信息包括生产商、产品编号、总线、端口、源网络之间互连的协议(IP)。生产商和产品编号是USB设备出厂时自带的标识,端口和总线可以表征USB设备在终端的哪一个插槽上,源IP可以用来确定插入USB设备的终端。这些信息足以唯一标识任何一个USB设备。It can be understood that if the device information includes not only the VENDOR ID (manufacturer) and the PRODUCT ID (product number) of the USB device, but also the slot location of the USB device, for example, remote_usb_192.168.1.10_1_0, where 1 is the BUS. Value, 0 is the value of PORT, the same batch of USB devices of the same manufacturer can be distinguished, so optional, the identification information of this embodiment includes the manufacturer, the product number, the bus, the port, and the source network. Interconnected Protocol (IP). The manufacturer and product number are the identifiers that come with the USB device shipped from the factory. The port and bus can characterize which slot of the USB device the USB device is in. The source IP can be used to determine the terminal plugged into the USB device. This information is sufficient to uniquely identify any USB device.
在相关技术中,当USB设备指向了虚拟机所运行的主机后,挂载了USB 的虚拟机就只能在这台主机上启动,而无法跨主机启动,造成这个问题的原因是:主机上获取的USB设备的名称由主机上的USB客户端自行编排的,这导致每一个主机获取的同一个USB设备的名称可能不一致,从而导致跨主机启动时,虚拟机挂载错误的USB设备。对于这个问题,可选地,S101中获取的设备信息包括终端统一产生的USB设备名称。可选的,该USB设备名称可以由终端上的USB服务端统一产生,并由USB服务端通过与主机的USB客户端建立的通信链路转发给USB客户端。由此,每一个主机获取的同一个USB设备的名称都是一致的。通过这种方法,解决了挂载USB设备的虚拟机无法跨主机的问题。In the related art, when the USB device points to the host where the virtual machine is running, the USB is mounted. The virtual machine can only be started on this host, but cannot be started across the host. The reason for this problem is that the name of the USB device obtained on the host is programmed by the USB client on the host, which leads to each host. The names of the same USB devices acquired may be inconsistent, causing the virtual machine to mount the wrong USB device when booting across the host. For this problem, optionally, the device information acquired in S101 includes a USB device name uniformly generated by the terminal. Optionally, the USB device name may be uniformly generated by the USB server on the terminal, and forwarded by the USB server to the USB client through a communication link established with the USB client of the host. Thus, the name of the same USB device acquired by each host is the same. In this way, the problem that the virtual machine on which the USB device is mounted cannot cross the host is solved.
采用本实施例的实现USB设备管理的方法,可以通过与终端建立的通信链路获取终端上的USB设备的设备信息;获取主机上的虚拟机信息;根据设备信息和虚拟机信息确定对USB设备的管理信息;根据管理信息对USB设备进行管理。本实施例的方法通过获取的终端的USB设备的设备信息和获取的主机上的虚拟机信息,确定对USB设备的管理信息,完成虚拟机对USB设备的管理,也即只要获取设备信息和虚拟机信息即可根据本方法完成虚拟机对USB设备的管理,所以本实施例的方法不需要复杂的操作指令即可实现虚拟机对USB设备的管理,具有管理简单、有效、易实现的优点。With the method for implementing USB device management in this embodiment, the device information of the USB device on the terminal can be obtained through the communication link established with the terminal; the virtual machine information on the host is obtained; and the USB device is determined according to the device information and the virtual machine information. Management information; management of USB devices based on management information. The method of the embodiment determines the management information of the USB device by acquiring the device information of the USB device of the terminal and the obtained virtual machine information of the host, and completes management of the USB device by the virtual machine, that is, acquiring device information and virtual The machine information can complete the management of the USB device by the virtual machine according to the method. Therefore, the method of the embodiment can implement the management of the USB device by the virtual machine without complicated operation instructions, and has the advantages of simple, effective, and easy to implement management.
可选的,本实施例的设备信息包括对USB设备进行唯一标识的标识信息,可以帮助解决由于同批次USB设备的特征信息一样,导致的冲突问题,有利于避免重复挂载USB设备的情况出现。Optionally, the device information of the embodiment includes the identifier information that is uniquely identified by the USB device, which can help solve the conflict problem caused by the same batch information of the USB device, and is beneficial to avoid repeated mounting of the USB device. appear.
可选的,本实施例的USB设备的设备名称由终端统一产生,可以解决由于主机自行编排USB设备名称带来的虚拟机不能跨主机启动的问题。Optionally, the device name of the USB device in this embodiment is uniformly generated by the terminal, and the problem that the virtual machine cannot be started across the host due to the host device arranging the USB device name may be solved.
可选的,本实施例可以对于虚拟机上USB设备的异常情况进行处理,可以解决USB设备从终端上被拔走,导致的虚拟机启动失败的问题。Optionally, the embodiment can process the abnormal situation of the USB device on the virtual machine, and can solve the problem that the virtual device fails to be booted when the USB device is removed from the terminal.
本发明实施例还提供一种计算机存储介质,计算机存储介质中存储有计算机可执行指令,计算机可执行指令用于执行上述实现USB设备管理的方法。 The embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the foregoing method for implementing USB device management.
本发明实施例还提供一种USB设备管理的主机,包括:存储器和处理器;其中,The embodiment of the invention further provides a host for managing a USB device, comprising: a memory and a processor; wherein
处理器被配置为执行所述存储器中的程序指令;A processor is configured to execute program instructions in the memory;
程序指令在处理器读取执行以下操作:Program instructions perform the following operations on the processor read:
通过与终端建立的通信链路获取终端上的USB设备的设备信息;Obtaining device information of the USB device on the terminal by using a communication link established with the terminal;
获取主机上的虚拟机信息;Obtain virtual machine information on the host;
根据设备信息和所述虚拟机信息确定对USB设备的管理信息;Determining management information for the USB device according to the device information and the virtual machine information;
根据管理信息对USB设备进行管理。The USB device is managed according to the management information.
实施例二:Embodiment 2:
本实施例提出一种实现USB设备管理的主机,参见图2,本实施例的主机2包括第一获取模块21,第二获取模块22,确定模块23以及管理模块24;第一获取模块21设置为:通过与终端建立的通信链路获取终端上的USB设备的设备信息;第二获取模块22设置为:获取主机上的虚拟机信息;确定模块23根据设备信息和虚拟机信息确定对USB设备的管理信息;管理模块24设置为:根据管理信息对USB设备进行管理。This embodiment provides a host for implementing USB device management. Referring to FIG. 2, the host 2 of the present embodiment includes a first obtaining module 21, a second obtaining module 22, a determining module 23, and a management module 24. The first acquiring module 21 is configured. The device information of the USB device on the terminal is obtained through the communication link established with the terminal; the second obtaining module 22 is configured to: obtain the virtual machine information on the host; and the determining module 23 determines the USB device according to the device information and the virtual machine information. Management information; the management module 24 is configured to: manage the USB device according to the management information.
本实施例的终端可以包括:电脑、手机、平板电脑等类型的终端,当终端是手机或者平板电脑时,一般不存在通用的USB设备接口,为了实现USB设备的插拔,可以利用接口转换线等工具使USB设备连接到手机或平板电脑上。The terminal in this embodiment may include: a terminal such as a computer, a mobile phone, or a tablet computer. When the terminal is a mobile phone or a tablet computer, there is generally no universal USB device interface. In order to implement USB device insertion and removal, an interface conversion line may be utilized. Tools such as USB devices can be connected to a phone or tablet.
本实施例中,第一获取模块21获取终端上的USB设备的设备信息的方式有多种,可选的,通过通信链路向终端发送查询指令,指示终端上报自身的USB设备的设备信息,接收终端通过通信链路发送的设备信息;还可以包括:接收终端自身定时上报的USB设备的设备信息。终端上的USB设备可以是多个,相应的,获取的设备信息可以是多个。第二获取模块22获取的主机上的虚拟机信息可以用来确定哪些虚拟机可用,可以理解的是,主机上的可以同时运行多台虚拟机,即第二获取模块22获取的虚拟机信息可以 是多个。In this embodiment, the first obtaining module 21 obtains the device information of the USB device on the terminal, and optionally sends an inquiry command to the terminal through the communication link, and instructs the terminal to report the device information of the USB device. Receiving device information sent by the terminal through the communication link; and further comprising: receiving device information of the USB device periodically reported by the terminal itself. The number of USB devices on the terminal may be multiple. Correspondingly, the acquired device information may be multiple. The virtual machine information obtained by the second obtaining module 22 can be used to determine which virtual machines are available. It can be understood that multiple virtual machines can be simultaneously run on the host, that is, the virtual machine information acquired by the second obtaining module 22 can be obtained. There are multiple.
可选的,本实施例的第一获取模块21获取的管理信息包括挂载指示或卸载指示;管理模块24包括挂载单元241和卸载单元242;挂载单元241设置为,根据挂载指示,将设备信息写入虚拟机的配置文件中,以供虚拟机根据配置文件中的设备信息,模拟出虚拟USB设备;一个USB设备只能同时挂载在一个虚拟机上。Optionally, the management information acquired by the first obtaining module 21 of the embodiment includes a mounting indication or an uninstalling instruction; the management module 24 includes a mounting unit 241 and an unloading unit 242; and the mounting unit 241 is configured to, according to the mounting indication, The device information is written into the configuration file of the virtual machine, so that the virtual machine can simulate the virtual USB device according to the device information in the configuration file; one USB device can only be mounted on one virtual machine at the same time.
可选的,在本实施例中挂载单元241的挂载方式包括:静态挂载和动态挂载,静态挂载包括:挂载单元241在虚拟机处于关机状态下,将USB设备的设备信息写入虚拟机的配置文件中,这样,虚拟机在开机的时候,就可以直接利用配置文件中的设备信息模拟出虚拟USB设备,完成USB设备的挂载;而动态挂载包括:挂载单元241在虚拟机开机时,将设备信息写入到虚拟机的配置文件中,再调用动态挂载命令,控制虚拟机根据配置文件中的设备信息模拟出虚拟USB设备。可以理解的是,挂载时,使用的设备信息是挂载指示对应的USB设备的设备信息。Optionally, in the embodiment, the mounting manner of the mounting unit 241 includes: static mounting and dynamic mounting. The static mounting includes: the mounting unit 241 sets the device information of the USB device when the virtual machine is in the shutdown state. Write to the configuration file of the virtual machine, so that when the virtual machine is powered on, the virtual USB device can be directly simulated by using the device information in the configuration file to complete the mounting of the USB device; and the dynamic mounting includes: the mounting unit When the virtual machine is powered on, the device information is written into the configuration file of the virtual machine, and then the dynamic mount command is invoked to control the virtual machine to simulate the virtual USB device according to the device information in the configuration file. It can be understood that, when the device is mounted, the device information used is the device information of the USB device corresponding to the mounting indication.
卸载单元242设置为:根据卸载指示,从虚拟机的配置文件中删除设备信息,或将根据设备信息模拟的虚拟USB设备从虚拟机上删除。The unloading unit 242 is configured to: delete the device information from the configuration file of the virtual machine according to the uninstallation instruction, or delete the virtual USB device simulated according to the device information from the virtual machine.
对应于挂载的两种方式,本实施例卸载单元242的卸载方式也包括静态卸载和动态卸载。静态卸载包括:卸载单元242在虚拟机关机状态下,从虚拟机的配置文件中删除USB设备的设备信息;动态卸载包括:卸载单元242在虚拟机的开机状态下,调用动态卸载命令,从虚拟机中删除根据USB设备的设备信息模拟的虚拟USB。可以理解的是,卸载USB设备时,被卸载的USB设备是对应于卸载指示的USB设备。The unloading manner of the unloading unit 242 of this embodiment also includes static unloading and dynamic unloading, corresponding to the two methods of mounting. The static uninstallation includes: the unloading unit 242 deletes the device information of the USB device from the configuration file of the virtual machine in the virtual machine state; the dynamic uninstallation includes: the unloading unit 242 invokes the dynamic uninstall command in the virtual state of the virtual machine, from the virtual The virtual USB simulated according to the device information of the USB device is deleted in the machine. It can be understood that when the USB device is uninstalled, the USB device that is uninstalled is a USB device corresponding to the uninstall indication.
在本实施例中,挂载单元241和卸载单元242可以调用libvirt函数库提供的动态挂载命令和动态卸载命令完成动态挂载和静态挂载的过程。In this embodiment, the mount unit 241 and the unload unit 242 can invoke the dynamic mount command and the dynamic unload command provided by the libvirt function library to complete the process of dynamic mount and static mount.
当虚拟机上挂载了USB设备后,用户在主机上对虚拟机挂载的USB设备进行读写,即可达到对终端上的USB设备进行读写的目的。当不需要在虚拟机上对终端的USB进行读写等操作时,虚拟机上的USB设备就没有存在的意义,需要对其进行删除。可选的,本实施例的管理信息还包括删除指示,管理模块24还包括删除单元243,设置为根据删除指示,确定USB设 备是否已挂载到虚拟机上,若确定USB设备已挂载到虚拟机上,则从虚拟机上卸载USB设备。After the USB device is mounted on the virtual machine, the user can read and write the USB device mounted on the virtual machine on the host to read and write the USB device on the terminal. When there is no need to read and write the USB of the terminal on the virtual machine, the USB device on the virtual machine has no meaning and needs to be deleted. Optionally, the management information of the embodiment further includes a deletion indication, and the management module 24 further includes a deleting unit 243, configured to determine the USB setting according to the deletion indication. Whether the device is mounted on the virtual machine. If it is determined that the USB device is mounted on the virtual machine, the USB device is uninstalled from the virtual machine.
可以理解的是,如果终端上的USB设备被拔除,虚拟机是无法获知的。当该拔除行为发生在虚拟机启动前,且虚拟机中的配置文件中已写入被拔除的USB设备的设备信息,会对虚拟机的启动造成影响甚至导致虚拟机无法启动;如果该拔除行为发生在使用虚拟机的过程中,且被拔除的USB设备已经挂载在该虚拟机上,则用户在虚拟机上读写USB设备的时候,会出现读写错误或读写失效的问题,这些都会给用户带来极差的体验。为了避免终端上USB设备被拔除带来的上述问题,可选的,本实施例的主机2还包括异常处理模块25,设置为当虚拟机上的USB设备出现异常时,根据虚拟机上的USB设备的设备信息和终端上的USB设备的设备信息,确定终端上被拔除的USB设备,从虚拟机上卸载被拔除的USB设备。It can be understood that if the USB device on the terminal is unplugged, the virtual machine is not known. When the unplugging behavior occurs before the virtual machine is started, and the device information of the extracted USB device is written in the configuration file in the virtual machine, the startup of the virtual machine may be affected or even the virtual machine cannot be started; if the extraction behavior is In the process of using a virtual machine, and the unplugged USB device is already mounted on the virtual machine, when the user reads and writes the USB device on the virtual machine, there will be problems of read/write errors or read/write failures. Will bring a very poor experience to users. In order to avoid the above problems caused by the USB device being removed from the terminal, the host 2 of the embodiment further includes an exception processing module 25 configured to be based on the USB on the virtual machine when the USB device on the virtual machine is abnormal. The device information of the device and the device information of the USB device on the terminal determine the USB device that is removed from the terminal, and uninstall the extracted USB device from the virtual machine.
在本实施例中,确定模块23可以包括接收单元231,配置为接收外部的虚拟化中心根据设备信息和虚拟机信息确定的管理信息。当管理信息是由接收单元231接收时,隐含了虚拟化中心获取设备信息和获取虚拟机信息的方案。可以理解的是,虚拟化中心可以获取多个虚拟机信息,通过确定管理信息,将其发给接收单元231,由管理模块24根据管理信息,控制虚拟机完成对USB设备的管理,如上述的卸载、挂载、删除等等管理。相应的,当管理信息是由虚拟化中心产生时,本实施例必定存在虚拟化中心发送卸载指示、挂载指示、删除指示等管理信息给主机的步骤。In this embodiment, the determining module 23 may include a receiving unit 231 configured to receive management information determined by the external virtualization center according to the device information and the virtual machine information. When the management information is received by the receiving unit 231, a scheme in which the virtualization center acquires device information and acquires virtual machine information is implied. It can be understood that the virtualization center can obtain multiple virtual machine information, and by sending the management information to the receiving unit 231, the management module 24 controls the virtual machine to complete management of the USB device according to the management information, as described above. Uninstall, mount, delete, etc. management. Correspondingly, when the management information is generated by the virtualization center, the embodiment must have a step of the virtualization center sending management information such as an uninstallation instruction, a mount indication, and a deletion indication to the host.
对于USB设备而言,不同厂家的USB设备,其VENDOR ID(生产商)与PRODUCT ID(产品编号)不一致,可以利用这两个值来区分插在同一个终端上的不同厂家的USB设备。但对于同一厂家的同一批次的USB设备,VENDOR与PRODUCT是一致的,如果两个同批次的USB设备插在终端上,主机获取虚拟化中心区分起来都比较麻烦。为了解决同批次USB设备特征信息一致,导致冲突的问题。可选地,第一获取模块21获取的USB设备的设备信息包括配置为对USB设备进行唯一标识的标识信息。For USB devices, the USB device of different manufacturers has a VENDOR ID (producer) that is inconsistent with the PRODUCT ID (product number). These two values can be used to distinguish USB devices of different manufacturers plugged into the same terminal. However, for the same batch of USB devices of the same manufacturer, VENDOR is consistent with PRODUCT. If two USB devices of the same batch are plugged into the terminal, it is troublesome for the host to obtain the virtualization center. In order to solve the same batch USB device feature information, it leads to conflicts. Optionally, the device information of the USB device acquired by the first obtaining module 21 includes identifier information configured to uniquely identify the USB device.
可以理解的是,如果在设备信息中不仅包含USB设备的VENDOR ID(生产商)与PRODUCT ID(产品编号),还包含USB设备的插槽位置, 例如remote_usb_192.168.1.10_1_0,其中1为BUS的值,0为PORT的值,就可以将同一批次的同一厂家的USB设备区分开来,所以可选的,本实施例的标识信息包括生产商、产品编号、总线、端口、源IP。生产商和产品编号是USB设备出厂时自带的标识,端口和总线可以表征USB设备在终端的哪一个插槽上,源IP可以用来确定插入USB设备的终端。这些信息足以唯一标识任何一个USB设备。It can be understood that if the device information includes not only the VENDOR ID (manufacturer) and the PRODUCT ID (product number) of the USB device, but also the slot position of the USB device. For example, remote_usb_192.168.1.10_1_0, where 1 is the value of BUS and 0 is the value of PORT, the same batch of USB devices of the same manufacturer can be distinguished, so that the identification information of this embodiment includes the manufacturer. , product number, bus, port, source IP. The manufacturer and product number are the identifiers that come with the USB device shipped from the factory. The port and bus can characterize which slot of the USB device the USB device is in. The source IP can be used to determine the terminal plugged into the USB device. This information is sufficient to uniquely identify any USB device.
在相关技术中,当USB设备指向了虚拟机所运行的主机后,挂载了USB的虚拟机就只能在这台主机上启动,而无法跨主机启动,造成这个问题的原因是,主机上获取的USB设备的名称由主机上的USB客户端自行编排的,这导致每一个主机获取的同一个USB设备的名称可能不一致,从而导致跨主机启动时,虚拟机挂载错误的USB设备。对于这个问题,可选地,第一获取模块21获取的设备信息包括终端统一产生的USB设备名称。可选的,该USB设备名称可以由终端上的USB服务端统一产生,并由USB服务端通过与主机的USB客户端建立的通信链路转发给USB客户端的。由此,所有主机获取的同一个USB设备的名称都是一致的。通过这种方法,解决了挂载USB设备的虚拟机无法跨主机的问题。In the related art, when the USB device points to the host where the virtual machine is running, the virtual machine on which the USB is mounted can only be started on this host, and cannot be started across the host. The reason for this problem is that the host is on the host. The name of the obtained USB device is self-programmed by the USB client on the host, which causes the name of the same USB device acquired by each host to be inconsistent, resulting in the virtual machine mounting the wrong USB device when starting across the host. For this problem, optionally, the device information acquired by the first obtaining module 21 includes a USB device name uniformly generated by the terminal. Optionally, the USB device name may be uniformly generated by the USB server on the terminal, and forwarded by the USB server to the USB client through a communication link established with the USB client of the host. Thus, the names of the same USB devices acquired by all hosts are the same. In this way, the problem that the virtual machine on which the USB device is mounted cannot cross the host is solved.
采用本实施例的实现USB设备管理的主机,第一获取模块用于通过与终端建立的通信链路获取终端上的USB设备的设备信息;第二获取模块用于获取主机上的虚拟机信息;确定模块用于根据设备信息和虚拟机信息确定对USB设备的管理信息;管理模块用于根据管理信息对USB设备进行管理。本实施例的主机通过第一、二获取模块分别获取设备信息、虚拟机信息,通过确定模块确定对USB设备进行管理的管理信息,管理模块根据管理信息对,完成虚拟机对USB设备的管理,基于获取的设备信息和虚拟机信息进行USB设备的管理,管理方法简单有效,不需要执行繁琐的指令,不易出现错误。可选的,还可以排出由于终端上的USB设备被拔除导致的异常,可以提高通过本实施例的主机对虚拟机上的USB设备的管理效果,提高用户体验。With the host that implements USB device management in this embodiment, the first acquiring module is configured to obtain device information of the USB device on the terminal by using a communication link established with the terminal; and the second acquiring module is configured to obtain virtual machine information on the host; The determining module is configured to determine management information for the USB device according to the device information and the virtual machine information; the management module is configured to manage the USB device according to the management information. The host of the embodiment obtains the device information and the virtual machine information by using the first and second acquiring modules respectively, and determines the management information for managing the USB device by using the determining module, and the management module completes the management of the USB device by the virtual machine according to the management information pair. The management of the USB device is performed based on the acquired device information and the virtual machine information, and the management method is simple and effective, and does not need to execute cumbersome instructions, and is not prone to errors. Optionally, the abnormality caused by the USB device being removed from the terminal may be exhausted, and the management effect of the USB device on the virtual machine by the host in this embodiment may be improved, and the user experience is improved.
实施例三:Embodiment 3:
参见图3,本实施例提出一种实现USB设备管理的系统,包括虚拟化中 心31和主机32;虚拟化中心31设置为:获取主机上的虚拟机信息,通过主机获取终端上的USB设备的设备信息,以及根据设备信息和虚拟机信息确定对USB设备的管理信息,将管理信息发送给主机;主机32设置为:通过与终端33建立的通信链路获取终端上的USB设备的设备信息,接收管理信息,根据管理信息对USB设备进行管理。Referring to FIG. 3, this embodiment provides a system for implementing USB device management, including virtualization. The core 31 and the host 32; the virtualization center 31 is configured to: obtain virtual machine information on the host, obtain device information of the USB device on the terminal through the host, and determine management information of the USB device according to the device information and the virtual machine information, The management information is sent to the host; the host 32 is configured to: obtain the device information of the USB device on the terminal through the communication link established with the terminal 33, receive the management information, and manage the USB device according to the management information.
在本实施例中,虚拟化中心可以实现整个虚拟化资源的集中管理,包括主机信息,虚拟机信息等等。在本实施例中,虚拟化中心可以获取到终端上的USB设备的设备信息,以及主机上的虚拟机信息,通过这两个信息是按虚拟机对USB设备的管理。In this embodiment, the virtualization center can implement centralized management of the entire virtualized resource, including host information, virtual machine information, and the like. In this embodiment, the virtualization center may obtain device information of the USB device on the terminal and virtual machine information on the host, and the two pieces of information are managed by the virtual machine to the USB device.
本实施例的虚拟机发送的管理信息可以包括挂载指示、卸载指示以及删除指示,分别设置为控制虚拟机挂载USB设备,从虚拟机上卸载USB设备以及从虚拟机上删除USB设备。The management information sent by the virtual machine in this embodiment may include a mount indication, an uninstall indication, and a delete indication, respectively configured to control the virtual machine to mount the USB device, uninstall the USB device from the virtual machine, and delete the USB device from the virtual machine.
本实施例的主机32可以包括主机代理模块321,该主机代理模块321可以实现实施例二中主机上的第一、二获取模块、确定模块以及管理模块的功能。The host 32 of the embodiment may include a host proxy module 321 , which may implement the functions of the first and second acquisition modules, the determination module, and the management module on the host in the second embodiment.
主机和终端的通信可通在主机上设置USB客户端323,在终端33上设置USB服务端331来实现,USB客户端323和USB服务端331可以建立通信链路,实现通信。The communication between the host and the terminal can be implemented by setting the USB client 323 on the host, and setting the USB server 331 on the terminal 33. The USB client 323 and the USB server 331 can establish a communication link to implement communication.
参见图4,虚拟化中心通过主机获取终端上的USB设备的设备信息可以包括:Referring to FIG. 4, the virtualization center obtains the device information of the USB device on the terminal by using the host, and the information may include:
S401、虚拟化中心向主机代理模块发起USB查询请求,并指明终端的IP;S401. The virtualization center initiates a USB query request to the host proxy module, and indicates the IP of the terminal.
S402、主机代理模块接收USB查询请求,并转发给主机上的USB客户端;S402. The host proxy module receives the USB query request and forwards the request to the USB client on the host.
S403、USB客户端建立与指定终端上的USB服务端的TCP通信链路,通过该通信链路转发USB查询请求给终端上的USB服务端;S403. The USB client establishes a TCP communication link with the USB server on the designated terminal, and forwards the USB query request to the USB server on the terminal through the communication link.
S404、终端上的USB服务端执行USB查询信息,读取终端上的USB设备列表,通过通信链路将USB设备列表返回给主机上的US客户端; S404: The USB server on the terminal executes the USB query information, reads the USB device list on the terminal, and returns the USB device list to the US client on the host through the communication link;
S405、主机上的USB客户端返回USB设备列表给主机代理模块;S405. The USB client on the host returns a list of USB devices to the host agent module.
S406、主机代理模块将返回的USB设备列表转化为内部响应,发送给虚拟化中心;S406. The host proxy module converts the returned USB device list into an internal response and sends the list to the virtualization center.
S407、虚拟化中心接收内部响应,将其保存到数据库中,并在USB管理页面上显示。S407. The virtualization center receives the internal response, saves it to the database, and displays it on the USB management page.
虚拟化中心获取了USB设备的设备信息之后,可以将其存储在数据库中。为了方便用户对USB设备信息的查看和操作,虚拟化中心上还可以用于将USB设备信息在其USB管理页面上显示出来。虚拟化中心可以根据用户选择的待挂载的USB设备以及挂载USB设备的虚拟机确定挂载指示,将挂载指示发给主机代理模块,通过主机代理模块将设备信息写入虚拟机的配置文件中,以供虚拟机根据配置文件中的设备信息模拟出虚拟USB设备。After the virtualization center obtains the device information of the USB device, it can store it in the database. In order to facilitate the user to view and operate the USB device information, the virtualization center can also be used to display the USB device information on its USB management page. The virtualization center may determine the mount indication according to the USB device to be mounted selected by the user and the virtual machine on which the USB device is mounted, send the mount indication to the host proxy module, and write the device information to the virtual machine through the host proxy module. In the file, the virtual machine simulates the virtual USB device according to the device information in the configuration file.
可选的,虚拟化中心可以采用静态挂载和动态挂载两种方式将USB设备挂载到虚拟机上。静态挂载:虚拟化中心在虚拟机关机状态下,将待挂载的USB设备的设备信息写入虚拟机的配置文件中,便于虚拟机启动时直接根据配置文件中的设备信息模拟出虚拟USB设备。Optionally, the virtualization center can mount the USB device to the virtual machine in two ways: static mount and dynamic mount. Statically mount: The virtualized center writes the device information of the USB device to be mounted to the configuration file of the virtual machine in the state of the virtual machine. This facilitates the virtual machine to simulate virtual USB based on the device information in the configuration file. device.
动态挂载:虚拟化中心在虚拟机开机状态下,将待挂载的USB设备的设备信息写入虚拟机的配置文件中,发送挂载指示给主机代理模块,便于其根据挂载指示,调用动态挂载命令,控制虚拟机根据配置文件中的设备信息模拟出虚拟USB设备。Dynamically mount: In the virtual machine, the virtualized center writes the device information of the USB device to be mounted to the configuration file of the virtual machine, and sends a mount indication to the host proxy module, so that it can be called according to the mount indication. The dynamic mount command controls the virtual machine to simulate a virtual USB device based on the device information in the configuration file.
为了方便用户了解到虚拟机和已挂载的USB设备的对应关系等信息,本实施例的虚拟化中心还可以在USB设备管理页面上展示虚拟机和对应挂载在该虚拟机上的USB设备,展示这些USB设备所在的终端,以及USB设备的型号、大小等信息,便于用户在USB设备管理页面查看的时候,可以了解虚拟机和USB设备的状态,对应关系等信息,然后根据自己的需要对不同的USB设备进行管理。In order to facilitate the user to know the information such as the correspondence between the virtual machine and the mounted USB device, the virtualization center of the embodiment may also display the virtual machine and the USB device corresponding to the virtual machine on the USB device management page. Shows the terminal where these USB devices are located, as well as the model and size of the USB device. It is convenient for users to know the status, correspondence, and other information of the virtual machine and USB device when viewing the USB device management page, and then according to their own needs. Manage different USB devices.
本实施例的虚拟机的状态可以包括开机、关机、待机等等实体机具有的状态。可选的,本实施例的虚拟化中心控制虚拟机对USB设备的卸载包括:在虚拟机关机状态下,将待卸载的USB设备的设备信息从虚拟机的配置文 件中删除;或者在虚拟机开机状态下,发送动态卸载指示给主机代理模块,便于其根据动态卸载指示,调用动态卸载命令,删除虚拟机上根据配置文件中的设备信息模拟的虚拟USB设备。The state of the virtual machine of this embodiment may include a state of a physical machine such as power on, power off, standby, and the like. Optionally, the virtualization center of the embodiment controls the uninstallation of the USB device by the virtual machine, including: in the virtual machine state, the device information of the USB device to be uninstalled is configured from the configuration file of the virtual machine. Delete the device; or send a dynamic uninstallation indication to the host agent module when the virtual machine is powered on, so that it can invoke the dynamic uninstall command according to the dynamic uninstallation instruction, and delete the virtual USB device simulated on the virtual machine according to the device information in the configuration file.
在本实施例中,主机代理模块调用的动态挂载命令和动态卸载命令可以利用现有的软件来实现,例如主机代理模块可以调用libvirt函数库提供的动态挂载和动态卸载命令。下面以libvirt提供动态挂载和动态卸载命令为例,对动态挂载和动态卸载的详细过程做出示例说明。In this embodiment, the dynamic mount command and the dynamic unload command invoked by the host proxy module can be implemented by using existing software. For example, the host proxy module can invoke the dynamic mount and dynamic uninstall commands provided by the libvirt function library. The following is an example of libvirt providing dynamic mount and dynamic unload commands, and an example of the detailed process of dynamic mount and dynamic unload.
参见图5,是本实施例的系统采用动态挂载方式挂载USB设备的方法流程图,动态挂载的过程包括:Referring to FIG. 5, it is a flowchart of a method for mounting a USB device by using a dynamic mounting manner in the system of the embodiment. The dynamic mounting process includes:
S501、虚拟化中心向主机代理模块发出挂载指示;S501. The virtualization center sends a mount indication to the host proxy module.
S502、主机代理模块接收到挂载指示,将待挂载的USB设备的设备信息写入对应的虚拟机的配置文件中,调用libvirt提供的挂载命令,在虚拟机中模拟出待挂载的USB设备;S502. The host agent module receives the mounting instruction, writes the device information of the USB device to be mounted into the configuration file of the corresponding virtual machine, invokes a mount command provided by libvirt, and simulates to be mounted in the virtual machine. USB device;
S503、libvirt返回命令执行的结果给主机代理;S503, libvirt returns the result of the command execution to the host agent;
S504、主机代理发送命令响应给虚拟化中心。S504. The host agent sends a command response to the virtualization center.
参见图6,是本实施例的系统采用动态卸载方式卸载USB设备的方法流程图,动态卸载的过程如下;Referring to FIG. 6, which is a flowchart of a method for uninstalling a USB device by using a dynamic uninstall method in the system of the embodiment, the process of dynamic uninstallation is as follows;
S601、虚拟化中心向主机代理模块发出卸载指示;S601. The virtualization center sends an uninstallation instruction to the host proxy module.
S602、主机代理模块接收到卸载指示,将待卸载的USB设备的设备信息从对应的虚拟机的配置文件中删除,调用libvirt提供的卸载命令,在虚拟机中删除模拟的待卸载的USB设备;S602. The host agent module receives the uninstallation instruction, deletes the device information of the USB device to be uninstalled from the configuration file of the corresponding virtual machine, invokes an uninstall command provided by libvirt, and deletes the simulated USB device to be uninstalled in the virtual machine.
S603、libvirt返回命令执行的结果给主机代理模块;S603, libvirt returns the result of the command execution to the host proxy module;
S604、主机代理模块发送命令响应给虚拟化中心。S604. The host agent module sends a command response to the virtualization center.
当用户已经不需要对某个USB设备进行管理时,为了节约资源,可以将该USB设备从对应的虚拟机上删除。可选的,本实施例的虚拟化中心可以发送删除指示给主机代理模块,主机代理模块根据该指示确定待删除的USB设备是否挂载在虚拟机上,若挂载,则将其从虚拟机上卸载,将虚拟化中心中存储的对应的设备信息删除,完成USB设备的彻底删除。若没有 挂载,只需要将虚拟化中心存储的设备信息删除即可。When the user does not need to manage a USB device, in order to save resources, the USB device can be deleted from the corresponding virtual machine. Optionally, the virtualization center of the embodiment may send a deletion indication to the host proxy module, and the host proxy module determines, according to the indication, whether the USB device to be deleted is mounted on the virtual machine, and if it is mounted, the virtual machine is removed from the virtual machine. Uninstall, delete the corresponding device information stored in the virtualization center, and complete the complete deletion of the USB device. If not To mount, you only need to delete the device information stored in the virtualization center.
参见图7,是利用本实施例的系统删除USB设备的方法流程图,删除的具体过程如下:Referring to FIG. 7, which is a flowchart of a method for deleting a USB device by using the system of the embodiment, the specific process of deleting is as follows:
S701、虚拟化中心获取用户在USB设备管理页上选择的待删除的USB设备;S701. The virtualization center acquires the USB device to be deleted selected by the user on the USB device management page.
S702、虚拟化中心检查待删除的USB设备是否已挂载,如果已经挂载到虚拟机,进入S703,否则进入S704;S702, the virtualization center checks whether the USB device to be deleted is mounted, if it has been mounted to the virtual machine, proceeds to S703, otherwise proceeds to S704;
S703、发送删除指示给主机代理模块,控制虚拟机卸载USB设备,进入S704;S703, sending a delete indication to the host proxy module, controlling the virtual machine to uninstall the USB device, and proceeding to S704;
S704、从虚拟化中心的数据库中删除USB设备的设备信息。S704. Delete device information of the USB device from the database of the virtualization center.
为了保证用户对USB设备的挂载、卸载状态的了解,可选地,本实施例的虚拟机中心还用于对每个USB设备设置挂载标识信息,挂载标识信息配置为对USB设备的挂载状态和卸载状态进行标识。例如虚拟化中心可以将挂载标识信息该挂载标识信息设置为一个挂载标志位FLAG,若USB设备被挂载,则该标志位置为1,否,则对该标志位置清0;或者是,虚拟化中心用于在USB管理页面上点亮挂载的USB设备对应的图标或者是文字信息,熄灭卸载或未挂载的USB设备的图标或文字信息。这样就可以实时地反应当前USB设备的状态。可选的,虚拟化中心设置的挂载标识信息可以设置在虚拟化中心的USB管理页面上向用户展示,也可以是通过其他的方式向用户展示。The virtual machine center of the embodiment is further configured to set the mounting identifier information for each USB device, and the mounting identifier information is configured to be used for the USB device, in order to ensure the user's understanding of the mounting and unloading status of the USB device. The mount status and the uninstall status are identified. For example, the virtualization center may set the mount identification information to a mount flag FLAG. If the USB device is mounted, the flag is 1; if not, the flag is cleared to 0; or The virtualization center is used to illuminate the icon or text information corresponding to the mounted USB device on the USB management page, and to extinguish the icon or text information of the unmounted or unmounted USB device. This allows you to react to the current state of the USB device in real time. Optionally, the mount identifier information set by the virtualization center may be displayed on the USB management page of the virtualization center to be displayed to the user, or may be displayed to the user in other manners.
在实际管理USB设备的过程中,会存在虚拟机上的模拟的虚拟USB设备的状态和对应的实际的USB设备状态不符的时候。例如当在终端上的USB设备被拔走,会导致虚拟机无法启动,或是虚拟机使用时,无法在虚拟机上读写USB设备。为了解决这些问题,可选的,可以利用本实施例的虚拟化中心对虚拟机上的USB设备的异常情况进行处理。所以本实施例的虚拟化中心还可以用于定时发送USB查询请求,获取终端上的设备信息,将其与数据库中的设备信息进行比较,确定终端上被拔除的USB设备,从对应的虚拟机中卸载被拔除的USB设备,从数据库中删除被拔除的USB设 备的设备信息;还可以是对无法启动的虚拟机的配置文件中的设备信息与终端上的设备信息进行比较,确定终端上被拔除的USB设备,从无法启动的虚拟机的配置文件中删除设备信息。In the process of actually managing the USB device, there is a time when the state of the simulated virtual USB device on the virtual machine does not match the state of the corresponding actual USB device. For example, when the USB device on the terminal is unplugged, the virtual machine cannot be started, or the virtual machine cannot read or write the USB device on the virtual machine. In order to solve these problems, optionally, the virtualization center of the embodiment may be used to process an abnormal condition of the USB device on the virtual machine. Therefore, the virtualization center of the embodiment may be used to periodically send a USB query request, obtain device information on the terminal, compare it with device information in the database, and determine the USB device that is removed from the terminal, from the corresponding virtual machine. Unmount the removed USB device and remove the removed USB device from the database The device information of the standby device can be compared with the device information in the configuration file of the virtual machine that cannot be started, and the device information on the terminal is determined, and the USB device that is removed from the terminal is deleted, and the configuration file of the virtual machine that cannot be started is deleted. Device Information.
对于USB设备而言,不同厂家的USB设备,其VENDOR ID(生产商)与PRODUCT ID(产品)不一致,可以利用这两个值来区分插在同一个终端上的不同厂家的USB设备。但对于同一厂家的同一批次的USB设备,VENDOR与PRODUCT是一致的,如果两个同批次USB设备插在终端上,虚拟化中心区分起来就比较麻烦。为了解决同批次USB设备特征信息一致,导致冲突的问题,可选地,本实施例的虚拟化中心获取的设备信息中包含配置为对USB设备进行唯一标识的标识信息。具体的,标识信息可以包括生产商、产品编号、总线、端口、源IP。生产商和产品编号是USB设备出厂时自带的标识,端口和总线可以表征USB设备在终端的哪一个插槽上,源IP可以用来确定插入USB设备的终端。这些信息足以唯一标识任何一个USB设备。For USB devices, the USB device of different manufacturers has a VENDOR ID (producer) that is inconsistent with the PRODUCT ID (product). These two values can be used to distinguish USB devices of different manufacturers plugged into the same terminal. However, for the same batch of USB devices of the same manufacturer, VENDOR is consistent with PRODUCT. If two USB devices of the same batch are inserted in the terminal, the virtualization center is more troublesome to distinguish. In order to solve the problem that the same batch of USB device feature information is consistent, causing a conflict, the device information acquired by the virtualization center of the embodiment includes the identifier information configured to uniquely identify the USB device. Specifically, the identification information may include a manufacturer, a product number, a bus, a port, and a source IP. The manufacturer and product number are the identifiers that come with the USB device shipped from the factory. The port and bus can characterize which slot of the USB device the USB device is in. The source IP can be used to determine the terminal plugged into the USB device. This information is sufficient to uniquely identify any USB device.
在现有的技术中,USB设备指向了虚拟机所运行的主机后,挂载了USB的虚拟机就只能在这台主机上启动,而无法跨主机启动,造成这个问题的原因是,主机上获取的USB设备的名称是由主机的USB客户端自行编排的,这导致每一个主机获取的同一个USB设备的名称可能不一致,从而导致跨主机启动时,虚拟机挂载错误的USB设备。对于这个问题,解决方案可以是主机获取的设备信息包括终端统一产生的USB设备名称。可选的,该USB设备名称是由终端上的USB服务端同一产生的,主机上的客户端通过通信链路获取该设备名称供主机使用。In the existing technology, after the USB device points to the host where the virtual machine is running, the virtual machine on which the USB is mounted can only be started on this host, and cannot be started across the host. The reason for this problem is that the host The name of the USB device obtained on the host is self-programmed by the host's USB client. This causes the name of the same USB device acquired by each host to be inconsistent, resulting in the virtual machine mounting the wrong USB device when booting across the host. For this problem, the solution may be that the device information acquired by the host includes the USB device name uniformly generated by the terminal. Optionally, the USB device name is generated by the USB server on the terminal, and the client on the host acquires the device name through the communication link for use by the host.
采用本实施例的实现USB设备管理的系统,虚拟化中心可以获取主机上的虚拟机信息,通过主机获取终端上的USB设备的设备信息,以及根据设备信息和虚拟机信息确定对USB设备的管理信息,将管理信息发送给主机;主机可以通过与终端建立的通信链路获取终端上的USB设备的设备信息,接收虚拟化中心发送的管理信息,根据管理信息对USB设备进行管理。本实施例的系统结构简单,通过虚拟化中心和主机的交互以及主机根据虚拟化中心的指示对虚拟机的控制可以完成主机上的虚拟机对终端上的USB设 备的管理,管理过程中,不用执行繁杂的命令,没有复杂的步骤,管理简单有效,带给用户良好的体验。With the system for implementing USB device management in this embodiment, the virtualization center can obtain the virtual machine information on the host, obtain the device information of the USB device on the terminal through the host, and determine the management of the USB device according to the device information and the virtual machine information. The information is sent to the host by the management information. The host can obtain the device information of the USB device on the terminal through the communication link established with the terminal, receive the management information sent by the virtualization center, and manage the USB device according to the management information. The system of the embodiment has a simple structure. The interaction between the virtualization center and the host and the control of the virtual machine by the host according to the indication of the virtualization center can complete the USB setting on the virtual machine to the terminal on the host. In the management and management process, there is no need to execute complicated commands, no complicated steps, simple and effective management, and bring a good experience to users.
显然,本领域的技术人员应该明白,上述本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储介质(ROM/RAM、磁碟、光盘)中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。所以,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in a storage medium (ROM/RAM, diskette, optical disk) by a computing device, and in some cases The steps shown or described may be performed in an order different than that herein, or they may be separately fabricated into individual integrated circuit modules, or a plurality of the modules or steps may be implemented as a single integrated circuit module. Therefore, the invention is not limited to any particular combination of hardware and software.
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件(例如处理器)完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的每个模块/单元可以采用硬件的形式实现,例如通过集成电路来实现其相应功能,也可以采用软件功能模块的形式实现,例如通过处理器执行存储于存储器中的程序/指令来实现其相应功能。本发明不限制于任何特定形式的硬件和软件的结合。One of ordinary skill in the art will appreciate that all or a portion of the above steps may be performed by a program to instruct related hardware, such as a processor, which may be stored in a computer readable storage medium, such as a read only memory, disk or optical disk. Wait. Alternatively, all or part of the steps of the above embodiments may also be implemented using one or more integrated circuits. Correspondingly, each module/unit in the foregoing embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, being executed by a processor and stored in a memory. Programs/instructions to implement their respective functions. The invention is not limited to any specific form of combination of hardware and software.
虽然本申请所揭露的实施方式如上,但所述的内容仅为便于理解本申请而采用的实施方式,并非用以限定本申请,如本发明实施方式中的具体的实现方法。任何本申请所属领域内的技术人员,在不脱离本申请所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本申请的专利保护范围,仍须以所附的权利要求书所界定的范围为准。The embodiments disclosed in the present application are as described above, but the descriptions are only for the purpose of understanding the present application, and are not intended to limit the present application, such as the specific implementation method in the embodiments of the present invention. Any modifications and changes in the form and details of the embodiments may be made by those skilled in the art without departing from the spirit and scope of the disclosure. The scope defined by the appended claims shall prevail.
工业实用性Industrial applicability
本发明实施例简化了USB设备管理的复杂度,节省了USB设备的管理时长。 The embodiment of the invention simplifies the complexity of USB device management and saves the management time of the USB device.

Claims (19)

  1. 一种实现通用串行总线USB设备管理的方法,包括:A method for implementing universal serial bus USB device management, comprising:
    通过与终端建立的通信链路获取所述终端上的USB设备的设备信息;Obtaining device information of the USB device on the terminal by using a communication link established with the terminal;
    获取主机上的虚拟机信息;Obtain virtual machine information on the host;
    根据所述设备信息和所述虚拟机信息确定对所述USB设备的管理信息;Determining management information for the USB device according to the device information and the virtual machine information;
    根据所述管理信息对所述USB设备进行管理。The USB device is managed according to the management information.
  2. 如权利要求1所述的方法,其中,所述管理信息包括挂载指示和卸载指示;The method of claim 1, wherein the management information comprises a mount indication and an uninstall indication;
    当所述管理信息为挂载指示时,所述根据所述管理信息对所述USB设备进行管理包括:根据所述挂载指示,将所述设备信息写入所述虚拟机的配置文件中,以供所述虚拟机根据所述配置文件中的设备信息,模拟出虚拟USB设备;其中,一个USB设备挂载在一个虚拟机上;When the management information is a mount indication, the managing the USB device according to the management information includes: writing the device information into a configuration file of the virtual machine according to the mount indication, The virtual machine is configured to simulate a virtual USB device according to device information in the configuration file; wherein a USB device is mounted on a virtual machine;
    当所述管理信息为卸载指示时,所述根据管理信息对所述USB设备进行管理包括:根据卸载指示,从所述虚拟机的配置文件中删除所述设备信息,或将根据所述设备信息模拟的虚拟USB设备从所述虚拟机上删除。When the management information is an uninstallation indication, the managing the USB device according to the management information includes: deleting the device information from a configuration file of the virtual machine according to an uninstallation instruction, or according to the device information The simulated virtual USB device is deleted from the virtual machine.
  3. 如权利要求1所述的方法,其中,所述管理信息还包括删除指示;所述根据所述管理信息对所述USB设备进行管理包括:根据所述删除指示,确定所述USB设备是否已挂载到所述虚拟机上,若确定所述USB设备已挂载到所述虚拟机上,则从所述虚拟机上卸载所述USB设备。The method of claim 1, wherein the management information further comprises a deletion indication; the managing the USB device according to the management information comprises: determining, according to the deletion indication, whether the USB device is hung Loading on the virtual machine, if it is determined that the USB device is mounted on the virtual machine, the USB device is uninstalled from the virtual machine.
  4. 如权利要求1所述的方法,所述方法还包括:当虚拟机上的USB设备出现异常时,根据虚拟机上的USB设备的设备信息和终端上的USB设备的设备信息,确定终端上被拔除的USB设备,从所述虚拟机上卸载所述被拔除的USB设备。The method of claim 1, further comprising: determining, when the USB device on the virtual machine is abnormal, based on device information of the USB device on the virtual machine and device information of the USB device on the terminal The detached USB device unloads the extracted USB device from the virtual machine.
  5. 如权利要求1-4任一项所述的方法,其中,所述设备信息包括所述终端统一产生的USB设备名称。The method according to any one of claims 1 to 4, wherein the device information comprises a USB device name uniformly generated by the terminal.
  6. 如权利要求5所述的方法,其中,所述USB设备名称由所述终端上 的USB服务端统一产生,并由所述USB服务端通过与所述主机的USB客户端建立的通信链路转发给USB客户端。The method of claim 5 wherein said USB device name is on said terminal The USB server is uniformly generated and forwarded to the USB client by the USB server through a communication link established with the USB client of the host.
  7. 如权利要求1-4任一项所述的方法,其中,所述设备信息包括:配置为对所述USB设备进行唯一标识的标识信息。The method of any of claims 1-4, wherein the device information comprises: identification information configured to uniquely identify the USB device.
  8. 如权利要求7所述的方法,其中,所述标识信息包括:生产商、产品编号、总线、端口、源网络之间互连的协议IP。The method of claim 7, wherein the identification information comprises: a manufacturer, a product number, a bus, a port, a protocol IP interconnected between the source networks.
  9. 如权利要求1-4任一项所述的方法,其中,所述根据所述设备信息和所述虚拟机信息确定对所述USB设备的管理信息包括:接收外部的虚拟化中心根据所述设备信息和所述虚拟机信息确定的管理信息。The method according to any one of claims 1 to 4, wherein the determining management information for the USB device according to the device information and the virtual machine information comprises: receiving an external virtualization center according to the device Information and management information determined by the virtual machine information.
  10. 一种实现USB设备管理的主机,包括:第一获取模块,第二获取模块,确定模块以及管理模块;A host for implementing USB device management includes: a first acquisition module, a second acquisition module, a determination module, and a management module;
    所述第一获取模块设置为:通过与终端建立的通信链路获取所述终端上的USB设备的设备信息;The first acquiring module is configured to: acquire device information of the USB device on the terminal by using a communication link established with the terminal;
    所述第二获取模块设置为:获取主机上的虚拟机信息;The second obtaining module is configured to: acquire virtual machine information on the host;
    所述确定模块设置为:根据所述设备信息和所述虚拟机信息确定对所述USB设备的管理信息;The determining module is configured to: determine management information about the USB device according to the device information and the virtual machine information;
    所述管理模块设置为:根据所述管理信息,完成所述虚拟机对所述USB设备的管理。The management module is configured to: complete management of the USB device by the virtual machine according to the management information.
  11. 如权利要求10所述的主机,其中,所述管理信息包括挂载指示或卸载指示;所述管理模块包括挂载单元和卸载单元;The host of claim 10, wherein the management information comprises a mount indication or an uninstallation indication; the management module comprises a mount unit and an offload unit;
    所述挂载单元设置为,根据所述挂载指示,将所述设备信息写入所述虚拟机的配置文件中,以供所述虚拟机根据所述配置文件中的设备信息,模拟出虚拟USB设备;一个USB设备挂载在一个虚拟机上;The mounting unit is configured to write the device information into a configuration file of the virtual machine according to the mounting indication, so that the virtual machine simulates virtual according to device information in the configuration file. USB device; a USB device is mounted on a virtual machine;
    所述卸载单元设置为:根据所述卸载指示,从所述虚拟机的配置文件中删除所述设备信息,或将根据所述设备信息模拟的虚拟USB设备从所述虚拟机上删除。The unloading unit is configured to: delete the device information from a configuration file of the virtual machine according to the uninstall indication, or delete a virtual USB device simulated according to the device information from the virtual machine.
  12. 如权利要求10所述的主机,所述管理信息还包括删除指示; The host of claim 10, the management information further comprising a deletion indication;
    所述管理模块还包括删除单元,设置为根据所述删除指示,确定所述USB设备是否已挂载到所述虚拟机上,若确定所述USB设备已挂载到所述虚拟机上,则从所述虚拟机上卸载所述USB设备。The management module further includes a deleting unit, configured to determine, according to the deletion indication, whether the USB device is mounted on the virtual machine, and if it is determined that the USB device is mounted on the virtual machine, Unloading the USB device from the virtual machine.
  13. 如权利要求10所述的主机,所述主机还包括异常处理模块,设置为当虚拟机上的USB设备出现异常时,根据虚拟机上的USB设备的设备信息和终端上的USB设备的设备信息,确定终端上被拔除的USB设备,从所述虚拟机上卸载所述被拔除的USB设备。The host of claim 10, the host further comprising an exception processing module configured to: according to the device information of the USB device on the virtual machine and the device information of the USB device on the terminal when the USB device on the virtual machine is abnormal Determining the USB device that is removed from the terminal, and unmounting the extracted USB device from the virtual machine.
  14. 如权利要求10-13任一项所述的主机,其中,所述第一获取模块获取的所述设备信息包括终端统一产生的USB设备名称。The host device according to any one of claims 10 to 13, wherein the device information acquired by the first obtaining module includes a USB device name uniformly generated by the terminal.
  15. 如权利要求14所述的主机,其中,所述USB设备名称由所述终端上的USB服务端统一产生,并由所述USB服务端通过与所述主机的USB客户端建立的通信链路转发给USB客户端。The host of claim 14, wherein the USB device name is uniformly generated by a USB server on the terminal, and is forwarded by the USB server through a communication link established with a USB client of the host. Give the USB client.
  16. 如权利要求10-13任一项所述的主机,其中,所述第一获取模块获取的所述设备信息包括:配置为对所述USB设备进行唯一标识的标识信息。The host device according to any one of claims 10 to 13, wherein the device information acquired by the first obtaining module comprises: identification information configured to uniquely identify the USB device.
  17. 如权利要求16所述的主机,其中,所述第一获取模块获取的所述标识信息包括:生产商、产品编号、总线、端口、源IP。The host of claim 16, wherein the identification information acquired by the first obtaining module comprises: a manufacturer, a product number, a bus, a port, and a source IP.
  18. 如权利要求10-13任一项所述的主机,其中,所述确定模块包括接收单元,设置为接收外部的虚拟化中心根据所述设备信息和所述虚拟机信息确定的管理信息。The host according to any one of claims 10 to 13, wherein the determining module comprises a receiving unit configured to receive management information determined by the external virtualization center based on the device information and the virtual machine information.
  19. 一种实现USB设备管理的系统,包括虚拟化中心和主机;A system for implementing USB device management, including a virtualization center and a host;
    所述虚拟化中心设置为:获取所述主机上的虚拟机信息,通过所述主机获取终端上的USB设备的设备信息,以及根据所述设备信息和所述虚拟机信息确定对所述USB设备的管理信息,将所述管理信息发送给所述主机;The virtualization center is configured to: acquire virtual machine information on the host, acquire device information of the USB device on the terminal by using the host, and determine, according to the device information and the virtual machine information, the USB device. Management information, the management information is sent to the host;
    所述主机设置为:通过与终端建立的通信链路获取终端上的USB设备的设备信息并将其转发给所述虚拟化中心,接收所述虚拟化中心发送的所述管理信息,根据所述管理信息,完成所述虚拟机对所述USB设备的管理。 The host is configured to: acquire device information of the USB device on the terminal by using a communication link established with the terminal, and forward the device information to the virtualization center, and receive the management information sent by the virtualization center, according to the Management information, completing management of the USB device by the virtual machine.
PCT/CN2017/079456 2016-04-28 2017-04-05 Method, host, and system for implementing usb device management WO2017185954A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610277997.4 2016-04-28
CN201610277997.4A CN107341039A (en) 2016-04-28 2016-04-28 Method, main frame and the system being managed under a kind of virtual environment to USB device

Publications (1)

Publication Number Publication Date
WO2017185954A1 true WO2017185954A1 (en) 2017-11-02

Family

ID=60161865

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/079456 WO2017185954A1 (en) 2016-04-28 2017-04-05 Method, host, and system for implementing usb device management

Country Status (2)

Country Link
CN (1) CN107341039A (en)
WO (1) WO2017185954A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107943560A (en) * 2017-11-27 2018-04-20 郑州云海信息技术有限公司 The hanging method and carry device of a kind of universal serial bus device
CN109284170B (en) * 2018-09-11 2021-10-26 山东观海数据技术有限公司 USB sharing system and sharing method in local area network
CN110413376A (en) * 2019-07-12 2019-11-05 苏州浪潮智能科技有限公司 A kind of method, equipment and the storage medium of Virtual Machine Manager USB device
CN110928644A (en) * 2019-11-15 2020-03-27 北京浪潮数据技术有限公司 USB management method, device, equipment and medium based on cloud platform
CN111103989A (en) * 2020-01-09 2020-05-05 南京艾拓维讯信息技术有限公司 KVM system for supermarket collection and payment condition management and transparent transmission method
CN114896188A (en) * 2022-04-26 2022-08-12 深圳市科陆电子科技股份有限公司 Method and system for network sharing automatic adaptation of USB (universal serial bus) equipment
CN115391255B (en) * 2022-10-27 2023-01-31 北京恩威特科技有限公司 High-availability USB equipment sharing server
CN116955236B (en) * 2023-09-20 2023-12-12 元内核(北京)科技有限公司 USB device sharing method and system based on virtualization

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101980165A (en) * 2010-11-04 2011-02-23 福建升腾资讯有限公司 Method for realizing soft-swap of universal serial bus (USB) equipment on virtual server
US20110107003A1 (en) * 2009-11-05 2011-05-05 Electronics And Telecommunications Research Institute Remote usb system for supporting multiple virtual machines of multiple host and method thereof
CN104317759A (en) * 2014-10-15 2015-01-28 国云科技股份有限公司 Method for supporting hot plugging of virtual machine USB (universal serial bus) storage equipment
CN104657690A (en) * 2013-11-20 2015-05-27 中兴通讯股份有限公司 External equipment control method and device
CN104991871A (en) * 2015-06-15 2015-10-21 湖南昇云科技有限公司 Method and system for redirecting cloud terminal USB

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8646028B2 (en) * 2009-12-14 2014-02-04 Citrix Systems, Inc. Methods and systems for allocating a USB device to a trusted virtual machine or a non-trusted virtual machine
US9804990B2 (en) * 2014-08-27 2017-10-31 Vmware, Inc. Sharing unclaimed USB devices as PCI devices
CN105488000B (en) * 2015-12-23 2018-09-14 数安时代科技股份有限公司 Realize the method and system that USB device quickly accesses

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110107003A1 (en) * 2009-11-05 2011-05-05 Electronics And Telecommunications Research Institute Remote usb system for supporting multiple virtual machines of multiple host and method thereof
CN101980165A (en) * 2010-11-04 2011-02-23 福建升腾资讯有限公司 Method for realizing soft-swap of universal serial bus (USB) equipment on virtual server
CN104657690A (en) * 2013-11-20 2015-05-27 中兴通讯股份有限公司 External equipment control method and device
CN104317759A (en) * 2014-10-15 2015-01-28 国云科技股份有限公司 Method for supporting hot plugging of virtual machine USB (universal serial bus) storage equipment
CN104991871A (en) * 2015-06-15 2015-10-21 湖南昇云科技有限公司 Method and system for redirecting cloud terminal USB

Also Published As

Publication number Publication date
CN107341039A (en) 2017-11-10

Similar Documents

Publication Publication Date Title
WO2017185954A1 (en) Method, host, and system for implementing usb device management
US9021480B2 (en) Security management device and method
US8738883B2 (en) Snapshot creation from block lists
CN102402446B (en) Method and device for installing application software
CN102799464B (en) Virtual machine creation method and system, virtual machine reloading method and system
US10303458B2 (en) Multi-platform installer
TWI492064B (en) Cloud system and the boot up and deployment method for the cloud system
US11210132B2 (en) Virtual machine migration in virtualization environment having different virtualization systems
CN110347483B (en) Method and device for migrating physical machine to virtual machine and storage medium
JP6089065B2 (en) Update method and computer system
WO2018192478A1 (en) Cloud management platform, virtual machine management method, system thereof
CN106980493B (en) Firmware management method and device
US20190205109A1 (en) Computer system, baseboard management controller, and os installation method
CN112527397A (en) Method and device for modifying basic input output system options and computer equipment
CN110825419B (en) Firmware refreshing method and device, electronic equipment and storage medium
US11403113B2 (en) Server with system setting data synchronization function
CN108234174B (en) Management method and device of virtual network function
CN112099902A (en) Network adapter configuration method and device of virtual machine, electronic device and storage medium
WO2023098052A1 (en) Server operation and maintenance method and apparatus, and device and storage medium
CA2997302C (en) Application migration
CN115357198A (en) Mounting method and device of storage volume, storage medium and electronic equipment
WO2017096889A1 (en) Method and device for upgrading and downgrading system
CN111147400B (en) Method and device for command line configuration synchronization and electronic equipment
CN114020308A (en) Camera equipment upgrading method, device, equipment and medium
CN114116030A (en) Operating system running method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 17788607

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17788607

Country of ref document: EP

Kind code of ref document: A1