CN114265806A - 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
- CN114265806A CN114265806A CN202111554298.7A CN202111554298A CN114265806A CN 114265806 A CN114265806 A CN 114265806A CN 202111554298 A CN202111554298 A CN 202111554298A CN 114265806 A CN114265806 A CN 114265806A
- Authority
- CN
- China
- Prior art keywords
- usb
- host
- equipment
- target
- data
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 230000005540 biological transmission Effects 0.000 claims abstract description 75
- 238000004891 communication Methods 0.000 claims description 51
- 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
Images
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, the server is provided with a USB host end and a USB equipment end, and the method comprises the following steps: establishing a data transmission link between a USB host end and a 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 data signal sent by the USB equipment is received through the USB equipment end and is converted into an Ethernet frame data packet, the Ethernet frame data packet is received through the USB host end and is converted into the USB data packet to be sent to the PC host, so that the sharing of the USB data signal between the USB equipment and the PC host is realized, and the technical problems that the sharing of the USB data signal cannot be realized between the USB host end and the remote USB equipment and the flexibility is poor in the prior art are solved.
Description
Technical Field
The present application 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
The current computers are basically equipped with USB functions, a host end of the computer can usually provide a plurality of USB interfaces, and the USB interfaces also become necessary interfaces of the computers. The USB equipment does not need to install a driver in most versions of WINDOWS operating systems, has a real 'plug and play' characteristic, and is convenient to use. However, in the prior art, only the USB device located in a short distance can be configured point-to-point with the host, that is, the USB device requiring data signal sharing is inserted into the USB interface of the USB host to access the USB device to the host, so as to implement USB data signal sharing.
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 a USB host end cannot realize USB data signal sharing with remote USB equipment and the flexibility is poor in the prior art.
In view of this, a first aspect 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 end and a USB device end, and includes:
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;
and based on the data transmission link, receiving the USB data signal sent by the USB equipment through the USB equipment 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 to be sent to the PC host, so that the USB data signal sharing between the USB equipment and the PC host is realized.
Optionally, the establishing a data transmission link between the USB host end and the USB device end includes:
configuring a first source Mac address for the USB host end;
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 end, the USB data signal sent by the USB device and converting the USB data signal into an ethernet frame data packet includes:
receiving a USB data signal sent by the USB equipment through the USB equipment terminal;
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, by the USB host, the ethernet frame packet and converting the ethernet frame packet into a USB packet, and sending the USB packet 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 according to a second conversion protocol through the USB host end, and sending the USB data packet to the PC host.
Optionally, the USB host end and the USB device end are both provided with a plurality of data transmission links, where a data transmission link is established between the USB host end and the USB device end, including:
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 end and the target USB device end according to the data communication relationship between the target USB host end and the target USB device end includes:
when the target USB host end has a data communication relation with other USB equipment ends and/or the target USB equipment end has a data communication relation with other USB host ends, sending a communication disconnection instruction to enable the target USB host end, the target USB equipment end, other USB equipment ends and other USB host ends not to have a data communication relation;
and establishing a data transmission link between the target USB host end and the target USB equipment end.
Optionally, the determination condition that the target USB host has a data communication relationship with other USB device terminals is that the target USB host has a first occupation signal;
and the judgment condition that the target USB equipment end and other USB host ends have the data communication relation 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 data transmission link establishing unit is used for establishing a data transmission link between a USB host end of the server and a USB equipment end of the server, 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;
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 and converting the USB data signal into an Ethernet frame data packet based on the data transmission link, 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 the sharing of the USB data signal 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 for implementing USB data signal sharing according to 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.
According to the technical scheme, the method has the following advantages:
according to the data transmission link between the USB host end and the USB equipment end, data transmission can be carried out on the USB host end and the USB equipment end based on the data transmission link, and 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.
Drawings
Fig. 1 is a schematic 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 configurations of a USB host end and a USB device end according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a connection between a USB host and a USB device according to an embodiment of the present invention;
FIG. 4 is a block diagram of an overall architecture for implementing USB data signal sharing according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an apparatus for implementing USB data signal sharing 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, and is used for solving the technical problems that a USB host end cannot realize USB data signal sharing with remote USB equipment and the flexibility is poor in the prior art.
In order to make the objects, features and advantages of the present invention more apparent and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the embodiments described below are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1 to 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 end and a USB device end, and the method 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 electrically connecting with a PC host, and the USB device end is used for electrically connecting with a USB device.
And 102, receiving the USB data signal sent by the USB equipment through the USB equipment end and converting the USB data signal into an Ethernet frame data packet based on the data transmission link, receiving the Ethernet frame data packet through the USB host end and converting the Ethernet frame data packet into the USB data packet to be sent to the PC host, so that the USB data signal sharing between the USB equipment and the PC host is realized.
The execution main body of the method for realizing the sharing of the USB data signals provided by the embodiment of the application 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 side of the server and a USB device side of the server, where the USB host side is used to electrically connect with the PC host and the USB device side is used to electrically connect with the USB device.
The server may be a gigabit switch or the like.
It should be noted that the USB host end includes a chip and a single chip microcomputer for converting USB to 802.3 protocol, the USB device end includes a chip and a single chip microcomputer for converting USB to 802.3 protocol, the USB host end may be electrically connected to the PC host through a USB connection line, the USB device end may be electrically connected to the USB device through a USB interface, and the USB device may be a USB disk or a camera, etc. By establishing a data transmission link between the USB host end and the USB device end, the USB host end and the USB device end can carry out data transmission based on the data transmission link.
In step 102, the network side device receives, through the USB device end, the USB data signal sent by the USB device and converts the USB data signal into an ethernet frame data packet based on the data transmission link, and receives, through the USB host end, 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 as to implement USB data signal sharing between the USB device and the PC host.
When the USB device is far from the USB host, the USB device may be accessed to the nearby USB device through the USB interface to perform data conversion, that is, the USB device 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 equipment end perform data transmission based on the data transmission link, namely the USB host end receives Ethernet frame data packets sent by the USB equipment end. And finally, the USB host converts the Ethernet frame data packet into a USB data packet and sends 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 comprises:
configuring a first source Mac address for a USB host end;
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.
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 the USB host end through the network side device, and a second source Mac address may be configured for the USB device end, where the first source Mac address and the second source Mac address are both 6-byte Mac addresses, and a configuration rule of the 6-byte Mac addresses is 02-a 0-XX. Secondly, the network side device can send the source address of the other party to the USB host end and the USB device end which need to establish the data transmission link, that is, 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 as to establish the data transmission link between the USB host end and the USB device end, thereby improving the speed of establishing the data transmission link and realizing the stability of data transmission.
Further, 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 includes:
receiving a USB data signal sent by a USB device through a USB device end;
and converting the USB data signal into an Ethernet frame data packet according to a first conversion protocol through the USB equipment terminal.
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 according to a TCP or IP protocol (i.e., a first conversion protocol) through the USB to 802.3 chip, thereby improving the stability of data conversion and transmission.
Further, receiving the ethernet frame data packet through the USB host and converting the ethernet frame data packet into a USB data packet to be sent to the PC host, including:
receiving an Ethernet frame data packet sent by a USB device end through a USB host end;
and converting the Ethernet frame data packet into a USB data packet according to a second conversion protocol through the USB host end, and sending 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 (i.e., a second conversion protocol) of the USB to 802.3 chip, thereby improving the stability of data conversion and transmission.
Further, the USB host end and the USB device end are both provided with a plurality of USB devices, 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, it is assumed that the USB host side of the server includes a USB host side A, USB host side B and a USB host side C, and 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 end A: 02-A0-AC-10-81-01
USB host end B: 02-A0-AC-10-81-02
USB host end C: 02-A0-AC-10-81-03
USB device end A: 02-A0-AC-10-82-04
USB device end B: 02-A0-AC-10-82-05
USB device end C: 02-A0-AC-10-82-06
Further, according to the data communication relationship between the target USB host end and the target USB device end, a data transmission link is established between the target USB host end and the target USB device end, including:
when the target USB host end has a data communication relation with other USB equipment ends and/or the target USB equipment end has a data communication relation with other USB host ends, sending a communication disconnection instruction to ensure that the target USB host end and the target USB equipment end have no data communication relation 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.
It should be noted that the other USB host terminals refer to all USB host terminals on the server except the target host terminal, and the other USB device terminals refer to all USB device terminals on the server except the target device terminal.
It should be noted that, as shown in fig. 3, before a data transmission link between the USB host end a and the USB device end a is established, the network side device may first determine whether the USB host end a is online (for example, whether the USB host end a is online may be determined by the server itself, when the server is in normal use, it indicates that the USB host end or the USB device end is online, or manually determines that the determination condition may be set according to an actual condition), if the USB host end a is not online, an error code is returned, the operation of establishing the data transmission link is suspended, if the USB host end a is online, it is determined whether the USB host end a has a data communication relationship with other USB device ends (for example, there is a data communication link), and if so, a communication disconnection instruction is sent, so that the USB host terminal A disconnects the data communication relation with other USB equipment terminals, if not, the source Mac address (02-a0-AC-10-82-04) of the USB device terminal a is sent to the USB host terminal a, and it is determined whether the USB device terminal a is online, if the USB device terminal a is not online, an error code is returned, the operation of establishing the data transmission link is suspended, if the USB device terminal a is online, then, it is determined whether the USB device side a has a data communication relationship with other USB host sides (for example, a data communication link exists), if so, a command of disconnecting communication is sent out, so that the USB device end A disconnects the data communication relation with other USB host ends, if not, the source Mac address of the USB host terminal a is sent to the USB device terminal a (02-a0-AC-10-81-01), so as to establish a data transmission link between the target USB host side and the target USB device side.
It should be noted that, the determination of whether the target USB host end has a data communication relationship with other USB device ends and the determination of whether the USB device end has a data communication relationship with other USB host ends may be performed simultaneously or sequentially, and the purpose is 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, and to issue a communication disconnection instruction in time, so that the target USB host end and the target USB device end are both 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 USB host end and a USB device end establish a one-to-one data transmission link, which can improve the security of USB data signal sharing.
Further, the judgment condition that the target USB host end and other USB equipment ends have a data communication relation is that the target USB host end has a first occupation signal; and the judgment condition that the target USB equipment end and other USB host ends have the data communication relation is that the target USB equipment end has a second occupation signal.
It should be noted that, when there is a data transmission link between the USB host end and the USB device end, a lock signal, i.e. an occupied signal, is generated to indicate that there is a data transmission relationship between the USB host end and the USB device end, and the lock signal is occupied. Therefore, before establishing a data transmission link between the target USB host end and the target USB device end, it is necessary to first determine whether the target USB host end has a data transmission relationship with other USB device ends (i.e. there is a first occupation signal) and whether the target USB device end has a data transmission relationship with other USB host ends (i.e. there is a second occupation signal), and meanwhile, it is also possible to prompt that the current USB host end/USB device end is occupied through a program control interface of a server or a program control interface of a network side device.
In this embodiment, a 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 perform data transmission based on the data transmission link, and because the USB host end is used to be electrically connected to the PC host, and the USB device end is used to be electrically connected to the USB device, when the USB device is far away from the PC host, the USB device at the far end can be connected to the USB device end, the USB data signal obtained from the USB device is converted into an ethernet frame data packet by the USB device end, and then the ethernet frame data packet is sent to the USB host, and then the USB host end converts the ethernet frame data packet into a USB data packet and sends the USB data packet to the PC host, so as to implement USB data signal sharing, thereby solving the technical problems that the USB host end cannot implement USB data signal sharing with the USB device at the far end and the flexibility is poor in the prior art.
The above is a detailed description of an embodiment of a method for implementing USB data signal sharing provided by the present application, and the following is a detailed description of an embodiment of an apparatus for implementing USB data signal sharing provided by the present application, and a device for implementing USB data signal sharing described below and a method for implementing USB data signal sharing described above may be referred to correspondingly.
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 configured to be electrically connected to a PC host and the USB device end is configured to be electrically connected to a USB device;
the USB data signal sharing unit 402 is configured to receive, through the USB device end, a USB data signal sent by the USB device and convert the USB data signal into an ethernet frame data packet, 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, based on the data transmission link, so as to implement USB data signal sharing between the USB device and the PC host.
Further, the data transmission link establishing unit 401 includes:
the first configuration subunit is used for configuring a first source Mac address for the USB host end;
the second configuration subunit is used for configuring a second source Mac address for the USB equipment terminal;
and the first establishing subunit is used for 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.
Further, the USB data signal sharing unit 402 includes:
the first receiving subunit is used for receiving the USB data signal sent by the USB equipment through the USB equipment terminal;
and the first conversion subunit is used for converting the USB data signal into an Ethernet frame data packet according to a first conversion protocol through the USB equipment terminal.
Further, the USB data signal sharing unit 402 includes:
the second receiving subunit is used for receiving the Ethernet frame data packet sent by the USB device end through the USB host end;
and the second conversion subunit is used for converting the Ethernet frame data packet into a USB data packet according to a second conversion protocol through the USB host end and sending the USB data packet to the PC host.
Further, the USB host end and the USB device end are both provided with a plurality of units, and the data transmission link establishing unit 401 includes:
the setting subunit is used for setting a target USB host terminal and a target USB equipment terminal;
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 establishing subunit includes:
the disconnection subunit is used for sending a disconnection communication instruction 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, so that the target USB host end, the target USB equipment end, other USB equipment ends and other USB host ends do not have a data communication relationship;
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 determination condition that the target USB host end has a data communication relationship with other USB device ends is that the target USB host end has a first occupation signal; and the judgment condition that the target USB equipment end and other USB host ends have the data communication relation 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 also provides an electronic device, which may include: a processor (processor)310, a Communication Interface (Communication Interface)320, a memory (memory)330 and a Communication bus 340, wherein the processor 310, the Communication Interface 320 and the memory 330 complete the Communication with each other through the Communication bus 340. The processor 310 may invoke computer programs in the memory 330 to perform the 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 equipment end of the server, 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 data signal sent by the USB device is received through the USB device end and converted into an Ethernet frame data packet, the Ethernet frame data packet is received through the USB host end and converted into the USB data packet, and the USB data packet is sent to the PC host, so that USB data signal sharing between the USB device and the PC host is achieved.
In addition, the logic instructions in the memory 330 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to 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), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, an embodiment of the present application further provides 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 equipment end of the server, 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 data signal sent by the USB device is received through the USB device end and converted into an Ethernet frame data packet, the Ethernet frame data packet is received through the USB host end and converted into the USB data packet, and the USB data packet is sent to the PC host, so that USB data signal sharing between the USB device and the PC host is achieved.
The processor-readable storage medium can be any available medium or data storage device that can be accessed by a processor, including, but not limited to, magnetic memory (e.g., floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc.), optical memory (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor memory (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND FLASH), Solid State Disks (SSDs)), etc.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present 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 solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. A method for realizing USB data signal sharing is applied to a server, the server is provided with a USB host end and a USB device end, and the method 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;
and based on the data transmission link, receiving the USB data signal sent by the USB equipment through the USB equipment 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 to be sent to the PC host, so that the USB data signal sharing between the USB equipment and the PC host is realized.
2. The method according to claim 1, wherein the establishing a data transmission link between the USB host end and the USB device end includes:
configuring a first source Mac address for the USB host end;
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.
3. The method according to claim 2, wherein the receiving, by the USB device end, the USB data signal sent by the USB device and converting the USB data signal into an ethernet frame packet includes:
receiving a USB data signal sent by the USB equipment through the USB equipment terminal;
and converting the USB data signal into the Ethernet frame data packet according to a first conversion protocol through the USB equipment terminal.
4. The method for implementing USB data signal sharing according to claim 3, wherein the receiving the ethernet frame packet by the USB host and converting it into a USB packet to send to the PC host comprises:
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 according to a second conversion protocol through the USB host end, and sending the USB data packet to the PC host.
5. The method according to any one of claims 1 to 4, wherein a plurality of USB host terminals and a plurality of USB device terminals are provided, and the establishing of the data transmission link between the USB host terminals and the USB device terminals 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.
6. The method according to claim 5, wherein 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 comprises:
when the target USB host end has a data communication relation with other USB equipment ends and/or the target USB equipment end has a data communication relation with other USB host ends, sending a communication disconnection instruction to enable the target USB host end, the target USB equipment end, other USB equipment ends and other USB host ends not to have a data communication relation;
and establishing a data transmission link between the target USB host end and the target USB equipment end.
7. The method of claim 6,
the judgment condition that the target USB host end and other USB equipment ends have the data communication relation is that the target USB host end has a first occupation signal;
and the judgment condition that the target USB equipment end and other USB host ends have the data communication relation is that the target USB equipment end has a second occupation signal.
8. An apparatus for implementing USB data signal sharing, comprising:
the data transmission link establishing unit is used for establishing a data transmission link between a USB host end of the server and a USB equipment end of the server, 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;
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 and converting the USB data signal into an Ethernet frame data packet based on the data transmission link, 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 the sharing of the USB data signal between the USB equipment and the PC host.
9. An electronic device comprising a processor and a memory storing a computer program, wherein the processor implements the steps of the method of implementing USB data signal sharing according to any one of claims 1 to 7 when executing the computer program.
10. A non-transitory computer readable storage medium, having stored thereon a computer program, wherein the computer program, when being executed by a processor, implements the steps of the method for implementing USB data signal sharing according to any one of claims 1 to 7.
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 true CN114265806A (en) | 2022-04-01 |
CN114265806B 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 (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7035948B1 (en) * | 2001-03-19 | 2006-04-25 | Transdimension, Inc. | System and method for USB controllers |
US20060123129A1 (en) * | 2004-12-07 | 2006-06-08 | Cisco Technology, Inc., A Corporation Of California | Method and system for sending and receiving USB messages over a data network |
KR20060094397A (en) * | 2005-02-24 | 2006-08-29 | 한국산업기술대학교 | Data sharing method using network file processor |
US20110026525A1 (en) * | 2009-08-03 | 2011-02-03 | Ziqiang He | Ethernet Switch and System |
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 |
US20160217093A1 (en) * | 2013-12-08 | 2016-07-28 | Crossport Network Solutions Inc. | Link system for establishing high speed network communications and file transfer between hosts using i/o device links |
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 |
-
2021
- 2021-12-17 CN CN202111554298.7A patent/CN114265806B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7035948B1 (en) * | 2001-03-19 | 2006-04-25 | Transdimension, Inc. | System and method for USB controllers |
US20060123129A1 (en) * | 2004-12-07 | 2006-06-08 | Cisco Technology, Inc., A Corporation Of California | Method and system for sending and receiving USB messages over a data network |
KR20060094397A (en) * | 2005-02-24 | 2006-08-29 | 한국산업기술대학교 | Data sharing method using network file processor |
US20110026525A1 (en) * | 2009-08-03 | 2011-02-03 | Ziqiang He | Ethernet Switch and System |
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 |
US20160217093A1 (en) * | 2013-12-08 | 2016-07-28 | Crossport Network Solutions Inc. | Link system for establishing high speed network communications and file transfer between hosts using i/o device links |
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 |
---|
丁璐等: ""嵌入式多串口到以太网网关的设计与实现"", 《测控技术》, vol. 28, no. 12, 31 December 2009 (2009-12-31), pages 72 - 75 * |
Also Published As
Publication number | Publication date |
---|---|
CN114265806B (en) | 2024-04-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6721872B1 (en) | Reconfigurable network interface architecture | |
CN109558371B (en) | Method for communicating with a microcontroller, and computing system | |
EP2339792B1 (en) | Method for accessing USB device attached to home gateway, home gateway and terminal | |
CN107926075B (en) | System and method for supporting data communication in heterogeneous environment | |
CN104243210A (en) | Method and system for remotely having access to administrative web pages of routers | |
CN108667699B (en) | Method and device for interconnecting terminal equipment and gateway equipment | |
CN110519068B (en) | POE power supply control device and POE power supply system | |
US20070155422A1 (en) | Method for controlling mobile data connection through USB Ethernet management of mobile station | |
CN110809002A (en) | Method for protocol conversion between robot and welding equipment and protocol conversion module | |
BRPI1105753B1 (en) | CONTROL METHOD PERFORMED BY A USER DEVICE, CONTROL METHOD PERFORMED BY A REMOTE DEVICE INTERFACE DEVICE, USER DEVICE AND REMOTE DEVICE INTERFACE DEVICE DEVICE | |
CN114143659A (en) | Earphone data sending method, terminal equipment, master earphone, slave earphone and system | |
WO2024045742A1 (en) | Computing device | |
CN114265806A (en) | Method, device, equipment and storage medium for realizing USB data signal sharing | |
WO2023045795A1 (en) | Infrared communication method and apparatus, and storage medium and electronic apparatus | |
CN116578316A (en) | Firmware updating method, device, server and storage medium of equipment | |
CN114116574B (en) | Data transmission method, device, electronic equipment and storage medium | |
CN116321195A (en) | Wireless distribution network method, device, equipment and system | |
US8954623B2 (en) | Universal Serial Bus devices supporting super speed and non-super speed connections for communication with a host device and methods using the same | |
CN112165715B (en) | Equipment detection method and device, storage medium and electronic device | |
CN118540213B (en) | Node configuration method and related device for secure real-time bus SRB | |
CN114780119B (en) | Firmware updating method and related equipment | |
CN114629889B (en) | Remote control link establishment method, device, equipment and medium | |
CN103004170B (en) | Responding device and integrated circuit, response method and responding system | |
CN111124445A (en) | Home gateway upgrading method and home gateway | |
CN112689284B (en) | Wireless network password modification method, device, equipment and storage medium |
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 |