CN114265806B - Method, device, equipment and storage medium for realizing USB data signal sharing - Google Patents
Method, device, equipment and storage medium for realizing USB data signal sharing Download PDFInfo
- Publication number
- CN114265806B CN114265806B CN202111554298.7A CN202111554298A CN114265806B CN 114265806 B CN114265806 B CN 114265806B CN 202111554298 A CN202111554298 A CN 202111554298A CN 114265806 B CN114265806 B CN 114265806B
- Authority
- CN
- China
- Prior art keywords
- usb
- host
- target
- data
- data transmission
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 230000005540 biological transmission Effects 0.000 claims abstract description 88
- 238000004891 communication Methods 0.000 claims description 57
- 238000006243 chemical reaction Methods 0.000 claims description 15
- 238000004590 computer program Methods 0.000 claims description 10
- 238000010586 diagram Methods 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 3
- 238000013500 data storage Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Landscapes
- Information Transfer Systems (AREA)
Abstract
The application discloses a method, a device, equipment and a storage medium for realizing USB data signal sharing, wherein the method is applied to a server, and the server is provided with a USB host end and a USB equipment end, and comprises the following steps: establishing a data transmission link between a USB host end and a USB device end, wherein the USB host end is used for being electrically connected with a PC host, and the USB device end is used for being electrically connected with USB devices; based on a data transmission link, the USB device end receives USB data signals sent by the USB device and converts the USB data signals into Ethernet frame data packets, the USB host end receives the Ethernet frame data packets and converts the Ethernet frame data packets into USB data packets to be sent to the PC host, so that USB data signal sharing between the USB device and the PC host is realized, and the technical problems that the USB host end cannot realize USB data signal sharing with the far-end USB device in the prior art and the flexibility is poor are solved.
Description
Technical Field
The present invention relates to the field of USB communication technologies, and in particular, to a method, an apparatus, a device, and a storage medium for implementing USB data signal sharing.
Background
At present, a computer is basically provided with a USB function, a host end of the computer can generally provide a plurality of USB interfaces, and the USB interfaces are also necessary interfaces of the computer. In most versions of WINDOWS operating systems, the USB device does not need to install a driver, and has a real "plug and play" feature, so that the USB device is convenient to use. However, in the prior art, only a short-distance USB device and a host end can be configured in a point-to-point manner, that is, a USB device that needs to share a data signal is inserted into a USB interface of the USB host end, so that the USB device is connected to the host end, thereby realizing the sharing of the USB data signal.
Disclosure of Invention
The application provides a method, a device, equipment and a storage medium for realizing USB data signal sharing, which are used for solving the technical problems that in the prior art, a USB host end cannot realize USB data signal sharing with remote USB equipment and the flexibility is poor.
In view of this, a first aspect of the present application provides a method for implementing USB data signal sharing, applied to a server, where the server is provided with a USB host side and a USB device side, including:
establishing a data transmission link between the USB host end and the USB equipment end, wherein the USB host end is used for being electrically connected with a PC host, and the USB equipment end is used for being electrically connected with USB equipment;
based on the data transmission link, the USB device end receives the USB data signal sent by the USB device and converts the USB data signal into an Ethernet frame data packet, and the USB host end receives the Ethernet frame data packet and converts the Ethernet frame data packet into a USB data packet and sends the USB data packet to the PC host, so that USB data signal sharing between the USB device and the PC host is realized.
Optionally, the establishing a data transmission link between the USB host and the USB device includes:
configuring a first source Mac address for the USB host;
configuring a second source Mac address for the USB equipment end;
and establishing a data transmission link between the USB host end and the USB equipment end according to the first source Mac address and the second source Mac address.
Optionally, the receiving, by the USB device side, the USB data signal sent by the USB device and converting the USB data signal into an ethernet frame data packet, including:
receiving a USB data signal sent by the USB equipment through the USB equipment end;
and converting the USB data signal into the Ethernet frame data packet according to a first conversion protocol through the USB equipment terminal.
Optionally, the receiving the ethernet frame data packet by the USB host side and converting the ethernet frame data packet into a USB data packet, and sending the USB data packet to the PC host, including:
receiving an Ethernet frame data packet sent by the USB equipment end through the USB host end;
and converting the Ethernet frame data packet into the USB data packet by the USB host end according to a second conversion protocol, and sending the USB data packet to the PC host.
Optionally, the USB host and the USB device are both provided with a plurality of data transmission links, and the establishing a data transmission link between the USB host and the USB device includes:
setting a target USB host end and a target USB equipment end;
and establishing a data transmission link between the target USB host end and the target USB equipment end according to the data communication relation between the target USB host end and the target USB equipment end.
Optionally, the establishing a data transmission link between the target USB host and the target USB device according to the data communication relationship between the target USB host and the target USB device includes:
when the target USB host end has a data communication relationship with other USB equipment ends and/or the target USB equipment end has a data communication relationship with other USB host ends, a communication disconnecting instruction is sent out, so that the target USB host end and the target USB equipment end have no data communication relationship with other USB equipment ends and other USB host ends;
and establishing a data transmission link between the target USB host end and the target USB equipment end.
Optionally, the judging condition that the target USB host and other USB device end have a data communication relationship is that the target USB host has a first occupation signal;
and the judging condition that the target USB equipment end has a data communication relation with other USB host ends is that the target USB equipment end has a second occupation signal.
A second aspect of the present application provides an apparatus for implementing USB data signal sharing, including:
the system comprises a data transmission link establishment unit, a data transmission link control unit and a data transmission control unit, wherein the data transmission link establishment unit is used for establishing a data transmission link between a USB host end of a server and a USB device end of the server, the USB host end is used for being electrically connected with a PC host, and the USB device end is used for being electrically connected with USB devices;
and the USB data signal sharing unit is used for receiving the USB data signal sent by the USB equipment through the USB equipment end based on the data transmission link and converting the USB data signal into an Ethernet frame data packet, and receiving the Ethernet frame data packet through the USB host end and converting the Ethernet frame data packet into a USB data packet and sending the USB data packet to the PC host so as to realize USB data signal sharing between the USB equipment and the PC host.
A third aspect of the present application provides an electronic device comprising a processor and a memory storing a computer program, the processor implementing the steps of the method of implementing USB data signal sharing as described in the first aspect when executing the computer program.
A fourth aspect of the present application provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of implementing USB data signal sharing as described in the first aspect.
From the above technical scheme, the application has the following advantages:
according to the method and the device, the data transmission link is established between the USB host end and the USB device end, so that the USB host end and the USB device end can carry out data transmission based on the data transmission link, and because the USB host end is used for being electrically connected with the PC host, the USB device end is used for being electrically connected with the USB device, when the USB device is far away from the PC host, the USB device at the far end can be connected with the USB device end, USB data signals acquired from the USB device are converted into Ethernet frame data packets through the USB device end, the Ethernet frame data packets are sent to the USB host end again, and then the Ethernet frame data packets are converted into USB data packets and sent to the PC host, so that the USB data signal sharing is achieved, and the technical problems that in the prior art, the USB host end cannot realize USB data signal sharing with the far-end USB device and the USB device is poor in flexibility are solved.
Drawings
FIG. 1 is a flowchart illustrating a method for implementing USB data signal sharing according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of address configuration of a USB host and a USB device according to an embodiment of the present invention;
FIG. 3 is a flowchart of a connection between a USB host and a USB device according to an embodiment of the present invention;
FIG. 4 is a diagram of an overall framework for implementing USB data signal sharing according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a device for sharing USB data signals according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The embodiment of the application provides a method, a device, equipment and a storage medium for realizing USB data signal sharing, which are used for solving the technical problems that a USB host end cannot realize USB data signal sharing with remote USB equipment in the prior art and the flexibility is poor.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the embodiments described below are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Referring to fig. 1 to fig. 4, an embodiment of the present application provides a method for implementing USB data signal sharing, which is applied to a server, where the server is provided with a USB host side and a USB device side, and may include:
step 101, a data transmission link is established between a USB host end and a USB device end, wherein the USB host end is used for being electrically connected with a PC host, and the USB device end is used for being electrically connected with a USB device.
Step 102, based on the data transmission link, receiving the USB data signal sent by the USB device through the USB device end and converting the USB data signal into an ethernet frame data packet, receiving the ethernet frame data packet through the USB host end and converting the ethernet frame data packet into a USB data packet, and sending the USB data packet to the PC host, so as to realize USB data signal sharing between the USB device and the PC host.
The implementation main body of the method for realizing the sharing of the USB data signals can be any network side equipment, such as a USB data signal sharing system and the like.
In step 101, the network side device establishes a data transmission link between a USB host end of the server and a USB device end of the server, where the USB host end is electrically connected to the PC host, and the USB device end is electrically connected to the USB device.
The server may be a gigabit switch or the like.
It should be noted that, the USB host includes a chip and a single chip microcomputer for converting USB into 802.3 protocol, the USB device includes a chip and a single chip microcomputer for converting USB into 802.3 protocol, the USB host may be electrically connected to the PC host through a USB connection wire, the USB device may be electrically connected to the USB device through a USB interface, and the USB device may be a USB disk, a camera, or the like. By establishing a data transmission link between the USB host side and the USB device side, it is made possible to perform data transmission based on the data transmission link.
In step 102, the network side device receives the USB data signal sent by the USB device through the USB device end and converts the USB data signal into an ethernet frame data packet based on the data transmission link, and receives the ethernet frame data packet through the USB host end and converts the ethernet frame data packet into a USB data packet and sends the USB data packet to the PC host, so as to realize USB data signal sharing between the USB device and the PC host.
When the USB device is far away from the USB host, the USB device can be accessed to the nearby USB device end through the USB interface to perform data conversion, namely, the USB device end receives the USB data signal sent by the USB device and converts the USB data signal into an Ethernet frame data packet. The USB host end and the USB device end perform data transmission based on the data transmission link, namely the USB host end receives the Ethernet frame data packet sent by the USB device end. And finally, the USB host end converts the Ethernet frame data packet into a USB data packet and transmits the USB data packet to the PC host, so that the sharing of USB data signals between the remote USB equipment and the PC host is realized.
Further, step 101 includes:
configuring a first source Mac address for a USB host;
configuring a second source Mac address for the USB equipment end;
and establishing a data transmission link between the USB host end and the USB device end according to the first source Mac address and the second source Mac address.
It should be noted that, in order to implement USB data transmission, a data transmission link needs to be established, a first source Mac address may be configured for a USB host through a network device, and a second source Mac address may be configured for the USB device, where the first source Mac address and the second source Mac address are both Mac addresses of 6 bytes, and a configuration rule of Mac addresses of 6 bytes is 02-A0-XX. And secondly, the source address of the other party can be sent to the USB host end and the USB device end which need to establish the data transmission link through the network side equipment, namely, the second source Mac address of the USB device end is sent to the USB host end, and the first source Mac address of the USB host end is sent to the USB device end, so that the data transmission link between the USB host end and the USB device end is established, and the rate of establishing the data transmission link and the stability of realizing data transmission are improved.
Further, receiving, by the USB device side, a USB data signal sent by the USB device and converting the USB data signal into an ethernet frame data packet, including:
receiving a USB data signal sent by USB equipment through the USB equipment end;
and converting the USB data signal into an Ethernet frame data packet according to a first conversion protocol through the USB equipment end.
After receiving the USB data signal sent by the USB device through the USB device end, the network side device converts the USB data signal into an Ethernet frame data packet through the USB-to-802.3 chip according to a TCP or IP protocol (namely a first conversion protocol), so that the stability of data conversion and transmission is improved.
Further, the method for receiving the ethernet frame data packet through the USB host and converting the ethernet frame data packet into a USB data packet and sending the USB data packet to the PC host includes:
receiving an Ethernet frame data packet sent by a USB equipment end through a USB host end;
and converting the Ethernet frame data packet into a USB data packet by the USB host end according to a second conversion protocol, and transmitting the USB data packet to the PC host.
After receiving the Ethernet frame data packet sent by the USB device end through the USB host end, the network side device converts the Ethernet frame data packet into a USB data packet through a TCP or IP protocol (namely a second conversion protocol) of the USB-to-802.3 chip, thereby improving the stability of data conversion and transmission.
Further, the USB host and the USB device are both provided with a plurality of USB interfaces, and step 101 may further include:
setting a target USB host end and a target USB equipment end;
and establishing a data transmission link between the target USB host end and the target USB equipment end according to the data communication relation between the target USB host end and the target USB equipment end.
It should be noted that, as shown in fig. 4, assuming that the USB host side of the server includes a USB host side A, USB host side B and a USB host side C, the USB device side of the server includes a USB device side A, USB device side B and a USB device side C, a source Mac address is configured for each of the USB host side and the USB device side through the network side device, and the configuration of the source Mac address of 6 bytes is as follows:
USB host A:02-A0-AC-10-81-01
USB host terminal B:02-A0-AC-10-81-02
USB host terminal C:02-A0-AC-10-81-03
USB device terminal A:02-A0-AC-10-82-04
USB device terminal B:02-A0-AC-10-82-05
USB device terminal C:02-A0-AC-10-82-06
Further, establishing a data transmission link between the target USB host and the target USB device according to a data communication relationship between the target USB host and the target USB device, including:
when the target USB host end and other USB equipment ends have a data communication relationship and/or the target USB equipment end and other USB host ends have a data communication relationship, sending a communication disconnecting instruction so that the target USB host end and the target USB equipment end do not have the data communication relationship with other USB equipment ends and other USB host ends;
a data transmission link is established between the target USB host and the target USB device.
It should be noted that, the other USB host terminals refer to all USB host terminals except the target host terminal on the server, and the other USB device terminals refer to all USB device terminals except the target device terminal on the server.
It should be noted that, as shown in fig. 3, a target USB host end may be set as a USB host end a by a network side device, the target USB device end may be set as a USB device end a, before a data transmission link between the USB host end a and the USB device end a is established, whether the USB host end a is online may be determined by the network side device (whether it is online, for example, by the server itself, when the server is in normal use, it means that the USB host end or the USB device end is online, or may be determined manually, a determination condition may be set according to an actual situation), if the USB host end a is not online, an error code is returned, an operation of establishing a data transmission link is suspended, if the USB host end a is online, a determination is made as to whether a data communication relationship (for example, a data communication link exists) with other USB device ends is established, if the USB host end a is online, a disconnection communication command is issued, a disconnection command is made so that the USB host end a disconnects the data communication relationship with other USB device ends (02-A0-AC-10-82-04) is disconnected, if the USB host end a is not online, and if the data communication relationship is not established with the USB host end a is opened, a data communication relationship is opened, for example, if the data communication command is not opened with the USB host end a is opened, and the data communication relationship is opened with other USB device ends is opened, the source Mac address of USB host a is sent to USB device a (02-A0-AC-10-81-01) to establish a data transfer link between the target USB host and the target USB device.
It should be noted that, whether the target USB host end has a data communication relationship with other USB device ends or not and whether the USB device end has a data communication relationship with other USB host ends or not may be determined, which may be performed simultaneously or sequentially, so as to detect whether the target USB host end has a data communication relationship with other USB device ends and whether the target USB device end has a data communication relationship with other USB host ends or not, and send a communication disconnection instruction in time, so that the target USB host end and the target USB device end are in an idle state, and a unique data transmission link can be established between the target USB host end and the target USB device end. A one-to-one data transmission link is established between a USB host end and a USB device end, so that the safety of sharing USB data signals can be improved.
Further, the judging condition that the target USB host end and other USB equipment ends have a data communication relationship is that the target USB host end has a first occupation signal; and the judging condition that the target USB equipment end has a data communication relation with other USB host ends is that the target USB equipment end has a second occupation signal.
It should be noted that, when a data transmission link exists between the USB host and the USB device, a lock signal, i.e. an occupied signal, is generated to indicate that a data transmission relationship exists between the USB host and the USB device, and the data transmission relationship is occupied. Therefore, before establishing a data transmission link between the target USB host and the target USB device, it is required to determine whether the target USB host has a data transmission relationship with other USB devices (i.e. a first occupation signal exists), and whether the target USB device has a data transmission relationship with other USB host (i.e. a second occupation signal exists), and meanwhile, the current USB host/USB device may be prompted to be occupied through a program control interface of the server or a program control interface of the network device.
According to the embodiment, the data transmission link is established between the USB host end and the USB device end, so that the USB host end and the USB device end can carry out data transmission based on the data transmission link, and because the USB host end is electrically connected with the PC host, the USB device end is electrically connected with the USB device, when the USB device is far away from the PC host, the USB device at the far end can be connected with the USB device end, USB data signals acquired from the USB device are converted into Ethernet frame data packets through the USB device end, the Ethernet frame data packets are sent to the USB host end, and then the Ethernet frame data packets are converted into USB data packets and sent to the PC host, so that the USB data signal sharing is realized, and the technical problems that the USB host end cannot realize USB data signal sharing with the far-end USB device in the prior art, and the flexibility is poor are solved.
The foregoing detailed description of an embodiment of a method for implementing USB data signal sharing provided in the present application is provided below, and the following detailed description of an embodiment of an apparatus for implementing USB data signal sharing provided in the present application may be referred to correspondingly to the foregoing method for implementing USB data signal sharing.
Referring to fig. 5, an embodiment of the present application provides an apparatus for implementing USB data signal sharing, including:
a data transmission link establishing unit 401, configured to establish a data transmission link between a USB host end of the server and a USB device end of the server, where the USB host end is electrically connected to the PC host, and the USB device end is electrically connected to the USB device;
the USB data signal sharing unit 402 is configured to receive, based on the data transmission link, a USB data signal sent by the USB device through the USB device end and convert the USB data signal into an ethernet frame data packet, and receive, through the USB host end, the ethernet frame data packet and convert the ethernet frame data packet into a USB data packet, and send the USB data packet to the PC host, so as to implement USB data signal sharing between the USB device and the PC host.
Further, the data transmission link establishment unit 401 includes:
a first configuration subunit, configured to configure a first source Mac address for the USB host;
a second configuration subunit, configured to configure a second source Mac address for the USB device side;
the first establishing subunit is configured to establish a data transmission link between the USB host and the USB device according to the first source Mac address and the second source Mac address.
Further, the USB data signal sharing unit 402 includes:
the first receiving subunit is used for receiving the USB data signals sent by the USB equipment through the USB equipment end;
the first conversion subunit is configured to convert, by the USB device side, the USB data signal into an ethernet frame data packet according to a first conversion protocol.
Further, the USB data signal sharing unit 402 includes:
a second receiving subunit, configured to receive, by using the USB host, an ethernet frame packet sent by the USB device;
the second conversion subunit is configured to convert the ethernet frame data packet into a USB data packet according to a second conversion protocol through the USB host, and send the USB data packet to the PC host.
Further, the USB host side and the USB device side are both provided with a plurality of data transmission link establishing units 401 include:
a setting subunit, configured to set a target USB host and a target USB device;
and the second establishing subunit is used for establishing a data transmission link between the target USB host end and the target USB equipment end according to the data communication relationship between the target USB host end and the target USB equipment end.
Further, the second setup subunit includes:
the disconnection subunit is used for sending a disconnection communication instruction when the target USB host end and other USB equipment ends have a data communication relationship and/or the target USB equipment end and other USB host ends have a data communication relationship, so that the target USB host end and the target USB equipment end do not have the data communication relationship with other USB equipment ends and other USB host ends;
and the third establishing subunit is used for establishing a data transmission link between the target USB host end and the target USB equipment end.
It should be noted that, the judging condition that the target USB host and other USB device end have a data communication relationship is that the target USB host has a first occupation signal; and the judging condition that the target USB equipment end has a data communication relation with other USB host ends is that the target USB equipment end has a second occupation signal.
Fig. 6 illustrates a physical structure diagram of an electronic device. As shown in fig. 6, the present invention further provides an electronic device, which may include: processor 310, communication interface (Communication Interface) 320, memory 330 and communication bus 340, wherein processor 310, communication interface 320, memory 330 accomplish communication with each other through communication bus 340. The processor 310 may invoke a computer program in the memory 330 to perform steps of a method of implementing USB data signal sharing, including, for example:
establishing a data transmission link between a USB host end of the server and a USB device end of the server, wherein the USB host end is used for being electrically connected with a PC host, and the USB device end is used for being electrically connected with USB devices;
based on the data transmission link, the USB device end receives the USB data signal sent by the USB device and converts the USB data signal into an Ethernet frame data packet, and the USB host end receives the Ethernet frame data packet and converts the Ethernet frame data packet into a USB data packet and sends the USB data packet to the PC host, so that the USB data signal sharing between the USB device and the PC host is realized.
Further, the logic instructions in the memory 330 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method of the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, embodiments of the present application further provide a non-transitory computer readable storage medium, where a processor readable storage medium stores a computer program, where the computer program is configured to cause a processor to perform the steps of the method provided in the foregoing embodiments, for example, including:
establishing a data transmission link between a USB host end of the server and a USB device end of the server, wherein the USB host end is used for being electrically connected with a PC host, and the USB device end is used for being electrically connected with USB devices;
based on the data transmission link, the USB device end receives the USB data signal sent by the USB device and converts the USB data signal into an Ethernet frame data packet, and the USB host end receives the Ethernet frame data packet and converts the Ethernet frame data packet into a USB data packet and sends the USB data packet to the PC host, so that the USB data signal sharing between the USB device and the PC host is realized.
The processor-readable storage medium may be any available medium or data storage device that can be accessed by a processor, including, but not limited to, magnetic storage (e.g., floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc.), optical storage (e.g., CD, DVD, BD, HVD, etc.), semiconductor storage (e.g., ROM, EPROM, EEPROM, nonvolatile storage (NAND FLASH), solid State Disk (SSD)), and the like.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (7)
1. The method for realizing the sharing of the USB data signals is applied to a server, and the server is provided with a USB host end and a USB device end, and is characterized by comprising the following steps:
establishing a data transmission link between the USB host end and the USB equipment end, wherein the USB host end is used for being electrically connected with a PC host, and the USB equipment end is used for being electrically connected with USB equipment;
based on the data transmission link, receiving a USB data signal sent by the USB device through the USB device end and converting the USB data signal into an Ethernet frame data packet, receiving the Ethernet frame data packet through the USB host end and converting the Ethernet frame data packet into a USB data packet and sending the USB data packet to the PC host so as to realize USB data signal sharing between the USB device and the PC host;
the establishing a data transmission link between the USB host and the USB device includes:
configuring a first source Mac address for the USB host;
configuring a second source Mac address for the USB equipment end;
establishing a data transmission link between the USB host end and the USB equipment end according to the first source Mac address and the second source Mac address;
the USB host end and the USB device end are provided with a plurality of data transmission links, and the data transmission links are established between the USB host end and the USB device end and comprise:
setting a target USB host end and a target USB equipment end;
establishing a data transmission link between the target USB host end and the target USB equipment end according to the data communication relationship between the target USB host end and the target USB equipment end;
the establishing a data transmission link between the target USB host and the target USB device according to the data communication relationship between the target USB host and the target USB device, includes:
when the target USB host end has a data communication relationship with other USB equipment ends and/or the target USB equipment end has a data communication relationship with other USB host ends, a communication disconnecting instruction is sent out, so that the target USB host end and the target USB equipment end have no data communication relationship with other USB equipment ends and other USB host ends;
and establishing a data transmission link between the target USB host end and the target USB equipment end.
2. The method for sharing USB data signals according to claim 1, wherein said receiving, by the USB device side, the USB data signals sent by the USB device and converting them into ethernet frame data packets comprises:
receiving a USB data signal sent by the USB equipment through the USB equipment end;
and converting the USB data signal into the Ethernet frame data packet according to a first conversion protocol through the USB equipment terminal.
3. The method for sharing USB data signals according to claim 2, wherein said receiving the ethernet frame data packet by the USB host and converting it into a USB data packet and transmitting it to the PC host includes:
receiving an Ethernet frame data packet sent by the USB equipment end through the USB host end;
and converting the Ethernet frame data packet into the USB data packet by the USB host end according to a second conversion protocol, and sending the USB data packet to the PC host.
4. The method for sharing USB data signals as defined in claim 1, wherein,
the judging condition that the target USB host end and other USB equipment ends have a data communication relationship is that the target USB host end has a first occupation signal;
and the judging condition that the target USB equipment end has a data communication relation with other USB host ends is that the target USB equipment end has a second occupation signal.
5. An apparatus for implementing USB data signal sharing, comprising:
the system comprises a data transmission link establishment unit, a data transmission link control unit and a data transmission control unit, wherein the data transmission link establishment unit is used for establishing a data transmission link between a USB host end of a server and a USB device end of the server, the USB host end is used for being electrically connected with a PC host, and the USB device end is used for being electrically connected with USB devices;
the USB data signal sharing unit is used for receiving the USB data signal sent by the USB device through the USB device end and converting the USB data signal into an Ethernet frame data packet based on the data transmission link, and receiving the Ethernet frame data packet through the USB host end and converting the Ethernet frame data packet into a USB data packet and sending the USB data packet to the PC host so as to realize USB data signal sharing between the USB device and the PC host;
the establishing a data transmission link between the USB host and the USB device includes:
configuring a first source Mac address for the USB host;
configuring a second source Mac address for the USB equipment end;
establishing a data transmission link between the USB host end and the USB equipment end according to the first source Mac address and the second source Mac address;
the USB host end and the USB device end are provided with a plurality of data transmission links, and the data transmission links are established between the USB host end and the USB device end and comprise:
setting a target USB host end and a target USB equipment end;
establishing a data transmission link between the target USB host end and the target USB equipment end according to the data communication relationship between the target USB host end and the target USB equipment end;
the establishing a data transmission link between the target USB host and the target USB device according to the data communication relationship between the target USB host and the target USB device, includes:
when the target USB host end has a data communication relationship with other USB equipment ends and/or the target USB equipment end has a data communication relationship with other USB host ends, a communication disconnecting instruction is sent out, so that the target USB host end and the target USB equipment end have no data communication relationship with other USB equipment ends and other USB host ends;
and establishing a data transmission link between the target USB host end and the target USB equipment end.
6. An electronic device comprising a processor and a memory storing a computer program, wherein the processor, when executing the computer program, performs the steps of the method of implementing USB data signal sharing according to any one of claims 1 to 4.
7. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the steps of the method of implementing USB data signal sharing according to any of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111554298.7A CN114265806B (en) | 2021-12-17 | 2021-12-17 | Method, device, equipment and storage medium for realizing USB data signal sharing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111554298.7A CN114265806B (en) | 2021-12-17 | 2021-12-17 | Method, device, equipment and storage medium for realizing USB data signal sharing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114265806A CN114265806A (en) | 2022-04-01 |
CN114265806B true CN114265806B (en) | 2024-04-02 |
Family
ID=80827851
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111554298.7A Active CN114265806B (en) | 2021-12-17 | 2021-12-17 | Method, device, equipment and storage medium for realizing USB data signal sharing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114265806B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7035948B1 (en) * | 2001-03-19 | 2006-04-25 | Transdimension, Inc. | System and method for USB controllers |
KR20060094397A (en) * | 2005-02-24 | 2006-08-29 | 한국산업기술대학교 | Data sharing method using network file processor |
CN102129384A (en) * | 2010-01-12 | 2011-07-20 | 国际商业机器公司 | Method and apparatus for virtualizing a host USB adapter |
CN103178872A (en) * | 2013-04-11 | 2013-06-26 | 江苏沁恒股份有限公司 | Method and device for prolonging USB (universal serial bus) system transmission distance through Ethernet |
CN106341777A (en) * | 2016-08-11 | 2017-01-18 | 深圳创维-Rgb电子有限公司 | USB virtual device creation method, device and system |
CN108063741A (en) * | 2016-11-07 | 2018-05-22 | 北京视联动力国际信息技术有限公司 | A kind of transport protocol conversion method and apparatus |
CN108885601A (en) * | 2016-08-19 | 2018-11-23 | 密克罗奇普技术公司 | The more host end point reflector hubs of USB |
CN110996307A (en) * | 2019-11-22 | 2020-04-10 | 华为技术有限公司 | Accessory device, host device and data transmission method |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8504707B2 (en) * | 2004-12-07 | 2013-08-06 | Cisco Technology, Inc. | Method and system for sending and receiving USB messages over a data network |
US20110026525A1 (en) * | 2009-08-03 | 2011-02-03 | Ziqiang He | Ethernet Switch and System |
US10133695B2 (en) * | 2013-12-08 | 2018-11-20 | Crossport Network Solutions Inc. | Link system for establishing high speed network communications and file transfer between hosts using I/O device links |
-
2021
- 2021-12-17 CN CN202111554298.7A patent/CN114265806B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7035948B1 (en) * | 2001-03-19 | 2006-04-25 | Transdimension, Inc. | System and method for USB controllers |
KR20060094397A (en) * | 2005-02-24 | 2006-08-29 | 한국산업기술대학교 | Data sharing method using network file processor |
CN102129384A (en) * | 2010-01-12 | 2011-07-20 | 国际商业机器公司 | Method and apparatus for virtualizing a host USB adapter |
CN103178872A (en) * | 2013-04-11 | 2013-06-26 | 江苏沁恒股份有限公司 | Method and device for prolonging USB (universal serial bus) system transmission distance through Ethernet |
CN106341777A (en) * | 2016-08-11 | 2017-01-18 | 深圳创维-Rgb电子有限公司 | USB virtual device creation method, device and system |
CN108885601A (en) * | 2016-08-19 | 2018-11-23 | 密克罗奇普技术公司 | The more host end point reflector hubs of USB |
CN108063741A (en) * | 2016-11-07 | 2018-05-22 | 北京视联动力国际信息技术有限公司 | A kind of transport protocol conversion method and apparatus |
CN110996307A (en) * | 2019-11-22 | 2020-04-10 | 华为技术有限公司 | Accessory device, host device and data transmission method |
Non-Patent Citations (1)
Title |
---|
"嵌入式多串口到以太网网关的设计与实现";丁璐等;《测控技术》;20091231;第28卷(第12期);72-75 * |
Also Published As
Publication number | Publication date |
---|---|
CN114265806A (en) | 2022-04-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6721872B1 (en) | Reconfigurable network interface architecture | |
CN111164923B (en) | Design for unidirectional data transmission | |
CN104781750A (en) | Balloon-based positioning system and method | |
WO2017028022A1 (en) | System and method for supporting data communication in heterogeneous environment | |
US20170181059A1 (en) | Wireless internet access | |
CN115632900B (en) | Computing equipment | |
CN114265806B (en) | Method, device, equipment and storage medium for realizing USB data signal sharing | |
JP2013543307A (en) | Control method, apparatus, and system | |
CN106664231B (en) | Transmission unit with checking function | |
CN111083447B (en) | Network communication method, device and storage medium | |
WO2023045795A1 (en) | Infrared communication method and apparatus, and storage medium and electronic apparatus | |
JPS5829244A (en) | Data communication system | |
US10637993B1 (en) | High-bandwidth home network over phone line | |
US7543044B2 (en) | Automatic configuration system | |
CN112532663B (en) | Household intelligent gateway login method and device | |
JP5101464B2 (en) | Communication processing device | |
US20140341070A1 (en) | Wireless network setting method, communication system and remote device | |
CN103004170B (en) | Responding device and integrated circuit, response method and responding system | |
CN108667724B (en) | Safe gateway device | |
CN110519339B (en) | Device connection method, device, system and storage medium | |
CN204087203U (en) | Telecommunication circuit between multiple ARM | |
CN113660734B (en) | Connection method and device of network equipment, network equipment and medium | |
CN118540213A (en) | Node configuration method and related device for secure real-time bus SRB | |
KR100631238B1 (en) | Data communication method between terminals in a packet based communication network | |
CN117648276A (en) | Out-of-band management system and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |