CN107168768B - Mapping method and device of equipment and virtual machine - Google Patents

Mapping method and device of equipment and virtual machine Download PDF

Info

Publication number
CN107168768B
CN107168768B CN201610130871.4A CN201610130871A CN107168768B CN 107168768 B CN107168768 B CN 107168768B CN 201610130871 A CN201610130871 A CN 201610130871A CN 107168768 B CN107168768 B CN 107168768B
Authority
CN
China
Prior art keywords
mapping
virtual machine
information
virtual
equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610130871.4A
Other languages
Chinese (zh)
Other versions
CN107168768A (en
Inventor
邓得敏
林海长
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN201610130871.4A priority Critical patent/CN107168768B/en
Publication of CN107168768A publication Critical patent/CN107168768A/en
Application granted granted Critical
Publication of CN107168768B publication Critical patent/CN107168768B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

The invention relates to a mapping method and a mapping device of equipment and a virtual machine, wherein the mapping method comprises the following steps: acquiring mapping information of a virtual interface of a device and a virtual machine; when detecting that the equipment is accessed, acquiring equipment information of the equipment; searching mapping information matched with the equipment information; determining a virtual interface of the virtual machine according to the searched mapping information; the device is mapped to the determined virtual interface. The method and the device for mapping the equipment and the virtual machine, provided by the invention, have the advantages that the mapping information of the virtual interfaces of the equipment and the virtual machine is obtained, when the access of the equipment is detected, the matched mapping information is searched according to the obtained equipment information, and the equipment is directly mapped onto the corresponding virtual interface of the virtual machine according to the searched mapping information. Therefore, when the equipment mapped to the virtual machine is accessed from any interface again, the equipment can be directly mapped to the virtual machine without additional configuration and can be normally used, so that the operation steps of mapping the equipment to the virtual machine are simpler and easier to use.

Description

Mapping method and device of equipment and virtual machine
Technical Field
The present invention relates to the field of virtualization technologies, and in particular, to a method and an apparatus for mapping a device and a virtual machine.
Background
In the virtualization technology, a plurality of virtual machines can be virtualized on a server, and the virtualized virtual machines are provided for users to use. When the user uses the virtual machine, the device accessed to the terminal needs to be mapped to the virtual machine, and the accessed device is operated through the virtual machine. In the conventional mapping method, an interface of a terminal is mapped into a virtual machine, and a device mapped to the virtual machine is required for fixed access, but when the device is offline, the device is unplugged from the fixed interface, and after the device is accessed from a new interface, the device needs to be reset, and the accessed device is mapped into the virtual machine again, so that the operation of using the device accessed on the terminal through the virtual machine is complicated.
Disclosure of Invention
Therefore, it is necessary to provide a mapping method between a device and a virtual machine, aiming at the problem that the operation of the device accessed to a terminal is complicated when the virtual machine is used.
A mapping method of a device and a virtual machine comprises the following steps:
acquiring mapping information of a virtual interface of a device and a virtual machine;
when detecting that the equipment is accessed, acquiring equipment information of the equipment;
searching mapping information matched with the equipment information;
determining a virtual interface of the virtual machine according to the searched mapping information;
the device is mapped to the determined virtual interface.
In one embodiment, obtaining a mapping relationship between a device and a virtual interface of a virtual machine includes:
sending a verification request carrying terminal information to the virtual machine, so that the virtual machine verifies the terminal information;
and receiving mapping information of the equipment and the virtual interface of the virtual machine, which is returned after the terminal information is verified by the virtual machine.
In one embodiment, after the mapping information matching the device information is found, the method further includes:
if the matched mapping information is not found, randomly selecting a virtual interface of the virtual machine;
and mapping the equipment to the selected virtual interface, and recording the mapping information of the equipment and the virtual interface.
In one embodiment, the recording mapping information of the device and the virtual interface includes:
extracting manufacturer identification and product identification of the equipment from the equipment information;
acquiring a virtual interface identifier corresponding to the selected virtual interface;
and establishing a mapping relation table of the manufacturer identification, the product identification and the virtual interface identification.
In one embodiment, the method further comprises the following steps:
receiving a change instruction of mapping information;
re-determining the virtual interface according to the change instruction;
the device is mapped to the re-determined virtual interface and the mapping information is updated.
The mapping method of the equipment and the virtual machine obtains the mapping information of the virtual interfaces of the equipment and the virtual machine, when the access of the equipment is detected, the matched mapping information is searched according to the obtained equipment information, and if the matched mapping information is searched, the equipment is directly mapped onto the corresponding virtual interface of the virtual machine according to the mapping information. Therefore, when the device mapped to the virtual machine is accessed from any interface again, the device can be directly mapped to the virtual machine without additional configuration and can be normally used, so that the operation steps of mapping the device to the virtual machine are simpler and easier to use.
An apparatus for mapping a device to a virtual machine, comprising:
the mapping information acquisition module is used for acquiring mapping information of a virtual interface between the equipment and the virtual machine;
the device information acquisition module is used for acquiring the device information of the device when the access of the device is detected;
the mapping information searching module is used for searching mapping information matched with the equipment information;
the virtual interface determining module is used for determining a virtual interface of the virtual machine according to the searched mapping information;
and the equipment mapping module is used for mapping the equipment to the determined virtual interface.
In one embodiment, the mapping information obtaining module includes:
the verification request sending module is used for sending a verification request carrying the terminal information to the virtual machine so that the virtual machine verifies the terminal information;
and the mapping information receiving module is used for receiving the mapping information of the virtual interface between the equipment and the virtual machine, which is returned after the terminal information is verified by the virtual machine.
In one embodiment, the virtual interface determining module is further configured to randomly select a virtual interface of the virtual machine if the matching mapping information is not found;
the device mapping module is further used for mapping the device to the selected virtual interface and recording mapping information of the device and the virtual interface.
In one embodiment, the device mapping module includes:
the equipment identification extraction module is used for extracting the manufacturer identification and the product identification of the equipment from the equipment information;
the interface identifier acquisition module is used for acquiring a virtual interface identifier corresponding to the selected virtual interface;
a mapping relation establishing module for establishing a mapping relation table of the manufacturer identification, the product identification and the virtual interface identification
In one embodiment, the method further comprises the following steps:
the mapping information modification module is used for receiving a modification instruction of the mapping information;
the virtual interface determining module is also used for re-determining the virtual interface according to the change instruction;
the device mapping module is further configured to map the device to the re-determined virtual interface and update the mapping information.
The device and virtual machine mapping device obtains the mapping information of the virtual interfaces of the device and the virtual machine, when the access of the device is detected, the matching mapping information is searched according to the obtained device information, and if the matching mapping information is searched, the device is directly mapped to the corresponding virtual interface of the virtual machine according to the mapping information. Therefore, when the device mapped to the virtual machine is accessed from any interface again, the device can be directly mapped to the virtual machine without additional configuration and can be normally used, so that the operation steps of mapping the device to the virtual machine are simpler and easier to use.
Drawings
FIG. 1 is a diagram of an application environment of a mapping system of devices and virtual machines in one embodiment;
FIG. 2 is a flowchart illustrating a mapping method between a device and a virtual machine according to an embodiment;
FIG. 3 is a flowchart illustrating steps for obtaining mapping information in one embodiment;
FIG. 4 is a flowchart illustrating the step of modifying the mapping information in one embodiment;
FIG. 5 is a block diagram illustrating an apparatus for mapping devices to virtual machines according to an embodiment;
FIG. 6 is a block diagram illustrating an exemplary mapping information obtaining module;
FIG. 7 is a block diagram that illustrates an exemplary device mapping module;
fig. 8 is a schematic structural diagram of a mapping apparatus between a device and a virtual machine in another embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 is a diagram of an environment of a mapping system of a device and a virtual machine in an embodiment, where the mapping system of the device and the virtual machine includes a terminal 110 and a server 120, and the terminal 110 is connected to the server 120 through a network. The server 120 runs a virtual machine thereon, and may specifically run a single or multiple virtual machines. The terminal 110 may access a virtual machine on the server.
As shown in fig. 2, in an embodiment, a mapping method of a device and a virtual machine is provided, and the mapping method of the device and the virtual machine is applied to the terminal 110 in the mapping system of the device and the virtual machine in fig. 1 for example. The method specifically comprises the following steps:
step 202, obtaining mapping information of a device and a virtual interface of a virtual machine.
Specifically, the terminal 110 sends an access request for accessing the virtual machine on the server, where the access request may specifically include the virtual machine identifier. The virtual machine identification may be an IP address or a virtual machine number of the virtual machine. The virtual machine returns mapping information of the virtual interface to the terminal 110. The mapping information of the virtual interface of the virtual machine specifically records the mapping relationship between the device and the virtual interface, and specifically may be the mapping relationship between the device type or the device identifier and the corresponding storage virtual interface identifier. The device identifier may specifically be at least one of a manufacturer identifier or a product identifier of the device. The virtual interface refers to an interface of virtual external equipment created in the virtual machine and accessed to the virtual machine.
In one embodiment, the terminal 110 sends an access request of a virtual machine to the corresponding virtual machine through the server, the virtual machine extracts mapping information of a virtual interface of the virtual machine from a corresponding storage of the server 120, and the virtual machine returns the mapping information to the terminal 110 through the server.
In one embodiment, a controller is arranged in an application environment of a mapping system of a device and a virtual machine, and the arranged controller is used for managing a terminal and the virtual machine in the application environment. The controller stores mapping information of virtual interfaces of the virtual machines. The controller detects the virtual machine logged in by the terminal 110, obtains a virtual machine identifier of the virtual machine, and searches for mapping information corresponding to the virtual machine identifier in the controller, where the mapping information includes virtual interface information in the virtual machine and device information mapped to a virtual interface.
In one embodiment, the server 120 extracts the virtual machine identifier and the terminal information in the access request, and sends the terminal information to the virtual machine corresponding to the virtual machine identifier, the virtual machine extracts the terminal identifier of the terminal 110 in the terminal information, the virtual machine verifies whether the terminal 110 has the right to access the virtual machine according to the terminal identifier, and if the terminal 110 has the right to access the virtual machine, the virtual machine returns mapping information of a virtual interface of the virtual machine to the terminal 110 through the server 120. The terminal information may specifically include a terminal identifier, and the terminal identifier may specifically include at least one of a physical address and an IP address.
In an embodiment, the terminal 110 obtains an operation interface of the virtual machine through the server, inputs a login account and a password in the operation interface of the virtual machine, and after the virtual machine verifies that the login account and the password are correct, the virtual machine sends virtual interface information and virtual interface mapping information of the virtual machine to the terminal 110 through the server 120.
Step 204, when detecting the device access, acquiring the device information of the device.
Specifically, when a device is inserted into the interface of the terminal 110, the terminal 110 identifies the accessed device and obtains device information of the device, where the device information includes a device identifier and may further include at least one of a capacity of a storage space of the device, a capacity occupied space, and a device type.
In one embodiment, when the terminal 110 detects the device access, it sends an inquiry packet to the device, and after receiving the inquiry packet, the device sends the device information to the terminal 110. The device information includes a device identification and may further include at least one of a device type, a device storage capacity, and a device storage status.
In step 206, mapping information matched with the device information is searched.
Specifically, the terminal 110 extracts the device identifier or the device type in the device information, and searches for the matching mapping information in the received mapping information, where the device identifier or the device type included in the matching mapping information is the same as the device identifier or the device type in the device information.
And step 208, determining a virtual interface of the virtual machine according to the searched mapping information.
Specifically, when the found mapping information and the device identifier or the device type stored correspondingly further include the virtual interface identifier of the virtual machine, the terminal 110 extracts the virtual interface identifier and determines the virtual interface of the virtual machine. The virtual interface identification may be a number, a character, or a combination of a number and a character. The virtual interface identifier is used to distinguish between different virtual interfaces.
Step 210, mapping the device to the determined virtual interface.
Specifically, the terminal 110 maps the accessed device to a virtual interface of the virtual machine, and after logging in the virtual machine mapped by the device, the terminal 110 performs a relevant operation on the device through the virtual machine.
In an embodiment, the terminal 110 sends a mapping request to the virtual machine, where the mapping request includes device information and a virtual interface identifier, and the virtual machine searches for the virtual interface according to the virtual interface identifier, adds the device information to the device list, and maps the device corresponding to the device information to the found virtual interface.
In this embodiment, mapping information of a device and a virtual interface of a virtual machine is obtained, when it is detected that the device is accessed, matching mapping information is searched according to the obtained device information, and if matching mapping information is found, the device is directly mapped onto the corresponding virtual interface of the virtual machine according to the mapping information. Therefore, when the device mapped to the virtual machine is accessed from any interface again, the device can be directly mapped to the virtual machine without additional configuration and can be normally used, so that the operation steps of mapping the device to the virtual machine are simpler and easier to use.
As shown in fig. 3, in an embodiment, after the step 206, the method specifically includes the following steps:
step 302, if the matching mapping information is not found, a virtual interface of the virtual machine is randomly selected.
Specifically, if the terminal 110 does not find the matching mapping information in the received mapping information, the device is identified as a newly accessed device, and there is no mapping information matching with the device before. The terminal 110 searches for virtual interfaces in the virtual machine, for which no mapping information exists, and randomly selects a virtual interface from the searched virtual interfaces.
In an embodiment, the terminal may further sequentially select, according to the sequence of the virtual interface identifiers, a virtual interface that does not have mapping information. For example, the virtual interfaces in the virtual machine are respectively the virtual interfaces with the virtual interface identifiers 1, 2, 3, and 4, only the virtual interface with the virtual interface identifier 1 is mapped with a device, and when the terminal 110 detects that a device is accessed for the first time, the device accessed for the first time is mapped to the virtual interface with the virtual interface identifier 2. When the terminal 110 detects that there is a device to access for the second time, the device accessed for the second time is mapped to the virtual interface with the virtual interface 3 according to the sequence of the virtual interface identifiers.
Step 304, mapping the device to the selected virtual interface, and recording the mapping information of the device and the virtual interface.
Specifically, the terminal 110 selects a virtual interface without mapping devices, maps the newly accessed device to the virtual interface, and after the terminal 110 logs in a virtual machine to which the virtual machine port belongs, the virtual machine may perform related operations on the accessed device. Meanwhile, the terminal 110 records mapping information of the newly accessed device and the virtual interface and transmits the recorded mapping information to the virtual machine, and the virtual machine stores the mapping information in a storage space of the server 120 corresponding to the virtual machine.
In one embodiment, step 304 specifically includes the following: the terminal 110 extracts a vendor identifier and a product identifier of the device from the device information, and the vendor identifier and the product identifier may be collectively used as the device identifier. When the virtual interface of the unmapped device is randomly selected, the terminal 110 extracts the virtual interface identifier of the virtual interface, correspondingly stores the manufacturer identifier, the product identifier and the virtual interface identifier of the device, and establishes a mapping relation table between the accessed device and the virtual machine interface of the virtual machine. The terminal 110 may send the mapping table to the virtual machine, and the virtual machine may store the mapping table in the storage space corresponding to the virtual machine in the server 120, or the terminal 110 may directly store the mapping table in the storage space corresponding to the virtual machine in the server 120.
In this embodiment, the matching mapping information is not found in the mapping information, which indicates that the accessed device is a newly accessed device, and the matching mapping information does not exist before, at this time, the device is randomly selected as the virtual interface of the mapping device, the newly accessed device is mapped to the selected virtual interface, and the mapping information of the newly accessed device and the virtual interface is recorded. Therefore, when the equipment is newly accessed, the equipment without the matching mapping information is directly mapped to the virtual interface of the unmapped equipment without configuring the newly accessed equipment, and the mapping information is recorded, so that the equipment is automatically mapped to the corresponding virtual interface when the equipment is accessed to the terminal again.
As shown in fig. 4, in an embodiment, the mapping method of the device and the virtual machine specifically further includes the following steps:
step 402, receiving a modification instruction for mapping information.
Specifically, after the terminal 110 logs in the virtual machine, the mapping information may be modified by the virtual machine. The terminal 110 receives a change instruction of the mapping information through the virtual machine, or inputs the change instruction of the mapping information in the registered virtual machine. The modification instruction may specifically include a virtual interface identifier or a device identifier to be modified.
In an embodiment, after logging in the virtual machine, the terminal 110 inputs an instruction for deleting the mapping information into the virtual machine, and the virtual machine parses the instruction for deleting the mapping information, extracts the virtual interface identifier or the device identifier in the change instruction, searches for the mapping information corresponding to the virtual interface identifier or the device identifier, deletes the found mapping information, and removes the mapping relationship between the device and the virtual interface.
Step 404, re-determining the virtual interface according to the change instruction.
Specifically, the terminal 110 or the virtual machine extracts the virtual interface identifier in the change instruction, and reselects the virtual interface of the virtual machine according to the virtual interface identifier.
At step 406, the device is mapped to the newly determined virtual interface and the mapping information is updated.
Specifically, after the terminal 110 or the virtual machine selects a virtual interface, the device corresponding to the device identifier carried in the change instruction is mapped to the virtual interface of the selected light, the mapping information matching the device identifier or the virtual interface identifier is deleted, and the mapping relationship between the device identifier and the virtual interface identifier after the change is recorded again.
In an embodiment, the terminal 110 may directly change the mapped virtual interface of the device, and after the terminal 110 selects the virtual interface, the device is directly connected to the selected virtual interface, and the device information of the device is stored in correspondence with the virtual interface.
In this embodiment, after the accessed device is mapped to the virtual interface, the virtual interface mapped by the device may be changed according to the change instruction, and the mapping information between the device and the virtual interface may be updated. Therefore, the mapping between the equipment and the virtual machine is flexible, and when the mapping relation between the equipment and the virtual interface needs to be changed, the mapping relation is correspondingly adjusted according to the instruction.
As shown in fig. 5, in an embodiment, an apparatus 500 for mapping a device and a virtual machine is provided, and the apparatus specifically includes: a mapping information obtaining module 502, a device information obtaining module 504, a mapping information lookup module 506, a virtual interface determination module 508, and a device mapping module 510.
A mapping information obtaining module 502, configured to obtain mapping information of a virtual interface between a device and a virtual machine.
A device information obtaining module 504, configured to obtain device information of a device when device access is detected.
And a mapping information searching module 506, configured to search for mapping information that matches the device information.
And a virtual interface determining module 508, configured to determine a virtual interface of the virtual machine according to the found mapping information.
A device mapping module 510 for mapping the device to the determined virtual interface.
In this embodiment, mapping information of a device and a virtual interface of a virtual machine is obtained, when it is detected that the device is accessed, matching mapping information is searched according to the obtained device information, and if matching mapping information is found, the device is directly mapped onto the corresponding virtual interface of the virtual machine according to the mapping information. Therefore, when the device mapped to the virtual machine is accessed from any interface again, the device can be directly mapped to the virtual machine without additional configuration and can be normally used, so that the operation steps of mapping the device to the virtual machine are simpler and easier to use.
As shown in fig. 6, in one embodiment, the mapping information obtaining module 502 includes: an authentication request transmitting module 502a and a mapping information receiving module 502 b.
The verification request sending module 502a is configured to send a verification request carrying the terminal information to the virtual machine, so that the virtual machine verifies the terminal information.
The mapping information receiving module 502b is configured to receive mapping information of a virtual interface between the device and the virtual machine, which is returned after the terminal information is verified by the virtual machine.
In this embodiment, after the terminal verifies the terminal information through the virtual machine, the terminal may obtain the mapping information of the virtual interface sent by the virtual machine, and the security of the virtual machine data is ensured by verifying the terminal.
In an embodiment, the virtual interface determining module 508 is further configured to randomly select a virtual interface of the virtual machine if the matching mapping information is not found.
The device mapping module 510 is further configured to map the device to the selected virtual interface, and record mapping information of the device and the virtual interface.
In this embodiment, the matching mapping information is not found in the mapping information, which indicates that the accessed device is a newly accessed device, and the matching mapping information does not exist before, at this time, the device is randomly selected as the virtual interface of the mapping device, the newly accessed device is mapped to the selected virtual interface, and the mapping information of the newly accessed device and the virtual interface is recorded. Therefore, when the equipment is newly accessed, the equipment without the matching mapping information is directly mapped to the virtual interface of the unmapped equipment without configuring the newly accessed equipment, and the mapping information is recorded, so that the equipment is automatically mapped to the corresponding virtual interface when the equipment is accessed to the terminal again.
As shown in fig. 7, in one embodiment, the device mapping module 510 includes: a device identifier extracting module 510a, a received identifier obtaining module 510b, and a mapping relationship establishing module 510 c.
The device identifier extracting module 510a is configured to extract a manufacturer identifier and a product identifier of the device from the set device information.
The interface identifier obtaining module 510b is configured to obtain a virtual interface identifier corresponding to the selected virtual interface.
The mapping relationship establishing module 510c is configured to establish a mapping relationship table of the vendor identifier, the product identifier, and the virtual interface identifier.
In this embodiment, a mapping relationship table of the manufacturer identifier, the product identifier, and the virtual interface identifier of the device is established, and the manufacturer identifier and the product identifier may be used as unique identifiers of the device. When the equipment is accessed, the corresponding virtual interface can be found according to the manufacturer identification and the product identification of the equipment, the interface of the terminal accessed by the equipment is not required to be considered, meanwhile, the equipment can be supported to be accessed to the terminal from the interface expansion equipment, and the equipment on the interface expansion equipment is directly mapped to the corresponding virtual interface according to the manufacturer identification and the product identification.
As shown in fig. 8, in an embodiment, the apparatus 500 for mapping the device and the virtual machine further includes: a mapping information modification module 512.
A mapping information modification module 512, configured to receive a modification instruction for mapping information;
the virtual interface determining module 506 is further configured to re-determine the virtual interface according to the change instruction;
the device mapping module 508 is also configured to map the device to the re-determined virtual interface and update the mapping information.
In this embodiment, after the accessed device is mapped to the virtual interface, the virtual interface mapped by the device may be changed according to the change instruction, and the mapping information between the device and the virtual interface may be updated. Therefore, the mapping between the equipment and the virtual machine is flexible, and when the mapping relation between the equipment and the virtual interface needs to be changed, the mapping relation is correspondingly adjusted according to the instruction.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (12)

1. A method for mapping a device to a virtual machine, the method comprising:
sending an access request for accessing a virtual machine on a server, and acquiring mapping information which is fed back in response to the access request and corresponds to the accessed virtual machine; the mapping information comprises a mapping relation between a virtual interface in the virtual machine and equipment information;
when detecting that the equipment is accessed, acquiring equipment information of the equipment;
searching mapping information matched with the equipment information;
determining a virtual interface of the virtual machine according to the searched mapping information;
mapping the device to the determined virtual interface.
2. The method according to claim 1, wherein the sending an access request for accessing a virtual machine on a server and obtaining mapping information corresponding to the accessed virtual machine, which is fed back in response to the access request, comprises:
sending an access request carrying terminal information to a virtual machine, so that the virtual machine verifies the terminal information;
and receiving mapping information which is returned after the virtual machine passes the terminal information verification and corresponds to the accessed virtual machine.
3. The method of claim 1, wherein after searching for mapping information matching the device information, further comprising:
if the matched mapping information is not found, randomly selecting a virtual interface of the virtual machine;
and mapping the equipment to the selected virtual interface, and recording the mapping information of the equipment and the virtual interface.
4. The method of claim 3, wherein the recording mapping information of the device and the virtual interface comprises:
extracting a manufacturer identifier and a product identifier of the equipment from the equipment information;
acquiring a virtual interface identifier corresponding to the selected virtual interface;
and establishing a mapping relation table of the manufacturer identification, the product identification and the virtual interface identification.
5. The method of claim 1, further comprising:
receiving a change instruction of the mapping information;
re-determining the virtual interface according to the change instruction;
mapping the device to the re-determined virtual interface and updating the mapping information.
6. An apparatus for mapping a device to a virtual machine, the apparatus comprising:
the mapping information acquisition module is used for sending an access request for accessing the virtual machine on the server and acquiring mapping information which is fed back in response to the access request and corresponds to the accessed virtual machine; the mapping information comprises a mapping relation between a virtual interface in the virtual machine and equipment information;
the device information acquisition module is used for acquiring the device information of the device when the access of the device is detected;
the mapping information searching module is used for searching mapping information matched with the equipment information;
the virtual interface determining module is used for determining the virtual interface of the virtual machine according to the searched mapping information;
a device mapping module for mapping the device to the determined virtual interface.
7. The apparatus of claim 6, wherein the mapping information obtaining module comprises:
the verification request sending module is used for sending an access request carrying terminal information to a virtual machine so that the virtual machine verifies the terminal information;
and the mapping information receiving module is used for receiving the mapping information of the equipment and the virtual interface of the virtual machine, which is returned after the virtual machine passes the terminal information verification.
8. The apparatus according to claim 6, wherein the virtual interface determining module is further configured to randomly select the virtual interface of the virtual machine if the matching mapping information is not found;
the device mapping module is further configured to map the device to the selected virtual interface, and record mapping information between the device and the virtual interface.
9. The apparatus of claim 8, wherein the device mapping module comprises:
the equipment identification extraction module is used for extracting a manufacturer identification and a product identification of the equipment from the equipment information;
an interface identifier obtaining module, configured to obtain a virtual interface identifier corresponding to the selected virtual interface;
and the mapping relation establishing module is used for establishing a mapping relation table of the manufacturer identifier, the product identifier and the virtual interface identifier.
10. The apparatus of claim 6, further comprising:
the mapping information changing module is used for receiving a changing instruction of the mapping information;
the virtual interface determining module is further used for re-determining a virtual interface according to the change instruction;
the device mapping module is further configured to map the device to the re-determined virtual interface and update the mapping information.
11. A terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1 to 5 are implemented by the processor when executing the computer program.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 5.
CN201610130871.4A 2016-03-08 2016-03-08 Mapping method and device of equipment and virtual machine Active CN107168768B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610130871.4A CN107168768B (en) 2016-03-08 2016-03-08 Mapping method and device of equipment and virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610130871.4A CN107168768B (en) 2016-03-08 2016-03-08 Mapping method and device of equipment and virtual machine

Publications (2)

Publication Number Publication Date
CN107168768A CN107168768A (en) 2017-09-15
CN107168768B true CN107168768B (en) 2020-04-14

Family

ID=59848859

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610130871.4A Active CN107168768B (en) 2016-03-08 2016-03-08 Mapping method and device of equipment and virtual machine

Country Status (1)

Country Link
CN (1) CN107168768B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144483A (en) * 2018-08-22 2019-01-04 浪潮电子信息产业股份有限公司 A kind of method, apparatus, equipment and readable storage medium storing program for executing matching software interface
CN109710379A (en) * 2018-12-24 2019-05-03 广州供电局有限公司 Virtual operation management method, apparatus, system, computer equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101170635A (en) * 2007-11-22 2008-04-30 深圳市茁壮网络技术有限公司 A mapping device and digital TV terminal device using this mapping device
CN101453399A (en) * 2007-11-30 2009-06-10 华为技术有限公司 Virtual network configuration, section switching method, apparatus and system
CN103533096A (en) * 2013-10-09 2014-01-22 杭州华三通信技术有限公司 Binding method and device of network card interface
CN103856547A (en) * 2012-12-07 2014-06-11 华为技术有限公司 Mapping method and system of virtual machines and client side devices
CN104508632A (en) * 2013-07-31 2015-04-08 华为技术有限公司 Data forwarding method, device and system
CN104521198A (en) * 2012-08-02 2015-04-15 思科技术公司 System and method for virtual ethernet interface binding
CN104753746A (en) * 2013-12-30 2015-07-01 华为技术有限公司 Device accessing method and control server
CN105183535A (en) * 2015-08-05 2015-12-23 北京奇虎科技有限公司 Method and apparatus for accessing virtual machine

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101170635A (en) * 2007-11-22 2008-04-30 深圳市茁壮网络技术有限公司 A mapping device and digital TV terminal device using this mapping device
CN101453399A (en) * 2007-11-30 2009-06-10 华为技术有限公司 Virtual network configuration, section switching method, apparatus and system
CN104521198A (en) * 2012-08-02 2015-04-15 思科技术公司 System and method for virtual ethernet interface binding
CN103856547A (en) * 2012-12-07 2014-06-11 华为技术有限公司 Mapping method and system of virtual machines and client side devices
CN104508632A (en) * 2013-07-31 2015-04-08 华为技术有限公司 Data forwarding method, device and system
CN103533096A (en) * 2013-10-09 2014-01-22 杭州华三通信技术有限公司 Binding method and device of network card interface
CN104753746A (en) * 2013-12-30 2015-07-01 华为技术有限公司 Device accessing method and control server
CN105183535A (en) * 2015-08-05 2015-12-23 北京奇虎科技有限公司 Method and apparatus for accessing virtual machine

Also Published As

Publication number Publication date
CN107168768A (en) 2017-09-15

Similar Documents

Publication Publication Date Title
CN109951435B (en) Equipment identifier providing method and device and risk control method and device
US8332423B2 (en) Method and apparatus for content sharing
KR101857511B1 (en) Method and apparatus for determining virtual machine migration
US20150106914A1 (en) Remote control system, and method thereof
US9584481B2 (en) Host providing system and communication control method
US20160330618A1 (en) Trusted execution environment initialization method and mobile terminal
CN104601685A (en) Music playing method and device of smart sound box
CN105338659B (en) A kind of equipment connection method and terminal
CN109445902B (en) Data operation method and system
CN108205504B (en) Terminal USB mapping method, virtual machine USB mapping method and system
CN107203409B (en) USB redirection processing method and system
WO2017185455A1 (en) Root detection method, device, and terminal
CN106886429A (en) The method and server of a kind of load driver program
CN105516395A (en) Network address assignment method and device
CN107168768B (en) Mapping method and device of equipment and virtual machine
CN107566518A (en) The method and apparatus of management equipment information during installation file
CN111163245B (en) Method and device for adding network camera in network hard disk video recorder
US9160807B2 (en) System and method for deriving a name for association with a device
CN105072608A (en) Method and device for managing authentication token
CN108089910A (en) The method and apparatus for configuring virtual machine IP address
KR101846778B1 (en) Method for ID Resolution Service and M2M System applying the same
WO2018050055A1 (en) Data request processing method and system, access device, and storage device therefor
CN109656679B (en) Storage access method and device of virtual machine
US10896047B2 (en) Booting a computer using a wireless network connection
CN105144073A (en) Removable storage device identity and configuration information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Nanshan District Xueyuan Road in Shenzhen city of Guangdong province 518000 No. 1001 Nanshan Chi Park building A1 layer

Applicant after: SANGFOR TECHNOLOGIES Inc.

Address before: Nanshan District Xueyuan Road in Shenzhen city of Guangdong province 518000 No. 1001 Nanshan Chi Park building A1 layer

Applicant before: Sangfor Technologies Co.,Ltd.

GR01 Patent grant
GR01 Patent grant