CN103970582A - USB device simulation method - Google Patents

USB device simulation method Download PDF

Info

Publication number
CN103970582A
CN103970582A CN201310033144.2A CN201310033144A CN103970582A CN 103970582 A CN103970582 A CN 103970582A CN 201310033144 A CN201310033144 A CN 201310033144A CN 103970582 A CN103970582 A CN 103970582A
Authority
CN
China
Prior art keywords
usb device
usb
service
electronic equipment
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.)
Pending
Application number
CN201310033144.2A
Other languages
Chinese (zh)
Inventor
王灿
戴辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201310033144.2A priority Critical patent/CN103970582A/en
Publication of CN103970582A publication Critical patent/CN103970582A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Systems (AREA)

Abstract

The invention provides a USB device simulation method and is applicable to electronic equipment. The method comprises the following steps: a virtual USB-HOST drive is loaded in a driver layer; application layer simulated USB device service is started in an application layer; the simulated USB device operation is realized based on the interaction between the virtual USB-HOST drive and application layer simulated USB device service; the device simulated as the USB device or service and the electric equipment are subjected to the interactive operation according to the application layer simulated USB device service, wherein the device simulated as the USB device comprises a USB device or a non USB device. According to the USB device simulation method, based on the data interaction between the application layer simulated USB device and the virtual USB-HOST drive, the date interaction between a real USB device and a real USB-HOST drive is simulated; from the perspective of the application layer, the simulated USB device is completely the same as the real USB device.

Description

USB device analogy method
Technical field
The present invention relates to USB device simulation, and relate more specifically to a kind of USB device analogy method.
Background technology
Although many hardware devices can be installed on end device, but the hardware device sometimes installed still cannot meet the demand of end device, therefore occurred that some simulate the method for particular device on end device, for example, utilize dummy keyboard to drive simulating keyboard, utilize virtual drive to simulate CDROM.
Yet, these analogy methods are developed for a certain particular device often, for example virtual drive is developed for CDROM, and dummy keyboard drives for keyboard exploitation, does not still have a kind of analogy method that can cover particular device as much as possible.On the other hand, be similar to the directly real equipment of access of " DirectX Input " such technology, and directly ignore virtual unit, therefore above-mentioned dummy keyboard drives and cannot use under Direct Input.
At present, USB external unit (hereinafter, referred to as USB device) development can cover all external units rapidly and almost, and Windows system also reaches its maturity to the tenability of USB device, almost can use all common USB device drive in the situation that without extra installation.There is a kind of equipment simulating method based on USB device,, the USB HOST simulation of USB-UP mode, thus it is driven in application layer intact being mapped to of the USB device on another end device is modeled to local USB device on home terminal device by virtual USB-HOST.Yet the USB HOST simulation of this USB-UP mode only can realize the simulation of true USB device, and can only use at one time the USB device and one of true USB device simulateding.
Due to application demand, sometimes need to be on end device simulation itself non-existent USB device (for example, camera on mobile phone or microphone are modeled to the USB device on end device), or certain service is modeled to USB device (for example, the touch-screen service on mobile phone being modeled to keyboard or the mouse on terminal device).
Therefore, be desirable to provide a kind of general USB device analogy method, it not only can simulate the USB device on another end device, and can simulation itself and non-existent USB device or certain service is modeled to USB device.
Summary of the invention
Consider the problems referred to above and proposed the present invention.The invention provides a kind of USB device analogy method, it drives by the virtual USB-HOST driving layer and alternately the service in the machine is modeled as to virtual USB equipment in the application layer simulation USB device service of application layer, or USB device, non-USB device or service on another device are modeled as to virtual USB equipment, thus make as in the machine, inserted with as described in virtual USB equipment have the true USB device of identical function and operate.
According to an aspect of the present invention, provide a kind of USB device analogy method, be applied to electronic equipment, described method comprises: driving layer to load virtual USB-HOST driving; In application layer, start the service of application layer simulation USB device; And by the operation of simulating alternately USB device between described virtual USB-HOST driving and the service of described application layer simulation USB device, so that be modeled as equipment or the service of described USB device, according to described USB device service and described electronic equipment, carry out interactive operation, wherein, the equipment that is modeled as described USB device described in comprises USB device or non-USB device.
Preferably, in described USB device analogy method, by the operation of simulating alternately USB device driving at described virtual USB-HOST and described application layer is simulated between USB device service, comprise: described virtual USB-HOST drives the insertion process of calling to simulate USB device by IO interface control function (IOCTRL); And the sign that loads simulated USB device in the equipment manager of described electronic equipment.
Preferably, in described USB device analogy method, by the operation of simulating alternately USB device driving at described virtual USB-HOST and described application layer is simulated between USB device service, also comprise: described virtual USB-HOST drives the withdrawal process that calls to simulate USB device by IO interface control function (IOCTRL); The system kernel unloading driving corresponding with simulated USB device of described electronic equipment; And the sign of deleting simulated USB device in the equipment manager of described electronic equipment.
Preferably, in described USB device analogy method, in the service of described application layer simulation USB device, stored the corresponding relation between the data of the data that will simulate and true USB device.
Preferably, in described USB device analogy method, specific drivers or the universal driver of the USB device of simulating has been installed in described electronic equipment.
Preferably, in described USB device analogy method, by at described virtual USB-HOST, drive and the service of described application layer simulation USB device between the operation of simulating alternately USB device comprise: from the first data of simulated USB device, by described application layer simulation USB device Service change, be the second data and arrive described virtual USB-HOST and drive, and described virtual USB-HOST drives special use or the universal driver that the second received data is passed to the USB device of simulating of installing in described electronic equipment, make described electronic equipment carry out the operation of carrying out according to described the second data.
Preferably, in described USB device analogy method, by at described virtual USB-HOST, drive and the service of described application layer simulation USB device between the operation of simulating alternately USB device also comprise: the special use of the 3rd data of sending from described electronic equipment by the USB device of simulating of installing in described electronic equipment or universal driver pass to described virtual USB-HOST and drive, described virtual USB-HOST drives the 3rd received data is passed to the service of described application layer simulation USB device, the service of described application layer simulation USB device changes described the 3rd data the 4th data into and sends it to simulated USB device.
Preferably, in described USB device analogy method, the described equipment that is modeled as described USB device comprises USB device or the non-USB device on another electronic equipment, and described in be modeled as described USB device service comprise service on described electronic equipment or the service on described another electronic equipment.
Preferably, in described USB device analogy method, described electronic equipment obtains its available shared resource by XMPP server, described shared resource is at least one in USB device, non-USB device, service, and described electronic equipment is modeled as the USB device on described electronic equipment by described shared resource.
Preferably, in described USB device analogy method, by XMPP server, described electronic equipment and described another electronic equipment are carried out to authentication, between described electronic equipment and described another electronic equipment, set up P2P data-transmission channel.
Preferably, in described USB device analogy method, described shared resource can be used by described electronic equipment, and can be used by other electronic equipment.
According to the USB device analogy method of the embodiment of the present invention, data interaction between driving by Reality simulation USB device and true USB-HOST in the data interaction between application layer simulation USB device service and virtual USB-HOST driving, thereby in application layer, look, the USB device of simulating is duplicate with true USB device.
Accompanying drawing explanation
Embodiments of the present invention is described in detail in conjunction with the drawings, and above and other objects of the present invention, feature, advantage will become apparent, wherein:
Fig. 1 is according to the indicative flowchart of the USB device analogy method of the embodiment of the present invention;
Fig. 2 A and Fig. 2 B are the process flow diagrams of part operation of the step S130 of the USB device analogy method shown in Fig. 1;
Fig. 3 A and Fig. 3 B are the process flow diagrams of part operation of the step S130 of the USB device analogy method shown in Fig. 1;
Fig. 4 is the comparison diagram illustrating according to the true USB device using method of the USB device analogy method of the embodiment of the present invention and prior art; And
Fig. 5 is the schematic diagram that utilizes the processing of XMPP server between shared Sub equipment/service providing end and shared subset/service use side illustrating according to the embodiment of the present invention.
Embodiment
Next, with reference to accompanying drawing, the USB device analogy method according to the embodiment of the present invention is schematically described.
Figure 1 illustrates according to the indicative flowchart of the USB device analogy method 100 of the embodiment of the present invention, according to the USB device analogy method 100 of the embodiment of the present invention, be applied in electronic equipment, this electronic equipment can be personal computer, flat computer, smart mobile phone, personal digital assistant, intelligent television etc.
As shown in Figure 1, according to the USB device analogy method 100 of the embodiment of the present invention, at step S101, start.
At step S110, driving layer to load virtual USB-HOST driving.
At step S120, in application layer, start the service of application layer simulation USB device.
At step S130, by the operation of simulating alternately USB device between described virtual USB-HOST driving and the service of described application layer simulation USB device, so that be modeled as equipment or the service of described USB device, according to described application layer simulation USB device service and described electronic equipment, carry out interactive operation.The described equipment that is modeled as described USB device comprises USB device or non-USB device.
Particularly, the equipment that is modeled as described USB device described in can comprise USB device or the non-USB device on another electronic equipment.For example, the USB printer on described another electronic equipment, USB keyboard, USB mouse, USB camera, USB storage etc. can be modeled as to the USB device in the machine.Again for example, the camera on described another electronic equipment, microphone, keyboard, scanner, printer etc. can be modeled as to the USB device in the machine.
On the other hand, the service that is modeled as described USB device described in comprises service on described electronic equipment or the service on described another electronic equipment.For example, described electronic equipment is intelligent television, and described another electronic equipment can be mobile phone, mobile phone screen can be modeled to keyboard in the machine or mouse to input.Again for example, described electronic equipment can be smart mobile phone, flat computer etc., the screen in the machine can be modeled to keyboard in the machine or mouse to input.
Figure 4 illustrates according to the comparison diagram of the true USB device using method of the USB device analogy method of the embodiment of the present invention and prior art.
As shown in Figure 4, " the application layer simulation USB device " in left side served as the role of the Physical layer " USB device " on right side, and " virtual USB-HOST drives " in left side served as the role of " the USB-HOST driving " on right side.
As is known, by usb bus communication mode, between " USB device " and " USB-HOST driving ", communicate.Unlike this, according in the USB device analogy method of the embodiment of the present invention, by operating system, call IO interface control function (IOCTRL) and communicate between " the application layer simulation USB device " in left side and " virtual USB-HOST drives ".
In addition, " USB device (simulation) " in left side is in full accord with " the USB device driving " on right side, can use the USB device that operating system carries (for example to drive, USB keyboard, USB mouse, USB storage etc.), also can use the driving (for example, printer driver etc.) of USB device manufacturer exploitation.In fact, the different names of " USB device (simulation) " in left side and " the USB device driving " on right side are also only used to distinguish the driving that USB physical equipment is corresponding with USB analog machine.
In left side, although USB device is the USB device of simulating out, its driving of using is the driving of true USB device.
Next, with reference to figure 2 and 3, describe according to the concrete operations of the USB device analogy method of the embodiment of the present invention.
The process flow diagram of simulating the insertion process of USB device according in the USB device analogy method of the embodiment of the present invention has been shown in Fig. 2 A.According to the USB device analogy method of the embodiment of the present invention by described virtual USB-HOST, drive and the service of described application layer simulation USB device between the insertion process of simulating alternately USB device.
At step S210, described virtual USB-HOST drives the insertion process of calling to simulate USB device by IO interface control function (IOCTRL).
At step S220, in the equipment manager of described electronic equipment, load the sign of simulated USB device.
In Fig. 3 A, illustrated according to simulating the process flow diagram of the data input operation of USB device in the USB device analogy method of the embodiment of the present invention.According to the USB device analogy method of the embodiment of the present invention, by the data of simulating alternately USB device that drive at described virtual USB-HOST and described application layer is simulated between USB device service, input.
At step S310, from the first data that are modeled as the equipment of USB device, by described application layer simulation USB device Service change, be the second data, and arrive described virtual USB-HOST driving.
In the service of described application layer simulation USB device, stored the corresponding relation between the data of the data that will simulate and true USB device.For example, described electronic equipment is intelligent television, described another electronic equipment is smart mobile phone, in the situation that the screen of described smart mobile phone is modeled as to the virtual USB keyboard of described intelligent television, in the service of described application layer simulation USB device, need storage for example by wireless mode, from described smart mobile phone, to receive the corresponding relation between next screen touch data and the button data of true keyboard.
At step S320, described virtual USB-HOST drives special use or the universal driver that the second received data is passed to the equipment that is modeled as USB device of installing in described electronic equipment, that is, and and the USB device (simulation) in left side in Fig. 4.
At step S330, described electronic equipment is carried out the operation of carrying out according to described the second data.The special use of the USB device of simulating of installing in described electronic equipment particularly, or universal driver operate according to described the second data.
In Fig. 3 B, illustrated according to simulating the process flow diagram of the data output function of USB device in the USB device analogy method of the embodiment of the present invention.According to the USB device analogy method of the embodiment of the present invention, by the data of simulating alternately USB device that drive at described virtual USB-HOST and described application layer is simulated between USB device service, export.
At step S360, the special use of the 3rd data of sending from described electronic equipment by the USB device of simulating of installing in described electronic equipment or universal driver pass to described virtual USB-HOST and drive.
At step S360, described virtual USB-HOST drives the 3rd received data is passed to the service of described application layer simulation USB device.
At step S370, the service of described application layer simulation USB device changes described the 3rd data into the 4th data, and sends it to the equipment that is modeled as USB device.
In Fig. 2 B, illustrated according to simulating the process flow diagram of extracting operation of USB device in the USB device analogy method of the embodiment of the present invention.According to the USB device analogy method of the embodiment of the present invention by described virtual USB-HOST, drive and the service of described application layer simulation USB device between the operation of extracting of simulating alternately USB device.
At step S260, described virtual USB-HOST drives the withdrawal process that calls to simulate USB device by IO interface control function (IOCTRL).
At step S270, the driving that the unloading of the system kernel of described electronic equipment is corresponding with simulated USB device.
At step S280, in the equipment manager of described electronic equipment, delete the sign of simulated USB device.
As mentioned above, according to can't see the USB device of simulating according to the USB device analogy method of the embodiment of the present invention and " true USB device " on " USB-HOST driving " (comprising application layer) any difference.For example, what " the USB keyboard of simulating " seen in equipment manager is " USB keyboard " rather than " dummy keyboard driving ", make thus the application (technology that great majority game is used) of using " DirectX Input " such can both correctly use " the USB keyboard of simulating ", and in the game of " DirectX Input ", directly skipped and cisco unity malfunction like that unlike " dummy keyboard driving ".
In addition, as mentioned above, due in fact identical with " USB device driving " in " USB device (simulation) ", the driver of the USB device of therefore also simulating out without extra exploitation.In fact, according to the equipment simulating process of the USB device analogy method of the embodiment of the present invention, in application layer, complete, that is, in the service of application layer simulation USB device, stored the corresponding relation between the data of the data that will simulate and true USB device.
If need to produce new simulation (virtual) USB device in electronic equipment, only need simulate specific drivers or the universal driver that adds new plug-in unit in USB device service and the equipment that is modeled as USB device is installed in this electronic equipment in application layer, this new plug-in unit has been stored the corresponding relation between the data of the data that will simulate and true USB device.
The first embodiment
In this first embodiment, described electronic equipment can be intelligent television, described another electronic equipment can be smart mobile phone, described intelligent television and described smart mobile phone communicate by wireless mode, the touch screen on described smart mobile phone are modeled as to the USB keyboard on described intelligent television on described intelligent television.
First, on described intelligent television, load virtual USB-HOST and drive, and start the service of application layer simulation USB device.
Next, by the insertion of simulating alternately " USB keyboard " of " service of application layer simulation USB device " and " virtual USB-HOST drives "." virtual USB-HOST drives " calls IO interface control function (IOCTRL), starting " service of application layer simulation USB device " afterwards, the insertion indication of " service of application layer simulation USB device " generation " USB keyboard ", and in response to IOCTRL, this insertion indication is offered to " virtual USB-HOST drives ".Then, " virtual USB-HOST drives " recognizes " USB keyboard " insertion.
When the correspondence driving of " USB keyboard " has been installed in the operating system of described intelligent television, the operating system of described intelligent television is inserted according to " USB keyboard " information such as device type that comprise in indication and is loaded corresponding driving, if do not find device drives, can point out user installation device drives.Once after the large operating system of described intelligent television has loaded corresponding device drives, should " USB keyboard " will appear as real USB keyboard in " equipment manager " of described intelligent television, rather than dummy keyboard drive.
Then, when touch operation that the enterprising line unit dish of the touch screen at described smart mobile phone shows, described smart mobile phone sends service data to " service of application layer simulation USB device " of described intelligent television by wireless mode, " service of application layer simulation USB device " of described intelligent television is converted to received service data the key assignments data of described " USB keyboard " and then provides it to " virtual USB-HOST drives ".
Then, " virtual USB-HOST drives " sends the key assignments data of described " USB keyboard " to the driver of " USB keyboard " again, that is, " USB device (simulation) ", realizes the simulation to " USB keyboard " operation thus.
When " USB keyboard " is somebody's turn to do in needs unloading, can correspondingly close or unload described " service of application layer simulation USB device ", make the indication of extracting of described " service of application layer simulation USB device " generations " USB keyboard ", and this is extracted to indication offer " virtual USB-HOST driving ".Then, " virtual USB-HOST driving " recognizes " USB keyboard " and extracts, and correspondingly unloads the corresponding device driving of being somebody's turn to do " USB keyboard ", and " USB keyboard " is somebody's turn to do in deletion from " equipment manager ".
The second embodiment
In this second embodiment, described electronic equipment can be flat computer, described another electronic equipment can be desk-top computer, described flat computer and described desk-top computer communicate by wireless mode, the printer on described flat computer, described desk-top computer being connected (for example, USB printer or non-USB printer) is modeled as " the USB printer " of described flat computer.
First, on described flat computer, load virtual USB-HOST and drive, and start the service of application layer simulation USB device.
Next, by the insertion of simulating alternately " USB printer " of " service of application layer simulation USB device " and " virtual USB-HOST drives "." virtual USB-HOST drives " calls IO interface control function (IOCTRL), starting " service of application layer simulation USB device " afterwards, the insertion indication of " service of application layer simulation USB device " generation " USB printer ", and in response to IOCTRL, this insertion indication is offered to " virtual USB-HOST drives ".Then, " virtual USB-HOST drives " recognizes " USB printer " insertion.
After the operating system of described flat computer has loaded the correspondence driving of " USB printer ", should " USB printer " will in " equipment manager " of described intelligent television, appear as real USB printer.
Then, when described flat computer is carried out printing, the correspondence driving that the print data of sending from described flat computer is passed through loaded " USB printer " is converted to the printer data that will send to " USB printer ", and described in being transmitted to " virtual USB-HOST drives ", and be then transmitted to " application layer simulation USB device service ", as required, described " application layer is simulated USB device service " can change the form of described printer data and send described printer data by wireless mode.Thus, realize the simulation to the printing of " USB printer ".
When " USB printer " is somebody's turn to do in needs unloading, can correspondingly close or unload described " service of application layer simulation USB device ", make the indication of extracting of described " service of application layer simulation USB device " generations " USB printer ", and this is extracted to indication offer " virtual USB-HOST driving ".Then, " virtual USB-HOST driving " recognizes " USB printer " and extracts, and correspondingly unloads the corresponding device driving of being somebody's turn to do " USB printer ", and " USB printer " is somebody's turn to do in deletion from " equipment manager ".
The 3rd embodiment
According to the USB device analogy method of the embodiment of the present invention, except carrying out in LAN (Local Area Network) equipment shares, can also expand to easily wide area network and carry out equipment and share.
As shown in Figure 5, show by XMPP agreement and on wide area network, realize the shared schematic diagram of equipment, " providing end of shared Sub equipment or service " and " use side of shared Sub equipment or service " utilizes the announcement (publish) in XMPP agreement and subscribes to (subscribe), realizes the plug and play of equipment.
" connection management " in Fig. 5 is the expansion form of " service of application layer simulation USB device " in Fig. 4, it can realize by XMPP client " providing end of shared Sub equipment or service " and " use side of shared Sub equipment or service " both sides' authentication, the foundation of P2P data transmission (passing through containing NAT) passage can be realized by XMPP client, the state synchronized of " providing end of shared Sub equipment or service " and " use side of shared Sub equipment or service " middle shared Sub equipment or service can be realized by XMPP client.
In addition, as shown in Figure 5, " providing end of shared Sub equipment or service " not only can share real USB device, but also can share non-USB device and service." real equipment or service " in Fig. 5 can comprise three kinds of situations: true USB device (such as USB keyboard, USB mouse, USB printer etc.), can be modeled to other subset (for example camera, microphone, non-USB printer etc.) of USB device and the service that can be modeled to USB device." analog service " in Fig. 5 is modeled as USB device by " service " (being non-existent USB device), for example touch-screen is modeled to USB keyboard, " simulation USB device " is modeled to USB device by the non-USB device in " providing end of shared Sub equipment or service ", and described non-USB device is for example camera, microphone etc.
" providing end of shared Sub equipment or service " starts backward XMPP server and announces (publish) its shared Sub equipment or service, and now can find this shared Sub equipment or service to " use side of shared Sub equipment or service " that XMPP server is asked for subscription.
When this shared Sub equipment or service are used in hope, " use side of shared Sub equipment or service " sends connection request by XMPP server to " providing end of shared Sub equipment or service ", this connection request can comprise the sign of " use side of shared Sub equipment or service ", so that " providing end of shared Sub equipment or service " identifies " use side of shared Sub equipment or service " that sends connection request.
After " providing end of shared Sub equipment or service " receives this connection request, if " providing end of shared Sub equipment or service " is configured to blacklist refusal,
1) if " use side of shared Sub equipment or service " in the blacklist of " providing end of shared Sub equipment or service ", " providing end of shared Sub equipment or service " returned to refusal and shared;
2) and if if " providing end of shared Sub equipment or service " is configured to automatically agree to share not in blacklist, " providing end of shared Sub equipment or service " returned and agreed to share;
3) and if if " providing end of shared Sub equipment or service " is configured to need remind not in blacklist,
If a) operator's refusal, " providing end of shared Sub equipment or service " returned and refused to share,
B) if operator agree to, " providing end of shared Sub equipment or service " returned and agreed to share.
Alternatively, after " providing end of shared Sub equipment or service " receives this connection request, if being configured to white list, " providing end of shared Sub equipment or service " start,
1) if " use side of shared Sub equipment or service " in white list, " providing end of shared Sub equipment or service " returned and agree to be shared;
2) if not in white list " and if the providing end of shared Sub equipment or service " be configured to other automatically refusal share, " providing end of shared Sub equipment or service " returned and agreed to share;
3) and if if " providing end of shared Sub equipment or service " is configured to other and needs to remind not in white list,
If a) operator's refusal, " providing end of shared Sub equipment or service " returned and refused to share,
B) if operator agree to, " providing end of shared Sub equipment or service " returned and agreed to share.
Take below " shared Sub equipment or service " as printer as example, be described.
After " use side of shared Sub equipment or service " receives the shared information of agreement, between " providing end of shared Sub equipment or service " and " use side of shared Sub equipment or service ", set up P2P data transmission channel.In " use side of shared Sub equipment or service " upper loading " virtual USB-HOST drives ", start " service of application layer simulation USB device ", and by the insertion of simulating alternately " USB printer " of " service of application layer simulation USB device " and " virtual USB-HOST drives ".For example, " virtual USB-HOST drives " calls IO interface control function (IOCTRL), starting " service of application layer simulation USB device " afterwards, the insertion indication of " service of application layer simulation USB device " generation " USB printer ", and in response to IOCTRL, this insertion indication is offered to " virtual USB-HOST drives ".Then, " virtual USB-HOST drives " recognizes " USB printer " insertion.
After the operating system of " use side of shared Sub equipment or service " has loaded the correspondence driving of " USB printer ", should " USB printer " will in " equipment manager " of " use side of shared Sub equipment or service ", appear as real USB printer.
Then, when " use side of shared Sub equipment or service " carries out printing, the correspondence driving that the print data of sending from " use side of shared Sub equipment or service " is passed through loaded " USB printer " is converted to the printer data that will send to " USB printer ", and described in being transmitted to " virtual USB-HOST drives ", and be then transmitted to " application layer simulation USB device service ", as required, described " service of application layer simulation USB device " can be changed the form of described printer data and to " providing end of shared Sub equipment or service ", send described printer data by P2P connected mode.Thus, realize the simulation to the printing of " USB printer ".
When " USB printer " is somebody's turn to do in needs unloading, described " service of application layer simulation USB device " can correspondingly be closed or unload to " use side of shared Sub equipment or service ", make the indication of extracting of described " service of application layer simulation USB device " generations " USB printer ", and this is extracted to indication offer " virtual USB-HOST driving ".Then, " virtual USB-HOST driving " recognizes " USB printer " and extracts, and correspondingly unloads the corresponding device driving of being somebody's turn to do " USB printer ", and " USB printer " is somebody's turn to do in deletion from " equipment manager ".
On the other hand, while not thinking shared Sub equipment or service or shutdown in " providing end of shared Sub equipment or service ", " providing end of shared Sub equipment or service " sent and disconnected notice by XMPP server.Correspondingly, " application layer simulation USB device service " generations " USB printer " extract indication, and this extracted to indication offer " virtual USB-HOST driving ".Then, " virtual USB-HOST driving " recognizes " USB printer " and extracts, and correspondingly unloads the corresponding device driving of being somebody's turn to do " USB printer ", and " USB printer " is somebody's turn to do in deletion from " equipment manager ".
In addition, in data transmission procedure, can also be by using the mechanism of similar OPENSSL to provide safeguard to safe, reliable, the integrality of communicating pair data.
According to third embodiment of the invention, can on wide area network, realize sharing of USB device, non-USB device or service, and shared equipment or service not only can be used by " providing end of shared Sub equipment or service ", and can be used by a plurality of " use side of shared Sub equipment or service ".
According to the USB device analogy method of the embodiment of the present invention, by utilizing XMPP agreement to obtain, share list and realize and share both sides' authentication, can on wide area network, realize sharing of subset or service, by setting up P2P transmission, can between " providing end of shared Sub equipment or service " and " use side of shared Sub equipment or service ", carry out data transmission, and the data interaction between driving by Reality simulation USB device and true USB-HOST in the data interaction between application layer simulation USB device service and virtual USB-HOST driving in " use side of shared Sub equipment or service ", thereby look in the application layer of " providing end of shared Sub equipment or service ", the USB device of simulating is duplicate with true USB device.
Although example embodiment has been described with reference to the drawings here, it is only exemplary should understanding above-mentioned example embodiment, and is not intended to limit the scope of the invention to this.Those of ordinary skills can make various changes and modifications therein, and do not depart from scope and spirit of the present invention.Within all such changes and modifications are intended to be included in the desired scope of the present invention of claims.

Claims (10)

1. a USB device analogy method, is applied to electronic equipment, and described method comprises:
Driving layer to load virtual USB-HOST driving;
In application layer, start the service of application layer simulation USB device; And
By the operation of simulating alternately USB device between described virtual USB-HOST driving and the service of described application layer simulation USB device, so that be modeled as equipment or the service of described USB device, according to described application layer simulation USB device service and described electronic equipment, carry out interactive operation, wherein, the equipment that is modeled as described USB device described in comprises USB device or non-USB device.
2. USB device analogy method as claimed in claim 1, wherein, by described virtual USB-HOST, drive and the service of described application layer simulation USB device between the operation of simulating alternately USB device comprise:
Described virtual USB-HOST drives the insertion process of calling to simulate USB device by IO interface control function (IOCTRL); And
In the equipment manager of described electronic equipment, load the sign of simulated USB device.
3. USB device analogy method as claimed in claim 2, wherein, by described virtual USB-HOST, drive and the service of described application layer simulation USB device between the operation of simulating alternately USB device also comprise:
Described virtual USB-HOST drives the withdrawal process that calls to simulate USB device by IO interface control function (IOCTRL);
The system kernel unloading driving corresponding with simulated USB device of described electronic equipment; And
In the equipment manager of described electronic equipment, delete the sign of simulated USB device.
4. USB device analogy method as claimed in claim 2 wherein, has been stored the corresponding relation between the data of the data that will simulate and true USB device in the service of described application layer simulation USB device.
5. USB device analogy method as claimed in claim 1 wherein, has been installed specific drivers or the universal driver of the equipment that is modeled as USB device in described electronic equipment;
By the operation of simulating alternately USB device driving at described virtual USB-HOST and described application layer is simulated between USB device service, comprise:
From the first data that are modeled as the equipment of USB device, by described application layer simulation USB device Service change, be the second data and arrive described virtual USB-HOST and drive, and described virtual USB-HOST drives special use or the universal driver that the second received data is passed to the equipment that is modeled as USB device of installing in described electronic equipment, make described electronic equipment carry out the operation of carrying out according to described the second data.
6. USB device analogy method as claimed in claim 5, wherein, by described virtual USB-HOST, drive and the service of described application layer simulation USB device between the operation of simulating alternately USB device also comprise:
The special use of the 3rd data of sending from described electronic equipment by the equipment that is modeled as USB device installed in described electronic equipment or universal driver pass to described virtual USB-HOST and drive, described virtual USB-HOST drives the 3rd received data is passed to the service of described application layer simulation USB device, and the service of described application layer simulation USB device changes described the 3rd data the 4th data into and sends it to the equipment that is modeled as USB device.
7. USB device analogy method as claimed in claim 1, wherein, described in be modeled as described USB device equipment comprise USB device or the non-USB device on another electronic equipment, and
The described service that is modeled as described USB device comprises service on described electronic equipment or the service on described another electronic equipment.
8. USB device analogy method as claimed in claim 1, wherein, described electronic equipment obtains its available shared resource by XMPP server, described shared resource is at least one in USB device, non-USB device, service, and described electronic equipment is modeled as the USB device on described electronic equipment by described shared resource.
9. USB device analogy method as claimed in claim 8, wherein,
By XMPP server, described electronic equipment and described another electronic equipment are carried out to authentication, between described electronic equipment and described another electronic equipment, set up P2P data-transmission channel.
10. USB device analogy method as claimed in claim 9, wherein, described shared resource can be used by described electronic equipment, and can be used by other electronic equipment.
CN201310033144.2A 2013-01-28 2013-01-28 USB device simulation method Pending CN103970582A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310033144.2A CN103970582A (en) 2013-01-28 2013-01-28 USB device simulation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310033144.2A CN103970582A (en) 2013-01-28 2013-01-28 USB device simulation method

Publications (1)

Publication Number Publication Date
CN103970582A true CN103970582A (en) 2014-08-06

Family

ID=51240118

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310033144.2A Pending CN103970582A (en) 2013-01-28 2013-01-28 USB device simulation method

Country Status (1)

Country Link
CN (1) CN103970582A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104363486A (en) * 2014-10-30 2015-02-18 青岛海信信芯科技有限公司 Combined television and USB (universal serial bus) sharing method thereof
CN104572564A (en) * 2015-01-13 2015-04-29 上海动联信息技术股份有限公司 Method for realizing communication of Android mobile equipment and USB OTG (On-The-Go) host computer
CN105159748A (en) * 2015-09-02 2015-12-16 湖南创博龙智信息科技股份有限公司 Hardware simulation method based on windows bottom drive technology
CN106341777A (en) * 2016-08-11 2017-01-18 深圳创维-Rgb电子有限公司 USB virtual device creation method, device and system
CN107357743A (en) * 2017-07-28 2017-11-17 郑州云海信息技术有限公司 A kind of method and device for controlling USB device
CN110278089A (en) * 2019-06-17 2019-09-24 厦门亿联网络技术股份有限公司 A kind of wireless session control system and control method and business method based on virtual USB device
CN113885816A (en) * 2021-09-29 2022-01-04 广东天波信息技术股份有限公司 Method, system, device and storage medium for printing by virtual printing device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751274A (en) * 2008-12-18 2010-06-23 联想(北京)有限公司 Virtual machine system and unloading method of universal serial bus device thereof
CN102281264A (en) * 2010-06-13 2011-12-14 杭州华三通信技术有限公司 Virtual universal serial bus (USB) system, equipment and method for realizing USB host remote access

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751274A (en) * 2008-12-18 2010-06-23 联想(北京)有限公司 Virtual machine system and unloading method of universal serial bus device thereof
CN102281264A (en) * 2010-06-13 2011-12-14 杭州华三通信技术有限公司 Virtual universal serial bus (USB) system, equipment and method for realizing USB host remote access

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
白涛: "USB模拟器的设计与实现", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104363486A (en) * 2014-10-30 2015-02-18 青岛海信信芯科技有限公司 Combined television and USB (universal serial bus) sharing method thereof
CN104363486B (en) * 2014-10-30 2018-07-13 青岛海信电器股份有限公司 A kind of the USB sharing methods and combination tv of combination tv
CN104572564A (en) * 2015-01-13 2015-04-29 上海动联信息技术股份有限公司 Method for realizing communication of Android mobile equipment and USB OTG (On-The-Go) host computer
CN104572564B (en) * 2015-01-13 2018-04-20 上海动联信息技术股份有限公司 It is a kind of to realize android movement equipment and the method for USB OTG host communications
CN105159748A (en) * 2015-09-02 2015-12-16 湖南创博龙智信息科技股份有限公司 Hardware simulation method based on windows bottom drive technology
CN105159748B (en) * 2015-09-02 2018-06-19 湖南创博龙智信息科技股份有限公司 A kind of hardware simulation method based on windows bottom layer driving technologies
CN106341777A (en) * 2016-08-11 2017-01-18 深圳创维-Rgb电子有限公司 USB virtual device creation method, device and system
CN106341777B (en) * 2016-08-11 2019-04-02 深圳创维-Rgb电子有限公司 USB virtual unit creation method, equipment and system
CN107357743A (en) * 2017-07-28 2017-11-17 郑州云海信息技术有限公司 A kind of method and device for controlling USB device
CN110278089A (en) * 2019-06-17 2019-09-24 厦门亿联网络技术股份有限公司 A kind of wireless session control system and control method and business method based on virtual USB device
CN113885816A (en) * 2021-09-29 2022-01-04 广东天波信息技术股份有限公司 Method, system, device and storage medium for printing by virtual printing device

Similar Documents

Publication Publication Date Title
CN103970582A (en) USB device simulation method
CN104702665B (en) Information sharing method and information sharing apparatus
CN101795269B (en) Presence information sharing apparatus, method, program and system
CN103150132B (en) A kind of biography screen method and electronic equipment
CN111552450A (en) Screen projection method and device
CN102891890B (en) Exchange method between a kind of terminal and relevant device, system
CN104092644A (en) Interaction method, device, client and server
CN105142011A (en) Web-based television terminal multi-screen interaction method and device
CN102413150A (en) Server and virtual desktop control method and virtual desktop control system
CN103701927A (en) Terminal-to-terminal image sharing method, terminal device and communication system
WO2010087829A1 (en) Selectively communicating data of a peripheral device to plural sending computers
CN103916883A (en) Wireless network device control method and main control device with wireless network function
CN103703484A (en) Advertising display control method and apparatus
CN106933523A (en) A kind of multi-screen interaction method and device
CN110582998A (en) Group communication method and device, computer storage medium and computer equipment
CN112953908A (en) Network isolation configuration method, device and system
CN107548083B (en) Wireless access point function test method and device
CN105554750A (en) Transmission method of data frame, and terminal
US20150186095A1 (en) Inter-terminal image sharing method, terminal device, and communications system
CN104023057A (en) Data sharing method and data sharing system
EP3151481B1 (en) Communication terminal, communication system, and output method
CN105227414A (en) Multi-user's binding method of smart machine under privately owned cloud environment
CN109583182B (en) Method and device for starting remote desktop, electronic equipment and computer storage medium
CN106302670A (en) A kind of picture update method, communication terminal and server
CN105049668A (en) Information processing system, information processing apparatus, method, and storage medium

Legal Events

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

Application publication date: 20140806

RJ01 Rejection of invention patent application after publication