WO2015074391A1 - Method and apparatus for mounting peripheral components on multiple virtual machines - Google Patents

Method and apparatus for mounting peripheral components on multiple virtual machines Download PDF

Info

Publication number
WO2015074391A1
WO2015074391A1 PCT/CN2014/078077 CN2014078077W WO2015074391A1 WO 2015074391 A1 WO2015074391 A1 WO 2015074391A1 CN 2014078077 W CN2014078077 W CN 2014078077W WO 2015074391 A1 WO2015074391 A1 WO 2015074391A1
Authority
WO
WIPO (PCT)
Prior art keywords
identification code
virtual machine
server
terminal
peripheral component
Prior art date
Application number
PCT/CN2014/078077
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 WO2015074391A1 publication Critical patent/WO2015074391A1/en

Links

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
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Abstract

Disclosed are a method and an apparatus for mounting peripheral components on multiple virtual machines. The method comprises: after a server receives a first message that is sent by a first terminal and is for establishing a connection with a peripheral component, the server obtaining an identification code uniquely identifying the peripheral component from the first message; the server establishing a connection with the terminal, so that the server accesses the peripheral component and connects the peripheral component to a corresponding virtual machine, so as to implement the mounting of the peripheral component of the virtual machine; and storing a correspondence between the virtual machine and the terminal according to the identification code, so that the server determines the corresponding virtual machine according to the received identification code. The method and the apparatus disclosed in the present invention solve the problem that the usability for a user is not high because an existing server cannot distinguish content of each terminal, and a CD-ROM drive can be mounted on only one virtual machine on a same host so as to install an operating system.

Description

一种实现多虚拟机挂载外设部件的方法及装置 技术领域 本发明涉及通信网络技术领域,尤其涉及一种多虚拟机挂载光驱方法 及装置。 背景技术  The present invention relates to the field of communication network technologies, and in particular, to a multi-virtual machine mounted optical drive method and apparatus. Background technique
云计算(Cloud Computing )作用是将计算资源(CPU、 内存 λ 网络和 存储资源简化为同水电一样易用的资源,用户通过网络即可方便的使用。  The role of Cloud Computing is to simplify computing resources (CPU, memory λ network and storage resources into resources that are as easy to use as hydropower, and users can easily use it over the network.
虚拟化技术是云计算的一种重要支撑技术,通过虚拟化技术可以扩大 硬件的容量,简化软件的重新配置过程。 通过 CPU、 内存、 网络的虚拟化 技术可以允许一个平台同时运行多个虚拟机,并且每一个虚拟机都可以独 立运行而互不影响,从而显著提高工作效率。  Virtualization technology is an important supporting technology for cloud computing. Virtualization technology can expand the capacity of hardware and simplify the software reconfiguration process. Virtualization technology through CPU, memory, and network allows one platform to run multiple virtual machines at the same time, and each virtual machine can run independently without affecting each other, which significantly improves work efficiency.
当云平台搭建完成后,需要首先创建出一个虚拟机模板或者镜像,通 过此模板和镜像可以批量部署并发放虚拟机。  After the cloud platform is set up, you need to create a virtual machine template or mirror. You can deploy and distribute VMs in batches through this template and mirror.
目前创建虚拟机模板或者镜像的通用方式是首先创建一个带有裸巻的 虚拟机,然后给虚拟机挂载便携电脑或者服务器的镜像为虚拟机光驱后进 行操作系统的安装。  The current common way to create a virtual machine template or image is to first create a virtual machine with a naked virtual machine, and then mount the virtual machine to mount the laptop or the image of the server as a virtual machine drive.
而挂载光驱的方式有多种,包括基于共享的通用 Internet 文件系统 (Common Internet File System ,CIFS) 协议和基于浏览方式的小封装( Small Form Factor , SFF )协议。 现有技术中如果多个终端同时连接服务器端后, 服务器无法区分每一个终端内容,最终表现同一个主机只能有一个虚拟机 挂载光驱进行操作系统的安装,所以导致用户易用性不高。 发明内容  There are many ways to mount an optical drive, including the shared Common Internet File System (CIFS) protocol and the Small Form Factor (SFF) protocol. In the prior art, if multiple terminals are connected to the server at the same time, the server cannot distinguish each terminal content, and finally the same host can only have one virtual machine mounted with the optical drive to install the operating system, so the user is not easy to use. . Summary of the invention
本发明提供一种实现多虚拟机挂载外设部件的方法及装置,本发明所 提供的方法和装置解决现有技术中服务器无法区分每一个终端内容,最终 表现同一个主机只能有一个虚拟机挂载光驱进行操作系统的安装,所以导 致用户易用性不高的问题。 The present invention provides a method and apparatus for implementing a multi-virtual machine to mount peripheral components, and the present invention The provided method and device solve the problem that the server in the prior art cannot distinguish each terminal content, and finally the same host can only have one virtual machine mounted with the optical drive to install the operating system, so the user is not easy to use.
第一方面,提供一种实现多虚拟机挂载外设部件的方法,该方法包括: 服务器接收到一终端发送的建立外设部件连接的第一消息后,从所述 第一消息中获取唯一标示所述外设部件的识别码;  In a first aspect, a method for implementing a multi-virtual machine to mount a peripheral component is provided. The method includes: after receiving a first message sent by a terminal to establish a connection of a peripheral component, the server obtains a uniqueness from the first message. Identifying an identification code of the peripheral component;
服务器与所述终端建立连接,使得服务器访问所述外设部件,并将所 述外设部件连接到对应的虚拟机中,实现所述虚拟机的外设部件挂载; 根据所述识别码存储所述虚拟机与所述终端的对应关系,使得服务器 根据接收到的识别码确定对应的虚拟机。  Establishing a connection between the server and the terminal, so that the server accesses the peripheral component, and connects the peripheral component to the corresponding virtual machine, and implements mounting of the peripheral component of the virtual machine; storing according to the identifier Corresponding relationship between the virtual machine and the terminal, so that the server determines the corresponding virtual machine according to the received identification code.
结合第一方面,在第一种可能的实现方式中,所述第一消息中包括: 标识信息,用于指示所述外设部件的类型;  With reference to the first aspect, in a first possible implementation, the first message includes: identifier information, used to indicate a type of the peripheral component;
识别码,用于唯一标示挂载在服务器上的所述外设部件。  An identification code for uniquely indicating the peripheral component mounted on the server.
结合第一方面或者第一方面的第一种可能的实现方式,在第二种可能 的实现方式中,从所述第一消息中获取唯一标示所述外设部件的识别码包 括:  In conjunction with the first aspect or the first possible implementation of the first aspect, in a second possible implementation, obtaining an identifier that uniquely identifies the peripheral component from the first message includes:
从指定标志位获取识别码的长度值,从预设位置开始获取所述长度值 对应的识别码;或者  Obtaining a length value of the identification code from the specified flag bit, and acquiring an identifier corresponding to the length value from the preset position; or
从预设位置获取存储识别码的起始位置和所述识别码的长度值,从所 述起始位置开始读取与所述长度值对应的识别码。  The start position of the storage identification code and the length value of the identification code are obtained from the preset position, and an identification code corresponding to the length value is read from the start position.
结合第一方面,或者第一方面的第一至二种可能的实现方式,在第三 种可能的实现方式中,该方法还包括:  With reference to the first aspect, or the first to the second possible implementation manners of the first aspect, in a third possible implementation manner, the method further includes:
当接收到多个访问终端同时对不同虚拟机进行访问的第二请求时,从 所述第二请求中获取识别码,并根据获取到的识别码确定每个访问终端对 应访问的目标虚拟机。  When receiving the second request that the plurality of access terminals access the different virtual machines at the same time, the identification code is obtained from the second request, and the target virtual machine corresponding to each access terminal is determined according to the obtained identification code.
结合第一方面,或者第一方面的第一至三种可能的实现方式,在第四 种可能的实现方式中,根据获取到的识别码确定每个访问终端对应访问的 目标虚拟机之后,进一步包括: In combination with the first aspect, or the first to third possible implementations of the first aspect, at the fourth After the target virtual machine corresponding to each access terminal is determined according to the obtained identification code, the method further includes:
服务器发送访问请求到所述目标虚拟机对应的目标终端,并接收目标 终端针对所述访问请求返回的数据流,并将所述数据流反馈给所述访问终 第二方面,提供一种服务器,该服务器包括:  Sending, by the server, an access request to the target terminal corresponding to the target virtual machine, and receiving a data flow returned by the target terminal for the access request, and feeding back the data flow to the second aspect of the access terminal, providing a server, The server includes:
获取模块,用于接收到一终端发送的建立外设部件连接的第一消息后, 从所述第一消息中获取唯一标示所述外设部件的识别码;  An obtaining module, configured to obtain, after receiving a first message sent by a terminal to establish a connection of a peripheral component, obtain an identifier that uniquely identifies the peripheral component from the first message;
挂载模块,用于与所述终端建立连接,使得服务器访问所述外设部件, 并将所述外设部件连接到对应的虚拟机中,实现所述虚拟机的外设部件挂 载;  a mounting module, configured to establish a connection with the terminal, so that the server accesses the peripheral component, and connects the peripheral component to a corresponding virtual machine to implement peripheral component mounting of the virtual machine;
存储模块,用于根据所述识别码存储所述虚拟机与所述终端的对应关 系,使得服务器根据接收到的识别码确定对应的虚拟机。  And a storage module, configured to store, according to the identifier, a correspondence between the virtual machine and the terminal, so that the server determines a corresponding virtual machine according to the received identifier.
结合第二方面,在第一种可能的实现方式中,获取模块从所述第一消 息中获取唯一标示所述外设部件的识别码包括:  With reference to the second aspect, in a first possible implementation, the obtaining module obtains the identifier that uniquely identifies the peripheral component from the first message, including:
从指定标志位获取识别码的长度值,从预设位置开始获取所述长度值 对应的识别码;或者,从预设位置获取存储识别码的起始位置和所述识别 码的长度值,从所述起始位置开始读取与所述长度值对应的识别码。  Obtaining a length value of the identifier from the specified flag bit, and acquiring an identifier corresponding to the length value from the preset position; or acquiring a starting position of the storage identifier and a length value of the identifier from the preset position, The starting position begins to read an identification code corresponding to the length value.
结合第二方面或者第二方面的第一种可能的实现方式,在第二种可能 的实现方式中,该服务器还包括:  With reference to the second aspect or the first possible implementation manner of the second aspect, in a second possible implementation manner, the server further includes:
访问接收模块,用于接收到多个访问终端同时对不同虚拟机进行访问 的第二请求时,从所述第二请求中获取识别码,并根据获取到的识别码确 定每个访问终端对应访问的目标虚拟机。  The access receiving module is configured to: when receiving the second request that the multiple access terminals access the different virtual machines at the same time, obtain the identification code from the second request, and determine, according to the obtained identification code, the corresponding access of each access terminal The target virtual machine.
结合第二方面的第二种可能的实现方式,在第三种可能的实现方式中, 访问接收模块还用于发送访问请求到所述目标虚拟机对应的目标终端,并 接收目标终端针对所述访问请求返回的数据流,并将所述数据流反馈给所 述访问终端。 With reference to the second possible implementation of the second aspect, in a third possible implementation, the access receiving module is further configured to send an access request to the target terminal corresponding to the target virtual machine, and receive the target terminal for the Accessing the data stream returned by the request and feeding back the data stream to the Said access terminal.
上述技术方案中的一个或两个,至少具有如下技术效果:  One or both of the above technical solutions have at least the following technical effects:
本发明实施例所提供的方法和装置进行虚拟机光驱挂载时通过唯一标 示终端的识别码区分每个终端,从而使得服务器能够根据识别码区分各虚 拟机,并且还能根据终端携带的识别码确定终端需要访问的虚拟机,所以 多个终端同时给多个虚拟机挂载光驱之后,不同终端可以是同时对虚拟机 进行操作(该操作包括:安装操作系统或者软件拷贝等 附图说明  The method and the device provided by the embodiments of the present invention distinguish each terminal by using an identification code that uniquely identifies the terminal when the virtual machine optical disk drive is mounted, so that the server can distinguish each virtual machine according to the identification code, and can also be based on the identification code carried by the terminal. Determine the virtual machine that the terminal needs to access. Therefore, after multiple terminals mount the optical drive to multiple virtual machines at the same time, different terminals can simultaneously operate the virtual machine (this operation includes: installing the operating system or software copy, etc.)
图 1 为本发明实施例一种实现多虚拟机挂载外设部件的方法的流程示 意图;  1 is a schematic flow chart of a method for implementing a multi-virtual machine to mount peripheral components according to an embodiment of the present invention;
图 1A 为本发明实施例一种实现多虚拟机挂载外设部件的方法具体应 用时的流程示意图;  FIG. 1 is a schematic flowchart of a specific application method for implementing a method for mounting a peripheral component of a multi-virtual machine according to an embodiment of the present invention; FIG.
图 2为本发明实施例一种服务器的结构示意图;  2 is a schematic structural diagram of a server according to an embodiment of the present invention;
图 3 为本发明实施例一种实现多虚拟机挂载外设部件的装置的结构示 意图。 具体实施方式  FIG. 3 is a schematic diagram showing the structure of an apparatus for implementing a peripheral component of a multi-virtual machine according to an embodiment of the present invention. detailed description
因为现有技术中,SFF协议由于消息格式长度和内存相同,多个 Client 同时连接 Server端后,服务器无法区分每一个 Client端内容,最终表现同 一个主机只能有一个虚拟机挂载光驱进行操作系统的安装,所以导致用户 易用性不高。  Because in the prior art, the SFF protocol has the same message format length and memory. After multiple clients are connected to the server at the same time, the server cannot distinguish each client-side content, and finally the same host can only have one virtual machine mounted on the optical drive for operation. The installation of the system, so the user is not easy to use.
为了克服现有技术中的上述问题,本发明提供一种实现多虚拟机挂载 外设部件方法,该方法包括:  In order to overcome the above problems in the prior art, the present invention provides a method for implementing a multi-virtual machine to mount a peripheral component, the method comprising:
服务器接收到一终端发送的建立外设部件连接的第一消息后,从所述 第一消息中获取唯一标示所述外设部件的识别码; 服务器与所述终端建立连接,使得服务器访问所述外设部件,并将所 述外设部件连接到对应的虚拟机中,实现所述虚拟机的外设部件挂载; 根据所述识别码存储所述虚拟机与所述终端的对应关系,使得服务器 根据接收到的识别码确定对应的虚拟机。 After receiving the first message sent by the terminal to establish a connection of the peripheral component, the server obtains an identifier that uniquely identifies the peripheral component from the first message; Establishing a connection between the server and the terminal, so that the server accesses the peripheral component, and connects the peripheral component to the corresponding virtual machine, and implements mounting of the peripheral component of the virtual machine; storing according to the identifier Corresponding relationship between the virtual machine and the terminal, so that the server determines the corresponding virtual machine according to the received identification code.
在本发明实例中,进行虚拟机光驱挂载时通过唯一标示终端的识别码 区分每个终端,从而使得服务器能够根据识别码区分各虚拟机,并且还能 根据终端携带的识别码确定终端需要访问的虚拟机,所以多个终端同时给 多个虚拟机挂载光驱之后,不同终端可以是同时对虚拟机进行操作(该操 作包括:安装操作系统或者软件拷贝等  In the example of the present invention, each virtual terminal is distinguished by an identification code that uniquely identifies the terminal when the virtual machine optical disk drive is mounted, so that the server can distinguish each virtual machine according to the identification code, and can also determine that the terminal needs to access according to the identification code carried by the terminal. The virtual machine, so after multiple terminals mount the optical drive to multiple virtual machines at the same time, different terminals can simultaneously operate the virtual machine (this operation includes: installing an operating system or software copy, etc.)
下文具体实施方式的某些部分是以算法的形式展现的,这些算法包括 对于计算机存储器内储存的数据进行的操作。 算法大体上是指造成所需结 果的操作的自洽序列。 这些操作通常需要或涉及到物理操纵或物理量。 通 常(但不是必然),这些量采取电信号或磁信号的形式,这些信号能够被 储 存、 传输、 合并、 比较和以其他方式受到操纵。 业已证明,有时(主要是 为了通常使用的原因),将这些信号称为位、 值、 元素、 符号、 字符、 项、 数等等是方便的。  Some portions of the detailed description below are presented in the form of an algorithm that includes operations on data stored in a computer memory. An algorithm generally refers to a self-consistent sequence of operations that result in a desired result. These operations typically require or involve physical manipulation or physical quantities. Typically, but not necessarily, these quantities take the form of electrical or magnetic signals that can be stored, transferred, combined, compared, and otherwise manipulated. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, and so forth.
但是应当牢记,这些以及类似的所有术语是与适当的物理量相关联的, 并且仅仅是应用于这些量的方便的标号。 除非下文中明显地以其他形 式另 有说明外,整个说明书中使用诸如"处理"或"计算"或"判定"或"显示"等术语 所进行的说明可以指数据处理系统或类似电子装置进行的动作和处理,所 述动作和处理操纵计算机的寄存器和存储器内以物理(电子)量表示的数 据并将其转换成该系统的存储器或寄存器(或其他这类信息存储、 传输或 显示的装置)内类似地以物理量的形式表示的其他数据。  It should be borne in mind, however, that all of these and similar terms are associated with the appropriate physical quantities and are merely a convenient reference to the quantities. The descriptions of terms such as "processing" or "calculating" or "determining" or "displaying" may be used throughout the specification to mean a data processing system or similar electronic device, unless otherwise explicitly stated otherwise. Actions and processes that manipulate data in a computer's registers and memory in physical (electronic) quantities and convert them into memory or registers of the system (or other such means of storing, transmitting, or displaying such information). Other data that is similarly represented in the form of physical quantities.
本发明可以涉及用于执行本申请中所述操作中的一项或多项操作的设 备。 该设备可以为所需的目的而专门构造,或者也可以包括通用计算机, 所述通用计算机由储存在该计算机中的计算机程序选择性地激活 (activate) 或重构( reconfigure^ 这样的计算机程序可以被储存在机器 (例如计算机) 可读介质中或者存储在适于储存电子指令并分别耦联到总线的任何类型介 质中,所述计算机可读介质包括但不限于任何类型的盘 (包括软盘、 光盘、 CD-ROM The invention may relate to an apparatus for performing one or more of the operations described herein. The device may be specially constructed for the required purposes, or may also include a general purpose computer selectively activated by a computer program stored in the computer. Or reconfigure such computer program may be stored in a machine (eg computer) readable medium or in any type of medium suitable for storing electronic instructions and respectively coupled to a bus, the computer readable medium comprising But not limited to any type of disk (including floppy disk, CD, CD-ROM)
关系,所以如果挂载成功后,用户终端想要访问对应的虚拟机,则可以在 访问请求中携带识别码,从而服务器就可以根据携带的识别码对应的找到 需要访问的虚拟机。 解决多个终端同时对应给多个虚拟机挂载外设部件后, 服务器无法识别的问题。 Relationship, so if the user terminal wants to access the corresponding virtual machine after the mount is successful, the identifier can be carried in the access request, so that the server can find the virtual machine to be accessed according to the carried identifier. Solve the problem that the server does not recognize the multiple terminals when they are attached to multiple virtual machines at the same time.
多个终端同时给多个虚拟机挂载光驱后,如果终端同时安装操作系统 或者是软件拷贝的具体实现可以是:  After multiple terminals mount optical drives to multiple virtual machines at the same time, if the terminal installs the operating system at the same time or the software copy is implemented, it can be:
当接收到多个访问终端同时对不同虚拟机进行访问的第二请求时,从 所述第二请求中获取识别码,并根据获取到的识别码确定每个访问终端对 应访问的目标虚拟机。  When receiving the second request that the plurality of access terminals access the different virtual machines at the same time, the identification code is obtained from the second request, and the target virtual machine corresponding to each access terminal is determined according to the obtained identification code.
为了  In order
服务器发送访问请求到所述目标虚拟机对应的目标终端,并接收目标 终端针对所述访问请求返回的数据流,并将所述数据流反馈给所述访问终 在本发明实施例中,终端在为虚拟机挂载外设部件的时候用识别码区 分每个终端和虚拟机,所以当虚拟机挂载外设部件完成后,服务器就可以 根据终端访问虚拟机的请求中携带的识别码确定终端需要访问的虚拟机, 从而使得多个终端可以同时对对应的虚拟机安装操作系统或者是软件拷 贝。  The server sends an access request to the target terminal corresponding to the target virtual machine, and receives the data flow returned by the target terminal for the access request, and feeds back the data flow to the access terminal. In the embodiment of the present invention, the terminal is When the peripheral component is mounted for the virtual machine, each terminal and the virtual machine are distinguished by the identification code. Therefore, after the virtual machine mounts the peripheral component, the server can determine the terminal according to the identification code carried in the request of the terminal to access the virtual machine. The virtual machine that needs to be accessed, so that multiple terminals can install an operating system or a software copy to the corresponding virtual machine at the same time.
为了更详细的说明本发明实施例所提供的方案,以下以光驱挂载为例 对本发明方案做进一步详细的说明:  In order to explain the solution provided by the embodiment of the present invention in more detail, the following is a detailed description of the solution of the present invention by taking an optical drive mount as an example:
如表 1所示,现有技术 SFF协议中建立光驱连接消息的结构,其中, SFF协议建立光驱连接消息大小为 12字节 (Byte) ,—般第 0个字节代表该 消息是建立光驱连接消息;第 1 个字节代表该消息是为了实现光驱挂载; 该消息中后面 2-11个字节全 0 ,无表示。 这样每一个 Client发送的建立光 驱连接消息格式和长度均相同,所以当多个 Client建立连接后, Server端无 法确定挂载光驱之后形成的镜像文件属于哪一个 Client 0 ( byte ) 1 2 11 As shown in Table 1, the structure of the optical drive connection message is established in the prior art SFF protocol, wherein the size of the optical drive connection message established by the SFF protocol is 12 bytes (Byte), and the 0th byte represents that the message is to establish an optical drive connection. Message; the first byte represents the message is to achieve the optical drive mount; the next 2-11 bytes in the message are all 0, no representation. The format and length of the optical drive connection message sent by each client are the same. Therefore, when multiple clients establish a connection, the server cannot determine which client the image file formed after the optical drive is mounted belongs to. 0 ( byte ) 1 2 11
Device—Type Device_Type_CDrom 0 0  Device—Type Device_Type_CDrom 0 0
表 1  Table 1
基于现有技术的上述问题,本发明实施例所提供的方法是对 SFF协议 的建立连接消息进行修改,修改的主要目的是在所述立连接消息中添加区 分各终端的和镜像文件的识别码,其中修改后的所述建立光驱连接消息中 包括:  Based on the above problem of the prior art, the method provided by the embodiment of the present invention is to modify the establishment connection message of the SFF protocol, and the main purpose of the modification is to add an identification code for distinguishing each terminal and the image file in the connection connection message. The modified optical drive connection message includes:
标识信息 (表 1 中第 0 字节的 Device_Type 和第 1 字节的 Device_Type_CDrom ) ,用于指示所述外设部件的类型;  Identification information (Device_Type of the 0th byte in Table 1 and Device_Type_CDrom of the 1st byte) for indicating the type of the peripheral component;
在本发明实施例中,因为外设部件的类型包括多种,例如:光驱、 软 驱和 USB等。 而且每个类型的外设部件还可以包括多种类型。 所以所述标 识信息可以是包括两部分:  In the embodiment of the present invention, since the types of peripheral components include various types, for example, an optical drive, a floppy drive, and a USB. Also, each type of peripheral component can include multiple types. Therefore, the identification information can be composed of two parts:
第一部分用于标示所述外设部件的大概分类,例如挂载的外设部件为 光驱或软驱。  The first part is used to indicate the approximate classification of the peripheral components, such as the mounted peripheral components are optical drives or floppy drives.
第二部分用于标示在所述大概分类的基础上,进一步的确定挂载的外 设部件的具体类型,例如:光驱分类下所述外设部件为 CD光驱或者是 iso 文件。  The second part is used to indicate the specific type of the mounted peripheral components based on the approximate classification, for example, the peripheral component of the optical drive classification is a CD drive or an iso file.
识别码,用于唯一标示挂载在服务器上的所述外设部件。  An identification code for uniquely indicating the peripheral component mounted on the server.
在本发明实施例中,因为只要所述建立连接消息中包含用于区分镜像 文件和终端的识别码就可以实现不同用户终端同时对对应的虚拟机执行操 作系统安装以及软件拷贝的操作,所以以下提供了几种最优化的实现方式 修改现有建立连接消息,修改后的建立连接消息能够携带所述识别码,具 体修改的方法包括:  In the embodiment of the present invention, as long as the establishment connection message includes an identification code for distinguishing the image file and the terminal, the operation of the operating system installation and the software copy of the corresponding virtual machine can be implemented by different user terminals at the same time, so the following Several optimized implementations are provided to modify an existing connection establishment message, and the modified connection establishment message can carry the identification code, and the specific modification method includes:
A ,修改所述建立光驱连接消息的长度,并将所述识别码添加到原建立 光驱连接消息的最后;  A, modifying the length of the establishing the optical drive connection message, and adding the identification code to the end of the original established optical drive connection message;
例如:本发明实施例中所提供的识别码为通用唯一识别码( Universally Unique Identifier , UUID ) ,并且 UUID的长度取 36字节,则本发明实施例 所提供的方法中所述建立光驱连接消息的具体格式可以是(如表 2所示):
Figure imgf000011_0001
For example, the identifier provided in the embodiment of the present invention is a universal unique identifier (Universally The specific format of the optical drive connection message in the method provided by the embodiment of the present invention may be (as shown in Table 2):
Figure imgf000011_0001
表 2  Table 2
在本发明实施例中可以将 SFF协议建立光驱连接消息(或称为建立光 驱连接消息)扩展为长度 48字节 (Byte)的消息,其中第 0个字节和第 1个 字节与原消息所携带的内容相同,即第 0个字节代表建立光驱连接消息, 第 1个字节代表挂载光驱的具体类型,后面 2、 3、 8、 9、 10、 11个字节为 0 ,无表示。  In the embodiment of the present invention, the SFF protocol establishing optical drive connection message (or called establishing an optical drive connection message) may be extended to a message of length 48 bytes (Byte), wherein the 0th byte and the 1st byte are combined with the original message. The content carried is the same, that is, the 0th byte represents the establishment of the optical drive connection message, the first byte represents the specific type of the mounted optical drive, and the following 2, 3, 8, 9, 10, 11 bytes are 0, no Said.
在该实施例中为了方便服务器确定识别码(可以是 UUID )的内容,可 以默认新添加的 UUID是添加在原消息的尾部的,所以在该实施例中只要 在原有消息结构中(即第 2个字节到第 11个字节)指示 UUID的长度即可。 在本实施例中选择第 4~7这四个字节(为了适应不同识别码的长度该实例 中设定使用四字节标示识别码的长度,并不限定只能使用四字节)标示 UUID的长度,具体环境中也可以是第 5〜第 8、 第 6〜第 9等等。 因为 UUID 的长度比较长,所以可以通过 16进制来表示 UUID 的长度。 在该实例中 UUID的长度为 36 ,则修改后的建立光驱连接的消息则可以是: 在该实施例中,服务器为了从形成的所述建立光驱连接消息中获取唯 一标示所述第一终端的第一识别码的具体实现方式包括:  In this embodiment, in order to facilitate the server to determine the content of the identification code (which may be a UUID), the newly added UUID may be added at the end of the original message by default, so in this embodiment as long as it is in the original message structure (ie, the second one) The byte to the eleventh byte) indicates the length of the UUID. In the present embodiment, the four bytes from the 4th to the 7th are selected (in order to adapt to the length of the different identification code, the length of the four-byte identification code is set in the example, and it is not limited to use only four bytes) to indicate the UUID. The length, the specific environment can also be 5th to 8th, 6th to 9th, and so on. Because the length of the UUID is long, the length of the UUID can be expressed in hexadecimal. In this example, the length of the UUID is 36, and the modified message for establishing the optical drive connection may be: In this embodiment, the server obtains a unique identifier for the first terminal from the formed optical drive connection message formed. The specific implementation manner of the first identification code includes:
从指定标志位获取识别码的长度值,从预设位置开始获取所述长度值 对应的识别码。  Obtaining a length value of the identification code from the specified flag bit, and acquiring an identifier corresponding to the length value from the preset position.
针对上述实例 A所形成的建立光驱连接消息中读取 UUID具体实现可 以是: Server识别消息第 4-7个字节(在具体的实现环境中可以是第 2~11 的两个或多个字节,其中字节的个数根据识别码的长度确定)的内容为The specific implementation of reading the UUID in the setup optical drive connection message formed by the foregoing example A may be: Server identification message 4-7 bytes (in the specific implementation environment, it may be the second to the 11th Two or more bytes, where the number of bytes is determined according to the length of the identification code)
0x24(十六进制),则可以确定从建立光驱连接的消息的第 12个字节开始读 取 0x24个字节为 UUID内容(即上述实例中 X代表了新添加 UUID的具体 内容),即唯一标识挂载光驱的 UUID长度为 36字节。 36字节 UUID由消 息中的第 12到第 47字节进行表示。 0x24 (hexadecimal), it can be determined that 0x24 bytes are read as UUID content from the 12th byte of the message establishing the optical drive connection (ie, X in the above example represents the specific content of the newly added UUID), ie The UUID that uniquely identifies the mounted optical drive is 36 bytes long. The 36-byte UUID is represented by the 12th to 47th bytes in the message.
B ,在建立光驱连接消息中添加标识指示识别码的起始位置和长度,将 所述识别码添加到建立光驱连接消息中;  B, adding a start position and a length of the identifier indication identifier in the establishing the optical drive connection message, and adding the identifier to the establishing the optical drive connection message;
例如:本发明实施例中所提供的识别码为通用唯一识别码(Universally Unique Identifier , UUID ) ,并且 UUID的长度取 36字节,则本发明实施例 所提供的方法中所述建立光驱连接消息的具体格式可以是(如表 3所示):
Figure imgf000012_0001
For example, if the identifier provided in the embodiment of the present invention is a Universally Unique Identifier (UUID), and the length of the UUID is 36 bytes, the optical drive connection message is established in the method provided by the embodiment of the present invention. The specific format can be (as shown in Table 3):
Figure imgf000012_0001
表 3  table 3
在本发明实施例中可以将 SFF协议建立光驱连接消息(或称为建立光 驱连接消息)扩展为长度 48字节 (Byte)的消息,其中第 0个字节和第 1个 字节与原消息所携带的内容相同,即第 0个字节代表建立光驱连接消息, 第 1个字节代表该消息用于光驱挂载,后面 2、 3、 8、 9、 10、 11个字节为 0 ,无表示。  In the embodiment of the present invention, the SFF protocol establishing optical drive connection message (or called establishing an optical drive connection message) may be extended to a message of length 48 bytes (Byte), wherein the 0th byte and the 1st byte are combined with the original message. The content carried is the same, that is, the 0th byte represents the establishment of the optical drive connection message, the first byte represents the message for the optical drive mount, and the latter 2, 3, 8, 9, 10, 11 bytes are 0. No indication.
在该实施例中为了方便服务器确定识别码(即 UUID )的内容,在所述 建立光驱连接消息中添加标志位用于指示添加的 UUID的起始位置和长度, 即表 3中第 4~7字节中的内容,在该实施例中只要在原有消息结构中(即 第 2个字节到第 11个字节)指示 UUID的起始位置和长度服务器即可通过 这两个信息定位添加的 UUID。 在本实施例中选择第 4~7这四个字节标示 UUID的起始位置和长度,具体环境中也可以是 5~8、 6-9等等。 在该实例 中,可以是第 4和 5字节标示存储 UUID的起始位置,第 6和 7字节标示 UUID 的长度。 因为在该实施例中标示了 UUID 的长度和起始位置,所以 UUID的起始位置可以是所述建立光驱连接消息的任一位置(如果 UUID并 不是从第 12字节开始,则所述连接消息的长度会有对应的调整 In this embodiment, in order to facilitate the server to determine the content of the identification code (ie, UUID), a flag is added in the setup optical drive connection message to indicate the starting position and length of the added UUID, that is, 4th to 7th in Table 3. The content in the byte, in this embodiment, as long as the starting position and length of the UUID are indicated in the original message structure (ie, the second byte to the eleventh byte), the server can be added by using the two information. UUID. In the embodiment, the four bytes of the 4th to 7th are selected to indicate the starting position and length of the UUID, and the specific environment may also be 5~8, 6-9, and the like. In this example, the 4th and 5th bytes may indicate the starting position of the storage UUID, and the 6th and 7th bytes indicate The length of the UUID. Since the length and the starting position of the UUID are indicated in this embodiment, the starting position of the UUID may be any position of the setup optical drive connection message (if the UUID does not start from the 12th byte, the connection The length of the message will have a corresponding adjustment
在该实例中 uuiD的长度为 36 ,并且 UUID的起始位置是第 12字节, 所以对应的第 4~7字节对应的为 i)C2 ( 0C对应起始位置 12 24对应 UUID 的长度 36 )则修改后的建立光驱连接消息则可以是: 在该实施例中,服务器为了从形成的所述建立光驱连接消息中获取唯 一标示所述第一终端的第一识别码的具体实现方式包括:  In this example, uuiD has a length of 36, and the starting position of the UUID is the 12th byte, so the corresponding 4th to 7th bytes correspond to i) C2 (0C corresponds to the starting position 12 24 corresponding to the length of the UUID 36 The modified optical drive connection message may be: In this embodiment, the specific implementation manner of the server for obtaining the first identifier that uniquely identifies the first terminal from the formed optical drive connection message is:
从预设位置获取识别码的存储起始位置和长度值,从所述存储起始位 置开始读取所述长度值对应的识别码。  The storage start position and the length value of the identification code are obtained from the preset position, and the identification code corresponding to the length value is read from the storage start position.
针对上述实例 B所形成的建立光驱连接消息中读取 UUID具体实现可 以是: Server识别消息第 4-7个字节的内容为 0C24(十六进制),则可以确定 从建立光驱连接的消息的第 12个字节开始读取 36个字节为 UUID内^:即 上述实例中 X代表了新添加 UUID的具体内容),即唯一标识光驱的 UUID 长度为 36字节,并且 36字节 UUID由消息中的第 12到第 47字节进行表 示。  The specific implementation of reading the UUID in the setup optical drive connection message formed by the foregoing example B may be: the content of the 4-7th byte of the server identification message is 0C24 (hexadecimal), then the message from the optical drive connection may be determined. The 12th byte begins to read 36 bytes for the UUID ^: that is, X in the above example represents the specific content of the newly added UUID), that is, the UUID uniquely identifies the optical drive is 36 bytes in length, and the 36-byte UUID It is represented by the 12th to 47th bytes in the message.
本发明实施例所提供的方法,即使每一个终端发送的连接消息长度相 同 (均为 48字节长度),但是由于每一个终端的 UUID不同,所以当多个终 端建立连接后, Server端根据 UUID判断并确定每个终端,这样多个终端就 可以同时给多个虚拟机挂载光驱,从而方便不同用户同时安装操作系统或 者软件拷贝。 可以达到同一个协议下,不同厂商的客户端和服务器可以进 行无缝链接。  The method provided by the embodiment of the present invention, even if the length of the connection messages sent by each terminal is the same (both 48-byte length), since the UUID of each terminal is different, when multiple terminals establish a connection, the server end is based on the UUID. Judging and determining each terminal, so that multiple terminals can mount optical drives to multiple virtual machines at the same time, thereby facilitating simultaneous installation of operating systems or software copies by different users. Under the same protocol, clients and servers from different vendors can seamlessly link.
如图 1A所示,为了达到终端的镜像文件不需要开放共享、 终端不需要 关闭本机的防火墙、 主机访问终端时不需要输入镜像的 URL以及主机访问 终端时不需要输入用户名和密码的效果,实现上述外设部件挂载时,服务 器端和终端之间的交互可以通过 SFF协议实现,具体实现步骤包括: 步骤 1A01 ,服务器和终端之间进行互信验证; As shown in FIG. 1A, in order to achieve the image file of the terminal, there is no need to open the sharing, the terminal does not need to turn off the firewall of the local machine, the host does not need to input the URL of the image when accessing the terminal, and the host does not need to input the user name and password when accessing the terminal. When the above peripheral components are mounted, the service The interaction between the device and the terminal can be implemented by using the SFF protocol. The specific implementation steps include: Step 1A01: Perform mutual trust verification between the server and the terminal.
进行互信验证时,客户端(或称为用户终端)根据算法生成一个安全 ID ,并将 ID发送到服务端进行验证。 由于服务端和客户端生成安全 ID的 算法一致,所以服务器端在对客户端发送来的安全 ID进行验证后,即可以 保证客户端是可依赖的。 所以,在保证了互信验证后,不需要额外的互信 操作,例如:输入服务端的用户名和密码进行互信验证等。  When performing mutual trust verification, the client (or user terminal) generates a security ID according to the algorithm and sends the ID to the server for verification. Since the algorithm for generating the security ID is the same as that of the client, the server can ensure that the client is dependable after verifying the security ID sent by the client. Therefore, after the mutual trust verification is guaranteed, no additional mutual trust operation is required, for example, inputting the username and password of the server for mutual trust verification.
步骤 1A02 ,客户端会和服务器端通过 TCP协议建立一个链接,客户端 同时将本地的 ISO文件或者光驱映射到服务端,形成虚拟机;  Step 1A02, the client and the server establish a link through the TCP protocol, and the client simultaneously maps the local ISO file or the optical drive to the server to form a virtual machine.
在虚拟机形成后,服务端就可以通过访问所述虚拟机来访问客户端的 ISO文件或者光驱。这样服务器只需要访问本地设备而不需要访问共享的远 端 URL ,所以能够达到主机访问客户端时不需要输入镜像的 URL的效果。  After the virtual machine is formed, the server can access the ISO file or the optical drive of the client by accessing the virtual machine. In this way, the server only needs to access the local device without accessing the shared remote URL, so it is possible to achieve the effect that the host does not need to input the mirrored URL when accessing the client.
步骤 1A03 ,服务器访问设备时,客户端会读取本地 ISO或者光驱的数 据流发送到服务端。  Step 1A03: When the server accesses the device, the client reads the data stream of the local ISO or CD-ROM and sends it to the server.
步骤 1A04 ,数据传输完成后,客户端会发送消息断开链接  Step 1A04, after the data transmission is completed, the client will send a message to disconnect the link.
步骤 1A05 ,服务端开放一个端口号供客户端访问,所以客户端可以不 需要关闭服务端防火墙即可访问服务端。  Step 1A05, the server opens a port number for client access, so the client can access the server without shutting down the server firewall.
本发明实施例所提供的上述外设部件的挂载方法,通过 SFF协议实现 客户端与服务器端的交互,所以可以达到便携电脑的镜像文件不需要开放 共享、 便携电脑不需要关闭本机的防火墙、 主机访问时不需要输入镜像的 URL以及主机访问时不需要输入用户名和密码的效果。  The mounting method of the above peripheral component provided by the embodiment of the present invention implements the interaction between the client and the server through the SFF protocol, so that the image file of the portable computer does not need to be openly shared, and the portable computer does not need to turn off the firewall of the machine. The host does not need to enter the URL of the image when accessing, and the effect of the user name and password is not required when the host accesses.
如图 2所示,本发明实施例还提供一种服务器,该服务器包括: 获取模块 201 ,用于接收到一终端发送的建立外设部件连接的第一消息 后,从所述第一消息中获取唯一标示所述外设部件的识别码;  As shown in FIG. 2, the embodiment of the present invention further provides a server, where the server includes: an obtaining module 201, configured to receive, after receiving a first message sent by a terminal to establish a connection of a peripheral component, from the first message. Obtaining an identification code uniquely identifying the peripheral component;
在本发明实施例中,所述外设部件可以是:光驱、 软驱以及 USB等等 设备。 如果所述外设部件是光驱,则所述第一消息可以是建立光驱连接消 挂载模块 202 ,用于与所述终端建立连接,使得服务器访问所述外设部 件,并将所述外设部件连接到对应的虚拟机中,实现所述虚拟机的外设部 件挂载; In the embodiment of the present invention, the peripheral components may be: an optical drive, a floppy drive, and a USB device. If the peripheral component is an optical drive, the first message may be to establish an optical drive connection The mounting module 202 is configured to establish a connection with the terminal, so that the server accesses the peripheral component, and connects the peripheral component to the corresponding virtual machine, so that the peripheral component of the virtual machine is mounted;
存储模块 203 ,用于根据所述识别码存储所述虚拟机与所述终端的对应 关系,使得服务器根据接收到的识别码确定对应的虚拟机。  The storage module 203 is configured to store, according to the identifier, a correspondence between the virtual machine and the terminal, so that the server determines the corresponding virtual machine according to the received identifier.
多个终端同时给多个虚拟机挂载光驱后,如果终端同时安装操作系统 或者是软件拷贝,则该服务器还用于将多个终端的访问请求对应的转到对 应的虚拟机上,所以该服务器还包括:  After a plurality of terminals simultaneously mount an optical drive to a plurality of virtual machines, if the terminal simultaneously installs an operating system or a software copy, the server is further configured to transfer the access requests of the multiple terminals to the corresponding virtual machines, so The server also includes:
访问接收模块 204 ,用于接收到多个访问终端同时对不同虚拟机进行访 问的第二请求时,从所述第二请求中获取识别码,并根据获取到的识别码 确定每个访问终端对应访问的目标虚拟机。  The access receiving module 204 is configured to: when receiving a second request that multiple access terminals access the different virtual machines at the same time, obtain an identification code from the second request, and determine, according to the obtained identification code, each access terminal The target virtual machine that is accessed.
另外,为了挂载外设部件时终端不需要关闭本机的防火墙的目的,所 述访问接收模块 204还用于接收到多个访问终端同时对不同虚拟机进行访 问的第二请求时,从所述第二请求中获取识别码,并根据获取到的识别码 确定每个访问终端对应访问的目标虚拟机。  In addition, in order to mount the peripheral component, the terminal does not need to turn off the firewall of the local machine, and the access receiving module 204 is further configured to receive a second request for accessing different virtual machines by multiple access terminals simultaneously. Obtaining an identification code in the second request, and determining, according to the obtained identification code, a target virtual machine corresponding to each access terminal.
在本发明实施例中,因为只要所述建立连接消息中包含用于区分外设 部件和终端的识别码就可以实现不同用户终端同时对对应的虚拟机执行操 作系统安装以及软件拷贝的操作,所从包含识别码的建立连接消息中获取 识别码的具体实现方式可以是:  In the embodiment of the present invention, the operating system installation and the software copy operation are performed on the corresponding virtual machine by using different user terminals at the same time, as long as the identification message for distinguishing the peripheral components and the terminal is included in the connection establishment message. The specific implementation manner of obtaining the identification code from the establishment connection message including the identification code may be:
所述 201 获取模块从所述第一消息中获取唯一标示所述外设部件的识 别码包括:  And obtaining, by the obtaining module, the identification code that uniquely identifies the peripheral component from the first message, including:
从指定标志位获取识别码的长度值,从预设位置开始获取所述长度值 对应的识别码;或者,从预设位置获取存储识别码的起始位置和所述识别 码的长度值,从所述起始位置开始读取与所述长度值对应的识别码。  Obtaining a length value of the identifier from the specified flag bit, and acquiring an identifier corresponding to the length value from the preset position; or acquiring a starting position of the storage identifier and a length value of the identifier from the preset position, The starting position begins to read an identification code corresponding to the length value.
如图 3所示,本发明还提供另一种实现多虚拟机挂载外设部件的装置, 用于执行前述各个实施例中的实现多虚拟机挂载外设部件的方法,包括至 少一个处理器 301 (例如 CPU:) ,至少一个网络接口 302或者其他通信接口 , 存储器 303 ,和至少一个通信总线 304 ,用于实现这些装置之间的连接通信。 处理器 301用于执行存储器 303中存储的可执行模块,例如计算机程序。 存储器 303可能包含高速随机存取存储 IK RAM Random Access Memory ) , 也可能还包括非不稳定的存储器(non-volatile memory ) ,例如至少一个磁 盘存储器。 通过至少一个网络接口 302 (可以是有线或者无线)实现该系统 网关与至少一个其他网元之间的通信连接,可以使用互联网,广域网,本 地网,城域网等。 As shown in FIG. 3, the present invention further provides another apparatus for implementing a multi-virtual machine to mount peripheral components. A method for implementing a multi-VM mount peripheral component in the various embodiments described above, comprising at least one processor 301 (eg, CPU:), at least one network interface 302 or other communication interface, memory 303, and at least one communication A bus 304 is used to implement connection communication between these devices. The processor 301 is configured to execute an executable module, such as a computer program, stored in the memory 303. The memory 303 may include a high speed random access memory (IK RAM Random Access Memory) and may also include a non-volatile memory such as at least one disk memory. The communication connection between the system gateway and at least one other network element is implemented by at least one network interface 302 (which may be wired or wireless), and may use an Internet, a wide area network, a local network, a metropolitan area network, or the like.
在一些实施方式中,本发明所提供的装置可以应用于一欲自建立 Χ2接 口的本对端基站中,则该装置中的存储器存储了程序 3031 ,程序可以被处 理器执行,这个程序包括:接收到一终端发送的建立外设部件连接的第一 消息后,从所述第一消息中获取唯一标示所述外设部件的识别码;与所述 终端建立连接,使得该装置访问所述外设部件,并将所述外设部件连接到 对应的虚拟机中,实现所述虚拟机的外设部件挂载;根据所述识别码存储 所述虚拟机与所述终端的对应关系,使得该装置根据接收到的识别码确定 对应的虚拟机。  In some embodiments, the apparatus provided by the present invention can be applied to a peer base station to establish a Χ2 interface, and the memory in the apparatus stores the program 3031, and the program can be executed by the processor. The program includes: After receiving the first message sent by the terminal to establish a connection of the peripheral component, obtaining an identifier that uniquely identifies the peripheral component from the first message; establishing a connection with the terminal, so that the device accesses the external a component is provided, and the peripheral component is connected to the corresponding virtual machine, and the peripheral component of the virtual machine is mounted; and the corresponding relationship between the virtual machine and the terminal is stored according to the identifier, so that the The device determines the corresponding virtual machine according to the received identification code.
本申请实施例中的上述一个或多个技术方案,至少具有如下的技术效 果:  The above one or more technical solutions in the embodiments of the present application have at least the following technical effects:
在本发明实例中,进行虚拟机光驱挂载时通过唯一标示终端的识别码 区分每个终端,从而使得服务器能够根据识别码区分各虚拟机,并且还能 根据终端携带的识别码确定终端需要访问的虚拟机,所以多个终端同时给 多个虚拟机挂载光驱之后,不同终端可以是同时对虚拟机进行操作(该操 作包括:安装操作系统或者软件拷贝等  In the example of the present invention, each virtual terminal is distinguished by an identification code that uniquely identifies the terminal when the virtual machine optical disk drive is mounted, so that the server can distinguish each virtual machine according to the identification code, and can also determine that the terminal needs to access according to the identification code carried by the terminal. The virtual machine, so after multiple terminals mount the optical drive to multiple virtual machines at the same time, different terminals can simultaneously operate the virtual machine (this operation includes: installing an operating system or software copy, etc.)
本发明所述的方法并不限于具体实施方式中所述的实施例,本领域技 术人员根据本发明的技术方案得出其它的实施方式,同样属于本发明的技 术创新范围。 The method of the present invention is not limited to the embodiments described in the specific embodiments, and those skilled in the art can obtain other embodiments according to the technical solutions of the present invention, and also belong to the technology of the present invention. The scope of innovation.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离 本发明的精神和范围。 这样,倘若本发明的这些修改和变型属于本发明权 利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在  It is apparent that those skilled in the art can make various modifications and variations to the invention without departing from the spirit and scope of the invention. Thus, it is intended that the present invention covers such modifications and variations as the modifications and variations of the present invention are intended to be included within the scope of the present invention.

Claims

权利要求 Rights request
1、 一种实现多虚拟机挂载外设部件的方法,其特征在于,该方法包括: 服务器接收到一终端发送的建立外设部件连接的第一消息后,从所述 第一消息中获取唯一标示所述外设部件的识别码; 1. A method for implementing multiple virtual machines to mount peripheral components, characterized in that the method includes: After the server receives a first message sent by a terminal to establish a peripheral component connection, the server obtains the peripheral component from the first message. An identification code that uniquely identifies the peripheral component;
服务器与所述终端建立连接,使得服务器访问所述外设部件,并将所 述外设部件连接到对应的虚拟机中,实现所述虚拟机的外设部件挂载; 根据所述识别码存储所述虚拟机与所述终端的对应关系,使得服务器 根据接收到的识别码确定对应的虚拟机。 The server establishes a connection with the terminal so that the server accesses the peripheral component and connects the peripheral component to the corresponding virtual machine to implement the mounting of the peripheral component of the virtual machine; store according to the identification code The corresponding relationship between the virtual machine and the terminal enables the server to determine the corresponding virtual machine based on the received identification code.
2、 如权利要求 1所述的方法,其特征在于,所述第一消息中包括: 标识信息,用于指示所述外设部件的类型; 2. The method of claim 1, wherein the first message includes: identification information used to indicate the type of the peripheral component;
识别码,用于唯一标示挂载在服务器上的所述外设部件。 An identification code used to uniquely identify the peripheral component mounted on the server.
3、 如权利要求 1~2任一所述的方法,其特征在于,从所述第一消息中 获取唯一标示所述外设部件的识别码包括: 3. The method according to any one of claims 1 to 2, wherein obtaining an identification code that uniquely identifies the peripheral component from the first message includes:
从指定标志位获取识别码的长度值,从预设位置开始获取所述长度值 对应的识别码;或者 Obtain the length value of the identification code from the specified flag position, and obtain the identification code corresponding to the length value starting from the preset position; or
从预设位置获取存储识别码的起始位置和所述识别码的长度值,从所 述起始位置开始读取与所述长度值对应的识别码。 Obtain the starting position of storing the identification code and the length value of the identification code from the preset position, and read the identification code corresponding to the length value starting from the starting position.
4、 如权利要求 1~3任一所述的方法,其特征在于,该方法还包括: 当接收到多个访问终端同时对不同虚拟机进行访问的第二请求时,从 所述第二请求中获取识别码,并根据获取到的识别码确定每个访问终端对 应访问的目标虚拟机。 4. The method according to any one of claims 1 to 3, characterized in that the method further includes: when receiving a second request from multiple access terminals to access different virtual machines at the same time, from the second request Obtain the identification code, and determine the target virtual machine corresponding to each access terminal based on the obtained identification code.
5、 如权利要求 1~4任一所述的方法,其特征在于,根据获取到的识别 码确定每个访问终端对应访问的目标虚拟机之后,进一步包括: 5. The method according to any one of claims 1 to 4, characterized in that, after determining the target virtual machine corresponding to each access terminal according to the obtained identification code, it further includes:
服务器发送访问请求到所述目标虚拟机对应的目标终端,并接收目标 终端针对所述访问请求返回的数据流,并将所述数据流反馈给所述访问终 The server sends an access request to the target terminal corresponding to the target virtual machine, receives the data stream returned by the target terminal in response to the access request, and feeds the data stream back to the access terminal.
6、 一种服务器,其特征在于,该服务器包括: 6. A server, characterized in that the server includes:
获取模块,用于接收到一终端发送的建立外设部件连接的第一消息后, 从所述第一消息中获取唯一标示所述外设部件的识别码; An acquisition module, configured to obtain an identification code that uniquely identifies the peripheral component from the first message after receiving a first message sent by a terminal to establish a connection to a peripheral component;
挂载模块,用于与所述终端建立连接,使得服务器访问所述外设部件, 并将所述外设部件连接到对应的虚拟机中,实现所述虚拟机的外设部件挂 载; A mounting module is used to establish a connection with the terminal, so that the server accesses the peripheral components, and connects the peripheral components to the corresponding virtual machine to implement mounting of the peripheral components of the virtual machine;
存储模块,用于根据所述识别码存储所述虚拟机与所述终端的对应关 系,使得服务器根据接收到的识别码确定对应的虚拟机。 A storage module configured to store the corresponding relationship between the virtual machine and the terminal according to the identification code, so that the server determines the corresponding virtual machine according to the received identification code.
7、 如权利要求 6所述的服务器,其特征在于,获取模块从所述第一消 息中获取唯一标示所述外设部件的识别码包括: 7. The server according to claim 6, wherein the acquisition module obtains the identification code that uniquely identifies the peripheral component from the first message and includes:
从指定标志位获取识别码的长度值,从预设位置开始获取所述长度值 对应的识别码;或者,从预设位置获取存储识别码的起始位置和所述识别 码的长度值,从所述起始位置开始读取与所述长度值对应的识别码。 Obtain the length value of the identification code from the specified flag position, and obtain the identification code corresponding to the length value starting from the preset position; or, obtain the starting position of the storage identification code and the length value of the identification code from the preset position, and obtain the length value of the identification code from the preset position. The starting position starts reading the identification code corresponding to the length value.
8、 如权利要求 6或 7任一所述的服务器,其特征在于,该服务器还包 括: 8. The server according to claim 6 or 7, wherein the server further includes:
访问接收模块,用于接收到多个访问终端同时对不同虚拟机进行访问 的第二请求时,从所述第二请求中获取识别码,并根据获取到的识别码确 定每个访问终端对应访问的目标虚拟机。 The access receiving module is used to obtain an identification code from the second request when receiving a second request from multiple access terminals to access different virtual machines at the same time, and determine the corresponding access of each access terminal based on the obtained identification code. the target virtual machine.
9、 如权利要求 8所述的服务器,其特征在于,访问接收模块还用于发 送访问请求到所述目标虚拟机对应的目标终端,并接收目标终端针对所述 访问请求返回的数据流,并将所述数据流反馈给所述访问终端。 9. The server according to claim 8, wherein the access receiving module is further configured to send an access request to a target terminal corresponding to the target virtual machine, and receive a data stream returned by the target terminal in response to the access request, and Feed back the data stream to the access terminal.
PCT/CN2014/078077 2013-11-22 2014-05-22 Method and apparatus for mounting peripheral components on multiple virtual machines WO2015074391A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310596635.8 2013-11-22
CN201310596635.8A CN103618780B (en) 2013-11-22 2013-11-22 A kind of method and device for realizing multi-dummy machine carry external components

Publications (1)

Publication Number Publication Date
WO2015074391A1 true WO2015074391A1 (en) 2015-05-28

Family

ID=50169484

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/078077 WO2015074391A1 (en) 2013-11-22 2014-05-22 Method and apparatus for mounting peripheral components on multiple virtual machines

Country Status (2)

Country Link
CN (1) CN103618780B (en)
WO (1) WO2015074391A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103618780B (en) * 2013-11-22 2017-10-10 华为技术有限公司 A kind of method and device for realizing multi-dummy machine carry external components
CN105354148B (en) * 2014-08-21 2019-02-26 华为技术有限公司 A kind of data processing method and relevant apparatus
CN107957900A (en) * 2016-10-17 2018-04-24 中兴通讯股份有限公司 The method and relevant apparatus of management and control are carried out under a kind of virtual environment to remote I SO
CN108595245B (en) * 2018-03-13 2021-08-13 深圳市文鼎创数据科技有限公司 Java card peripheral access method and Java card virtual machine
CN108563589A (en) * 2018-04-08 2018-09-21 深圳市沃特沃德股份有限公司 Terminal device obtains the method and device of input equipment type
CN110086661B (en) * 2019-04-18 2022-02-25 绿盟科技集团股份有限公司 Method and device for identifying virtual terminal
CN112506819B (en) * 2019-08-26 2022-04-15 成都鼎桥通信技术有限公司 Dual-system-based external equipment control method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101410803A (en) * 2006-01-24 2009-04-15 思杰系统有限公司 Methods and systems for providing access to a computing environment
CN101681257A (en) * 2007-04-26 2010-03-24 惠普开发有限公司 Virtual machine control
CN102204210A (en) * 2011-05-18 2011-09-28 华为技术有限公司 Method, server, and system for starting application
CN103618780A (en) * 2013-11-22 2014-03-05 华为技术有限公司 Method and device for realizing multiple virtual machine mounted externally-arranged components

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5154238B2 (en) * 2008-01-18 2013-02-27 株式会社日立製作所 Management method of composite computer system and composite computer system
CN101419535B (en) * 2008-11-19 2010-07-14 北京航空航天大学 Distributed virtual magnetic disc system of virtual machine
CN101808128B (en) * 2010-03-18 2012-12-26 卢伟 Virtual system of open wireless architecture of wireless mobile terminal equipment
CN102170424A (en) * 2010-12-13 2011-08-31 沈晖 Mobile medium safety protection system based on three-level security architecture
CN102523264B (en) * 2011-12-06 2014-07-02 北京航空航天大学 USB (Universal Serial Bus) equipment remote sharing method and system for virtual machine

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101410803A (en) * 2006-01-24 2009-04-15 思杰系统有限公司 Methods and systems for providing access to a computing environment
CN101681257A (en) * 2007-04-26 2010-03-24 惠普开发有限公司 Virtual machine control
CN102204210A (en) * 2011-05-18 2011-09-28 华为技术有限公司 Method, server, and system for starting application
CN103618780A (en) * 2013-11-22 2014-03-05 华为技术有限公司 Method and device for realizing multiple virtual machine mounted externally-arranged components

Also Published As

Publication number Publication date
CN103618780B (en) 2017-10-10
CN103618780A (en) 2014-03-05

Similar Documents

Publication Publication Date Title
WO2015074391A1 (en) Method and apparatus for mounting peripheral components on multiple virtual machines
EP2973147B1 (en) Policy-based secure web boot
EP2901659B1 (en) Systems and methods for sharing files among multiple terminals
US11240314B2 (en) Systems and methods for remote management of appliances
WO2017024842A1 (en) Internet access authentication method, client, computer storage medium
TWI735429B (en) Authentication method, device, system and electronic equipment for client login server end
TWI497404B (en) Bridging non-network interfaces and network interfaces
JP5129770B2 (en) Network equipment
WO2007098679A1 (en) Method and apparatus for media sharing
EP3065058B1 (en) A method and a device for flowing data between entities
CN109542862A (en) For controlling the methods, devices and systems of the carry of file system
JPWO2009122526A1 (en) Thin client implementation method, client terminal and server therefor
JP2012027520A (en) Information processing system, information processor, information processing method, information processing program and recording medium recorded with information processing program
JP6346208B2 (en) Communications system
US11962465B2 (en) Control system, electronic device, and control method
US9823944B2 (en) Deployment control device and deployment control method for deploying virtual machine for allowing access
US9882956B1 (en) Network-backed mass storage device
TW201223188A (en) Networking equipment with hot plug function
CN112748831A (en) Method, device and medium for opening virtual application through desktop shortcut

Legal Events

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

Ref document number: 14863257

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14863257

Country of ref document: EP

Kind code of ref document: A1