CN102098309B - Device and method for realizing multiuser access to USB equipment - Google Patents

Device and method for realizing multiuser access to USB equipment Download PDF

Info

Publication number
CN102098309B
CN102098309B CN201110042522.4A CN201110042522A CN102098309B CN 102098309 B CN102098309 B CN 102098309B CN 201110042522 A CN201110042522 A CN 201110042522A CN 102098309 B CN102098309 B CN 102098309B
Authority
CN
China
Prior art keywords
usb
physical interface
interface
mapping relations
tcp port
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
CN201110042522.4A
Other languages
Chinese (zh)
Other versions
CN102098309A (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.)
New H3C Information Technologies Co Ltd
Original Assignee
Hangzhou H3C 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201110042522.4A priority Critical patent/CN102098309B/en
Publication of CN102098309A publication Critical patent/CN102098309A/en
Application granted granted Critical
Publication of CN102098309B publication Critical patent/CN102098309B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Abstract

The invention discloses a device and method for realizing multiuser access to USB equipment. By means of the device and the method provided by the invention, users can use TCP (Transmission Control Protocol) ports to realize remote access crossing IP networks and can access USB equipment connected to corresponding USB physical ports through the TCP ports which are used during remote access and are mapped to the corresponding physical ports. Because the same TCP port number is not limited to be used by users logged in the same PC (Personal Computer), the access limit on the single USB mainframe to the USB equipment can be avoided to realize real multiuser access; and the access to the USB equipment through the IP networks is also beneficial to avoiding spatial position limitations of the USB equipment. In addition, the mapping relation between the TCP ports and the USB physical ports can be established according to the corresponding relationship between the TCP ports configured for users and silk screen numbers of the USB physical ports, and thus, the management of the USB equipment is facilitated.

Description

For realizing the device and method of multi-user access USB device
Technical field
The present invention relates to USB (USB) technology, particularly a kind of for realizing the device of multi-user access USB device and a kind of for realizing the method for multi-user access USB device.
Background technology
Usb protocol is that a kind of general peripheral hardware connects standard, and in other words, usb protocol is a kind of peripheral interface standard of serial communication.USB has the features such as hot plug, transfer of data is reliable, expansion is convenient, low-cost, has become the Peripheral Interface of current electronic device indispensability.The Topological Skew Field owner of USB system will be comprised of these three elements of usb host (Host), usb hub (Hub) and USB device (Node), and usb host can be direct-connected by USB connecting line and USB device, also can pass through USB connecting line and at least one usb hub and USB device cascade.
Along with popularizing of USB technology, USB interface starts to substitute traditional RS-232 serial line interface gradually.For adapting to this variation, datacom devices such as router and switch is also used USB device interface and the direct-connected or cascade as the PC of usb host, so that can manage operation to the datacom device as USB device as the PC user of usb host.Fig. 1 shows the exemplary block diagram under a kind of cascade state, in Fig. 1, the PC that can login for user is as usb host, datacom device A~datacom device C is connected to the PC as usb host as USB device and by usb hub level, and the PC that user can login as usb host is led to device A~datacom device C and realized the bookkeeping that logarithm leads to device A~datacom device C by USB interface access number.
Yet, can there is following technical problem in prior art in the Topological Skew Field architecture of the USB system based on traditional:
1, in each USB system, have and only have 1 usb host, the USB address of all usb hubs and all USB device is all distributed by this usb host, therefore, under the prerequisite of line that does not change USB system, can only there is 1 usb host to conduct interviews to all USB device.
The structure of take is as shown in Figure 1 example, user only has the PC of logining as usb host access number to lead to device A~datacom device C, and realize the bookkeeping of the logical device A~datacom device C of logarithm, and for the user who logins unshowned other non-usb host PCs in Fig. 1, unless non-usb host PC is changed to usb host by changing USB connecting line, otherwise, just can not lead to device A~datacom device C by the USB interface access number of datacom device A~datacom device C, thereby also just can not realize the bookkeeping of the logical device A~datacom device C of logarithm, that is to say, can be by the logical device A~datacom device C of USB interface access number, and the bookkeeping of realizing the logical device A~datacom device C of the logarithm user that only limits to login usb host.
2, because USB system is used for judging that transfer of data is overtime realizes by hardware handshaking signal, and too much time delay can cause transfer of data to occur time-out error on USB connecting line, therefore, in USB system, require every section of direct-connected USB connecting line length to be no more than 5 meters, use the cascade of usb hub to be no more than 5 grades (in usb hosts integrated Root Hub not very interior), thereby make the ultimate range between usb host and USB device in USB system can not surpass 30m.
The structure of take is as shown in Figure 1 example, and user can only realize access and the bookkeeping that logarithm leads to device A~datacom device C in the limited physical space within 30 meters, thereby the locus of the logical device A~datacom device C of logarithm has proposed harsh requirement.
3, it is corresponding com port that the PC that USB device is often used as usb host utilizes operating system (for example Windows system) of its inner carrying virtual, and, com port can be associated with the logical port number of USB physical interface, for user, distinguishes different USB device.But, because com port is dynamic change with this associated of logical port number, thereby will cause the USB device that is connected to USB physical interface to be easily confused, to be difficult for being distinguished.
The structure of take is as shown in Figure 1 example, after datacom device A is inserted in the USB physical interface 1 of PC, in PC the operating system of carrying can by datacom device A virtual be corresponding com port 1, and com port 1 is associated with the logical port number 1 of USB physical interface 1.And when datacom device A is after USB physical interface 1 is extracted, if there is again datacom device B to be inserted in other USB physical interfaces except USB physical interface 1, datacom device B is just likely virtual as com port 1.After this, then after datacom device A inserts USB physical interface 1 again, in PC the operating system of carrying again may by datacom device A virtual be com port 2, and com port 2 is associated with the logical port number 1 of USB physical interface 1.That is to say, for same datacom device A, even if it is successively inserted in same USB physical interface 1, its corresponding com port is also likely different; And for same com port 1, it is corresponding different datacom device A and the datacom device B of priority likely.Thereby that user is difficult to distinguish com port 1 correspondence is datacom device A or datacom device B, for user brings many inconvenience for the management of all datacom devices.
Summary of the invention
In view of this, the invention provides a kind of for realizing the device of multi-user access USB device and a kind of for realizing the method for multi-user access USB device.
Provided by the invention a kind of for realizing the device of multi-user access USB device, described device has can be by IP network by remote access IP network interface and several USB physical interfaces that can connect USB device, and described device also comprises:
TCP driver module, for the tcp port that provides several to be used by described remote access;
USB driver module, for driving several USB physical interfaces;
Interface mappings module, sets up and safeguards the mapping relations between the tcp port number of tcp port and the USB port of USB physical interface number; Described remote access take the IP address of described device as object IP address, take arbitrary tcp port during as destination interface, this tcp port is mapped to corresponding USB physical interface according to described mapping relations, and realize this tcp port and change with the data protocol between corresponding USB physical interface.
In described interface mappings module, be further provided with the first corresponding relation between the USB port number of each USB physical interface and the silk-screen of this USB physical interface number;
Described interface mappings module further receives configuration information, includes the second corresponding relation between tcp port number and silk-screen number in described configuration information; According to described the first corresponding relation and described the second corresponding relation, set up described mapping relations.
Described device further has a configuration input port, and described interface mappings module receives described configuration information by described configuration input port; Or described interface mappings module further receives by TCP driver module the described configuration information that uses reserved tcp port to send.
Described interface mappings module further, after knowing that arbitrary USB physical interface has USB device to insert, checks whether to have set up the described mapping relations of this USB physical interface and when setting up described mapping relations, asked described TCP driver module to trigger the corresponding tcp port of this USB physical interface to enter listening state; After knowing that arbitrary USB physical interface has USB device to extract, check whether to have set up the described mapping relations of this USB physical interface and when setting up described mapping relations, asked described TCP driver module to trigger the corresponding tcp port of this USB physical interface to enter closed condition.
Described interface mappings module is further after setting up described mapping relations, and whether the USB port number corresponding USB physical interface in the described mapping relations that judgement has been set up has USB device to insert and ask described TCP driver module to trigger the corresponding tcp port of this USB physical interface when having USB device to insert enters listening state;
And, described interface mappings module is further informed in arbitrary USB physical interface to be had after USB device insertion, checks whether to have set up the described mapping relations of this USB physical interface and when setting up described mapping relations, asked described TCP driver module to trigger the corresponding tcp port of this USB physical interface to enter listening state; After knowing that arbitrary USB physical interface has USB device to extract, check whether to have set up the described mapping relations of this USB physical interface and when setting up described mapping relations, asked described TCP driver module to trigger the corresponding tcp port of this USB physical interface to enter closed condition.
Described interface mappings module is further being known the insertion event that records this USB physical interface while having USB physical interface to insert USB device, is being known the insertion event of deleting this USB physical interface having recorded while having USB physical interface to extract USB device; And described interface mappings module is further carried out described judgement according to the insertion event of record after setting up described mapping relations.
Provided by the invention a kind of for realizing the method for multi-user access USB device, the method be applied to have can be by IP network by remote access IP network interface and can connect in the device of several USB physical interfaces of USB device, and described method comprises:
Several tcp ports that can be used by described remote access are provided and drive several USB physical interfaces;
Set up and safeguard the mapping relations between the tcp port number of tcp port and the USB port of USB physical interface number;
Described remote access take the IP address of described device as object IP address, take arbitrary tcp port during as destination interface, this tcp port is mapped to corresponding USB physical interface according to described mapping relations, and realize this tcp port and change with the data protocol between corresponding USB physical interface.
Described method further comprises:
Set in advance the first corresponding relation between the USB port number of each USB physical interface and the silk-screen of this USB physical interface number;
Receive configuration information, in described configuration information, include the second corresponding relation between tcp port number and silk-screen number;
According to described the first corresponding relation and described the second corresponding relation, set up described mapping relations.
Described method further sets in advance configuration input port, and further utilizes described configuration input port to receive described configuration information; Or described method further sets in advance reserved tcp port, and further receive the described configuration information sending when PC uses reserved tcp port access.
Described method further comprises knowing after arbitrary USB physical interface has USB device to insert: check whether to have set up the described mapping relations of this USB physical interface and when setting up described mapping relations, triggered the corresponding tcp port of this USB physical interface to enter listening state;
Described method further comprises knowing after arbitrary USB physical interface has USB device to extract: check whether to have set up the described mapping relations of this USB physical interface and when setting up described mapping relations, triggered the corresponding tcp port of this USB physical interface to enter closed condition.
Described method further comprises after setting up described mapping relations: whether the USB port number corresponding USB physical interface in the described mapping relations that judgement has been set up has USB device to insert and trigger the corresponding tcp port of this USB physical interface when having USB device to insert enters listening state;
Described method further comprises knowing after arbitrary USB physical interface has USB device to insert: check whether to have set up the described mapping relations of this USB physical interface and when setting up described mapping relations, triggered the corresponding tcp port of this USB physical interface to enter listening state;
Described method further comprises knowing after arbitrary USB physical interface has USB device to extract: check whether to have set up the described mapping relations of this USB physical interface and when setting up described mapping relations, triggered the corresponding tcp port of this USB physical interface to enter closed condition.
Described method is knowing that arbitrary USB physical interface further comprises while having USB device to insert: the insertion event that records this USB physical interface;
Described method is knowing that arbitrary USB physical interface further comprises while having USB device to extract: the insertion event of deleting this USB physical interface having recorded; And described method is further carried out described judgement according to the insertion event of record after setting up described mapping relations.
As seen from the above technical solution, utilize the present invention, with using per family tcp port, realize the remote access across IP network, and the tcp port using during by remote access is mapped in corresponding USB physical interface, thereby can pass through shone upon USB physical interface, have access to the USB device that connects corresponding USB physical interface.Because same tcp port number is not limited to login, the user of same PC, use, thereby can avoid the single usb host restrict access to USB device, realize real multi-user access; And, by IP network, to the access of USB device, also make the distance between PC and USB device can arbitrary extension, avoided the locus limitation of USB device.
More preferably, the mapping relations of tcp port and USB physical interface, can be according to the corresponding relation between the silk-screen of user configured tcp port number and USB physical interface number and set up.User can observe the silk-screen number of institute's mint-mark on the USB physical interface that its USB device that need to access connects in advance, corresponding relation between the silk-screen of the USB physical interface of then inputting the tcp port number of its tcp port that need to use and observing number, thus the mapping relations that obtain between USB physical interface that its tcp port that need to use is connected with its USB device that need to access just can be set up.Thus, because user can be known the corresponding relation between tcp port number that it arranges voluntarily and silk-screen number, thereby also just can uniquely know the mapping relations of tcp port and USB physical interface by inference, thereby can distinguish the USB device that is inserted in corresponding USB physical interface according to different tcp ports, and then also facilitate the management to USB device.Even if the USB physical interface that USB device connects can change, corresponding relation between the silk-screen of the tcp port number that user still can use corresponding tcp port before this USB device and reconfigure this tcp port and new USB physical interface number, thereby the obscuring of can avoid that variation due to USB physical interface causes USB device is identified.
Accompanying drawing explanation
Fig. 1 is the exemplary block diagram of a kind of usb host cascade USB device of the prior art;
Fig. 2 is for realizing a kind of exemplary block diagram of the system of multi-user access USB device in the embodiment of the present invention;
Fig. 3 for as shown in Figure 2 for realizing the inside principle schematic of the device of multi-user access USB device;
Fig. 4 for as shown in Figure 2 and there is logical layer as shown in Figure 3 for realizing a kind of better internal structure schematic diagram of the device of multi-user access USB device;
Fig. 5 a is that the present embodiment is carried out the processing procedure schematic diagram of mapping configuration for realizing the device of multi-user access USB device;
Fig. 5 b is that the present embodiment is for realizing the processing procedure schematic diagram of the device executive's interface mapping of multi-user access USB device.
Embodiment
For making object of the present invention, technical scheme and advantage clearer, referring to the accompanying drawing embodiment that develops simultaneously, the present invention is described in more detail.
The present embodiment has substituted USB system architecture simple in prior art with the system architecture of IP based network, and in the system architecture of IP based network, be provided with a kind of device that is integrated with IP network interface (for example 100,000,000 ether interfaces) and a plurality of USB physical interfaces, and utilize this device to realize the access of multi-user to any USB device.
Specifically, referring to Fig. 2, the present embodiment comprises for realizing the system of multi-user access USB device:
Be positioned at least one PC of IP network one side;
At least one the USB device (datacom device for example with USB device function) of the present embodiment that is arranged in described IP network opposite side for realizing the device of multi-user access USB device and can connecting the USB interface of this device.Owing to being connected to IP network for realizing the IP network interface that the device of multi-user access USB device has by it in the present embodiment, thereby this device has IP address; But described at least one USB device is only to connect not connect IP network for realizing the device of multi-user access USB device, thereby can not have IP address.
Wherein, in the present embodiment, for realizing the tcp port using when the device of multi-user access USB device can provide several to be accessed by described IP network by arbitrary PC and can be used as usb host, drive several USB physical interfaces that can insert USB device (the USB physical interface quantity having can arrange arbitrarily, thereby this device need to be integrated with concentrator function or built-in hub).
And, in the present embodiment, for realizing the device of multi-user access USB device, can also set up and safeguard the mapping relations between the tcp port number of at least one tcp port and the USB port of its arbitrary USB physical interface number (or being referred to as hub side slogan).These mapping relations can automatically be set up (these mapping relations are the mapping relations that device carries) after device initialization, also can in device use procedure, be configured voluntarily (these mapping relations are user-defined mapping relations and be not present in this device before being configured by user) by user.
Arbitrary the PC that user logins all can by IP network and use Telnet (for example Telnet agreement) realize in the present embodiment for realizing the remote access of the device of multi-user access USB device.Arbitrary PC when remote access, need to take the IP address of this device as object IP address, the arbitrary tcp port that this device provides of take is destination interface.
Although the object IP address of access is for realizing the IP address of the device of multi-user access USB device in the present embodiment, but, this device can be mapped in corresponding USB physical interface using the tcp port as destination interface according to above-mentioned mapping relations, thus make arbitrary PC to the access map of this device for invisible to PC to being inserted in access and the said apparatus of USB device of corresponding USB physical interface.
As above visible, because same tcp port number is not limited to login, the user of same PC, use, thereby can avoid the single usb host restrict access to USB device, realize real multi-user access; And, by IP network, to the access of USB device, also make the distance between PC and USB device can arbitrary extension, avoided the locus limitation of USB device.
In addition, as long as user can be known the mapping relations between the tcp port number of tcp port and the USB port of USB physical interface number, can distinguish the USB device that is inserted in corresponding USB physical interface according to tcp port, and then also just can be convenient to the management to USB device.
For this reason, in the present embodiment, preferably by user, configure voluntarily the mapping relations between the tcp port number of tcp port and the USB port of USB physical interface number.
Concrete configuration mode is: the silk-screen of institute's mint-mark number (" silk-screen number " as herein described refers to that mint-mark is at the visable indicia of USB physical interface) on the USB physical interface that its USB device that need to access of user's observable connects.Then, user inputs the tcp port number of its tcp port that need to use in the present embodiment for realizing the device of multi-user access USB device, with and the silk-screen observed number between corresponding relation, this device can be according to user configured above-mentioned corresponding relation, and the corresponding relation (this corresponding relation is the corresponding relation that device carries) between the USB port of the inner predefined same USB physical interface of this device number and silk-screen number, foundation obtains the mapping relations between the USB port number of the USB physical interface that USB device that the tcp port number of the tcp port that user need to use need to access with user is connected.
Like this, because user can be known the corresponding relation between tcp port number and silk-screen number, thereby also just can uniquely know the mapping relations of tcp port and USB physical interface by inference, thereby can distinguish the USB device that is inserted in corresponding USB physical interface according to tcp port, and then also facilitate the management to USB device.Even if the USB physical interface that USB device connects can change, corresponding relation between the silk-screen of the tcp port number that user still can use corresponding tcp port before this USB device and reconfigure this tcp port and new USB physical interface number, thereby the obscuring of can avoid that variation due to USB physical interface causes USB device is identified.
Referring to Fig. 3, in the present embodiment, for realizing the internal logic layer of the device of multi-user access USB device, comprise:
Tcp protocol stack, it uses while accessing by described IP network for arbitrary PC for the tcp port of predetermined quantity is provided;
USB device class drives, usb protocol stack drives and usb host controller drives, for example, for driving several USB physical interfaces (USB device and the transfer of data based on usb protocol that, drive some USB physical interface identification to insert);
Interface mappings function, mainly comprises the mapping relations of setting up and safeguarding between tcp port and USB physical interface; Arbitrary PC take the IP address of described device as object IP address, take arbitrary tcp port when destination interface is accessed, can utilize above-mentioned mapping relations that the tcp port as destination interface is mapped to corresponding USB physical interface, and realize the data protocol conversion between this tcp port and corresponding USB physical interface.
When needing user to configure above-mentioned mapping relations, interface mappings function can be by the tcp port number in the configuration information of user's input and silk-screen number binding, and according to the corresponding relation between the silk-screen of the same USB physical interface setting in advance number and USB port number, find the silk-screen number corresponding USB port number in configuration information, so can set up the tcp port number in configuration information and the USB port that finds number between mapping relations, be the mapping relations between tcp port and USB physical interface.
When driving, USB device class knows that arbitrary USB physical interface has after USB device insertion, can to interface mappings function, report insertion event by control channel C2, the corresponding tcp port that is identified corresponding tcp port and identify to tcp protocol stack registration by control channel C1 according to above-mentioned mapping relations by interface mappings function again, makes tcp protocol stack can trigger corresponding tcp port and enters monitoring (Listening) state.
In practical application, whether the driving of USB device class can detect immediately this USB physical interface after interface mappings function is set up mapping relations for arbitrary USB physical interface has USB device to insert; Interface mappings function also can drive to detect after arbitrary USB physical interface has USB device to insert to check immediately whether for this USB physical interface, set up and have mapping relations in USB device class.
When corresponding tcp port enters after listening state, use the access of this tcp port can be mapped in the corresponding USB physical interface of this tcp port, and transmit data between this tcp port and corresponding USB physical interface.Wherein, the data of transmitting can be presented as with being segmented data flow M2 between driving of data flow M1 between interface mappings function and tcp protocol stack, interface mappings function and USB device class and USB device class drive with the driving of usb protocol stack between data flow M3.Because interface mappings function can also realize the transparent transmission based on protocol conversion between data flow M1 and data flow M2, thereby, between data flow M1, data flow M2 and data flow M3, can be connected.
After the driving of USB device class knows that arbitrary USB physical interface has USB device to extract, can to interface mappings function, report the event of extracting by control channel C2, by interface mappings function, according to above-mentioned mapping relations, identify corresponding tcp port and by control channel C1, to tcp protocol stack, nullify the corresponding tcp port identifying again, make tcp protocol stack trigger corresponding tcp port and enter closed condition.
Internal logic layer based on as shown in Figure 3, in the present embodiment for realize the device of multi-user access USB device except have can be by IP network by remote access IP network interface and can connect several USB physical interfaces of USB device, referring to Fig. 4, this device also specifically comprises following internal logic structure:
TCP driver module, tcp protocol stack the tcp port for providing several to be used by remote access are at least provided for it;
USB driver module, it at least carries, and USB device class drives, usb protocol stack drives and usb host controller drives, and for driving several can insert the USB physical interface of USB device;
Interface mappings module, for set up and safeguard between the tcp port number of tcp port and USB physical interface USB port mapping relations; The remote access of carrying out at arbitrary PC take the IP address of the machine as object IP address, take arbitrary tcp port during as destination interface, tcp port as destination interface is mapped to corresponding USB physical interface according to above-mentioned mapping relations, and realize this tcp port and change with the data protocol between corresponding USB physical interface.
For the ease of user, can decide above-mentioned mapping relations in its sole discretion, in interface mappings module, be further provided with the corresponding relation between the USB port number of each USB physical interface and the silk-screen of this USB physical interface number, and can further receive the configuration information that user inputs, in this configuration information, include the corresponding relation between tcp port number and silk-screen number, thereby can make interface mappings module according to above-mentioned two corresponding relations, set up the mapping relations between the tcp port number of tcp port and the USB port of USB physical interface number.
The mode of user's input configuration information has two kinds:
Local configuration mode, user in the present embodiment for realize multi-user access USB device device place IP network a side, be that local side is directly to this device input configuration information, now, this device can further have one and be exclusively used in the configuration input port that receives configuration information, so that interface mappings module receives configuration information by configuration input port;
Remote configuration mode, user logins PC and accesses in the present embodiment for realizing the device of multi-user access USB device by IP network, in this PC access process at this moment, can send configuration information to this device, and the tcp port that the access now of this PC is used is to be exclusively used in the reserved tcp port that receives configuration information; Interface mappings module can will be used the access of reserved tcp port to be identified as configuration operation, and the information that the access of using reserved tcp port is sent is identified as configuration information.
In addition, whether interface mappings module can also have equipment to insert to safeguard the state of corresponding tcp port according to USB physical interface, specifically:
Interface mappings module after setting up above-mentioned mapping relations at every turn, the whether existing USB device of USB port number corresponding USB physical interface in the mapping relations that capital judgement has been set up is inserted, and when the existing USB device of this USB physical interface is inserted, asks TCP driver module to trigger the corresponding tcp port of this USB physical interface to enter listening state; Wherein, interface mappings module can be notified immediately USB driver module to carry out detection and carry out judgement according to testing result after setting up above-mentioned mapping relations; Or, the insertion event that interface mappings module also can record according to it at every turn when knowing the USB physical interface that has USB device insertion is carried out judgement, in this case, interface mappings module also need to known the insertion event of deleting this USB physical interface having recorded while having USB physical interface to extract USB device at every turn;
Interface mappings module detects USB physical interface at USB driver module and inserts after USB device (the USB device class of carrying in USB driver module drives the insertion event that reports), check the above-mentioned mapping relations whether set up this USB physical interface, and when this USB physical interface has been set up above-mentioned mapping relations, according to above-mentioned mapping relations request TCP driver module (tcp protocol stack carrying in TCP driver module), trigger the corresponding tcp port of this USB physical interface and enter listening state;
That is to say, as long as meeting to be inserted with USB device and to set up simultaneously, arbitrary USB physical interface has these two conditions of corresponding mapping relations, interface mappings module enters listening state with regard to asking TCP driver module to trigger corresponding tcp port, but the precedence relationship of two condition establishments does not affect corresponding tcp port, does not enter listening state;
The USB device that interface mappings module also detects USB physical interface at USB driver module is extracted after (the USB device class of carrying in USB driver module drives the event of extracting that reports), check the described mapping relations whether set up this USB physical interface, and when the built vertical mapping relations of this USB physical interface, according to described mapping relations request TCP driver module (tcp protocol stack carrying in TCP driver module), trigger the corresponding tcp port of this USB physical interface and enter closed condition.
Below, in conjunction with specific works flow process, the present embodiment is being further illustrated for realizing the device of multi-user access USB device.
Fig. 5 a is that the present embodiment is carried out the processing procedure schematic diagram of mapping configuration for realizing the device of multi-user access USB device.As shown in Figure 5 a, the processing procedure of this mapping configuration is mainly completed and is comprised by interface mappings module:
S11, interface mappings module receives the configuration information (local input or remote input) of user's input.
S12, interface mappings module judges whether the represented tcp port of the tcp port number in configuration information is used,, whether the represented tcp port of tcp port number there are the mapping relations with USB physical interface, if, thereby represent to be configured and can to cause corresponding tcp port to shine upon more than one USB physical interface appearance conflict simultaneously with this tcp port number, therefore jump to S17; Otherwise continue to carry out S13.
S13, interface mappings module, by the tcp port number in configuration information and silk-screen number binding, then continues to carry out S14.
S14, interface mappings module is according to the corresponding relation of the USB port that sets in advance number and silk-screen number, identify bound silk-screen number corresponding USB port number, and set up the tcp port number in configuration information and the USB port that identifies number between mapping relations, for tcp port and the mapping relations between USB physical interface, then the continuation execution S15 that represents that user will configure.
S15, whether the USB port number corresponding USB physical interface that the judgement of interface mappings module identifies now has USB device to insert, if there is USB device to insert and continue, carries out S16, otherwise process ends.
Judgment mode in this step can wait for that receiving USB device class drives the insertion event reporting for interface mappings module, or, also can inquire about the equipment insertion information of its record, all insertion events that this equipment insertion information recording has the driving of USB device class to report for interface mappings module.
S16, interface mappings module is registered the tcp port number in configuration information to TCP driver module immediately, with notice TCP driver module, trigger immediately corresponding tcp port and enter listening state, thereby allow the USB device of using USB physical interface corresponding to this tcp port number remote access now to insert, then process ends.
S17, the information of interface mappings module output tcp port conflict, then process ends.
So far, a configuration flow finishes.
Fig. 5 b is that the present embodiment is for realizing the processing procedure schematic diagram of the device executive's interface mapping of multi-user access USB device.As shown in Figure 5 b, the processing procedure of this interface mappings comprises:
S21, USB driver module detects the device type that equipment inserts arbitrary USB physical interface and obtains interventional instrument.
Processing procedure in this step specifically comprises: the HCD carrying in USB driver module can notify usb protocol stack to drive has equipment to insert USB physical interface, the usb protocol stack carrying in USB driver module again drives and utilizes general USB control command to obtain the type of interventional instrument, and then notifying the USB device class of carrying in USB driver module to drive has equipment to insert USB physical interface.
S22, whether the equipment that USB driver module inserts USB physical interface according to the device type judgement of obtaining is legal USB device, if it is carries out S23, otherwise indication equipment does not mate and process ends.
" legal " described in this step mainly refers to USB serial line interface, also allows by the USB device of user management.For example, for the present embodiment, with USB serial line interface, and to allow can be datacom device by " legal " USB device of user management, such as USB flash disk, USB mouse etc., do not need by the USB device for managing, not belong to " legal " USB device in the present embodiment.That is to say, " legal " can be understood as the USB device classification of predefined a kind of acquiescence, only belongs to USB device " legal " of this USB device classification.
Processing procedure in this step specifically comprises: the USB device class of carrying in USB driver module drives according to usb protocol stack and drives the device type of obtaining to carry out above-mentioned judgement, if, by S23 trigger interface mapping block, otherwise notice usb protocol stack driving arrangement does not mate and process ends.
S23, USB driver module reports insertion event to interface mappings module, with notification interface mapping block, has USB device to insert USB physical interface, then carries out S24.
S24, interface mappings module records equipment inserts information, then carries out S25.
The equipment recording in this step inserts information, can use for the S15 as shown in Fig. 5 a.Interface mappings module is being known the insertion event that also should delete this USB physical interface having recorded while having USB physical interface to extract USB device.
S25, the USB physical interface that whether the USB physical interface that interface mappings module is inserted with USB device according to the mapping relations judgement of having set up exist corresponding tcp port, insert USB device has been set up mapping relations, if, carry out S26, otherwise the USB device that represents to be inserted in this USB physical interface cannot be by remote access process ends.
S26, interface mappings module is registered corresponding tcp port number to TCP driver module, with notice TCP driver module, trigger immediately corresponding tcp port and enter listening state, thereby allow the USB device of using corresponding this USB physical interface of tcp port number remote access now to insert, then process ends.
So far, once shining upon flow process finishes.
Except as above, for realizing the system and device of multi-user access USB device, it is a kind of for realizing the method for multi-user access USB device that the present embodiment also provides.
The method be applied to have can be by IP network by remote access IP network interface and can connect in the device of several USB physical interfaces of USB device.
And the method can provide several tcp ports that can be used by the remote access of arbitrary PC and drive several USB physical interfaces that can insert USB device, meanwhile, the method can also comprise the steps:
Set up and safeguard the mapping relations between tcp port and USB physical interface, these mapping relations can be expressed as the mapping relations between the tcp port number of tcp port and the USB port of USB physical interface number;
And, arbitrary PC take the IP address of device of application the method as object IP address, take arbitrary tcp port when destination interface is accessed, this tcp port is mapped to corresponding USB physical interface according to above-mentioned mapping relations, and realize this tcp port and change with the data protocol between corresponding USB physical interface.
In addition, in order to make user, can know that mapping relations between tcp port and USB physical interface are so that the management to USB device, the method can support user to configure the corresponding relation between the silk-screen number of tcp port number and USB physical interface, and according to user configured above-mentioned corresponding relation, sets up the mapping relations of tcp port and USB physical interface.
Specifically, user can observe the silk-screen number of institute's mint-mark on the USB physical interface that its USB device that need to access connects in advance.Then, to the device of application the method input the tcp port number that need to use when it carries out remote access, with and the silk-screen observed number between corresponding relation, the method can be according to the corresponding relation between the USB port of user configured above-mentioned corresponding relation and predefined same USB physical interface number and silk-screen number, sets up the mapping relations between the USB port number that obtains the USB physical interface that USB device that the tcp port number of the tcp port that user need to use need to access with user is connected.
With described in device part above in like manner, the mode of user's input configuration information has two kinds:
For local configuration mode, the method can further have one and be exclusively used in the configuration input port that receives configuration information, and utilizes configuration input port to receive described configuration information.
For Remote configuration mode, the method can further set in advance reserved tcp port, and further receive the configuration information that the reserved tcp port of PC access sends, be that the method will be used the access of reserved tcp port to be identified as configuration operation, and the information that the access of using reserved tcp port is sent is identified as configuration information.
In addition, whether the method can also have equipment to insert to safeguard the state of corresponding tcp port according to USB physical interface, specifically:
After setting up above-mentioned mapping relations at every turn, the whether existing USB device of USB port number corresponding USB physical interface in the above-mentioned mapping relations that capital judgement has been set up is inserted, and when the existing USB device of this USB physical interface is inserted, triggers the corresponding tcp port of this USB physical interface and enter listening state; Wherein, can after setting up above-mentioned mapping relations, carry out immediately detection, also according to instant testing result, carry out judgement; Or, also can be according to knowing that the insertion event that further records this USB physical interface while having USB device to insert USB physical interface carries out judgement before this at every turn, and, knowing the insertion event that also should delete this USB physical interface having recorded while having USB physical interface to extract USB device at every turn;
Knowing have USB physical interface to insert after USB device at every turn, check the above-mentioned mapping relations whether set up this USB physical interface, and when this USB physical interface has been set up above-mentioned mapping relations, according to above-mentioned mapping relations, trigger the corresponding tcp port of this USB physical interface and enter listening state;
That is to say, as long as meeting to be inserted with USB device and to set up simultaneously, arbitrary USB physical interface has these two conditions of corresponding mapping relations, the method enters listening state with regard to triggering corresponding tcp port, but the precedence relationship of two condition establishments does not affect corresponding tcp port, does not enter listening state;
Also after knowing at every turn and having the USB device of USB physical interface to extract, check the above-mentioned mapping relations whether set up this USB physical interface, and when this USB physical interface has been set up above-mentioned mapping relations, according to above-mentioned mapping relations, trigger the corresponding tcp port of this USB physical interface and enter closed condition.
The foregoing is only preferred embodiment of the present invention, be not intended to limit protection scope of the present invention.Within the spirit and principles in the present invention all, any modification of doing, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.

Claims (12)

1. one kind for realizing the device of multi-user access USB device, it is characterized in that, described device has can be by IP network by the remote access IP network interface of PC and several USB physical interfaces that can connect USB device, wherein, described USB device is the datacom device with USB function, and described device also comprises:
TCP driver module, for the tcp port that provides several to be used by described remote access;
USB driver module, for driving several USB physical interfaces;
Interface mappings module, sets up and safeguards the mapping relations between the tcp port number of tcp port and the USB port of USB physical interface number; Described remote access take the IP address of described device as object IP address, take arbitrary tcp port during as destination interface, this tcp port is mapped to corresponding USB physical interface according to described mapping relations, and realize this tcp port and change with the data protocol between corresponding USB physical interface;
Described interface mappings module further, after knowing that arbitrary USB physical interface has USB device to insert, checks whether to have set up the described mapping relations of this USB physical interface and when setting up described mapping relations, asked described TCP driver module to trigger the corresponding tcp port of this USB physical interface to enter listening state; After knowing that arbitrary USB physical interface has USB device to extract, check whether to have set up the described mapping relations of this USB physical interface and when setting up described mapping relations, asked described TCP driver module to trigger the corresponding tcp port of this USB physical interface to enter closed condition.
2. device as claimed in claim 1, is characterized in that,
In described interface mappings module, be further provided with the first corresponding relation between the USB port number of each USB physical interface and the silk-screen of this USB physical interface number;
Described interface mappings module further receives configuration information, includes the second corresponding relation between tcp port number and silk-screen number in described configuration information; According to described the first corresponding relation and described the second corresponding relation, set up described mapping relations.
3. device as claimed in claim 2, is characterized in that, described device further has a configuration input port, and described interface mappings module receives described configuration information by described configuration input port; Or described interface mappings module further receives by TCP driver module the described configuration information that uses reserved tcp port to send.
4. device as claimed in claim 2, it is characterized in that, described interface mappings module is further after setting up described mapping relations, and whether the USB port number corresponding USB physical interface in the described mapping relations that judgement has been set up has USB device to insert and ask described TCP driver module to trigger the corresponding tcp port of this USB physical interface when having USB device to insert enters listening state.
5. device as claimed in claim 1, it is characterized in that, described interface mappings module is further after setting up described mapping relations, and whether the USB port number corresponding USB physical interface in the described mapping relations that judgement has been set up has USB device to insert and ask described TCP driver module to trigger the corresponding tcp port of this USB physical interface when having USB device to insert enters listening state.
6. the device as described in claim 4 or 5, it is characterized in that, described interface mappings module is further being known the insertion event that records this USB physical interface while having USB physical interface to insert USB device, is being known the insertion event of deleting this USB physical interface having recorded while having USB physical interface to extract USB device;
And described interface mappings module is further carried out described judgement according to the insertion event of record after setting up described mapping relations.
7. one kind for realizing the method for multi-user access USB device, it is characterized in that, the method be applied to have can be by IP network by the remote access IP network interface of PC and can connect in the device of several USB physical interfaces of USB device, wherein, described USB device is the datacom device with USB function, and described method comprises:
Several tcp ports that can be used by described remote access are provided and drive several USB physical interfaces;
Set up and safeguard the mapping relations between the tcp port number of tcp port and the USB port of USB physical interface number;
Described remote access take the IP address of described device as object IP address, take arbitrary tcp port during as destination interface, this tcp port is mapped to corresponding USB physical interface according to described mapping relations, and realize this tcp port and change with the data protocol between corresponding USB physical interface;
Described method further comprises knowing after arbitrary USB physical interface has USB device to insert: check whether to have set up the described mapping relations of this USB physical interface and when setting up described mapping relations, triggered the corresponding tcp port of this USB physical interface to enter listening state;
Described method further comprises knowing after arbitrary USB physical interface has USB device to extract: check whether to have set up the described mapping relations of this USB physical interface and when setting up described mapping relations, triggered the corresponding tcp port of this USB physical interface to enter closed condition.
8. method as claimed in claim 7, is characterized in that, described method further comprises:
Set in advance the first corresponding relation between the USB port number of each USB physical interface and the silk-screen of this USB physical interface number;
Receive configuration information, in described configuration information, include the second corresponding relation between tcp port number and silk-screen number;
According to described the first corresponding relation and described the second corresponding relation, set up described mapping relations.
9. method as claimed in claim 8, is characterized in that, described method further sets in advance configuration input port, and further utilizes described configuration input port to receive described configuration information; Or described method further sets in advance reserved tcp port, and further receive the described configuration information sending when PC uses reserved tcp port access.
10. method as claimed in claim 8, it is characterized in that, described method further comprises after setting up described mapping relations: whether the USB port number corresponding USB physical interface in the described mapping relations that judgement has been set up has USB device to insert and trigger the corresponding tcp port of this USB physical interface when having USB device to insert enters listening state.
11. methods as claimed in claim 7, it is characterized in that, described method further comprises after setting up described mapping relations: whether the USB port number corresponding USB physical interface in the described mapping relations that judgement has been set up has USB device to insert and trigger the corresponding tcp port of this USB physical interface when having USB device to insert enters listening state.
12. methods as described in claim 10 or 11, is characterized in that,
Described method is knowing that arbitrary USB physical interface further comprises while having USB device to insert: the insertion event that records this USB physical interface;
Described method is knowing that arbitrary USB physical interface further comprises while having USB device to extract: the insertion event of deleting this USB physical interface having recorded;
And described method is further carried out described judgement according to the insertion event of record after setting up described mapping relations.
CN201110042522.4A 2011-02-22 2011-02-22 Device and method for realizing multiuser access to USB equipment Active CN102098309B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110042522.4A CN102098309B (en) 2011-02-22 2011-02-22 Device and method for realizing multiuser access to USB equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110042522.4A CN102098309B (en) 2011-02-22 2011-02-22 Device and method for realizing multiuser access to USB equipment

Publications (2)

Publication Number Publication Date
CN102098309A CN102098309A (en) 2011-06-15
CN102098309B true CN102098309B (en) 2014-04-16

Family

ID=44131172

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110042522.4A Active CN102098309B (en) 2011-02-22 2011-02-22 Device and method for realizing multiuser access to USB equipment

Country Status (1)

Country Link
CN (1) CN102098309B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546704A (en) * 2013-07-02 2014-01-29 Tcl集团股份有限公司 Method and television for recognizing USB (universal serial bus) devices plugged in television
CN104808978A (en) * 2014-01-28 2015-07-29 宏碁股份有限公司 Method for sharing plug-and-play device and electronic device therefor
CN104038564A (en) * 2014-07-08 2014-09-10 马传军 System and method for achieving mobile terminal management in router based on cloud network center
CN104065747A (en) * 2014-07-08 2014-09-24 马传军 System and method for managing mobile terminal in charger on basis of could network center
CN106991067B (en) * 2017-04-14 2021-02-02 湖南威胜信息技术有限公司 Data interaction method for one-master multi-slave network and embedded equipment thereof
CN108829623A (en) * 2018-06-20 2018-11-16 郑州云海信息技术有限公司 A kind of USB port adaptation method and device
CN111339014A (en) * 2020-03-02 2020-06-26 芯启源(上海)半导体科技有限公司 USB equipment sharing device
CN111447240B (en) * 2020-04-29 2022-02-15 安康鸿天科技股份有限公司 Data communication control method, device, system, storage medium and computer equipment
CN115904884B (en) * 2023-03-09 2023-05-30 苏州浪潮智能科技有限公司 Method and device for identifying peripheral configuration of server and method and device for silk screen layout of server

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101291319A (en) * 2007-04-20 2008-10-22 张超鹏 Method, system and device for access storage apparatus
CN101938398A (en) * 2009-06-29 2011-01-05 深圳市联软科技有限公司 Generation method, system and server of equipment positioning relationship table

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5318111B2 (en) * 2007-10-24 2013-10-16 ラントロニクス・インコーポレイテツド Various methods and apparatus for a central management station for automatically distributing configuration information to remote devices
CN101540699A (en) * 2009-05-04 2009-09-23 杭州华三通信技术有限公司 Method and device for realizing remote maintenance of network equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101291319A (en) * 2007-04-20 2008-10-22 张超鹏 Method, system and device for access storage apparatus
CN101938398A (en) * 2009-06-29 2011-01-05 深圳市联软科技有限公司 Generation method, system and server of equipment positioning relationship table

Also Published As

Publication number Publication date
CN102098309A (en) 2011-06-15

Similar Documents

Publication Publication Date Title
CN102098309B (en) Device and method for realizing multiuser access to USB equipment
US8683567B2 (en) Method of distributing information regarding one or more electrical devices and system for the same
US8023434B2 (en) Arrangements for auto-merging and auto-partitioning processing components
US7853994B2 (en) Computer system and method of updating authentication information of computer system
CN102684970B (en) Thin-client environment providing system, server and thin-client environmental management technique
US20030212781A1 (en) Network topology management system, management apparatus, management method, management program, and storage media that records management program
US10284632B2 (en) Electronic testing device
US7103665B2 (en) Method of managing a resource storage data, program for managing the resource storage data, storage media having the resource managing program, and resource manager for managing the resource storage data
EP1357464A2 (en) Method, apparatus and program for managing the operation of a storage device
JP2001337863A (en) Storage controller, storage system, and the method for setting security for storage system
CN103793307A (en) Electronic device, management method thereof and cabinet servo system
WO2017113879A1 (en) Method and device for controlling smart interface card
US20130110960A1 (en) Method and system for accessing storage device
CN104156647B (en) Thin terminal control method and device and thin terminal
CN109428783A (en) Network apparatus test method and device
JP2001265655A (en) Security system for storage sub system
US20130282886A1 (en) Network management
CN109033804A (en) A kind of software virtual machine authorization method and device
KR100967400B1 (en) Wireless USB device apparatus for networking with plurality of wireless USB host and method thereof
CN111157942A (en) Electricity stealing event monitoring method, electronic monitoring equipment and electricity stealing prevention system
TW201324173A (en) Method and system for adjusting SAS Expander device's PHY
CN105376298A (en) A fluorescence spectrum measuring instrument allowing remote control
CN109542808A (en) The method and apparatus for controlling hard disk access
CN102761538B (en) Design management method for communication shared field applied to various communication interface gateways
CN105591729B (en) The network equipment and for the timestamp acquisition methods in the network equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Patentee after: NEW H3C TECHNOLOGIES Co.,Ltd.

Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base

Patentee before: HANGZHOU H3C TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230627

Address after: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: H3C INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 310052 Changhe Road, Binjiang District, Hangzhou, Zhejiang Province, No. 466

Patentee before: NEW H3C TECHNOLOGIES Co.,Ltd.