WO2017197900A1 - Usb switching method, device, and system - Google Patents

Usb switching method, device, and system Download PDF

Info

Publication number
WO2017197900A1
WO2017197900A1 PCT/CN2017/000055 CN2017000055W WO2017197900A1 WO 2017197900 A1 WO2017197900 A1 WO 2017197900A1 CN 2017000055 W CN2017000055 W CN 2017000055W WO 2017197900 A1 WO2017197900 A1 WO 2017197900A1
Authority
WO
WIPO (PCT)
Prior art keywords
usb
bus
hub
switching
slave device
Prior art date
Application number
PCT/CN2017/000055
Other languages
French (fr)
Chinese (zh)
Inventor
卢翠玲
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017197900A1 publication Critical patent/WO2017197900A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver

Definitions

  • the present invention relates to the field of communications, and in particular to a universal serial bus (USB) switching method, apparatus, and system.
  • USB universal serial bus
  • USB3.0 host controller chip In recent years, with the personal computer (Personal Computer, PC for short) manufacturers gradually add USB3.0 host controller chip on the machine, the production and application of USB3.0 device is more and more extensive, people also enjoy USB3.0 The high rate of technology in data transmission.
  • USB 3.0 affects 2.4 GHz communication, and any wired signal will radiate electromagnetic waves outward unless it is DC (no frequency change) or completely shielded.
  • the intensity of the interference is related to the signals transmitted on the cable (such as voltage, current, frequency). Therefore, although USB3.0 is a wired signal, it is still possible to radiate electromagnetic waves outward and interfere with other signals.
  • the transmission frequency of USB3.0 is 5GHz serial
  • USB3.0 uses 4 data lines to form 2 groups, each group is responsible for one transmission direction, achieving full-duplex bidirectional 5GHz, and the reference frequency of each data line is 2.5GHz.
  • This frequency is too close to the frequency of 2.4G Wireless Fidelity (WiFi), and most of the high-frequency equipment uses SSC technology, so that the signal is not completely distributed on a fixed frequency, so it affects other frequencies around 2.5GHz. That is, USB 3.0 has a large interference with WiFi and other products using the 2.4 GHz band.
  • WiFi 2.4G Wireless Fidelity
  • USB3.0 The host controller of USB3.0 has only begun to develop and produce in recent years. Different manufacturers have different drivers, which will inevitably lead to compatibility problems. Sometimes, when the USB device is in use, the host controller has a yellow exclamation mark and even no port problem. Only plugging and unplugging can continue to use; sometimes the plugging cannot be restored, and only the operating system can be restarted to continue using it. All of the above are USB3.
  • the 0 device is manufactured by different device and chip manufacturers at the same time as the USB3.0 host controller, and cannot be tested by enough compatibility tests. This can only be set The backup and host driver manufacturers continue to improve the product to solve the problem.
  • USB3.0 the wireless network card of USB3.0 is the same as USB2.0, but the use of USB3.0 needs to cooperate with USB3.0 host, USB3.0 wireless network card and USB3.0 line.
  • the USB3.0 wireless network card is inserted into the USB3.0 host interface and reported to the host operating system as a virtual optical drive. After the user installs the application and driver in the virtual optical drive, the USB3.0 wireless network card will be switched to the working mode (including the modem).
  • the modem or the network interface interface of the Network Diver Interface Specification (NDIS) can be used by the user to perform network operations using the wireless network.
  • NDIS Network Diver Interface Specification
  • USB3.0 for high-speed download or use USB3.0 hard disk for file copying
  • WIFI will slow down or interrupt
  • wireless USB mouse will react very slowly, this It is the interference of electromagnetic waves generated by USB3.0 overspeed transmission to the 2.4 GHz frequency.
  • the solution to the interference problem occurring in the USB 3.0 overspeed transmission process is mainly for the electromagnetic shielding of the USB3.0 interface, either to increase the shield or to modify the USB circuit structure, which is modified around the physical properties.
  • This modification requires an increase in hardware costs, and there is no uniform specification. Different hardware manufacturers may design things that vary widely.
  • USB3.0 hub HUB cannot be used, and an application is installed.
  • This application detects the HUB abnormality and gives USB3. 0
  • the device sends a mode switching command to switch from USB3.0 mode to USB2.0 mode, thus avoiding the problem that USB3.0 cannot be used anymore.
  • One disadvantage of this patent is that the application must detect the abnormality in advance, or the abnormality does not affect the delivery of the USB switching instruction.
  • the USB3.0 mode of this patent will be switched to the USB2.0 mode. Once all the USB ports are disabled, Then the USB switching command cannot be sent to the USB device side at all, and it cannot be switched.
  • the embodiment of the invention provides a USB switching method, device and system to solve at least the interference problem occurring in the USB 3.0 overspeed transmission process in the related art.
  • a method for switching a universal serial bus USB including: determining that a USB 3.0 interface of a universal serial bus USB host device is inserted into a USB 3.0 slave device Whether there is interference signal between the network where the USB3.0 device is located and the network where the specified wireless network and/or the specified wireless device is located; if the judgment result is that there is an interference signal, the USB3.0 bus is switched to the USB2.0 bus. .
  • switching the USB 3.0 bus to the USB 2.0 bus includes: switching the root hub of the USB host device connected to the USB 3.0 slave device from the USB 3.0 hub to the USB 2.0 hub.
  • the root hub connected to the USB 3.0 slave device in the USB host device is switched from the USB 3.0 hub to the USB 2.0 hub by: corresponding to the USB 3.0 hub in the USB host device.
  • the value is modified to the value corresponding to the USB 2.0 hub.
  • the method further includes: issuing a reset reset command to the USB 3.0 slave device, wherein the reset command is used to indicate the USB 3.0 slave device.
  • the method before the USB 3.0 bus is switched to the USB 2.0 bus, the method further includes: receiving a switching instruction, wherein the switching instruction is used to indicate that the USB 3.0 bus is allowed to be switched to the USB 2.0 bus. .
  • the method further includes: switching the USB 2.0 bus to the USB 3 when detecting that the USB 3.0 slave device pulls out the USB host device .0 bus.
  • the designated wireless network includes a wireless fidelity WIFI
  • the designated wireless device includes: a wireless mouse.
  • a universal serial bus USB switching apparatus comprising: a determining module configured to detect a universal serial bus USB host device When the USB3.0 interface is inserted into the USB 3.0 slave device, it is determined whether there is an interference signal between the network where the USB 3.0 slave device is located and the network where the specified wireless network and/or the designated wireless device is located; the switching module is set to When the result of the judgment is that there is an interference signal, the USB 3.0 bus is switched to the USB 2.0 bus.
  • the switching module is further configured to switch the root hub of the USB host device connected to the USB 3.0 slave device from the USB 3.0 hub to the USB 2.0 hub.
  • the switching module switches the root hub connected to the USB 3.0 slave device in the USB host device from the USB 3.0 hub to the USB 2.0 hub in the following manner: the USB host device and the USB 3.0 hub The corresponding value is modified to the value corresponding to the USB2.0 hub.
  • the device further includes: a sending module, configured to send a reset reset command to the USB 3.0 slave device, wherein the reset command is used to instruct the USB 3.0 slave device to use the USB2.0 protocol and the USB host The device communicates.
  • a sending module configured to send a reset reset command to the USB 3.0 slave device, wherein the reset command is used to instruct the USB 3.0 slave device to use the USB2.0 protocol and the USB host The device communicates.
  • the apparatus further includes: a receiving module configured to receive a switching instruction, wherein the switching instruction is used to indicate that the USB 3.0 bus is allowed to be switched to the USB 2.0 bus.
  • the switching module is further configured to switch the USB 2.0 bus to the USB 3.0 bus when detecting that the USB 3.0 slave device pulls out the USB host device.
  • the designated wireless network includes a wireless fidelity WIFI
  • the designated wireless device includes: a wireless mouse.
  • a system comprising: a USB host device, a USB 3.0 slave device and a USB 3.0 cable; wherein the USB host device comprises the device of any one of claims 9 to 16. .
  • a storage medium is also provided.
  • the storage medium is configured to store program code for performing the following steps: in the case where the USB 3.0 interface of the universal serial bus USB host device is inserted and the USB 3.0 slave device is inserted, the network of the USB 3.0 slave device is determined Specifies whether there is a dry network between the wireless network and/or the network where the specified wireless device is located The scramble signal; in the case where the judgment result is that there is an interference signal, the USB 3.0 bus is switched to the USB 2.0 bus.
  • the network in which the USB 3.0 slave device is located and the network in which the designated wireless network and/or the designated wireless device are located are determined. Whether there is an interference signal between, and if the judgment result is that there is an interference signal, the USB3.0 bus is switched to the USB2.0 bus, that is, the USB 3.0 interface of the USB host device is detected and the USB 3.0 slave device is inserted. In the case of interference signal, USB3.0 is switched to USB2.0, thereby avoiding the corresponding interference problem, and solving the interference problem occurring in the USB3.0 overspeed transmission process in the related art.
  • FIG. 1 is a block diagram showing the hardware structure of a computer terminal of a USB switching method according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for switching a USB according to an embodiment of the present invention
  • FIG. 3 is a block diagram showing the structure of a universal serial bus USB switching apparatus according to an embodiment of the present invention.
  • FIG. 4 is a physical connection diagram of a USB 3.0 system according to a preferred embodiment of the present invention.
  • FIG. 5 is a schematic diagram of installation of an automatic detection and switching APP according to a preferred embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a relationship between a host application and each module according to a preferred embodiment of the present invention.
  • FIG. 7 is a structural block diagram of a USB 3.0 host controller according to a preferred embodiment of the present invention.
  • FIG. 8 is a structural block diagram of a module in an application according to a preferred embodiment of the present invention.
  • FIG. 9 is a schematic flowchart of application installation according to a preferred embodiment of the present invention.
  • FIG. 10 is a schematic flowchart diagram of a USB 3.0 switching method according to a preferred embodiment of the present invention.
  • FIG. 1 is a hardware block diagram of a computer terminal of a USB switching method according to an embodiment of the present invention.
  • computer terminal 10 may include one or more (only one shown) processor 102 (processor 102 may include, but is not limited to, a Microcontroller Unit (MCU) or a programmable logic device.
  • MCU Microcontroller Unit
  • a processing device such as a Field-Programmable Gate Array (FPGA), a memory 104 for storing data, and a transmission device 106 for a communication function.
  • FPGA Field-Programmable Gate Array
  • FIG. 1 is merely illustrative and does not limit the structure of the above electronic device.
  • computer terminal 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG.
  • the memory 104 can be used to store software programs and modules of application software, such as program instructions/modules corresponding to the switching method of the universal serial bus USB in the embodiment of the present invention, and the processor 102 runs the software programs and modules stored in the memory 104. In order to perform various functional applications and data processing, the above method is implemented.
  • Memory 104 may include high speed random access memory, and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • memory 104 may further include memory remotely located relative to processor 102, which may be coupled to computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • Transmission device 106 is for receiving or transmitting data via a network.
  • the network specific examples described above may include a wireless network provided by a communication provider of the computer terminal 10.
  • the transmission device 106 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet.
  • the transmission device 106 can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.
  • NIC Network Interface Controller
  • RF Radio Frequency
  • FIG. 2 is a flowchart of a method for switching a USB according to an embodiment of the present invention. As shown in FIG. 2, the process includes The following steps:
  • Step S202 when it is detected that the USB3.0 interface of the universal serial bus USB host device is inserted into the USB3.0 slave device, determining that the network where the USB 3.0 slave device is located and the designated wireless network and/or the designated wireless device are located. Whether there is interference signal between networks;
  • step S204 if the result of the determination is that there is an interference signal, the USB 3.0 bus is switched to the USB 2.0 bus.
  • the network where the USB 3.0 slave device is located and the network where the specified wireless network and/or the designated wireless device are located are determined. Whether there is an interference signal between, and if the judgment result is that there is an interference signal, the USB3.0 bus is switched to the USB2.0 bus, that is, the USB 3.0 interface of the USB host device is detected and the USB 3.0 slave device is inserted. In the case of interference signal, USB3.0 is switched to USB2.0, thereby avoiding the corresponding interference problem, and solving the interference problem occurring in the USB3.0 overspeed transmission process in the related art.
  • step S202 may include: detecting whether a network where the USB 3.0 slave device is located is used, and detecting whether the specified wireless network and/or a network where the specified wireless device is located is being used; detecting the specified wireless network and / or if the network where the specified wireless device is located is being used and the network where the USB 3.0 slave device is located is being used, it is determined that the network where the USB 3.0 slave device is located and the designated wireless network and/or the designated wireless device are located. There is an interference signal between the networks.
  • the detection mode may be performed on the designated wireless network, in one embodiment of the present invention, where the network in which the specified wireless network and/or the designated wireless device are located may be used. And/or whether the service on the network where the specified wireless device is located is executed, and if so, the network in which the designated wireless network and/or the designated wireless device is located is being used, but is not limited thereto.
  • step S204 may be performed by: switching a root hub in the USB host device connected to the USB 3.0 slave device from a USB 3.0 hub to a USB 2.0 hub.
  • the root hub connected to the USB 3.0 slave device in the USB host device can be switched from the USB 3.0 hub to the USB 2.0 hub by corresponding to the USB 3.0 hub in the USB host device.
  • the value is modified to the value corresponding to the USB 2.0 hub. That is, by switching the corresponding value in the USB host device to switch between the USB 3.0 state and the USB 2.0 state, whether the hub corresponding to the USB 3.0 is faulty or compared with the switching mode in the related art.
  • the USB3.0 to USB2.0 can still be switched, which improves the user experience.
  • the value corresponding to the USB 3.0 hub and the value corresponding to the USB 2.0 hub may be stored in a control register in the USB host device, that is, the value of the corresponding hub in the control register may be modified or set. To switch between the USB3.0 state and the USB2.0 state.
  • the value 2 set in the control register represents USB3.0
  • the value 1 represents the use of a dual bus structure, that is, USB3.0 and USB2.0 coexist
  • the value 0 represents the use of USB2.0
  • the default value is 1.
  • the value 1 After receiving the signal that the wireless network and/or wireless device is being used, the value 1 will be changed to 0, that is, the USB3.0 to USB2.0 switching is completed.
  • the above numerical values are only used as examples and are not used for limitation.
  • the value 0 can also indicate that USB 3.0 is used
  • the value 2 indicates that USB 2.0 is used.
  • the foregoing method may further The method includes: issuing a reset reset command to the USB 3.0 slave device, wherein the reset command is used to instruct the USB 3.0 slave device to communicate with the USB master device by using the USB2.0 protocol. It should be noted that the reset command can also be used to indicate that the connected USB device is re-identified. Through this step, the USB 3.0 slave device will eventually complete the information report and continue to work under the USB2.0 protocol.
  • the method may further include: receiving a switching instruction; wherein the switching instruction is used to indicate that the USB 3.0 bus is allowed to be switched to the USB 2.0 bus. That is, switching between USB 3.0 and USB 2.0 is performed after receiving the above switching instruction.
  • the foregoing receiving switching instruction may be expressed as: when the designated wireless network and/or the network where the designated wireless device is located is being used, and/or the network where the USB 3.0 slave device is located is being used, the switching may be directly triggered.
  • the command may also be expressed as: when the above condition is satisfied, the switching command is not triggered first, but the prompt information for prompting the user whether to perform the switching of the USB bus is first issued, and the instruction to perform the switching of the USB bus (ie, switching) is received. After the command), switching is performed, but it is not limited to this. It should be noted that the user is prompted to perform USB bus switching first. If the user instructs not to perform USB bus switching, it indicates that the user can accept the interference signal, so that it can be determined according to the user's instruction whether to perform switching, which is better. Improve user experience.
  • the method may further include: switching the USB 2.0 bus to the USB 3.0 bus when detecting that the USB 3.0 slave device pulls out the USB host device. That is, after detecting that the USB 3.0 slave device is unplugged, it switches back to the USB 3.0 bus.
  • the USB 2.0 bus may be switched to the USB 3.0 bus, or may not occur after step S204, for example, may be detected.
  • the USB3.0 slave device it is determined whether the USB3.0 slave device is inserted or unplugged from the USB host device.
  • step S204 is performed, and when the USB device is pulled out, the USB2.0 bus can be switched to the USB3.0 bus. But it is not limited to this.
  • the above specified wireless network may be a wireless fidelity WIFI, such as 2.4 GHz.
  • WIFI wireless fidelity
  • USB3.0 can cause certain interference to the WIFI
  • the frequency is within the predetermined range of 2.5GHz WIFI
  • the predetermined range can be 0.5GHz, that is, the frequency is WIFI between 2GHz and 3GHz, but is not limited to this.
  • the above specified wireless device may be a wireless mouse or other wireless device, such as a wireless earphone, and is not limited thereto, and the wireless device may also use a device of a frequency band within a predetermined range of 2.5 GHz.
  • the execution body of the foregoing steps may be a terminal, including a computer terminal, a mobile terminal, etc., or may be a server or the like, but is not limited thereto.
  • the USB host device may be a mobile terminal, a computer terminal, and is not limited thereto.
  • the USB 3.0 slave device may also be a mobile terminal or a computer terminal, but may also be a USB 3.0 device, such as USB 3. 0 wireless network card, etc., but is not limited to this.
  • the foregoing method may also be stored in a USB 3.0 slave device in a program manner.
  • the corresponding program of the method may be copied to the USB by means of a virtual optical disk.
  • the method is performed by the USB master device; of course, it can also be directly stored in the USB host device, and is not limited thereto.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
  • a universal serial bus USB switching device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and has not been described again.
  • the term “module” may implement a combination of software and/or hardware of a predetermined function. Do The apparatus described in the following embodiments is preferably implemented in software, but hardware, or a combination of software and hardware, is also possible and contemplated.
  • FIG. 3 is a structural block diagram of a universal serial bus USB switching apparatus according to an embodiment of the present invention. As shown in FIG. 3, the apparatus includes:
  • the judging module 32 is configured to determine, when the USB 3.0 interface of the universal serial bus USB host device is inserted into the USB 3.0 slave device, the network of the USB 3.0 slave device and the designated wireless network and/or the designated wireless Whether there is an interference signal between the networks where the device is located;
  • the switching module 34 is connected to the determination module 32 and is configured to switch the USB 3.0 bus to the USB 2.0 bus if the determination result is that there is an interference signal.
  • the determination module 32 determines the network where the USB 3.0 slave device is located and the designated wireless network and/or the designated wireless device. Whether there is an interference signal between the networks in which the network is located, and in the case where the judgment result is that there is an interference signal, the switching module 34 switches the USB 3.0 bus to the USB 2.0 bus, that is, the USB 3.0 interface of the USB host device is detected to be inserted.
  • USB3.0 slave device when there is interference signal, USB3.0 is switched to USB2.0, which circumvents the corresponding interference problem and solves the interference problem in USB3.0 overspeed transmission process in related art. .
  • the determining module 32 is further configured to detect whether the network where the USB 3.0 slave device is located is being used, and whether the network where the specified wireless network and/or the designated wireless device is located is being used. After detecting that the specified wireless network and/or the network where the designated wireless device is located is being used, and the network where the USB 3.0 slave device is located is also being used, determining the network where the USB 3.0 slave device is located and the designated wireless device and / or there is an interference signal between the networks where the specified wireless device is located.
  • the switching module 34 is further configured to switch the root hub of the USB host device connected to the USB 3.0 slave device from the USB 3.0 hub to the USB 2.0 hub.
  • the switching module 34 can set the USB host in the following manner.
  • the root hub connected to the USB3.0 slave device is switched from the USB3.0 hub to the USB2.0 hub: the value corresponding to the USB3.0 hub in the USB host device is modified to the value corresponding to the USB 2.0 hub. That is, the switching module 34 performs switching between the USB 3.0 state and the USB 2.0 state by modifying the corresponding value in the USB host device, so that whether the hub corresponding to the USB 3.0 appears compared with the switching mode in the related art.
  • the USB 3.0 to USB 2.0 can still be switched, which improves the user experience.
  • the value corresponding to the USB 3.0 hub and the value corresponding to the USB 2.0 hub may be stored in a control register in the USB host device, that is, the value of the corresponding hub in the control register may be modified or set. To switch between the USB3.0 state and the USB2.0 state.
  • the value 2 set in the control register represents USB3.0
  • the value 1 represents the use of a dual bus structure, that is, USB3.0 and USB2.0 coexist
  • the value 0 represents the use of USB2.0
  • the default value is 1.
  • the switching module 34 After receiving the signal that the wireless network and/or the wireless device is being used, the switching module 34 will change the value 1 to 0, that is, the USB 3.0 to USB 2.0 switching is completed.
  • the above numerical values are only used as examples and are not used for limitation.
  • the value 0 can also indicate that USB 3.0 is used
  • the value 2 indicates that USB 2.0 is used.
  • the apparatus may further include: a sending module, connected to the switching module 34, configured to issue a reset reset command to the USB 3.0 slave device, wherein the reset command is used to indicate the USB 3.0
  • the slave communicates with the USB master using the USB 2.0 protocol. It should be noted that the reset command can also be used to indicate that the connected USB device is re-identified. Through this step, the USB 3.0 slave device will eventually complete the information report and continue to work under the USB2.0 protocol.
  • the apparatus further includes: a receiving module, connected to the switching module 34, configured to receive a switching instruction, wherein the switching instruction is used to indicate that the USB 3.0 bus is allowed to be switched to the USB 2.0 bus. . That is, after receiving the switching instruction, the receiving module The switching module 34 performs switching between USB 3.0 and USB 2.0.
  • the receiving instruction of the upper receiving module may be expressed as: when the designated wireless network and/or the network where the designated wireless device is located is being used, and/or the network where the USB 3.0 slave device is located is directly available,
  • the triggering command it may be expressed that, when the above condition is met, the switching command is not triggered first, but the prompt information for prompting the user whether to perform the switching of the USB bus is first issued, and the instruction to perform the switching of the USB bus is received ( That is, after switching the command, switching is performed, but it is not limited to this.
  • the user is prompted to perform USB bus switching first. If the user instructs not to perform USB bus switching, it indicates that the user can accept the interference signal, so that it can be determined according to the user's instruction whether to perform switching, which is better. Improve user experience.
  • the switching module 34 is further configured to switch the USB 2.0 bus to the USB 3.0 bus in the event that the USB 3.0 slave device is detected to be unplugged from the device.
  • the foregoing specified wireless network may be a wireless fidelity WIFI, such as a 2.4 GHz WIFI, but is not limited thereto.
  • WIFI wireless fidelity
  • the predetermined range may be 0.5 GHz, that is, WIFI with a frequency between 2 GHz and 3 GHz, but is not limited thereto.
  • the above specified wireless device may be a wireless mouse or other wireless device, such as a wireless earphone, and is not limited thereto, and the wireless device may also use a device of a frequency band within a predetermined range of 2.5 GHz.
  • the foregoing device may be located in the USB host device, may be located in another USB 3.0 device such as a terminal, or may be located in the server, but is not limited thereto.
  • the USB host device may be a mobile terminal, a computer terminal, and is not limited thereto.
  • the second USB 3.0 may also be a mobile terminal or a computer terminal, but may also be a USB 3.0 device, such as USB 3. 0 wireless network card, etc., but is not limited to this.
  • each of the foregoing modules may be implemented by software or hardware.
  • the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor. Or; each of the above modules is located in a different processor in any combination.
  • a system including: a USB host device, a USB 3.0 slave device, and a USB 3.0 cable; wherein the USB host device and the USB 3.0 slave device are connected through a USB 3.0 cable,
  • the USB host device includes the USB switching device in Embodiment 2.
  • Embodiments of the present invention also provide a storage medium.
  • the above storage medium may be set to store program code for executing the steps of the method in Embodiment 1.
  • the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • a mobile hard disk e.g., a hard disk
  • magnetic memory e.g., a hard disk
  • a preferred embodiment of the present invention provides a USB 3.0 and USB 2.0 switching method, which can solve the interference problem caused by 2.4 GHz wireless transmission during USB 3.0 overspeed transmission.
  • the preferred embodiment of the present invention is capable of automatically detecting interference and controlling a Peripheral Component Interconnect (PCI) control register of the eXtensible Host Controller Interface (xHCI) on the host side.
  • PCI Peripheral Component Interconnect
  • the PCI control register can control whether the root hub to which the USB 3.0 host controller is connected is a USB 3.0 hub (HUB) or a USB 2.0 HUB, and the value of the control register can be configured to make the root The hub (ROOT HUB) switches to the USB2.0 state, so that the device is re-identified by USB2.0, which better solves the interference problem.
  • UOB USB 3.0 hub
  • ROOT HUB The hub
  • the system physical device provided by the preferred embodiment of the present invention includes a USB 3.0 host (corresponding to the USB host device in the above embodiment), a USB 3.0 cable, and a USB 3.0 wireless network card (corresponding to USB 3.0 in the above embodiment). From the device).
  • An application app is run in the USB3.0 host system in the embodiment of the present invention.
  • the app includes two large modules: an interference and anomaly detection module, and a USB HUB switching module. It should be noted that the function performed by the application APP is equivalent to the function performed by the method in the above embodiment.
  • the application app is stored in the flash memory of the USB3.0 wireless network card.
  • the USB3.0 wireless network card When the USB3.0 wireless network card is first connected to the USB3.0 host through the USB3.0 cable, the USB3.0 wireless network card will be virtualized. The form of the disc appears on the USB 3.0 host. This way the app can be copied or installed on a USB 3.0 host. The USB3.0 wireless network card is connected to the host again, and the application will run automatically.
  • the app's interference and anomaly detection module is used to detect whether the USB3.0 interface in the system is connected to the USB3.0 device. If the USB3.0 device is connected, the interference and anomaly detection module continues to detect whether there is a 2.4GHz wireless USB. The mouse is connected to the 2.4G WIFI network. If there is any data transmission, the message is sent to the USB HUB switching module (equivalent to the switching module in the above embodiment). If there is no USB 3.0 device connected or no data transmission is performed, no switching is performed.
  • the USB3.0 protocol specification states that the USB3.0 host controller is a dual bus structure with a USB2.0HUB and a USB3.0HUB.
  • the USB HUB switching module is used to manage the USB HUB used by the USB3.0 host controller. Once the interference message sent by the interference and abnormality detecting module is received (equivalent to the switching instruction in the above embodiment), the USB HUB switching module will The value of the control register is modified. For example, the value 2 indicates that the connection is USB3.0HUB; the value 1 indicates that the connection is using the dual bus structure, that is, USB3.0HUB and USB2.0HUB coexist; the value 0 indicates that the connection is USB2.0HUB.
  • the switch module will change the value from the default state 1 to 0, and the ROOT HUB connected to the USB3.0 wireless network card will switch from the USB3.0HUB to the HU2.0 of the USB2.0.
  • the HUB switching module will send a reset.
  • Our USB3.0 wireless network card is compatible with USB2.0 protocol, so after receiving the reset command, USB2.0HUB will communicate with our USB3.0 wireless network card.
  • the protocol used is USB2.0, USB3.0 wireless network card is finally The information will be reported and continued to work under the USB2.0 agreement.
  • USB HUB switching module After the USB3.0 wireless network card is removed, the USB HUB switching module will continue to work. After detecting that the USB3.0 device is unplugged, the control register to which the xHCI belongs will be switched from 0 to 1, without affecting the use of other USB3.0 devices.
  • This app is still valid for other USB3.0 devices, but requires user permission, otherwise it is only valid for this USB3.0 wireless network card. This feature can be used during the app installation phase or the post-set phase.
  • USB 3.0 is a physical connection diagram of a USB 3.0 system according to a preferred embodiment of the present invention. As shown in FIG. 4, the preferred embodiment needs to have a PC host with USB 3.0, one of which stores automatic detection interference and automatically Switch the executable program's USB3.0 wireless network card and a USB3.0 cable.
  • the PC host and the USB3.0 wireless network card connect the device to the USB3.0 interface of the host through a USB3.0 cable.
  • the host side should install a real-time monitoring program to monitor whether the host side is using 2.4G WIFI and wireless mouse and switch USB hub (USB HUB) according to the situation.
  • This monitor installation package is placed in a file system partition of the USB 3.0 wireless network card.
  • the wireless network card can report its own interface as a mass storage device interface.
  • the interface subclass code uses the Small Computer System Interface (SCSI) instruction set, and the interface protocol is batch (BULK-ONLY) transmission.
  • SCSI Small Computer System Interface
  • BULK-ONLY batch
  • the PC host The wireless network card is recognized as a virtual optical disk, and then the contents of the optical disk are read, and then the files stored in the wireless network card are read and installed on the PC host.
  • FIG. 5 is a schematic diagram of installation of an automatic detection and switching APP according to a preferred embodiment of the present invention.
  • the descriptor is a default control of a USB pipe established by a device and a host.
  • the read command of the host and the reply of the device are transmitted through the batch input (BULK IN) and the batch output (BULK OUT). After many readings, the contents of the disc are read to the PC side.
  • FIG. 6 is a schematic diagram of a relationship between a host application and each module according to a preferred embodiment of the present invention.
  • the host controller system of USB 3.0 is designed into two.
  • Set of HUB structure a set of HUB supports USB2.0 protocol
  • a set of HUB supports USB3.0 protocol is a dual bus structure.
  • the specific USB 2.0 HUB work or the USB 3.0 HUB work depends on whether the USB 3.0 cable or the USB 2.0 cable is connected.
  • this interface can control whether the control register written by USB3.0 host controller is 0 or 1, 0 means only enable USB2.0HUB, 1 means USB2 Both .0HUB and USB3.0HUB are enabled. Therefore, we can dynamically support the USB3.0 protocol or the USB2.0 protocol on the PC side, and then control the USB3.0 device to work in the USB2.0 mode according to the selection.
  • the module responsible for the control register in the USB 3.0 host controller is the HUB switching module of the host application of the present invention.
  • the premise of the HUB switching module for register writing is the result of the wireless wifi detection module and the wireless mouse detection module.
  • the wireless wifi detecting module of the preferred embodiment detects a wireless network connection, and obtains a connection type, a used frequency, and a use state through a wireless network connection; the wireless mouse detection module can determine the connection type by detecting the HID driver and the PS/2 driver operation interface. ,status of use.
  • the above detection methods include, but are not limited to, the above methods.
  • FIG. 7 is a structural block diagram of a USB3.0 host controller according to a preferred embodiment of the present invention. As shown in FIG. 7, the preferred embodiment is described by the simplest interface, and only a USB 2.0 interface and a motherboard are connected. USB3.0 interface.
  • the actual USB 3.0 host controller may be complex and will have one or more hubs (HUBs) internally, extending multiple USB 2.0 interfaces and multiple USB 3.0 interfaces.
  • UOBs hubs
  • the USB3.0 host controller XHC fixes the HUB control register to the USB3.0 and USB2.0HUB coexistence mode.
  • the operation interface of the HUB control register is still retained in the kernel.
  • the kernel provides usb_enable_xhci_ports() and The usb_disable_xhci_ports() function is used to enable and disable USB3.0HUB. So abstract this type of interface as a control register switch (S0 in the figure), the application chooses whether to disable USB3.0HUB by controlling the register switch.
  • C2 will choose to connect the dotted line to the HCP2 hub interface according to the connected USB device type, and hang it to USB3.0HUB or black. Connect the cable to HCP1 and hang it to USB2.0HUB.
  • USB2.0 device If S0 is set to 0, then regardless of whether the C2 interface is plugged into a USB2.0 device or a USB3.0 device, the black solid cable will be connected to the HCP1 hub interface and connected to the USB2.0HUB. The final device will be recognized as USB2.0 device.
  • FIG. 8 is a structural block diagram of a module in an application according to a preferred embodiment of the present invention.
  • the monitoring module includes a monitoring module, a message collection and judgment module, an automatic switching module, and a device control module, wherein the monitoring module is divided into three.
  • the application will first monitor the USB3.0 port. If a device is plugged in the USB3.0 port, the descriptor information of the USB device will be further obtained. If a BOS (Binary Device Object Store) or ECD (Endpoint Companion Descriptor) descriptor is obtained ( Including but not limited to this USB3.0 judgment mode), it is determined that the USB 3.0 wireless network card is accessed, otherwise the USB 3.0 device will be inserted. After monitoring the USB3.0 device, a message collection and judgment module will be sent.
  • BOS Binary Device Object Store
  • ECD Endpoint Companion Descriptor
  • the WIFI monitoring module and the wireless mouse monitoring module will detect whether the PC host has a 2.4G WIFI service running, or whether the wireless mouse is in use, and the result will be Feedback to the message collection and judgment module, the message collection and judgment module internally makes a judgment, comprehensively judges whether the use of the USB3.0 device will affect the 2.4GHz wireless, if it affects, then the automatic switching module is notified, and the automatic switching module will rewrite the PCI. Control the value of the register, complete the ROOT HUB switch, switch to complete the message to notify the device control module, the device control module will perform bus reset, after the restart, the USB3.0 wireless network card device will be mounted to the USB2.0 HUB to USB2 The configuration of .0 is reported.
  • FIG. 9 is a schematic flowchart of an application installation according to a preferred embodiment of the present invention.
  • the following is a detailed description of the USB 3.0 PC on the USB 3.0 PC host, and the network card enumerates itself as a virtual one.
  • CD for the host to recognize, the PC host will automatically run after reading the contents of the CD (autorun), and then call the installation process, the "Continue to continue installation" interface appears, if the user does not choose to install, then wait, if you choose to install Then, the application process that detects interference and performs automatic adaptation switching is installed on the PC host. Then the USB3.0 NIC is switched to another working state - NIC mode - to continue working.
  • the application process installed at this time has started to work and is monitored in real time. After the above process completes the installation of the host-side application, the application starts running.
  • FIG. 10 is a schematic flowchart of a USB 3.0 switching method according to a preferred embodiment of the present invention. As shown in FIG. 10, the method (ie, the foregoing application) includes:
  • the application starts.
  • the USB3.0 interface monitoring module starts monitoring, detects whether the USB3.0 device is plugged in or unplugged, and continues to detect if no device is detected. If the USB3.0 device is detected to be inserted, the WIFI detection module, the wireless mouse monitoring module, and the like are triggered. Wireless device monitoring module. If the USB 3.0 device is detected to be unplugged, the previously switched USB bus is switched back to the USB 3.0 mode.
  • the WIFI monitoring module first monitors whether the WIFI frequency is 2.4 GHz through the API interface. If not, the WIFI monitoring module function is completed; otherwise, the WIFI connection usage is monitored, and if it is being used, then the message collection and judgment module is fed back.
  • the wireless mouse monitoring module also determines whether it is in use and feeds back the usage to the message collection and judgment module.
  • the invention includes, but is not limited to, the use of the two wireless products described above, thus adding one other wireless device monitoring.
  • the USB3.0 interface monitoring module detects that the USB3.0 device is plugged in, and then continues to detect whether there is a network data packet on the USB3.0 network card interface, and if so, samples it. The result is fed back to the message collection and judgment module.
  • the message collection and judgment module comprehensively considers the information fed back by the above several monitoring modules, makes a judgment, prompts the user to have interference, and performs USB bus switching of USB3.0-USB2.0. If the user gives up, the user accepts the interference; then the program exits and re-executes.
  • USB3.0 the interface provided by PCI is called to modify the bus register value, and the USB3.0 bus will switch to the USB2.0 bus. Then the program sends a bus reset command, and the device is powered off and restarted. After the reboot is completed, although the USB3.0 device is still connected to the USB3.0 cable and USB3.0 Host interface, but at this time, the host interface of USB3.0 is connected to the USB2.0 bus, and the USB device will report in the configuration of USB2.0. The program loops back from the beginning. Through the above steps, the impact of USB3.0 on WIFI and other wireless 2.4GHz communications is circumvented.
  • the application for monitoring interference and automatic switching in the preferred embodiment of the present invention is stored in the USB wireless network card.
  • the installation program of the application can be placed on the server side after modification, and the wireless network card can be directly downloaded and installed without using the wireless network card.
  • the application can also add other USB3.0 devices to the monitoring range, which can not only solve the interference generated by the USB3.0 wireless network card, but also apply to other USB3.0 terminals.
  • PID port ID
  • VID voltage identification
  • interface judgment of other USB3.0 terminals to the application.
  • the preferred embodiment of the present invention can solve the interference problem of 2.4 GHz WIFI and 2.4 GHz wireless USB mouse when USB 3.0 overspeed transmission.
  • this method is simple and convenient to implement, and relies entirely on software.
  • the method does not require modifying the circuit, adding additional hardware components, and saving hardware costs.
  • the user only needs to install the application for monitoring interference to the USB3.0 host, and the application can complete the interference monitoring, and automatically switch the USB bus from 3.0 to 2.0 by user prompting, and the user experience is good.
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the USB 3.0 interface of the USB host device when the USB 3.0 interface of the USB host device is detected to be inserted into the USB 3.0 slave device, the network where the USB 3.0 slave device is located and the designated wireless network and/or Or whether there is an interference signal between the networks where the wireless device is located, and if the judgment result is that there is an interference signal, the USB3.0 bus is switched to the USB2.0 bus, that is, the USB 3.0 interface of the USB host device is detected.
  • USB3.0 slave device is inserted and there is an interference signal
  • USB3.0 is switched to USB2.0, thereby circumventing the corresponding interference problem, and solving the interference occurring in the USB3.0 overspeed transmission process in the related art. problem.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

A USB switching method, device, and system. The method comprises: if a USB 3.0 interface of a USB master apparatus is inserted with a USB 3.0 slave apparatus, determining whether an interference signal exists between a network of the USB 3.0 slave apparatus and a specified wireless network and/or a network of a specified wireless apparatus (S202); and if the determination result is that an interference signal exists, switching from a USB 3.0 bus to a USB 2.0 bus (S204). The method of the present invention solves the problem of the related art in which interference occurs during a USB 3.0 high-speed transmission process.

Description

USB的切换方法及装置、系统USB switching method, device and system 技术领域Technical field
本发明涉及通信领域,具体而言,涉及一种通用串行总线(Universal Serial Bus,简称为USB)的切换方法及装置、系统。The present invention relates to the field of communications, and in particular to a universal serial bus (USB) switching method, apparatus, and system.
背景技术Background technique
近几年,随着个人计算机(Personal Computer,简称PC)厂商在机器上逐步增加了USB3.0主机控制器芯片,USB3.0设备的生产和应用越来越广泛,人们也享受到了USB3.0技术在数据传输上的高速率。In recent years, with the personal computer (Personal Computer, PC for short) manufacturers gradually add USB3.0 host controller chip on the machine, the production and application of USB3.0 device is more and more extensive, people also enjoy USB3.0 The high rate of technology in data transmission.
但是由于下面原因,USB3.0的使用上还有一些影响用户体验的东西:But for the following reasons, there are some things that affect the user experience in the use of USB 3.0:
其一:USB3.0影响2.4GHz的通信,任何有线信号都会向外辐射电磁波,除非它是直流电(没有频率变化)、或者完全屏蔽。干扰的强度与线缆上传输的信号(如电压、电流、频率)有关。所以,尽管USB3.0是有线信号,但仍然可能向外辐射电磁波,对其它信号产生干扰。尽管USB3.0的传输频率是5GHz串行,但USB3.0使用4条数据线组成2组,每组负责一个传输方向,实现全双工双向5GHz,而每条数据线的基准频率是2.5GHz,这个频率距离2.4G无线保真(WiFi)的频率太近,而高频设备大多数都使用了SSC技术,使得信号不完全分布在一个固定频率上,所以就波及了2.5GHz附近的其它频率,即USB3.0对WiFi和和其他使用2.4GHz频段的产品产生了较大的干扰。One: USB 3.0 affects 2.4 GHz communication, and any wired signal will radiate electromagnetic waves outward unless it is DC (no frequency change) or completely shielded. The intensity of the interference is related to the signals transmitted on the cable (such as voltage, current, frequency). Therefore, although USB3.0 is a wired signal, it is still possible to radiate electromagnetic waves outward and interfere with other signals. Although the transmission frequency of USB3.0 is 5GHz serial, USB3.0 uses 4 data lines to form 2 groups, each group is responsible for one transmission direction, achieving full-duplex bidirectional 5GHz, and the reference frequency of each data line is 2.5GHz. This frequency is too close to the frequency of 2.4G Wireless Fidelity (WiFi), and most of the high-frequency equipment uses SSC technology, so that the signal is not completely distributed on a fixed frequency, so it affects other frequencies around 2.5GHz. That is, USB 3.0 has a large interference with WiFi and other products using the 2.4 GHz band.
其二:USB3.0的主机控制器也是近几年才开始研发生产,各个不同的生产厂家驱动不同,这就难免会出现兼容性问题。有时候USB设备使用过程中突然出现主机控制器黄叹号、甚至无端口问题,只有拔插才能继续使用;有时候拔插无法恢复,只能重新启动操作系统才能继续使用,以上种种皆是USB3.0设备是与USB3.0主机控制器同时间段由不同的设备和芯片厂商生产的,无法经过足够多的兼容性测试导致。这个只能通过设 备和主机驱动厂商对产品的不断完善更新来解决。Second: The host controller of USB3.0 has only begun to develop and produce in recent years. Different manufacturers have different drivers, which will inevitably lead to compatibility problems. Sometimes, when the USB device is in use, the host controller has a yellow exclamation mark and even no port problem. Only plugging and unplugging can continue to use; sometimes the plugging cannot be restored, and only the operating system can be restarted to continue using it. All of the above are USB3. The 0 device is manufactured by different device and chip manufacturers at the same time as the USB3.0 host controller, and cannot be tested by enough compatibility tests. This can only be set The backup and host driver manufacturers continue to improve the product to solve the problem.
相关技术中,USB3.0的无线网卡使用与USB2.0相同,只不过USB3.0的使用需要配合USB3.0主机、USB3.0无线网卡以及USB3.0线。USB3.0无线网卡插入USB3.0主机接口中,会以虚拟光驱的方式上报给主机操作系统,用户安装虚拟光驱里面的应用以及驱动之后,USB3.0无线网卡会被切换到工作模式(包含调制解调器modem或网络驱动接口规范(Network Diver Interface Specification,简称NDIS)的网卡接口),此时用户即可使用无线网络进行联网操作。In the related art, the wireless network card of USB3.0 is the same as USB2.0, but the use of USB3.0 needs to cooperate with USB3.0 host, USB3.0 wireless network card and USB3.0 line. The USB3.0 wireless network card is inserted into the USB3.0 host interface and reported to the host operating system as a virtual optical drive. After the user installs the application and driver in the virtual optical drive, the USB3.0 wireless network card will be switched to the working mode (including the modem). The modem or the network interface interface of the Network Diver Interface Specification (NDIS) can be used by the user to perform network operations using the wireless network.
然而,可能会遇到一插上USB3.0的无线网卡进行高速下载或者使用USB3.0的硬盘进行文件拷贝,WIFI就出现降速或者中断的问题,或者无线USB鼠标就会反应很慢,这就是USB3.0超速传输所产生的电磁波对2.4GHz频率的干扰问题。However, you may encounter a wireless network card plugged into USB3.0 for high-speed download or use USB3.0 hard disk for file copying, WIFI will slow down or interrupt, or wireless USB mouse will react very slowly, this It is the interference of electromagnetic waves generated by USB3.0 overspeed transmission to the 2.4 GHz frequency.
目前针对USB3.0超速传输过程中出现的干扰问题的解决方法主要是针对USB3.0接口的电磁屏蔽,要么是增加屏蔽罩,要么是修改USB电路结构,都是围绕物理属性来修改。这种修改需要增加硬件成本,而且没有统一的规范,不同的硬件厂家可能设计出来的东西千差万别。At present, the solution to the interference problem occurring in the USB 3.0 overspeed transmission process is mainly for the electromagnetic shielding of the USB3.0 interface, either to increase the shield or to modify the USB circuit structure, which is modified around the physical properties. This modification requires an increase in hardware costs, and there is no uniform specification. Different hardware manufacturers may design things that vary widely.
软件上对此问题也没有很好的解决方法,基本上是规避,并且在软件上述解决的是USB3.0集线器HUB无法使用问题,其中安装了一个应用,此应用检测到HUB异常后给USB3.0设备下发模式切换指令,从USB3.0模式切换到USB2.0模式,从而规避了USB3.0无法继续使用的问题。此专利有一个缺点就是应用必须提前检测到异常,或者所出现的异常不影响USB切换指令的下发,此专利的USB3.0模式才会切换成USB2.0模式,一旦USB所有管道都不通,那么USB切换指令根本就没法下发到USB设备侧,也就无法切换了。There is no good solution to this problem in the software, basically it is circumventing, and the software above solves the problem that the USB3.0 hub HUB cannot be used, and an application is installed. This application detects the HUB abnormality and gives USB3. 0 The device sends a mode switching command to switch from USB3.0 mode to USB2.0 mode, thus avoiding the problem that USB3.0 cannot be used anymore. One disadvantage of this patent is that the application must detect the abnormality in advance, or the abnormality does not affect the delivery of the USB switching instruction. The USB3.0 mode of this patent will be switched to the USB2.0 mode. Once all the USB ports are disabled, Then the USB switching command cannot be sent to the USB device side at all, and it cannot be switched.
针对相关技术中USB3.0超速传输过程中出现的干扰问题,目前尚未提出有效的解决方案。 In view of the interference problem occurring in the USB 3.0 overspeed transmission process in the related art, an effective solution has not been proposed yet.
发明内容Summary of the invention
本发明实施例提供了一种USB的切换方法及装置、系统,以至少解决相关技术中USB3.0超速传输过程中出现的干扰问题。The embodiment of the invention provides a USB switching method, device and system to solve at least the interference problem occurring in the USB 3.0 overspeed transmission process in the related art.
根据本发明的一个实施例,提供了一种通用串行总线USB的切换方法,包括:在检测到通用串行总线USB主设备的USB3.0接口插入了USB3.0从设备的情况下,判断USB3.0从设备所在的网络与指定无线网络和/或指定无线设备所在的网络之间是否存在干扰信号;在判断结果为存在干扰信号的情况下,将USB3.0总线切换至USB2.0总线。According to an embodiment of the present invention, a method for switching a universal serial bus USB is provided, including: determining that a USB 3.0 interface of a universal serial bus USB host device is inserted into a USB 3.0 slave device Whether there is interference signal between the network where the USB3.0 device is located and the network where the specified wireless network and/or the specified wireless device is located; if the judgment result is that there is an interference signal, the USB3.0 bus is switched to the USB2.0 bus. .
在本发明实施例中,将USB3.0总线切换至USB2.0总线包括:将USB主设备中与USB3.0从设备连接的根集线器由USB3.0集线器切换到USB2.0集线器。In the embodiment of the present invention, switching the USB 3.0 bus to the USB 2.0 bus includes: switching the root hub of the USB host device connected to the USB 3.0 slave device from the USB 3.0 hub to the USB 2.0 hub.
在本发明实施例中,通过以下方式将USB主设备中与USB3.0从设备连接的根集线器由USB3.0集线器切换到USB2.0集线器:将USB主设备中与USB3.0集线器对应的取值修改为与USB2.0集线器对应的取值。In the embodiment of the present invention, the root hub connected to the USB 3.0 slave device in the USB host device is switched from the USB 3.0 hub to the USB 2.0 hub by: corresponding to the USB 3.0 hub in the USB host device. The value is modified to the value corresponding to the USB 2.0 hub.
在本发明实施例中,在将USB3.0总线切换至USB2.0总线之后,方法还包括:向USB3.0从设备下发重置reset指令,其中,reset指令用于指示USB3.0从设备使用USB2.0协议与USB主设备进行通信。In the embodiment of the present invention, after the USB 3.0 bus is switched to the USB 2.0 bus, the method further includes: issuing a reset reset command to the USB 3.0 slave device, wherein the reset command is used to indicate the USB 3.0 slave device. Communicate with a USB host device using the USB 2.0 protocol.
在本发明实施例中,在将USB3.0总线切换至USB2.0总线之前,上述方法还包括:接收切换指令;其中,上述切换指令用于指示允许将USB3.0总线切换至USB2.0总线。In the embodiment of the present invention, before the USB 3.0 bus is switched to the USB 2.0 bus, the method further includes: receiving a switching instruction, wherein the switching instruction is used to indicate that the USB 3.0 bus is allowed to be switched to the USB 2.0 bus. .
在本发明实施例中,在将USB3.0总线切换至USB2.0总线之后,方法还包括:在检测到USB3.0从设备拔出USB主设备的情况下,将USB2.0总线切换至USB3.0总线。In the embodiment of the present invention, after the USB 3.0 bus is switched to the USB 2.0 bus, the method further includes: switching the USB 2.0 bus to the USB 3 when detecting that the USB 3.0 slave device pulls out the USB host device .0 bus.
在本发明实施例中,指定无线网络包括无线保真WIFI,指定无线设备包括:无线鼠标。In the embodiment of the present invention, the designated wireless network includes a wireless fidelity WIFI, and the designated wireless device includes: a wireless mouse.
根据本发明的另一个实施例,提供了一种通用串行总线USB的切换装置,包括:判断模块,设置为在检测到通用串行总线USB主设备的 USB3.0接口插入了USB3.0从设备的情况下,判断USB3.0从设备所在的网络与指定无线网络和/或指定无线设备所在的网络之间是否存在干扰信号;切换模块,设置为在判断结果为存在干扰信号的情况下,将USB3.0总线切换至USB2.0总线。According to another embodiment of the present invention, there is provided a universal serial bus USB switching apparatus, comprising: a determining module configured to detect a universal serial bus USB host device When the USB3.0 interface is inserted into the USB 3.0 slave device, it is determined whether there is an interference signal between the network where the USB 3.0 slave device is located and the network where the specified wireless network and/or the designated wireless device is located; the switching module is set to When the result of the judgment is that there is an interference signal, the USB 3.0 bus is switched to the USB 2.0 bus.
在本发明实施例中,切换模块还设置为将USB主设备中与USB3.0从设备连接的根集线器由USB3.0集线器切换到USB2.0集线器。In the embodiment of the present invention, the switching module is further configured to switch the root hub of the USB host device connected to the USB 3.0 slave device from the USB 3.0 hub to the USB 2.0 hub.
在本发明实施例中,上述切换模块通过以下方式将USB主设备中与USB3.0从设备连接的根集线器由USB3.0集线器切换到USB2.0集线器:将USB主设备中与USB3.0集线器对应的取值修改为与USB2.0集线器对应的取值。In the embodiment of the present invention, the switching module switches the root hub connected to the USB 3.0 slave device in the USB host device from the USB 3.0 hub to the USB 2.0 hub in the following manner: the USB host device and the USB 3.0 hub The corresponding value is modified to the value corresponding to the USB2.0 hub.
在本发明实施例中,上述装置还包括:发送模块,设置为向USB3.0从设备下发重置reset指令,其中,reset指令用于指示USB3.0从设备使用USB2.0协议与USB主设备进行通信。In the embodiment of the present invention, the device further includes: a sending module, configured to send a reset reset command to the USB 3.0 slave device, wherein the reset command is used to instruct the USB 3.0 slave device to use the USB2.0 protocol and the USB host The device communicates.
在本发明实施例中,上述装置还包括:接收模块,设置为接收切换指令,其中,上述切换指令用于指示允许将USB3.0总线切换至USB2.0总线。In an embodiment of the invention, the apparatus further includes: a receiving module configured to receive a switching instruction, wherein the switching instruction is used to indicate that the USB 3.0 bus is allowed to be switched to the USB 2.0 bus.
在本发明实施例中,切换模块还设置为在检测到USB3.0从设备拔出USB主设备的情况下,将USB2.0总线切换至USB3.0总线。In the embodiment of the present invention, the switching module is further configured to switch the USB 2.0 bus to the USB 3.0 bus when detecting that the USB 3.0 slave device pulls out the USB host device.
在本发明实施例中,指定无线网络包括无线保真WIFI,指定无线设备包括:无线鼠标。In the embodiment of the present invention, the designated wireless network includes a wireless fidelity WIFI, and the designated wireless device includes: a wireless mouse.
根据本发明的另一个实施例,提供了一种系统,包括:USB主设备、USB3.0从设备和USB3.0线缆;其中,USB主设备包括权利要求9至16中任一项的装置。According to another embodiment of the present invention, there is provided a system comprising: a USB host device, a USB 3.0 slave device and a USB 3.0 cable; wherein the USB host device comprises the device of any one of claims 9 to 16. .
根据本发明的又一个实施例,还提供了一种存储介质。该存储介质设置为存储用于执行以下步骤的程序代码:在检测到通用串行总线USB主设备的USB3.0接口插入了USB3.0从设备的情况下,判断USB3.0从设备所在网络与指定无线网络和/或指定无线设备所在的网络之间是否存在干 扰信号;在判断结果为存在干扰信号的情况下,将USB3.0总线切换至USB2.0总线。According to still another embodiment of the present invention, a storage medium is also provided. The storage medium is configured to store program code for performing the following steps: in the case where the USB 3.0 interface of the universal serial bus USB host device is inserted and the USB 3.0 slave device is inserted, the network of the USB 3.0 slave device is determined Specifies whether there is a dry network between the wireless network and/or the network where the specified wireless device is located The scramble signal; in the case where the judgment result is that there is an interference signal, the USB 3.0 bus is switched to the USB 2.0 bus.
通过本发明,由于在检测到USB主设备的USB3.0接口插入了USB3.0从设备的情况下,通过判断USB3.0从设备所在的网络与指定无线网络和/或指定无线设备所在的网络之间是否存在干扰信号,并且在判断结果为存在干扰信号的情况下,将USB3.0总线切换至USB2.0总线,即在检测到USB主设备的USB3.0接口插入了USB3.0从设备的情况下,且存在干扰信号时,将USB3.0切换为USB2.0,进而规避了相应的干扰问题,解决了相关技术中USB3.0超速传输过程中出现的干扰问题。According to the present invention, since the USB 3.0 interface of the USB host device is detected to be inserted into the USB 3.0 slave device, the network in which the USB 3.0 slave device is located and the network in which the designated wireless network and/or the designated wireless device are located are determined. Whether there is an interference signal between, and if the judgment result is that there is an interference signal, the USB3.0 bus is switched to the USB2.0 bus, that is, the USB 3.0 interface of the USB host device is detected and the USB 3.0 slave device is inserted. In the case of interference signal, USB3.0 is switched to USB2.0, thereby avoiding the corresponding interference problem, and solving the interference problem occurring in the USB3.0 overspeed transmission process in the related art.
附图说明DRAWINGS
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the invention, and are intended to be a part of the invention. In the drawing:
图1是本发明实施例的一种USB的切换方法的计算机终端的硬件结构框图;1 is a block diagram showing the hardware structure of a computer terminal of a USB switching method according to an embodiment of the present invention;
图2是根据本发明实施例的USB的切换方法的流程图;2 is a flowchart of a method for switching a USB according to an embodiment of the present invention;
图3是根据本发明实施例的通用串行总线USB的切换装置的结构框图;3 is a block diagram showing the structure of a universal serial bus USB switching apparatus according to an embodiment of the present invention;
图4是根据本发明优选实施例提供的USB3.0系统物理连接图;4 is a physical connection diagram of a USB 3.0 system according to a preferred embodiment of the present invention;
图5是根据本发明优选实施例提供的自动检测和切换APP的安装示意图;FIG. 5 is a schematic diagram of installation of an automatic detection and switching APP according to a preferred embodiment of the present invention; FIG.
图6是根据本发明优选实施例提供的主机应用程序与各模块之间的关系示意图;6 is a schematic diagram of a relationship between a host application and each module according to a preferred embodiment of the present invention;
图7是根据本发明优选实施例提供的USB3.0主机控制器结构框图;7 is a structural block diagram of a USB 3.0 host controller according to a preferred embodiment of the present invention;
图8是根据本发明优选实施例提供的应用程序中模块的结构框图;FIG. 8 is a structural block diagram of a module in an application according to a preferred embodiment of the present invention; FIG.
图9是根据本发明优选实施例提供的应用程序安装的流程示意图; 9 is a schematic flowchart of application installation according to a preferred embodiment of the present invention;
图10是根据本发明优选实施例提供的USB3.0切换方法的流程示意图。FIG. 10 is a schematic flowchart diagram of a USB 3.0 switching method according to a preferred embodiment of the present invention.
具体实施方式detailed description
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。The invention will be described in detail below with reference to the drawings in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It is to be understood that the terms "first", "second" and the like in the specification and claims of the present invention are used to distinguish similar objects, and are not necessarily used to describe a particular order or order.
实施例1Example 1
本申请实施例1所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在计算机终端上为例,图1是本发明实施例的一种USB的切换方法的计算机终端的硬件结构框图。如图1所示,计算机终端10可以包括一个或多个(图中仅示出一个)处理器102(处理器102可以包括但不限于微处理器(Microcontroller Unit,简称MCU)或可编程逻辑器件(Field-Programmable Gate Array,简称FPGA)等的处理装置)、用于存储数据的存储器104、以及用于通信功能的传输装置106。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,计算机终端10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiment provided by Embodiment 1 of the present application can be executed in a mobile terminal, a computer terminal or the like. Taking a computer terminal as an example, FIG. 1 is a hardware block diagram of a computer terminal of a USB switching method according to an embodiment of the present invention. As shown in FIG. 1, computer terminal 10 may include one or more (only one shown) processor 102 (processor 102 may include, but is not limited to, a Microcontroller Unit (MCU) or a programmable logic device. A processing device such as a Field-Programmable Gate Array (FPGA), a memory 104 for storing data, and a transmission device 106 for a communication function. It will be understood by those skilled in the art that the structure shown in FIG. 1 is merely illustrative and does not limit the structure of the above electronic device. For example, computer terminal 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG.
存储器104可用于存储应用软件的软件程序以及模块,如本发明实施例中的通用串行总线USB的切换方法对应的程序指令/模块,处理器102通过运行存储在存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至计算机终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。 The memory 104 can be used to store software programs and modules of application software, such as program instructions/modules corresponding to the switching method of the universal serial bus USB in the embodiment of the present invention, and the processor 102 runs the software programs and modules stored in the memory 104. In order to perform various functional applications and data processing, the above method is implemented. Memory 104 may include high speed random access memory, and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory. In some examples, memory 104 may further include memory remotely located relative to processor 102, which may be coupled to computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机终端10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。Transmission device 106 is for receiving or transmitting data via a network. The network specific examples described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.
在本实施例中提供了一种运行于上述计算机终端的通用串行总线USB的切换方法,图2是根据本发明实施例的USB的切换方法的流程图,如图2所示,该流程包括如下步骤:In this embodiment, a method for switching a universal serial bus USB running on the computer terminal is provided. FIG. 2 is a flowchart of a method for switching a USB according to an embodiment of the present invention. As shown in FIG. 2, the process includes The following steps:
步骤S202,在检测到通用串行总线USB主设备的USB3.0接口插入了USB3.0从设备的情况下,判断USB3.0从设备所在的网络与指定无线网络和/或指定无线设备所在的网络之间是否存在干扰信号;Step S202, when it is detected that the USB3.0 interface of the universal serial bus USB host device is inserted into the USB3.0 slave device, determining that the network where the USB 3.0 slave device is located and the designated wireless network and/or the designated wireless device are located. Whether there is interference signal between networks;
步骤S204,在判断结果为存在干扰信号的情况下,将USB3.0总线切换至USB2.0总线。In step S204, if the result of the determination is that there is an interference signal, the USB 3.0 bus is switched to the USB 2.0 bus.
通过上述步骤,由于在检测到USB主设备的USB3.0接口插入了USB3.0从设备的情况下,通过判断USB3.0从设备所在的网络与指定无线网络和/或指定无线设备所在的网络之间是否存在干扰信号,并且在判断结果为存在干扰信号的情况下,将USB3.0总线切换至USB2.0总线,即在检测到USB主设备的USB3.0接口插入了USB3.0从设备的情况下,且存在干扰信号时,将USB3.0切换为USB2.0,进而规避了相应的干扰问题,解决了相关技术中USB3.0超速传输过程中出现的干扰问题。Through the above steps, since the USB 3.0 interface of the USB host device is detected to be inserted into the USB 3.0 slave device, the network where the USB 3.0 slave device is located and the network where the specified wireless network and/or the designated wireless device are located are determined. Whether there is an interference signal between, and if the judgment result is that there is an interference signal, the USB3.0 bus is switched to the USB2.0 bus, that is, the USB 3.0 interface of the USB host device is detected and the USB 3.0 slave device is inserted. In the case of interference signal, USB3.0 is switched to USB2.0, thereby avoiding the corresponding interference problem, and solving the interference problem occurring in the USB3.0 overspeed transmission process in the related art.
需要说明的是,步骤S202可以包括:检测USB3.0从设备所在的网络是否被使用,以及检测上述指定无线网络和/或指定无线设备所在的网络是否正在被使用;在检测到指定无线网络和/或指定无线设备所在的网络正在被使用且所述USB3.0从设备所在的网络正在被使用的情况下,确定USB3.0从设备所在的网络与指定无线网络和/或指定无线设备所在的网络之间存在干扰信号。 It should be noted that step S202 may include: detecting whether a network where the USB 3.0 slave device is located is used, and detecting whether the specified wireless network and/or a network where the specified wireless device is located is being used; detecting the specified wireless network and / or if the network where the specified wireless device is located is being used and the network where the USB 3.0 slave device is located is being used, it is determined that the network where the USB 3.0 slave device is located and the designated wireless network and/or the designated wireless device are located. There is an interference signal between the networks.
需要说明的是,上述检测指定无线网络和/或指定无线设备所在的网络正在被使用的方式可以有多种,在本发明的一个实施例中,上述检测方式可以表现为检测在指定无线网络上和/或指定无线设备所在的网络上是否有业务在执行,如果有,可以认为是该指定无线网络和/或指定无线设备所在的网络正在被使用,但并不限于此。It should be noted that, in the foregoing embodiment, the detection mode may be performed on the designated wireless network, in one embodiment of the present invention, where the network in which the specified wireless network and/or the designated wireless device are located may be used. And/or whether the service on the network where the specified wireless device is located is executed, and if so, the network in which the designated wireless network and/or the designated wireless device is located is being used, but is not limited thereto.
在本发明的一个实施例中,上述步骤S204可以表现为:将USB主设备中与USB3.0从设备连接的根集线器由USB3.0集线器切换到USB2.0集线器。In an embodiment of the present invention, the foregoing step S204 may be performed by: switching a root hub in the USB host device connected to the USB 3.0 slave device from a USB 3.0 hub to a USB 2.0 hub.
在本发明实施例中,可以通过以下方式将USB主设备中与USB3.0从设备连接的根集线器由USB3.0集线器切换到USB2.0集线器:将USB主设备中与USB3.0集线器对应的取值修改为与USB2.0集线器对应的取值。即通过修改USB主设备中的相应值来进行USB3.0状态和USB2.0状态之间的切换,使得与相关技术中的切换方式相比,在USB3.0对应的集线器是否出现了故障或者是USB所有的管道都不通的情况下,仍然能够实现USB3.0到USB2.0的切换,更好得提高了用户的体验度。In the embodiment of the present invention, the root hub connected to the USB 3.0 slave device in the USB host device can be switched from the USB 3.0 hub to the USB 2.0 hub by corresponding to the USB 3.0 hub in the USB host device. The value is modified to the value corresponding to the USB 2.0 hub. That is, by switching the corresponding value in the USB host device to switch between the USB 3.0 state and the USB 2.0 state, whether the hub corresponding to the USB 3.0 is faulty or compared with the switching mode in the related art. When all the USB pipes are not connected, the USB3.0 to USB2.0 can still be switched, which improves the user experience.
具体地,可以与USB3.0集线器对应的取值和与USB2.0集线器对应的取值可以存储在USB主设备中的控制寄存器中,即可以通过修改或者设置控制寄存器中相应的集线器的取值,来进行USB3.0状态和USB2.0状态之间的切换。Specifically, the value corresponding to the USB 3.0 hub and the value corresponding to the USB 2.0 hub may be stored in a control register in the USB host device, that is, the value of the corresponding hub in the control register may be modified or set. To switch between the USB3.0 state and the USB2.0 state.
以下举例说明,比如在控制寄存器中设置的数值2代表使用的是USB3.0,数值1代表使用的是双总线结构,即USB3.0和USB2.0共存,数值0代表使用的是USB2.0,默认值为数值1,在接收到无线网络和/或无线设备正在被使用的信号后,会将数值1修改为0,即完成了USB3.0到USB2.0的切换。需要说明的是,上述数值代表的意义仅仅用于举例,并不用来进行限定,比如数值0也可以表示使用的是USB3.0,数值2代表使用的是USB2.0。The following example shows that, for example, the value 2 set in the control register represents USB3.0, the value 1 represents the use of a dual bus structure, that is, USB3.0 and USB2.0 coexist, the value 0 represents the use of USB2.0 The default value is 1. After receiving the signal that the wireless network and/or wireless device is being used, the value 1 will be changed to 0, that is, the USB3.0 to USB2.0 switching is completed. It should be noted that the above numerical values are only used as examples and are not used for limitation. For example, the value 0 can also indicate that USB 3.0 is used, and the value 2 indicates that USB 2.0 is used.
在本发明的一个实施例中,在上述步骤S204之后,上述方法还可以 包括:向USB3.0从设备下发重置reset指令,其中,reset指令用于指示USB3.0从设备使用USB2.0协议与USB主设备进行通信。需要说明的是,reset指令还可以用于指示重新识别所连接的USB设备。通过该步骤可以使得USB3.0从设备最终会以USB2.0的协议完成信息上报并继续工作。In an embodiment of the present invention, after the step S204, the foregoing method may further The method includes: issuing a reset reset command to the USB 3.0 slave device, wherein the reset command is used to instruct the USB 3.0 slave device to communicate with the USB master device by using the USB2.0 protocol. It should be noted that the reset command can also be used to indicate that the connected USB device is re-identified. Through this step, the USB 3.0 slave device will eventually complete the information report and continue to work under the USB2.0 protocol.
在本发明的一个实施例中,在上述步骤S204之前,上述方法还可以包括:接收切换指令;其中,上述切换指令用于指示允许将USB3.0总线切换至USB2.0总线。即在接收到上述切换指令后才进行USB3.0和USB2.0的切换。In an embodiment of the present invention, before the step S204, the method may further include: receiving a switching instruction; wherein the switching instruction is used to indicate that the USB 3.0 bus is allowed to be switched to the USB 2.0 bus. That is, switching between USB 3.0 and USB 2.0 is performed after receiving the above switching instruction.
需要说明的是,上述接收切换指令可以表现为:在指定无线网络和/或指定无线设备所在的网络正在被使用,和/或USB3.0从设备所在的网络正在被使用时,可以直接触发切换命令,也可以表现为,在满足上述条件时,先不触发切换命令,而是先发出用于提示用户是否进行USB总线的切换的提示信息,在接收到进行USB总线的切换的指令(即切换指令)后,进行切换,但并不限于此。需要说明的是,先提示用户是否进行USB总线切换,如果用户指示不进行USB总线切换,则表明用户能够接受该干扰信号,这样,可以使得能够根据用户的指示来确定是否进行切换,能够更好地提高用户的体验度。It should be noted that the foregoing receiving switching instruction may be expressed as: when the designated wireless network and/or the network where the designated wireless device is located is being used, and/or the network where the USB 3.0 slave device is located is being used, the switching may be directly triggered. The command may also be expressed as: when the above condition is satisfied, the switching command is not triggered first, but the prompt information for prompting the user whether to perform the switching of the USB bus is first issued, and the instruction to perform the switching of the USB bus (ie, switching) is received. After the command), switching is performed, but it is not limited to this. It should be noted that the user is prompted to perform USB bus switching first. If the user instructs not to perform USB bus switching, it indicates that the user can accept the interference signal, so that it can be determined according to the user's instruction whether to perform switching, which is better. Improve user experience.
在本发明的一个实施例中,在上述步骤S204之后,上述方法还可以包括:在检测到USB3.0从设备拔出USB主设备的情况下,将USB2.0总线切换至USB3.0总线。即在检测到USB3.0从设备被拔出之后,再切换回USB3.0总线。In an embodiment of the present invention, after the step S204, the method may further include: switching the USB 2.0 bus to the USB 3.0 bus when detecting that the USB 3.0 slave device pulls out the USB host device. That is, after detecting that the USB 3.0 slave device is unplugged, it switches back to the USB 3.0 bus.
需要说明的是,上述在检测到二USB3.0设备拔出USB主设备的情况下,将USB2.0总线切换至USB3.0总线,也可以不发生在步骤S204之后,比如可以是在检测到上述USB3.0从设备时,判断该USB3.0从设备是插入还是拔出USB主设备,在插入时,执行步骤S204,在拔出时可以执行将USB2.0总线切换至USB3.0总线,但并不限于此。It should be noted that, in the case that the USB 3.0 device is detected to be unplugged from the USB host device, the USB 2.0 bus may be switched to the USB 3.0 bus, or may not occur after step S204, for example, may be detected. When the USB3.0 slave device is used, it is determined whether the USB3.0 slave device is inserted or unplugged from the USB host device. When inserting, step S204 is performed, and when the USB device is pulled out, the USB2.0 bus can be switched to the USB3.0 bus. But it is not limited to this.
需要说明的是,上述指定无线网络可以是无线保真WIFI,比如2.4GHz 的WIFI,但并不限于此,比如USB3.0能够对该WIFI造成一定干扰的,频率在2.5GHz的预定范围内的WIFI,需要说明的是,该预定范围可以是0.5GHz作用,即频率为2GHz到3GHz之间的WIFI,但并不限于此。上述指定无线设备可以是无线鼠标,也可以是其他无线设备,比如无线耳机,并不限于此,这可以无线设备也可以使用了2.5GHz的预定范围内的频段的设备。It should be noted that the above specified wireless network may be a wireless fidelity WIFI, such as 2.4 GHz. WIFI, but not limited to this, for example, USB3.0 can cause certain interference to the WIFI, the frequency is within the predetermined range of 2.5GHz WIFI, it should be noted that the predetermined range can be 0.5GHz, that is, the frequency is WIFI between 2GHz and 3GHz, but is not limited to this. The above specified wireless device may be a wireless mouse or other wireless device, such as a wireless earphone, and is not limited thereto, and the wireless device may also use a device of a frequency band within a predetermined range of 2.5 GHz.
在本发明实施例中,上述步骤的执行主体可以终端,包括计算机终端、移动终端等,也可以是服务器等,但不限于此。In the embodiment of the present invention, the execution body of the foregoing steps may be a terminal, including a computer terminal, a mobile terminal, etc., or may be a server or the like, but is not limited thereto.
需要说明的是,上述USB主设备可以是移动终端,计算机终端,并不限于此,上述USB3.0从设备也可以是移动终端,计算机终端,但也可以是一些USB3.0设备,比如USB3.0无线网卡等,但并不限于此。It should be noted that the USB host device may be a mobile terminal, a computer terminal, and is not limited thereto. The USB 3.0 slave device may also be a mobile terminal or a computer terminal, but may also be a USB 3.0 device, such as USB 3. 0 wireless network card, etc., but is not limited to this.
需要说明的是,上述方法也可以以程序的方式存储在USB3.0从设备中,当USB3.0从设备插入USB主设备时,可以以虚拟光盘的方式将于该方法对应的程序拷贝到USB主设备中,由USB主设备来执行该方法;当然也可以直接存储在USB主设备中,并不限于此。It should be noted that the foregoing method may also be stored in a USB 3.0 slave device in a program manner. When the USB 3.0 slave device is inserted into the USB host device, the corresponding program of the method may be copied to the USB by means of a virtual optical disk. In the master device, the method is performed by the USB master device; of course, it can also be directly stored in the USB host device, and is not limited thereto.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, The optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
实施例2Example 2
在本实施例中还提供了一种通用串行总线USB的切换装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽 管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a universal serial bus USB switching device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and has not been described again. As used below, the term "module" may implement a combination of software and/or hardware of a predetermined function. Do The apparatus described in the following embodiments is preferably implemented in software, but hardware, or a combination of software and hardware, is also possible and contemplated.
图3是根据本发明实施例的通用串行总线USB的切换装置的结构框图,如图3所示,该装置包括:FIG. 3 is a structural block diagram of a universal serial bus USB switching apparatus according to an embodiment of the present invention. As shown in FIG. 3, the apparatus includes:
判断模块32,设置为在检测到通用串行总线USB主设备的USB3.0接口插入了USB3.0从设备的情况下,判断USB3.0从设备所在的网络与指定无线网络和/或指定无线设备所在的网络之间是否存在干扰信号;The judging module 32 is configured to determine, when the USB 3.0 interface of the universal serial bus USB host device is inserted into the USB 3.0 slave device, the network of the USB 3.0 slave device and the designated wireless network and/or the designated wireless Whether there is an interference signal between the networks where the device is located;
切换模块34,与上述判断模块32连接,设置为在判断结果为存在干扰信号的情况下,将USB3.0总线切换至USB2.0总线。The switching module 34 is connected to the determination module 32 and is configured to switch the USB 3.0 bus to the USB 2.0 bus if the determination result is that there is an interference signal.
通过上述装置,由于在检测到USB主设备的USB3.0接口插入了USB3.0从设备的情况下,通过判断模块32判断USB3.0从设备所在的网络与指定无线网络和/或指定无线设备所在的网络之间是否存在干扰信号,并且在判断结果为存在干扰信号的情况下,切换模块34将USB3.0总线切换至USB2.0总线,即在检测到USB主设备的USB3.0接口插入了USB3.0从设备的情况下,且存在干扰信号时,将USB3.0切换为USB2.0,进而规避了相应的干扰问题,解决了相关技术中USB3.0超速传输过程中出现的干扰问题。With the above device, since the USB 3.0 interface of the USB host device is detected to be inserted into the USB 3.0 slave device, the determination module 32 determines the network where the USB 3.0 slave device is located and the designated wireless network and/or the designated wireless device. Whether there is an interference signal between the networks in which the network is located, and in the case where the judgment result is that there is an interference signal, the switching module 34 switches the USB 3.0 bus to the USB 2.0 bus, that is, the USB 3.0 interface of the USB host device is detected to be inserted. In the case of USB3.0 slave device, when there is interference signal, USB3.0 is switched to USB2.0, which circumvents the corresponding interference problem and solves the interference problem in USB3.0 overspeed transmission process in related art. .
在本发明的一个实施例中,上述判断模块32还设置为,检测USB3.0从设备所在的网络是否正在被使用,以及检测指定无线网络和/或指定无线设备所在的网络是否正在被使用,在检测到指定无线网络和/或指定无线设备所在的网络正在被使用,并且USB3.0从设备所在的网络也正在被使用的情况下,确定USB3.0从设备所在的网络与指定无线设备和/或指定无线设备所在的网络之间存在干扰信号。In an embodiment of the present invention, the determining module 32 is further configured to detect whether the network where the USB 3.0 slave device is located is being used, and whether the network where the specified wireless network and/or the designated wireless device is located is being used. After detecting that the specified wireless network and/or the network where the designated wireless device is located is being used, and the network where the USB 3.0 slave device is located is also being used, determining the network where the USB 3.0 slave device is located and the designated wireless device and / or there is an interference signal between the networks where the specified wireless device is located.
在本发明的一个实施例中,上述切换模块34还设置为将USB主设备中与USB3.0从设备连接的根集线器由USB3.0集线器切换到USB2.0集线器。In one embodiment of the present invention, the switching module 34 is further configured to switch the root hub of the USB host device connected to the USB 3.0 slave device from the USB 3.0 hub to the USB 2.0 hub.
在本发明实施例中,上述切换模块34可以通过以下方式将USB主设 备中与USB3.0从设备连接的根集线器由USB3.0集线器切换到USB2.0集线器:将USB主设备中与USB3.0集线器对应的取值修改为与USB2.0集线器对应的取值。即切换模块34通过修改USB主设备中的相应值来进行USB3.0状态和USB2.0状态之间的切换,使得与相关技术中的切换方式相比,在USB3.0对应的集线器是否出现了故障或者是USB所有的管道都不通的情况下,仍然能够实现USB3.0到USB2.0的切换,更好得提高了用户的体验度。In the embodiment of the present invention, the switching module 34 can set the USB host in the following manner. The root hub connected to the USB3.0 slave device is switched from the USB3.0 hub to the USB2.0 hub: the value corresponding to the USB3.0 hub in the USB host device is modified to the value corresponding to the USB 2.0 hub. That is, the switching module 34 performs switching between the USB 3.0 state and the USB 2.0 state by modifying the corresponding value in the USB host device, so that whether the hub corresponding to the USB 3.0 appears compared with the switching mode in the related art. In the case of a failure or a failure of all the USB pipes, the USB 3.0 to USB 2.0 can still be switched, which improves the user experience.
具体地,可以与USB3.0集线器对应的取值和与USB2.0集线器对应的取值可以存储在USB主设备中的控制寄存器中,即可以通过修改或者设置控制寄存器中相应的集线器的取值,来进行USB3.0状态和USB2.0状态之间的切换。Specifically, the value corresponding to the USB 3.0 hub and the value corresponding to the USB 2.0 hub may be stored in a control register in the USB host device, that is, the value of the corresponding hub in the control register may be modified or set. To switch between the USB3.0 state and the USB2.0 state.
以下举例说明,比如在控制寄存器中设置的数值2代表使用的是USB3.0,数值1代表使用的是双总线结构,即USB3.0和USB2.0共存,数值0代表使用的是USB2.0,默认值为数值1,在接收到无线网络和/或无线设备正在被使用的信号后,切换模块34会将数值1修改为0,即完成了USB3.0到USB2.0的切换。需要说明的是,上述数值代表的意义仅仅用于举例,并不用来进行限定,比如数值0也可以表示使用的是USB3.0,数值2代表使用的是USB2.0。The following example shows that, for example, the value 2 set in the control register represents USB3.0, the value 1 represents the use of a dual bus structure, that is, USB3.0 and USB2.0 coexist, the value 0 represents the use of USB2.0 The default value is 1. After receiving the signal that the wireless network and/or the wireless device is being used, the switching module 34 will change the value 1 to 0, that is, the USB 3.0 to USB 2.0 switching is completed. It should be noted that the above numerical values are only used as examples and are not used for limitation. For example, the value 0 can also indicate that USB 3.0 is used, and the value 2 indicates that USB 2.0 is used.
在本发明的一个实施例中,上述装置还可以包括:发送模块,与上述切换模块34连接,设置为向USB3.0从设备下发重置reset指令,其中,reset指令用于指示USB3.0从设备使用USB2.0协议与USB主设备进行通信。需要说明的是,reset指令还可以用于指示重新识别所连接的USB设备。通过该步骤可以使得USB3.0从设备最终会以USB2.0的协议完成信息上报并继续工作。In an embodiment of the present invention, the apparatus may further include: a sending module, connected to the switching module 34, configured to issue a reset reset command to the USB 3.0 slave device, wherein the reset command is used to indicate the USB 3.0 The slave communicates with the USB master using the USB 2.0 protocol. It should be noted that the reset command can also be used to indicate that the connected USB device is re-identified. Through this step, the USB 3.0 slave device will eventually complete the information report and continue to work under the USB2.0 protocol.
在本发明的一个实施例中,上述装置还包括:接收模块,与上述切换模块34连接,设置为接收切换指令,其中,上述切换指令用于指示允许将USB3.0总线切换至USB2.0总线。即接收模块在接收到切换指令后, 切换模块34才进行USB3.0和USB2.0的切换。In an embodiment of the present invention, the apparatus further includes: a receiving module, connected to the switching module 34, configured to receive a switching instruction, wherein the switching instruction is used to indicate that the USB 3.0 bus is allowed to be switched to the USB 2.0 bus. . That is, after receiving the switching instruction, the receiving module The switching module 34 performs switching between USB 3.0 and USB 2.0.
需要说明的是,上接收模块接收切换指令可以表现为:在指定无线网络和/或指定无线设备所在的网络正在被使用,和/或USB3.0从设备所在的网络正在被使用时,可以直接触发切换命令,也可以表现为,在满足上述条件时,先不触发切换命令,而是先发出用于提示用户是否进行USB总线的切换的提示信息,在接收到进行USB总线的切换的指令(即切换指令)后,进行切换,但并不限于此。需要说明的是,先提示用户是否进行USB总线切换,如果用户指示不进行USB总线切换,则表明用户能够接受该干扰信号,这样,可以使得能够根据用户的指示来确定是否进行切换,能够更好地提高用户的体验度。It should be noted that the receiving instruction of the upper receiving module may be expressed as: when the designated wireless network and/or the network where the designated wireless device is located is being used, and/or the network where the USB 3.0 slave device is located is directly available, When the triggering command is triggered, it may be expressed that, when the above condition is met, the switching command is not triggered first, but the prompt information for prompting the user whether to perform the switching of the USB bus is first issued, and the instruction to perform the switching of the USB bus is received ( That is, after switching the command, switching is performed, but it is not limited to this. It should be noted that the user is prompted to perform USB bus switching first. If the user instructs not to perform USB bus switching, it indicates that the user can accept the interference signal, so that it can be determined according to the user's instruction whether to perform switching, which is better. Improve user experience.
在本发明的一个实施例中,上述切换模块34还设置为在检测到USB3.0从设备拔出USB主设备的情况下,将USB2.0总线切换至USB3.0总线。In an embodiment of the invention, the switching module 34 is further configured to switch the USB 2.0 bus to the USB 3.0 bus in the event that the USB 3.0 slave device is detected to be unplugged from the device.
需要说明的是,上述指定无线网络可以是无线保真WIFI,比如2.4GHz的WIFI,但并不限于此,比如USB3.0能够对该WIFI造成一定干扰的,频率在2.5GHz的预定范围内的WIFI,需要说明的是,该预定范围可以是0.5GHz作用,即频率为2GHz到3GH之间的WIFI,但并不限于此。上述指定无线设备可以是无线鼠标,也可以是其他无线设备,比如无线耳机,并不限于此,这可以无线设备也可以使用了2.5GHz的预定范围内的频段的设备。It should be noted that the foregoing specified wireless network may be a wireless fidelity WIFI, such as a 2.4 GHz WIFI, but is not limited thereto. For example, USB 3.0 can cause certain interference to the WIFI, and the frequency is within a predetermined range of 2.5 GHz. WIFI, it should be noted that the predetermined range may be 0.5 GHz, that is, WIFI with a frequency between 2 GHz and 3 GHz, but is not limited thereto. The above specified wireless device may be a wireless mouse or other wireless device, such as a wireless earphone, and is not limited thereto, and the wireless device may also use a device of a frequency band within a predetermined range of 2.5 GHz.
需要说明的是,上述装置可以位于USB主设备中,可以是位于其他的USB3.0设备比如终端等,还可以位于服务器中,但并不限于此。需要说明的是,上述USB主设备可以是移动终端,计算机终端,并不限于此,上述第二USB3.0也可以是移动终端,计算机终端,但也可以是一些USB3.0设备,比如USB3.0无线网卡等,但并不限于此。It should be noted that the foregoing device may be located in the USB host device, may be located in another USB 3.0 device such as a terminal, or may be located in the server, but is not limited thereto. It should be noted that the USB host device may be a mobile terminal, a computer terminal, and is not limited thereto. The second USB 3.0 may also be a mobile terminal or a computer terminal, but may also be a USB 3.0 device, such as USB 3. 0 wireless network card, etc., but is not limited to this.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器 中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that each of the foregoing modules may be implemented by software or hardware. For the latter, the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor. Or; each of the above modules is located in a different processor in any combination.
实施例3Example 3
在本实施例中还提供了一种系统,包括:USB主设备、USB3.0从设备和USB3.0线缆;其中,USB主设备和USB3.0从设备通过USB3.0线缆进行连接,USB主设备包括实施例2中的USB的切换装置。In this embodiment, a system is further provided, including: a USB host device, a USB 3.0 slave device, and a USB 3.0 cable; wherein the USB host device and the USB 3.0 slave device are connected through a USB 3.0 cable, The USB host device includes the USB switching device in Embodiment 2.
对于切换装置可以参考实施例2的描述,此处不再赘述。For the switching device, reference may be made to the description of Embodiment 2, and details are not described herein again.
实施例4Example 4
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行实施例1中的方法的步骤的程序代码。Embodiments of the present invention also provide a storage medium. Alternatively, in the present embodiment, the above storage medium may be set to store program code for executing the steps of the method in Embodiment 1.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment, the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory. A variety of media that can store program code, such as a disc or a disc.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。For example, the specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the optional embodiments, and details are not described herein again.
为了更好地理解本发明,以下结合优选的实施例对本发明做进一步解释。For a better understanding of the invention, the invention is further explained in conjunction with the preferred embodiments.
本发明优选实施例提供了一种USB3.0和USB2.0切换的方法,能够解决USB3.0超速传输过程中对2.4GHz无线传输带来的干扰问题。本发明优选实施例能够自动检测到干扰并能控制主机侧的可扩展的主机控制器接口(eXtensible Host Controller Interface,简称xHCI)所属的外部设备互连总线(Peripheral Component Interconnect,简称PCI)控制寄存器(相当于上述实施例中的控制寄存器),PCI控制寄存器可以控制USB3.0主机控制器所连接的根集线器是USB3.0集线器(HUB)还是USB2.0HUB,可以通过配置控制寄存器的值,使得根集线器(ROOT HUB)切换到USB2.0状态,这样设备重新以USB2.0进行识别,较好的解决了干扰问题。 A preferred embodiment of the present invention provides a USB 3.0 and USB 2.0 switching method, which can solve the interference problem caused by 2.4 GHz wireless transmission during USB 3.0 overspeed transmission. The preferred embodiment of the present invention is capable of automatically detecting interference and controlling a Peripheral Component Interconnect (PCI) control register of the eXtensible Host Controller Interface (xHCI) on the host side. Corresponding to the control register in the above embodiment, the PCI control register can control whether the root hub to which the USB 3.0 host controller is connected is a USB 3.0 hub (HUB) or a USB 2.0 HUB, and the value of the control register can be configured to make the root The hub (ROOT HUB) switches to the USB2.0 state, so that the device is re-identified by USB2.0, which better solves the interference problem.
本发明优选实施例提供的系统物理设备包括USB3.0主机(相当于上述实施例中的USB主设备)、USB3.0线缆、USB3.0无线网卡(相当于上述实施例中的USB3.0从设备)。The system physical device provided by the preferred embodiment of the present invention includes a USB 3.0 host (corresponding to the USB host device in the above embodiment), a USB 3.0 cable, and a USB 3.0 wireless network card (corresponding to USB 3.0 in the above embodiment). From the device).
本发明实施例中所述USB3.0主机系统里面会运行一个应用app,此app包含有两个大的模块:干扰和异常检测模块、USB HUB切换模块。需要说明的是,该应用APP所完成的功能相当于上述实施例中的方法所完成的功能。An application app is run in the USB3.0 host system in the embodiment of the present invention. The app includes two large modules: an interference and anomaly detection module, and a USB HUB switching module. It should be noted that the function performed by the application APP is equivalent to the function performed by the method in the above embodiment.
需要说明的是,该应用app存储于USB3.0无线网卡的闪存(flash)上,USB3.0无线网卡首次通过USB3.0线缆接入USB3.0主机时,USB3.0无线网卡会以虚拟光盘的形式出现在USB3.0主机上。这样应用app就可以拷贝或者安装到USB3.0主机上。USB3.0无线网卡再次接入主机,此应用会自动运行。It should be noted that the application app is stored in the flash memory of the USB3.0 wireless network card. When the USB3.0 wireless network card is first connected to the USB3.0 host through the USB3.0 cable, the USB3.0 wireless network card will be virtualized. The form of the disc appears on the USB 3.0 host. This way the app can be copied or installed on a USB 3.0 host. The USB3.0 wireless network card is connected to the host again, and the application will run automatically.
应用app的干扰和异常检测模块用来检测系统中USB3.0接口是否接入了USB3.0设备,如果接入了USB3.0设备,那么干扰和异常检测模块继续检测是否有2.4GHz的无线USB鼠标或者是否接入了2.4G的WIFI网络,如果有,并且都在进行数据传输,那么发消息给USB HUB切换模块(相当于上述实施例中的切换模块)。如果没有接入USB3.0设备或者没有进行数据传输,那么不进行切换。The app's interference and anomaly detection module is used to detect whether the USB3.0 interface in the system is connected to the USB3.0 device. If the USB3.0 device is connected, the interference and anomaly detection module continues to detect whether there is a 2.4GHz wireless USB. The mouse is connected to the 2.4G WIFI network. If there is any data transmission, the message is sent to the USB HUB switching module (equivalent to the switching module in the above embodiment). If there is no USB 3.0 device connected or no data transmission is performed, no switching is performed.
USB3.0协议规范中指出USB3.0主机控制器是双总线结构,有一个USB2.0HUB和一个USB3.0HUB所组成。USB HUB切换模块用来管理USB3.0主机控制器所使用的USB HUB,一旦接收到干扰和异常检测模块发送的切换消息(相当于上述实施例中的切换指令),那么USB HUB切换模块会将控制寄存器的值进行修改,例如数值2表示连接的是USB3.0HUB;数值1代表连接的是使用双总线结构,即USB3.0HUB和USB2.0HUB共存;数值0代表连接的是USB2.0HUB。干扰检测到,切换模块会将值从默认状态1修改为0,USB3.0无线网卡连接的ROOT HUB就会从USB3.0HUB切换到USB2.0的HUB。切换之后HUB切换模块会下发reset 指令,重新识别HUB下游端口所连接的USB设备。我们的USB3.0无线网卡是兼容USB2.0协议的,所以收到reset指令之后,USB2.0HUB会与我们的USB3.0无线网卡通信,使用的协议是USB2.0,USB3.0无线网卡最终会以USB2.0的协议完成信息上报并继续工作。The USB3.0 protocol specification states that the USB3.0 host controller is a dual bus structure with a USB2.0HUB and a USB3.0HUB. The USB HUB switching module is used to manage the USB HUB used by the USB3.0 host controller. Once the interference message sent by the interference and abnormality detecting module is received (equivalent to the switching instruction in the above embodiment), the USB HUB switching module will The value of the control register is modified. For example, the value 2 indicates that the connection is USB3.0HUB; the value 1 indicates that the connection is using the dual bus structure, that is, USB3.0HUB and USB2.0HUB coexist; the value 0 indicates that the connection is USB2.0HUB. The interference is detected, the switch module will change the value from the default state 1 to 0, and the ROOT HUB connected to the USB3.0 wireless network card will switch from the USB3.0HUB to the HU2.0 of the USB2.0. After switching, the HUB switching module will send a reset. Command to re-identify the USB device connected to the downstream port of the HUB. Our USB3.0 wireless network card is compatible with USB2.0 protocol, so after receiving the reset command, USB2.0HUB will communicate with our USB3.0 wireless network card. The protocol used is USB2.0, USB3.0 wireless network card is finally The information will be reported and continued to work under the USB2.0 agreement.
USB3.0无线网卡拔出之后,USB HUB切换模块会继续工作,检测到USB3.0设备拔出之后,会将xHCI所属的控制寄存器从0切换到1,不影响其他USB3.0设备的使用。After the USB3.0 wireless network card is removed, the USB HUB switching module will continue to work. After detecting that the USB3.0 device is unplugged, the control register to which the xHCI belongs will be switched from 0 to 1, without affecting the use of other USB3.0 devices.
此应用app对其它USB3.0设备依然有效,但是需要得到用户许可,否则只对本USB3.0无线网卡有效。此功能可以做到app安装阶段或者后期设置阶段。This app is still valid for other USB3.0 devices, but requires user permission, otherwise it is only valid for this USB3.0 wireless network card. This feature can be used during the app installation phase or the post-set phase.
对于上述优选实施例,具体介绍如下:For the above preferred embodiments, the details are as follows:
图4是根据本发明优选实施例提供的USB3.0系统物理连接图,如图4所示,此优选实施例要正常工作要有带USB3.0的PC主机,一个存放有自动检测干扰并自动切换可执行程序的USB3.0无线网卡和一根USB3.0线缆。PC主机和USB3.0无线网卡通过USB3.0线缆将设备和主机的USB3.0接口相连。4 is a physical connection diagram of a USB 3.0 system according to a preferred embodiment of the present invention. As shown in FIG. 4, the preferred embodiment needs to have a PC host with USB 3.0, one of which stores automatic detection interference and automatically Switch the executable program's USB3.0 wireless network card and a USB3.0 cable. The PC host and the USB3.0 wireless network card connect the device to the USB3.0 interface of the host through a USB3.0 cable.
要实现自动检测干扰并自动切换的功能,主机侧要安装一个实时监控程序,用于监测主机侧是否有在使用2.4G的WIFI和无线鼠标并根据情况进行USB集线器(USB HUB)的切换。此监控程序安装包被放置在USB3.0无线网卡的某个文件系统分区内。无线网卡可以通过将自己的接口上报为大容量存储设备接口,接口子类码使用小型计算机系统接口(Small Computer System Interface;简称SCSI)指令集,接口协议为批量(BULK-ONLY)传输,PC主机就会将无线网卡识别为虚拟光盘,进而读取光盘中的内容,然后将存储于无线网卡内部的文件读取安装到PC主机上。To achieve automatic detection of interference and automatic switching, the host side should install a real-time monitoring program to monitor whether the host side is using 2.4G WIFI and wireless mouse and switch USB hub (USB HUB) according to the situation. This monitor installation package is placed in a file system partition of the USB 3.0 wireless network card. The wireless network card can report its own interface as a mass storage device interface. The interface subclass code uses the Small Computer System Interface (SCSI) instruction set, and the interface protocol is batch (BULK-ONLY) transmission. The PC host The wireless network card is recognized as a virtual optical disk, and then the contents of the optical disk are read, and then the files stored in the wireless network card are read and installed on the PC host.
图5是根据本发明优选实施例提供的自动检测和切换APP的安装示意图,如图5所示,描述符是通过设备和主机建立的USB管道的默认控 制端点获取的,主机的读指令和设备的回复是通过批量输入(BULK IN)和批量输出(BULK OUT)管道传输的,经过许多次的读,光盘内容就会被读取到PC侧。FIG. 5 is a schematic diagram of installation of an automatic detection and switching APP according to a preferred embodiment of the present invention. As shown in FIG. 5, the descriptor is a default control of a USB pipe established by a device and a host. The read command of the host and the reply of the device are transmitted through the batch input (BULK IN) and the batch output (BULK OUT). After many readings, the contents of the disc are read to the PC side.
图6是根据本发明优选实施例提供的主机应用程序与各模块之间的关系示意图,如图6所示,为了USB2.0的向前兼容,USB3.0的主机控制器系统设计成了两套HUB的结构,一套HUB支持USB2.0协议,一套HUB支持USB3.0协议,是双总线结构。具体USB2.0的HUB工作还是USB3.0的HUB工作,取决于接入的是USB3.0线缆还是USB2.0线缆。FIG. 6 is a schematic diagram of a relationship between a host application and each module according to a preferred embodiment of the present invention. As shown in FIG. 6, for USB 2.0 forward compatibility, the host controller system of USB 3.0 is designed into two. Set of HUB structure, a set of HUB supports USB2.0 protocol, a set of HUB supports USB3.0 protocol, is a dual bus structure. The specific USB 2.0 HUB work or the USB 3.0 HUB work depends on whether the USB 3.0 cable or the USB 2.0 cable is connected.
不管是windows还是linux操作系统都提供了一套PCI总线操作接口,此接口可以控制USB3.0主机控制器的控制寄存器写入的是0还是1,0表示只使能USB2.0HUB,1表示USB2.0HUB和USB3.0HUB都使能。因此我们可以在PC侧动态实现支持USB3.0协议还是支持USB2.0协议,进而根据选择,控制USB3.0的设备以USB2.0的模式进行工作。Whether it is windows or linux operating system provides a set of PCI bus operation interface, this interface can control whether the control register written by USB3.0 host controller is 0 or 1, 0 means only enable USB2.0HUB, 1 means USB2 Both .0HUB and USB3.0HUB are enabled. Therefore, we can dynamically support the USB3.0 protocol or the USB2.0 protocol on the PC side, and then control the USB3.0 device to work in the USB2.0 mode according to the selection.
负责USB3.0主机控制器中控制寄存器的模块是本发明主机应用程序的HUB切换模块。HUB切换模块进行寄存器写入的前提是无线wifi检测模块和无线鼠标检测模块检测的结果。本优选实施例的无线wifi检测模块检测的是无线网络连接,通过无线网络连接获得连接类型、所用频率以及使用状态;无线鼠标检测模块可以通过检测HID驱动和PS/2驱动操作接口,判断连接类型、使用状态。以上检测方法包括但不局限于上述方法。The module responsible for the control register in the USB 3.0 host controller is the HUB switching module of the host application of the present invention. The premise of the HUB switching module for register writing is the result of the wireless wifi detection module and the wireless mouse detection module. The wireless wifi detecting module of the preferred embodiment detects a wireless network connection, and obtains a connection type, a used frequency, and a use state through a wireless network connection; the wireless mouse detection module can determine the connection type by detecting the HID driver and the PS/2 driver operation interface. ,status of use. The above detection methods include, but are not limited to, the above methods.
图7是根据本发明优选实施例提供的USB3.0主机控制器结构框图,如图7所示,本优选实施例以最简单的接口来描述,只在主板连出来一个USB2.0接口和一个USB3.0接口。实际的USB3.0主机控制器可能比较复杂,会在内部接入一个或多个集线器(HUB),从而扩展出多个USB2.0接口和多个USB3.0接口。FIG. 7 is a structural block diagram of a USB3.0 host controller according to a preferred embodiment of the present invention. As shown in FIG. 7, the preferred embodiment is described by the simplest interface, and only a USB 2.0 interface and a motherboard are connected. USB3.0 interface. The actual USB 3.0 host controller may be complex and will have one or more hubs (HUBs) internally, extending multiple USB 2.0 interfaces and multiple USB 3.0 interfaces.
USB3.0主机控制器XHC是将HUB控制寄存器固定为USB3.0和USB2.0HUB共存方式,然而内核中依然保留了HUB控制寄存器的操作接口,例如linux系统中,内核提供了usb_enable_xhci_ports()和 usb_disable_xhci_ports()函数来使能和禁用USB3.0HUB。所以把此类接口抽象为控制寄存器开关(图中S0),应用程序通过控制寄存器开关来自由选择是否禁用USB3.0HUB。The USB3.0 host controller XHC fixes the HUB control register to the USB3.0 and USB2.0HUB coexistence mode. However, the operation interface of the HUB control register is still retained in the kernel. For example, in the Linux system, the kernel provides usb_enable_xhci_ports() and The usb_disable_xhci_ports() function is used to enable and disable USB3.0HUB. So abstract this type of interface as a control register switch (S0 in the figure), the application chooses whether to disable USB3.0HUB by controlling the register switch.
如果S0值为1,那么选择的就是USB3.0和USB2.0HUB共存,那么C2会根据连接的USB设备类型,选择走虚线的连线连到HCP2集线器接口,挂到USB3.0HUB还是黑色的实线连线连到HCP1,挂到USB2.0HUB。If the S0 value is 1, then the choice is that USB3.0 and USB2.0HUB coexist, then C2 will choose to connect the dotted line to the HCP2 hub interface according to the connected USB device type, and hang it to USB3.0HUB or black. Connect the cable to HCP1 and hang it to USB2.0HUB.
如果S0设置为了0,那么不管C2接口插入的是USB2.0设备还是USB3.0设备,都会走黑色的实线连线连到HCP1集线器接口,挂到USB2.0HUB上,最终设备会被识别为USB2.0的设备。If S0 is set to 0, then regardless of whether the C2 interface is plugged into a USB2.0 device or a USB3.0 device, the black solid cable will be connected to the HCP1 hub interface and connected to the USB2.0HUB. The final device will be recognized as USB2.0 device.
图8是根据本发明优选实施例提供的应用程序中模块的结构框图,如图8所示,包括监测模块,消息收集和判断模块,自动切换模块和设备控制模块,其中,监测模块分为三个:USB3.0接口监测模块、WIFI监测模块、无线鼠标监测模块,包括但不限于这两种无线设备监测模块。FIG. 8 is a structural block diagram of a module in an application according to a preferred embodiment of the present invention. As shown in FIG. 8, the monitoring module includes a monitoring module, a message collection and judgment module, an automatic switching module, and a device control module, wherein the monitoring module is divided into three. A: USB3.0 interface monitoring module, WIFI monitoring module, wireless mouse monitoring module, including but not limited to these two wireless device monitoring modules.
应用程序首先会监测USB3.0端口,如果USB3.0的端口上有设备插入,会进一步获取USB设备的描述符信息,如果获得BOS(Binary Device Object Store)或者ECD(Endpoint Companion Descriptor)描述符(包括但不限于此种USB3.0判断方式),则确定接入的是USB3.0无线网卡,否则会一直等待USB3.0设备插入。监测到USB3.0设备之后,会发消息给消息收集和判断模块,WIFI监测模块和无线鼠标监测模块会检测此时PC主机是否有2.4G WIFI业务在跑,或者无线鼠标是否在使用,结果会反馈给消息收集和判断模块,消息收集和判断模块内部进行判断,综合评判USB3.0设备的使用是否会影响2.4GHz的无线,如果影响,那么通知自动切换模块,自动切换模块会重新写入PCI控制寄存器的值,完成ROOT HUB的切换,切换完成发消息通知设备控制模块,设备控制模块会进行总线reset,重启完成后USB3.0无线网卡设备就会挂载到USB2.0的HUB,以USB2.0的配置进行上报。 The application will first monitor the USB3.0 port. If a device is plugged in the USB3.0 port, the descriptor information of the USB device will be further obtained. If a BOS (Binary Device Object Store) or ECD (Endpoint Companion Descriptor) descriptor is obtained ( Including but not limited to this USB3.0 judgment mode), it is determined that the USB 3.0 wireless network card is accessed, otherwise the USB 3.0 device will be inserted. After monitoring the USB3.0 device, a message collection and judgment module will be sent. The WIFI monitoring module and the wireless mouse monitoring module will detect whether the PC host has a 2.4G WIFI service running, or whether the wireless mouse is in use, and the result will be Feedback to the message collection and judgment module, the message collection and judgment module internally makes a judgment, comprehensively judges whether the use of the USB3.0 device will affect the 2.4GHz wireless, if it affects, then the automatic switching module is notified, and the automatic switching module will rewrite the PCI. Control the value of the register, complete the ROOT HUB switch, switch to complete the message to notify the device control module, the device control module will perform bus reset, after the restart, the USB3.0 wireless network card device will be mounted to the USB2.0 HUB to USB2 The configuration of .0 is reported.
图9是根据本发明优选实施例提供的应用程序安装的流程示意图,以下结合图8和图9进行详细说明,USB3.0PC主机上首次插入USB3.0无线网卡,网卡会将自己枚举为虚拟光盘,以供主机识别,PC主机上读取到光盘内容后会自动运行(autorun),然后调用安装进程,出现“是否继续安装”的界面,如果用户不选择安装,则一直等待,如果选择安装,那么检测干扰并进行自动适配切换的应用进程就被安装到了PC主机上。然后USB3.0的网卡被切换到另外一种工作状态——网卡模式——继续工作。此时安装的应用进程已经开始工作,进行实时监测。上面流程将主机侧应用程序安装完成后,应用程序随即开始运行。FIG. 9 is a schematic flowchart of an application installation according to a preferred embodiment of the present invention. The following is a detailed description of the USB 3.0 PC on the USB 3.0 PC host, and the network card enumerates itself as a virtual one. CD, for the host to recognize, the PC host will automatically run after reading the contents of the CD (autorun), and then call the installation process, the "Continue to continue installation" interface appears, if the user does not choose to install, then wait, if you choose to install Then, the application process that detects interference and performs automatic adaptation switching is installed on the PC host. Then the USB3.0 NIC is switched to another working state - NIC mode - to continue working. The application process installed at this time has started to work and is monitored in real time. After the above process completes the installation of the host-side application, the application starts running.
图10是根据本发明优选实施例提供的USB3.0切换方法的流程示意图,如图10所示,该方法(即上述的应用程序)包括:FIG. 10 is a schematic flowchart of a USB 3.0 switching method according to a preferred embodiment of the present invention. As shown in FIG. 10, the method (ie, the foregoing application) includes:
应用程序启动。USB3.0接口监测模块开始监测,检测到USB3.0设备是否插入或者拔出,没有检测到设备那么继续检测,如果检测到USB3.0设备插入,那么触发WIFI检测模块、无线鼠标监测模块以及其他无线设备监测模块。如果监测到USB3.0设备拔出,那么将之前切换的USB总线切换回USB3.0模式。WIFI监测模块首先通过API接口监测WIFI频率是否2.4GHz,如果不是,那么WIFI监测模块功能完成;否则监测WIFI连接使用情况,如果正在使用,那么反馈给消息收集与判断模块。无线鼠标监测模块也是要判断是否在使用中,将使用情况反馈给消息收集与判断模块。本发明包括但不限于上述两种无线产品使用,因此增加了一个其他无线设备监测。USB3.0接口监测模块检测到USB3.0设备插入,那么继续检测USB3.0的网卡接口上是否有网络数据包,有的话进行采样。结果反馈给消息收集与判断模块。消息收集与判断模块综合考虑前述几个监测模块反馈的信息,做出判断,提示用户有干扰,是否进行USB3.0-USB2.0的总线切换。用户如果放弃,那么表示用户接受干扰;那么程序退出,重新执行。否则调用PCI提供的接口将总线寄存器值进行修改,USB3.0总线就会切换到USB2.0总线。接着程序下发一个总线reset指令,设备掉电重启。重启完成后,虽然USB3.0设备依然连接的是USB3.0的线缆和USB3.0的 主机接口,但是此时USB3.0的主机接口连接的是USB2.0的总线,USB设备会以USB2.0的配置进行上报。程序重新从头循环。通过上述步骤,USB3.0对WIFI和其他无线2.4GHz通信的影响就被规避解决了。The application starts. The USB3.0 interface monitoring module starts monitoring, detects whether the USB3.0 device is plugged in or unplugged, and continues to detect if no device is detected. If the USB3.0 device is detected to be inserted, the WIFI detection module, the wireless mouse monitoring module, and the like are triggered. Wireless device monitoring module. If the USB 3.0 device is detected to be unplugged, the previously switched USB bus is switched back to the USB 3.0 mode. The WIFI monitoring module first monitors whether the WIFI frequency is 2.4 GHz through the API interface. If not, the WIFI monitoring module function is completed; otherwise, the WIFI connection usage is monitored, and if it is being used, then the message collection and judgment module is fed back. The wireless mouse monitoring module also determines whether it is in use and feeds back the usage to the message collection and judgment module. The invention includes, but is not limited to, the use of the two wireless products described above, thus adding one other wireless device monitoring. The USB3.0 interface monitoring module detects that the USB3.0 device is plugged in, and then continues to detect whether there is a network data packet on the USB3.0 network card interface, and if so, samples it. The result is fed back to the message collection and judgment module. The message collection and judgment module comprehensively considers the information fed back by the above several monitoring modules, makes a judgment, prompts the user to have interference, and performs USB bus switching of USB3.0-USB2.0. If the user gives up, the user accepts the interference; then the program exits and re-executes. Otherwise, the interface provided by PCI is called to modify the bus register value, and the USB3.0 bus will switch to the USB2.0 bus. Then the program sends a bus reset command, and the device is powered off and restarted. After the reboot is completed, although the USB3.0 device is still connected to the USB3.0 cable and USB3.0 Host interface, but at this time, the host interface of USB3.0 is connected to the USB2.0 bus, and the USB device will report in the configuration of USB2.0. The program loops back from the beginning. Through the above steps, the impact of USB3.0 on WIFI and other wireless 2.4GHz communications is circumvented.
本发明优选实施例的监测干扰和自动切换的应用存储于USB无线网卡中,当然经过修改可以将本应用的安装程序放在服务器端,不用无线网卡也可以直接下载安装。经过修改,应用程序也可以将其他USB3.0的设备加入到监测范围,不止可以解决USB3.0无线网卡产生的干扰,对其他USB3.0终端也同样适用。要达到这种目的,只需要在应用程序中加入对其他USB3.0终端的端口标识(Port ID,简称PID)、电压标识(Voltage Identification,简称VID)以及接口的判断即可。The application for monitoring interference and automatic switching in the preferred embodiment of the present invention is stored in the USB wireless network card. Of course, the installation program of the application can be placed on the server side after modification, and the wireless network card can be directly downloaded and installed without using the wireless network card. After modification, the application can also add other USB3.0 devices to the monitoring range, which can not only solve the interference generated by the USB3.0 wireless network card, but also apply to other USB3.0 terminals. To achieve this goal, you only need to add the port ID (PID), voltage identification (VID) and interface judgment of other USB3.0 terminals to the application.
本发明优选实施例可以解决USB3.0超速传输时对2.4GHz的WIFI和2.4GHz的无线USB鼠标带来的干扰问题,此方法虽然是规避解决方法,但是实施起来简单方便,完全依靠的是软件方法,不需要修改电路,增加额外的硬件器件,节约了硬件成本。用户只需要将监测干扰的应用安装到USB3.0主机上,应用就可以完成干扰的监测,并自动或者通过用户提示的方式将USB总线从3.0切换到2.0,用户体验好。The preferred embodiment of the present invention can solve the interference problem of 2.4 GHz WIFI and 2.4 GHz wireless USB mouse when USB 3.0 overspeed transmission. Although this method is a circumvention solution, it is simple and convenient to implement, and relies entirely on software. The method does not require modifying the circuit, adding additional hardware components, and saving hardware costs. The user only needs to install the application for monitoring interference to the USB3.0 host, and the application can complete the interference monitoring, and automatically switch the USB bus from 3.0 to 2.0 by user prompting, and the user experience is good.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。It will be apparent to those skilled in the art that the various modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精 神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above description is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Where in the essence of the invention Any modifications, equivalent substitutions, improvements, etc. made within the principles of God and the principles are intended to be included within the scope of the present invention.
工业实用性Industrial applicability
基于本发明实施例提供的上述技术方案,由于在检测到USB主设备的USB3.0接口插入了USB3.0从设备的情况下,通过判断USB3.0从设备所在的网络与指定无线网络和/或指定无线设备所在的网络之间是否存在干扰信号,并且在判断结果为存在干扰信号的情况下,将USB3.0总线切换至USB2.0总线,即在检测到USB主设备的USB3.0接口插入了USB3.0从设备的情况下,且存在干扰信号时,将USB3.0切换为USB2.0,进而规避了相应的干扰问题,解决了相关技术中USB3.0超速传输过程中出现的干扰问题。 According to the foregoing technical solution provided by the embodiment of the present invention, when the USB 3.0 interface of the USB host device is detected to be inserted into the USB 3.0 slave device, the network where the USB 3.0 slave device is located and the designated wireless network and/or Or whether there is an interference signal between the networks where the wireless device is located, and if the judgment result is that there is an interference signal, the USB3.0 bus is switched to the USB2.0 bus, that is, the USB 3.0 interface of the USB host device is detected. When the USB3.0 slave device is inserted and there is an interference signal, USB3.0 is switched to USB2.0, thereby circumventing the corresponding interference problem, and solving the interference occurring in the USB3.0 overspeed transmission process in the related art. problem.

Claims (15)

  1. 一种通用串行总线USB的切换方法,包括:A universal serial bus USB switching method includes:
    在检测到通用串行总线USB主设备的USB3.0接口插入了USB3.0从设备的情况下,判断所述USB3.0从设备所在的网络与指定无线网络和/或指定无线设备所在的网络之间是否存在干扰信号;When it is detected that the USB3.0 interface of the universal serial bus USB host device is inserted into the USB 3.0 slave device, it is determined that the network where the USB 3.0 slave device is located and the network where the specified wireless network and/or the designated wireless device are located are determined. Whether there is an interference signal between them;
    在判断结果为存在所述干扰信号的情况下,将USB3.0总线切换至USB2.0总线。In the case where the result of the judgment is that the interference signal exists, the USB 3.0 bus is switched to the USB 2.0 bus.
  2. 根据权利要求1所述的方法,其中,将USB3.0总线切换至USB2.0总线包括:The method of claim 1 wherein switching the USB 3.0 bus to the USB 2.0 bus comprises:
    将所述USB主设备中与所述USB3.0从设备连接的根集线器由USB3.0集线器切换到USB2.0集线器。The root hub of the USB host device connected to the USB 3.0 slave device is switched from a USB 3.0 hub to a USB 2.0 hub.
  3. 根据权利要求2所述的方法,其中,通过以下方式将所述USB主设备中与所述USB3.0从设备连接的根集线器由USB3.0集线器切换到USB2.0集线器:The method of claim 2, wherein the root hub of the USB host device connected to the USB 3.0 slave device is switched from a USB 3.0 hub to a USB 2.0 hub by:
    将所述USB主设备中与所述USB3.0集线器对应的取值修改为与所述USB2.0集线器对应的取值。The value corresponding to the USB 3.0 hub in the USB host device is modified to a value corresponding to the USB 2.0 hub.
  4. 根据权利要求1所述的方法,其中,在将所述USB3.0总线切换至USB2.0总线之后,所述方法还包括:The method of claim 1, wherein after switching the USB 3.0 bus to the USB 2.0 bus, the method further comprises:
    向所述USB3.0从设备下发重置reset指令,其中,所述reset指令用于指示所述USB3.0从设备使用USB2.0协议与所述USB主设备进行通信。The reset reset command is sent to the USB 3.0 slave device, wherein the reset command is used to instruct the USB 3.0 slave device to communicate with the USB master device using the USB2.0 protocol.
  5. 根据权利要求1所述的方法,其中,在将所述USB3.0总线切换至USB2.0总线之前,所述方法还包括:The method of claim 1 wherein prior to switching the USB 3.0 bus to the USB 2.0 bus, the method further comprises:
    接收切换指令,其中,所述切换指令设置为指示允许将USB3.0 总线切换至USB2.0总线。Receiving a switching instruction, wherein the switching instruction is set to indicate that USB 3.0 is allowed The bus switches to the USB 2.0 bus.
  6. 根据权利要求1所述的方法,其中,在将USB3.0总线切换至USB2.0总线之后,所述方法还包括:The method of claim 1, wherein after switching the USB 3.0 bus to the USB 2.0 bus, the method further comprises:
    在检测到所述USB3.0从设备拔出所述USB主设备的情况下,将所述USB2.0总线切换至所述USB3.0总线。The USB 2.0 bus is switched to the USB 3.0 bus in the event that the USB 3.0 slave device is detected to be unplugged from the device.
  7. 根据权利要求1至6中任一项所述的方法,其中,所述指定无线网络包括无线保真WIFI,所述指定无线设备包括:无线鼠标。The method of any of claims 1 to 6, wherein the designated wireless network comprises a wireless fidelity WIFI, the designated wireless device comprising: a wireless mouse.
  8. 一种通用串行总线USB的切换装置,包括:A universal serial bus USB switching device includes:
    判断模块,设置为在检测到通用串行总线USB主设备的USB3.0接口插入了USB3.0从设备的情况下,判断所述USB3.0从设备所在的网络与指定无线网络和/或指定无线设备所在的网络之间是否存在干扰信号;a judging module configured to determine, when the USB 3.0 interface of the universal serial bus USB host device is inserted into the USB 3.0 slave device, the network in which the USB 3.0 slave device is located and the designated wireless network and/or designation Whether there is an interference signal between the networks where the wireless devices are located;
    切换模块,设置为在判断结果为存在所述干扰信号的情况下,将USB3.0总线切换至USB2.0总线。The switching module is configured to switch the USB 3.0 bus to the USB 2.0 bus if the result of the determination is that the interference signal is present.
  9. 根据权利要求8所述的装置,其中,所述切换模块还设置为将所述USB主设备中与所述USB3.0从设备连接的根集线器由USB3.0集线器切换到USB2.0集线器。The apparatus of claim 8, wherein the switching module is further configured to switch a root hub of the USB host device connected to the USB 3.0 slave device from a USB 3.0 hub to a USB 2.0 hub.
  10. 根据权利要求9所述的装置,其中,所述切换模块通过以下方式将所述USB主设备中与所述USB3.0从设备连接的根集线器由USB3.0集线器切换到USB2.0集线器:The apparatus according to claim 9, wherein the switching module switches a root hub of the USB host device connected to the USB 3.0 slave device from a USB 3.0 hub to a USB 2.0 hub by:
    将所述USB主设备中与所述USB3.0集线器对应的取值修改为与所述USB2.0集线器对应的取值。The value corresponding to the USB 3.0 hub in the USB host device is modified to a value corresponding to the USB 2.0 hub.
  11. 根据权利要求8所述的装置,其中,所述装置还包括:发送模块,设置为向所述USB3.0从设备下发重置reset指令,其中,所述 reset指令用于指示所述USB3.0从设备使用USB2.0协议与所述USB主设备进行通信。The device according to claim 8, wherein the device further comprises: a sending module, configured to issue a reset reset command to the USB 3.0 slave device, wherein the The reset command is used to instruct the USB 3.0 slave device to communicate with the USB master device using the USB 2.0 protocol.
  12. 根据权利要求8所述的装置,其中,所述装置还包括:The apparatus of claim 8 wherein said apparatus further comprises:
    接收模块,设置为接收切换指令,其中,所述切换指令用于指示允许将USB3.0总线切换至USB2.0总线。The receiving module is configured to receive a switching instruction, wherein the switching instruction is used to indicate that the USB 3.0 bus is allowed to be switched to the USB 2.0 bus.
  13. 根据权利要求8所述的装置,其中,所述切换模块还设置为在检测到所述USB3.0从设备拔出所述USB主设备的情况下,将所述USB2.0总线切换至USB3.0总线。The apparatus according to claim 8, wherein the switching module is further configured to switch the USB 2.0 bus to USB3 in case detecting that the USB 3.0 slave device pulls out the USB host device. 0 bus.
  14. 根据权利要求8至13中任一项所述的装置,其中,所述无线网络包括无线保真WIFI,所述无线设备包括:无线鼠标。The apparatus of any one of claims 8 to 13, wherein the wireless network comprises a wireless fidelity WIFI, and the wireless device comprises: a wireless mouse.
  15. 一种系统,包括:USB主设备、USB3.0从设备和USB3.0线缆;其中,所述USB主设备包括权利要求8至14中任一项所述的装置。 A system comprising: a USB host device, a USB 3.0 slave device, and a USB 3.0 cable; wherein the USB host device comprises the device of any one of claims 8 to 14.
PCT/CN2017/000055 2016-05-19 2017-01-03 Usb switching method, device, and system WO2017197900A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610340344.6 2016-05-19
CN201610340344.6A CN107402893A (en) 2016-05-19 2016-05-19 USB switching method and device, system

Publications (1)

Publication Number Publication Date
WO2017197900A1 true WO2017197900A1 (en) 2017-11-23

Family

ID=60326412

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/000055 WO2017197900A1 (en) 2016-05-19 2017-01-03 Usb switching method, device, and system

Country Status (2)

Country Link
CN (1) CN107402893A (en)
WO (1) WO2017197900A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109947675A (en) * 2018-05-03 2019-06-28 广州视源电子科技股份有限公司 Intelligent tablet, channel switching method and computer readable storage medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108092986B (en) * 2017-12-27 2021-06-08 深圳市泰衡诺科技有限公司 Data transmission method and device of mobile terminal
CN108768706A (en) * 2018-05-16 2018-11-06 四川斐讯信息技术有限公司 The mode selecting method of storage device interface and selection system on a kind of router
CN109032831A (en) * 2018-08-30 2018-12-18 中新工程技术研究院有限公司 A kind of scheme of USB device identification automatic error correction
TWI707236B (en) * 2019-05-31 2020-10-11 佳世達科技股份有限公司 Mode switching system and mode switching method using the same

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201408862Y (en) * 2009-05-18 2010-02-17 东莞市扬明精密塑胶五金电子有限公司 Novel pin structure of USB3.0 connector
CN104079415A (en) * 2013-03-27 2014-10-01 瑞昱半导体股份有限公司 Network device and connection detection method thereof
CN104102603A (en) * 2013-04-09 2014-10-15 瑞昱半导体股份有限公司 USB (Universal Serial Bus) network interface controller and operation mode switching method thereof
CN105406896A (en) * 2015-10-19 2016-03-16 联想(北京)有限公司 Electronic equipment and control method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6036222B2 (en) * 2012-11-28 2016-11-30 セイコーエプソン株式会社 Device control apparatus, host apparatus and host apparatus control method
US20140244852A1 (en) * 2013-02-27 2014-08-28 Ralink Technology Corp. Method of Reducing Mutual Interference between Universal Serial Bus (USB) data transmission and wireless data transmission

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201408862Y (en) * 2009-05-18 2010-02-17 东莞市扬明精密塑胶五金电子有限公司 Novel pin structure of USB3.0 connector
CN104079415A (en) * 2013-03-27 2014-10-01 瑞昱半导体股份有限公司 Network device and connection detection method thereof
CN104102603A (en) * 2013-04-09 2014-10-15 瑞昱半导体股份有限公司 USB (Universal Serial Bus) network interface controller and operation mode switching method thereof
CN105406896A (en) * 2015-10-19 2016-03-16 联想(北京)有限公司 Electronic equipment and control method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109947675A (en) * 2018-05-03 2019-06-28 广州视源电子科技股份有限公司 Intelligent tablet, channel switching method and computer readable storage medium
CN109947675B (en) * 2018-05-03 2023-09-15 广州视源电子科技股份有限公司 Intelligent flat panel, channel switching method and computer readable storage medium

Also Published As

Publication number Publication date
CN107402893A (en) 2017-11-28

Similar Documents

Publication Publication Date Title
WO2017197900A1 (en) Usb switching method, device, and system
US8843664B2 (en) Re-enumeration of USB 3.0 compatible devices
US7739487B2 (en) Method for booting a host device from an MMC/SD device, a host device bootable from an MMC/SD device and an MMC/SD device method a host device may booted from
US9747237B2 (en) Methods and apparatus for reliable detection and enumeration of devices
EP3529705B1 (en) Configuring docks
US20150169484A1 (en) Active USB device and switching method for operating mode thereof
KR20110098974A (en) System, apparatus, and method for fast startup of usb devices
WO2019042421A1 (en) Method, apparatus and device for rate adjustment of usb data transmission, and storage medium
CN105893311A (en) Universal serial bus interface drive configuration method and device
TWI778063B (en) Usb host-to-host auto-switching
US9418033B2 (en) Using USB signaling to trigger a device to enter a mode of operation
WO2012100498A1 (en) Method and system for switching port of usb device
CN102073524B (en) A kind of method of wireless communication terminal and self-starting thereof
WO2012100504A1 (en) Wireless communication method, wireless communication system and wireless communication terminal
WO2018099255A1 (en) Method, device and system for configuring transfer mode and computer storage medium
EP2990956B1 (en) Usb device and method thereof for automatically recognizing microsoft windowing operating system version
US8527667B2 (en) Apparatuses and methods for transferring data
US10616944B2 (en) Computer system and method thereof for sharing of wireless connection information between UEFI firmware and OS
CN108153626B (en) USB, serial port multiplexing and safety isolation system
US9824046B2 (en) Using USB signaling to trigger a device to enter a mode of operation
CN113934661B (en) Electronic equipment, control method, device and medium
CN111711460B (en) USB working mode processing method and device, storage medium and electronic equipment
CN109656757B (en) Intelligent diagnosis method for redirection problem of USB (universal serial bus) equipment
EP3413205A1 (en) Re-enumeration of usb 3.0 compatible devices
EP2477120B1 (en) Method for processing device connection, combination device and host device

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17798474

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17798474

Country of ref document: EP

Kind code of ref document: A1