WO2016127402A1 - Method for switching usb driver version and usb device - Google Patents

Method for switching usb driver version and usb device Download PDF

Info

Publication number
WO2016127402A1
WO2016127402A1 PCT/CN2015/073040 CN2015073040W WO2016127402A1 WO 2016127402 A1 WO2016127402 A1 WO 2016127402A1 CN 2015073040 W CN2015073040 W CN 2015073040W WO 2016127402 A1 WO2016127402 A1 WO 2016127402A1
Authority
WO
WIPO (PCT)
Prior art keywords
usb
driver version
version
usb device
usb driver
Prior art date
Application number
PCT/CN2015/073040
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 华为技术有限公司
Priority to CN201580002425.9A priority Critical patent/CN106170778B/en
Priority to PCT/CN2015/073040 priority patent/WO2016127402A1/en
Publication of WO2016127402A1 publication Critical patent/WO2016127402A1/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/38Information transfer, e.g. on bus

Definitions

  • the present invention relates to the field of universal serial bus (English: universal serial bus, abbreviated as USB), and in particular, to a method for switching a USB driver version and a USB device.
  • USB universal serial bus
  • USB masters and USB slaves negotiate the USB driver version used for data transfer with the highest supported USB driver version when they first establish a connection.
  • the USB host device supports up to USB version 3.0
  • the USB slave device also supports USB version 3.0.
  • the USB3.0 version is used for data transmission.
  • the USB 3.0 version can achieve high data transfer rate when data is transmitted, in some frequency bands, data transmitted by USB 3.0 version USB devices (including USB host devices and USB slave devices) will be used.
  • the wireless signal transmitted by the wireless module in the USB device causes interference.
  • the USB host device uses USB3.0 version for data transmission, in order to avoid the interference caused by the data to the wireless signal transmitted by the wireless module in the USB host device, the highest USB driver version supported by the USB host device can be manually modified. To reduce the USB driver version used for data transfer between the USB host device and the USB slave device.
  • the USB host device and the USB slave device need to re-establish a connection and renegotiate the USB driver version for data transmission, thereby interrupting the service transmitted between the USB host device and the USB slave device.
  • the invention provides a method for switching a USB driver version and a USB device, which can ensure the transmission between the USB host device and the USB slave device when switching the USB driver version. Business is not interrupted.
  • the present invention provides a method for switching a universal serial bus USB driver version, including:
  • the first USB device sends a switch request message to the second USB device, where the switch request message carries a first USB driver version, and the switch request message is used to request the second USB device to use the second USB driver version.
  • the switch request message carries a first USB driver version
  • the switch request message is used to request the second USB device to use the second USB driver version.
  • Switching to the first USB driver version, the second USB driver version being a USB driver version currently used by the first USB device and the second USB device;
  • the first USB device receives a handover response message corresponding to the handover request message sent by the second USB device, where the handover response message is used to indicate whether the second USB device allows the Switching the second USB driver version to the first USB driver version;
  • the switch response message indicates that the second USB device allows to switch the second USB driver version to the first USB driver version
  • the first USB device switches the second USB driver version to The first USB driver version.
  • the first USB device switches the second USB driver version to the first USB driver version, including:
  • the first USB device switches a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version;
  • the first USB device switches a second register corresponding to the second USB driver version to a first register corresponding to the first USB driver version
  • the first USB device switches a second data transmission line corresponding to the second USB driver version to a first data transmission line corresponding to the first USB driver version.
  • the first USB device sends a handover request message to the second USB device, including:
  • the first USB device When the USB transmission interface in the first USB device is in the first USB device When the wireless module simultaneously transmits data, the first USB device sends the switching request message to the second USB device, where the first USB driver version is a USB driver version lower than the second USB driver version. .
  • the first USB device sends a handover request message to the second USB device, including:
  • the first USB device sends the switching request message to the second USB device, the first USB driver version being a USB driver version higher than the second USB driver version.
  • the first USB device sends a handover request message to the second USB device, including:
  • the first USB device sends the switching request message to the second USB device according to a triggering operation of the user, where the triggering operation is triggered by the user operating a driving version switching menu or a driving version switching button.
  • the method before the first USB device sends a handover request message to the second USB device, the method further includes:
  • the first USB device generates the driver version switching menu or the driver version switching button according to a third USB driver version, and the driving version switching menu or the driving version switching button includes at least the first USB device selection Switching the first USB driver version, the third USB driver version is a USB driver version adopted after the first USB device and the second USB device establish a connection for the first time.
  • the first USB device is a USB host device
  • the second USB device is a USB slave device
  • the first USB device is a USB slave device
  • the second USB device is a USB master device.
  • the present invention provides a method for switching a universal serial bus USB driver version, including:
  • the second USB device receives the switch request message sent by the first USB device, where the switch request message carries the first USB driver version, and the switch request message is used to request the second USB device to drive the second USB drive
  • the version is switched to the first USB driver version, and the second USB driver version is a USB driver version currently adopted by the first USB device and the second USB device;
  • the second USB device sends a handover response message corresponding to the handover request message to the first USB device, where the handover response message is used to indicate whether the second USB device allows the second
  • the USB driver version is switched to the first USB driver version
  • the switch response message indicates that the second USB device allows to switch the second USB driver version to the first USB driver version
  • the second USB device switches the second USB driver version to The first USB driver version.
  • the second USB device switches the second USB driver version to the first USB driver version, including:
  • the second USB device switches a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version;
  • the second USB device switches a second register corresponding to the second USB driver version to a first register corresponding to the first USB driver version
  • the second USB device switches a second data transmission line corresponding to the second USB driver version to a first data transmission line corresponding to the first USB driver version.
  • the first USB device is a USB host device
  • the second USB device is a USB slave device
  • the first USB device is a USB slave device
  • the second USB device is a USB master device.
  • the present invention provides a universal serial bus USB device, including:
  • a transceiver unit configured to send a handover request message to the second USB device, and receive a handover response packet corresponding to the handover request packet sent by the second USB device, where the handover request packet carries the first a USB driver version, the switch request message is used to request the second USB device to switch the second USB driver version to the first USB driver version, the second USB driver version is the USB device and the a USB driver version currently used by the second USB device, the switch response message being used to indicate whether the second USB device allows to switch the second USB driver version to the first USB driver version;
  • a switching unit configured to: if the switch response message received by the transceiver unit indicates that the second USB device allows to switch the second USB driver version to the first USB driver version, The USB driver version is switched to the first USB driver version.
  • the switching unit is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; and to be associated with the second USB driver version Corresponding second register is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to correspond to the first USB driver version The first data transmission line.
  • the transceiver unit is configured to: when the USB transmission interface in the USB device transmits data simultaneously with the wireless module in the USB device, send the handover request message to the second USB device, where the A USB driver version is a lower USB driver version than the second USB driver version.
  • the transceiver unit is specifically configured to: when detecting that the wireless module in the USB device does not transmit data, and the USB driver version used by the USB device to transmit data is not the highest USB driver version supported by the USB device, The second USB device sends the switching request message, and the first USB driver version is a USB driver version higher than the second USB driver version.
  • the transceiver unit is configured to send the switch request message to the second USB device according to a trigger operation of the user, where the trigger operation is triggered by the user operating a driver version switch menu or a driver version switch button.
  • the USB device further includes a generating unit
  • the generating unit is configured to generate the driving version switching menu or the driving version switching button according to the third USB driver version before the sending and receiving unit sends the switching request message to the second USB device,
  • the driving version switching menu or the driving version switching button includes at least the first USB driving version that the switching unit selects to switch, and the third USB driving version is the USB device and the second USB device for the first time.
  • the USB driver version used after negotiation to establish a connection.
  • the USB device is a USB host device, and the second USB device is a USB slave device; or
  • the USB device is a USB slave device, and the second USB device is a USB master device.
  • the present invention provides a universal serial bus USB device, including:
  • the transceiver unit is configured to receive a handover request packet sent by the first USB device, and send a handover response packet corresponding to the handover request packet to the first USB device, where the handover request packet carries the first a USB driver version, the switch request message is used to request the USB device to switch the second USB driver version to the first USB driver
  • the second USB driver version is a USB driver version currently used by the first USB device and the USB device, and the switch response message is used to indicate whether the USB device allows the second USB driver The version is switched to the first USB driver version;
  • a switching unit configured to: if the switching response message sent by the transceiver unit indicates that the USB device allows to switch the second USB driver version to the first USB driver version, then the second USB driver The version is switched to the first USB driver version.
  • the switching unit is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; and to be associated with the second USB driver version Corresponding second register is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to correspond to the first USB driver version The first data transmission line.
  • the first USB device is a USB host device, and the USB device is a USB slave device; or
  • the first USB device is a USB slave device, and the USB device is a USB master device.
  • the present invention provides a universal serial bus USB device, including:
  • a processor configured to send, by using a USB transmission interface, a handover request message to the second USB device, and receive, by using the USB transmission interface, a handover response message that is sent by the second USB device and corresponding to the handover request message,
  • the switching request message carries a first USB driver version, and the switching request message is used to request the second USB device to switch the second USB driver version to the first USB driver version, the second USB
  • the driver version is a USB driver version currently used by the USB device and the second USB device, and the switch response message is used to indicate whether the second USB device allows to switch the second USB driver version to the First USB driver version;
  • the processor is further configured to: if the switch response message indicates that the second USB device allows to switch the second USB driver version to the first USB driver version, Switching the second USB driver version to the first USB driver version.
  • the processor is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; and to be associated with the second USB driver version Corresponding second register is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to correspond to the first USB driver version The first data transmission line.
  • the processor is configured to: when the USB transmission interface in the USB device transmits data simultaneously with the wireless module in the USB device, send the switching request to the second USB device by using the USB transmission interface
  • the message, the first USB driver version is a USB driver version lower than the second USB driver version.
  • the processor is specifically configured to: when detecting that the wireless module in the USB device does not transmit data, and the USB driver version used by the USB device to transmit data is not the highest USB driver version supported by the USB device, The USB transmission interface sends the switching request message to the second USB device, where the first USB driver version is a USB driver version higher than the second USB driver version.
  • the processor is specifically configured to send, by using the USB transmission interface, the handover request message to the second USB device according to a trigger operation of the user, where the trigger operation is the user operating a driver version switching menu or driver The version switch button is triggered.
  • the processor is further configured to send the handover request to the second USB device Before the message, generating the driver version switching menu or the driver version switching button according to the third USB driver version, the driving version switching menu or the driving version switching button at least including the processor selection switching a first USB driver version, wherein the third USB driver version is a USB driver version adopted after the USB device and the second USB device establish a connection for the first time.
  • the USB device is a USB host device, and the second USB device is a USB slave device; or
  • the USB device is a USB slave device, and the second USB device is a USB master device.
  • the present invention provides a universal serial bus USB device, including:
  • a processor configured to receive, by using a USB transmission interface, a handover request message sent by the first USB device, and send, by using the USB transmission interface, a handover response message corresponding to the handover request message to the first USB device,
  • the switching request message carries a first USB driver version, and the switching request message is used to request the USB device to switch the second USB driver version to the first USB driver version, and the second USB driver version
  • the switching response message is used to indicate whether the USB device allows to switch the second USB driver version to the first USB driver for the USB driver version currently used by the first USB device and the USB device. version;
  • the processor is further configured to: if the switch response message indicates that the USB device allows to switch the second USB driver version to the first USB driver version, switch the second USB driver version to The first USB driver version.
  • the processor is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; and to be associated with the second USB driver version Corresponding second register is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to correspond to the first USB driver version The first data transmission line.
  • the first USB device is a USB host device, and the USB device is a USB slave device; or
  • the first USB device is a USB slave device, and the USB device is a USB master device.
  • the present invention provides a method for switching a USB driver version and a USB device.
  • the first USB device sends a switch request message to the second USB device, where the switch request message carries the first USB driver version, and the switch request message is used by the switch request message.
  • the second USB driver version is the USB driver version currently adopted by the first USB device and the second USB device; and the first USB device receives the second a switching response message corresponding to the switching request message sent by the USB device, the switching response message is used to indicate whether the second USB device allows to switch the second USB driver version to the first USB driver version; and if the switching response is The message indicates that the second USB device allows the second USB driver version to be switched to the first USB driver version, and the first USB device switches the second USB driver version to the first USB driver version.
  • the first USB device and the second USB device negotiate whether to switch the USB driver version by using the handover request message and the handover response message, so in the process of switching the handover request message and the handover response message, the first USB device
  • the connection between the second USB device and the second USB device is not disconnected, so that the first USB device and the second USB device can directly switch the USB driver version after negotiating to switch the USB driver version, and use the switched USB driver version for data transmission.
  • the present invention does not need to re-establish connection and renegotiate the USB driver version for data transmission between the first USB device and the second USB device, thereby ensuring the first USB device and The second USB device ensures that the services transmitted between the two USB devices are not interrupted when the USB driver version is switched.
  • FIG. 1 is a flowchart of a method for switching a USB driver version according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a handover request packet according to an embodiment of the present invention.
  • FIG. 2(b) is a schematic structural diagram of a handover response packet according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of a method for switching a USB driver version according to an embodiment of the present invention
  • FIG. 4 is an interaction diagram of a method for switching a USB driver version according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a driving version switching menu according to an embodiment of the present invention.
  • FIG. 5(b) is a schematic diagram of a driving version switching button according to an embodiment of the present invention.
  • FIG. 6 is an interaction diagram of a method for switching a USB driver version according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram 1 of a USB device according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram 2 of a USB device according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram 3 of a USB device according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram 1 of another USB device according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram 2 of another USB device according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic diagram of hardware of a USB device according to an embodiment of the present disclosure.
  • FIG. 13 is a schematic diagram of hardware of another USB device according to an embodiment of the present disclosure.
  • FIG. 14 is a structural diagram of a USB data transmission system according to an embodiment of the present invention.
  • USB 3.0 version for data transmission.
  • the transmission rate generally up to 640MB / S
  • the application of the USB3.0 standard is becoming more and more extensive.
  • the USB driver version used by the device for data transfer. For example, if both USB devices support the USB 3.0 version, then the two USB devices will use the USB 3.0 version to transfer data after the first connection is established.
  • USB3.0 version can achieve high data transmission rate, in some scenarios, it is not suitable to use USB3.0 version to transmit data, for example, in the frequency band of 0-5 GHz.
  • the data transmitted by the USB device of USB3.0 will cause great interference to the wireless signal transmitted by the wireless module in the USB device. Therefore, when the wireless module transmits wireless signals in the frequency band of 0-5 GHz, it is not suitable for simultaneous use.
  • USB3.0 version transfers data.
  • the USB driver version can only be modified by manual reconfiguration, but manually modified. After the USB driver version, since the two USB devices are disconnected, the USB devices need to be re-established and renegotiated for data transfer between the two USB devices, which will result in transmission between the two USB devices. Business disruption.
  • the embodiment of the present invention proposes a method for self-negotiating and automatically switching the USB driver version through two USB devices. It can ensure that the two USB devices ensure that the services transmitted between the two USB devices are not interrupted when switching the USB driver version.
  • One possible hardware architecture of the method for switching the USB driver version provided by the embodiment of the present invention is: a USB device having a wireless module and a USB transmission interface and supporting the USB 3.0 version.
  • a USB device having a wireless module and a USB transmission interface and supporting the USB 3.0 version.
  • the USB device uses USB 3.0 version to transmit data with other USB devices, if the USB device needs to transmit wireless signals through the wireless module at the same time, and the wireless signal transmitted by the wireless module has a large amount of data and delays The requirement is higher, that is, the USB device needs to preferentially ensure the normal transmission of the wireless signal transmitted by the wireless module.
  • the USB device can be used to reduce the USB driver version used by the USB device by using the method of switching the USB driver version provided by the embodiment of the present invention.
  • the USB 3.0 version currently used by the USB device can be switched to the USB 2.0 version. It can ensure the normal transmission of data transmitted through the USB transmission interface, and can ensure the normal transmission of wireless signals transmitted through the wireless module.
  • the method for switching the USB driver version provided by the embodiment of the present invention may also be the USB device.
  • the adopted USB driver version is increased, for example, the USB2.0 version currently adopted by the USB device can be switched to the USB3.0 version.
  • the embodiment of the invention provides a method for switching a USB driver version. As shown in FIG. 1 , the method may include:
  • the first USB device sends a switch request message to the second USB device, where the switch request message carries a first USB driver version, where the switch request message is used to request the second USB device to switch the second USB driver version to
  • the first USB driver version, the second USB driver version is the USB driver version currently used by the first USB device and the second USB device.
  • the first USB device receives, by the second USB device, a handover response packet corresponding to the handover request packet, where the handover response packet is used to indicate whether the second USB device allows to switch the second USB driver version to the first USB driver version.
  • the first USB device may be a USB host device, and the second USB device may be a USB slave device; or the first USB device may be a USB slave device, and the second USB device may be a USB host device. That is, the USB host device can initiate the switching of the USB driver version, and the USB slave device can also initiate the switching of the USB driver version. There are no restrictions.
  • the USB host device provided by the embodiment of the present invention may be a device such as a computer or a television
  • the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
  • the first USB device and the second USB device are in the process of data transmission using the USB3.0 version
  • the wireless fidelity module (English: WIreless-Fidelity, The abbreviation: WIFI) transmits a wireless signal
  • the data transmitted by the USB device of the USB 3.0 version may interfere with the wireless signal transmitted by the wireless module in the USB device. Therefore, the first USB device may be provided by using the embodiment of the present invention.
  • the method of switching the USB driver version switches the USB driver version used by the first USB device and the second USB device for data transmission.
  • the first USB device can reduce the USB driver version from the USB 3.0 version to the USB 2.0 version, so that While the data transmitted by the first USB device through the USB transmission interface is normally transmitted, the wireless signal transmitted by the first USB device through the wireless module is normally transmitted.
  • the first USB device when determining that the first USB device needs to switch the second USB driver version of the first USB device and the second USB device for data transmission, the first USB device may initiate a USB driver version switching, the specific A USB device can send a switch request message to the second USB device, where the switch request message carries a first USB driver version, and the switch request message can be used to request the second USB device to switch the second USB driver version to the first A USB driver version.
  • the second USB device can send a switch response message corresponding to the switch request message to the first USB device according to the USB drive version supported by the second USB device, and the switch response message is available. Instructing the second USB device whether to allow the second USB driver version to be switched to the first USB driver version, wherein the description of whether the specific second USB device supports the first USB driver version will be enumerated in detail in the following embodiments.
  • the first USB device may perform current data between the first USB device and the second USB device.
  • the second USB driver version used for the transfer is switched to the first USB driver version.
  • the handover request packet and the handover response packet provided by the embodiment of the present invention may be implemented by extending a field in a packet defined in the USB standard, for example, a control transfer (English: control transfer) message;
  • the format of the packet defined by the USB standard redefines a new packet implementation, and the implementation manner of the specific handover request packet and the handover response packet is not limited in the present invention.
  • a USB transaction is usually composed of three messages (also called packets or periods), which are marked packets (English: token packet) and data packets (English: data packet) ) and handshake packet.
  • the switch request message and the handover response message are implemented by extending a field in the tagged message and setting the identifier of the handover request message or the handover response message in the field.
  • the embodiment of the present invention may also re-define a new packet, and set the identifier of the handover request packet or the handover response packet in the new packet to implement the handover request packet and the handover response packet.
  • FIG. 2 is a schematic structural diagram of a handover request message;
  • FIG. 2 is a schematic structural diagram of a handover response message. Specifically, whether the marked message is a handover request message or a handover response message can be indicated by setting different values in the extension field.
  • USB driver versions mentioned in the embodiments of the present invention all refer to the hardware version of the USB.
  • the hardware version of the USB can include a USB hardware driver, a USB register, and a USB transmission line.
  • the first USB device may temporarily stop sending data to the second USB device, but the first USB device The data sent by the second USB device can still be received, and the data that has been received is processed; after the second USB device receives the switch request message sent by the first USB device, the second USB device can temporarily stop the first USB device.
  • the device sends data and continues the data that has been received before. The processing continues, and the second USB device responds to the handover request message, that is, the second USB device sends a handover response message to the first USB device.
  • the data can be continuously transmitted through the respective USB transmission interface using the switched USB driver version.
  • the switch request message and the switch response message exchanged by the first USB device and the second USB device are transmitted through the USB control channel.
  • the first USB device and the second USB device are not disconnected, so that the first USB device and the second USB device can directly switch the USB driver version after negotiating to switch the USB driver version, and After switching the USB driver version, you can continue to transfer data without re-establishing the connection and without renegotiating the USB driver version for data transmission, thus ensuring that the first USB device and the second USB device guarantee two USBs when switching the USB driver version.
  • the services transmitted between devices are not interrupted.
  • the method for switching the USB driver version provided by the embodiment of the present invention, because the first USB device and the second USB device negotiate whether to switch the USB driver version through the switch request message and the switch response message, so the switch request message and the switch response report are During the file transmission process, the first USB device and the second USB device are not disconnected, so that the first USB device and the second USB device can switch the USB driver version after negotiating through the switch request message and the switch response message. It can directly switch the USB driver version and use the switched USB driver version for data transmission.
  • the method for switching the USB driver version provided by the embodiment of the present invention does not disconnect the connection between the first USB device and the second USB device during the process of switching the USB driver version, so the USB is switched.
  • USB driver version After the driver version, there is no need to re-establish the connection and renegotiate the USB driver version for data transmission between the first USB device and the second USB device, thereby ensuring that the first USB device and the second USB device guarantee two when switching the USB driver version.
  • the services transmitted between the USB devices are not interrupted.
  • An embodiment of the present invention provides a method for switching a USB driver version. As shown in FIG. 3, the method may include:
  • the second USB device receives the handover request packet sent by the first USB device.
  • the switch request message carries a first USB driver version, and the switch request message is used to request the second USB device to switch the second USB driver version to the first USB driver version, and the second USB driver version is the first USB device and The USB driver version currently used by the second USB device.
  • the second USB device sends a handover response packet corresponding to the handover request packet to the first USB device, where the handover response packet is used to indicate whether the second USB device allows to switch the second USB driver version to the first USB. Driver version.
  • the second USB device can determine whether the second USB device supports the first USB driver version according to the USB driver version supported by the second USB device, if the second USB device supports the second USB device. a USB driver version, the second USB device may allow the second USB driver version to be switched to the first USB driver version; conversely, if the second USB device does not support the first USB driver version, the second USB device does not allow The second USB driver version is switched to the first USB driver version.
  • the USB driver version is USB3.0 version
  • the USB3.0 version is negotiated after the first USB device and the second USB device establish a connection for the first time.
  • the USB driver version, the USB driver version that the first USB device can support includes USB3.0 version, USB2.0 version and USB1.1 version; the second USB device can support the USB driver version also includes USB3.0 version, USB2 .0 version and USB 1.1 version.
  • the first USB driver version carried in the handover request message sent by the first USB device is the USB2.0 version
  • the second USB device since the second USB device supports the USB2.0 version, the second USB device can allow the USB 3.0 version to be switched. For the USB2.0 version.
  • the USB driver version is USB2.0 version
  • the USB2.0 version is the negotiated USB driver version when the first USB device and the second USB device establish a connection for the first time.
  • the USB driver version that the first USB device can support includes USB3.0 version, USB2.0 version and USB1.1. Version
  • the USB driver version that the second USB device can support includes USB2.0 version and USB1.1 version.
  • the USB driver version is USB2.0 version
  • the USB2.0 version is the first USB device and the second USB device will be USB3.0 version during data transmission.
  • the USB driver version that the first USB device can support includes USB3.0 version, USB2.0 version and USB1.1 version;
  • the second USB device can support the USB driver version also includes USB3.0 version. , USB2.0 version and USB1.1 version.
  • the first USB driver version carried in the switch request message sent by the first USB device is the USB3.0 version
  • the second USB device since the second USB device supports the USB3.0 version, the second USB device can allow the USB2.0 version to be switched. For the USB3.0 version.
  • the USB driver version that the first USB device can support is related to the actual hardware support capability of the first USB device; the USB driver version that the second USB device can support is related to the actual hardware support capability of the second USB device, and the present invention does not Specific restrictions.
  • the first USB device or the second USB device can also support all USB driver versions lower than the USB driver version.
  • the first USB device or the second USB device can also support all USB driver versions lower than the USB 3.0 version, such as the USB 2.0 version and the USB1. .1 version.
  • the second USB device may use the second data transmission currently after transmitting the handover response message to the first USB device.
  • the USB driver version is switched to the first USB driver version.
  • the method for switching the USB driver version provided by the embodiment of the present invention, because the first USB device and the second USB device negotiate whether to switch the USB driver version through the switch request message and the switch response message, so the switch request message and the switch response report are During the file transmission process, the first USB device and the second USB device are not disconnected, so that the first USB device and the second USB device can switch the USB driver version after negotiating through the switch request message and the switch response message. It can directly switch the USB driver version and use the switched USB driver version for data transmission.
  • the method for switching the USB driver version provided by the embodiment of the present invention does not disconnect the connection between the first USB device and the second USB device during the process of switching the USB driver version, so the USB is switched.
  • USB driver version After the driver version, there is no need to re-establish the connection and renegotiate the USB driver version for data transmission between the first USB device and the second USB device, thereby ensuring that the first USB device and the second USB device guarantee two when switching the USB driver version.
  • the services transmitted between the USB devices are not interrupted.
  • An embodiment of the present invention provides a method for switching a USB driver version. As shown in FIG. 4, the method may include:
  • the first USB device receives the first negotiation message sent by the second USB device, where the first negotiation message carries the highest USB driver version supported by the second USB device.
  • the first negotiation message is used by the second USB device to negotiate with the first USB device for the USB driver version for data transmission.
  • the first negotiation packet may further carry information such as the type of the second USB device.
  • the type of the second USB device can be a mouse, a USB flash drive, a keyboard, or the like.
  • the information of the type of the second USB device may be such that after the first USB device receives the first negotiation message sent by the second USB device, it determines which device the second USB device is, so that the first USB device can negotiate data.
  • the hardware drivers and control commands corresponding to the device are loaded. For example, if the type of the second USB device is a mouse, the first USB device can load the hardware driver and control commands corresponding to the mouse after negotiating the USB driver version for data transmission.
  • the first USB device is supported by the highest USB driver version supported by the second USB device. This and the highest USB driver version supported by the first USB device determine the third USB driver version for data transfer.
  • the third USB driver version for performing data transmission is the highest USB driver version supported by the first USB device and the second USB device. For example, if the highest USB driver version supported by the first USB device and the second USB device is the USB3.0 version, the third USB driver version for data transmission is the USB3.0 version; if the first USB device supports the highest The USB driver version is USB3.0 version, and the second USB device supports the highest USB driver version as USB2.0 version.
  • the third USB driver version for data transmission is USB2.0 version.
  • the first USB device sends a second negotiation message to the second USB device, where the second negotiation message carries the third USB driver version.
  • the second negotiation message is used to indicate to the second USB device that the USB driver version used for data transmission by the first USB device and the second USB device is the third USB driver version.
  • the first USB device is a USB host device
  • the second USB device is a USB slave device.
  • the USB host device provided by the embodiment of the present invention may be a device such as a computer or a television
  • the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
  • USB driver version when the first USB device and the second USB device described in the above S301-S303 negotiate a USB driver version for data transmission, the highest supported by both the first USB device and the second USB device can be negotiated.
  • USB driver version this is because the higher the USB driver version, the higher the data transfer rate of the USB transfer interface, so as to ensure that the data transmitted through the USB transfer interface can achieve a relatively large transfer rate.
  • the first USB device and the second USB device use the third USB driver version for data transmission.
  • the first USB device sends a handover request message to the second USB device, where the handover request message carries the first USB driver version.
  • the switching request message is used to request the second USB device to drive the second USB
  • the version is switched to the first USB driver version
  • the second USB driver version is the USB driver version currently used by the first USB device and the second USB device.
  • the second USB driver version may be a USB driver version negotiated when the first USB device and the second USB device are first established, that is, the second USB driver version may be the third USB driver determined in the above S302.
  • the second USB driver version may also be a USB driver version after the third USB driver version is negotiated after the first USB device and the second USB device are first established in the data transmission process.
  • the method for switching the USB driver version provided by the embodiment of the present invention may be applied to the third USB driver version negotiated when the first USB device and the second USB device are first established. (The third USB driver version is the second at this time.
  • USB driver version In the scenario that needs to be switched; it can also be applied to the first USB device to switch the first USB driver version after switching (the first USB driver version is the second USB driver version) to the first connection.
  • the third USB driver version after negotiation (the third USB driver version is the first USB driver version at this time); it can also be applied to the first USB driver version that needs to be switched after the first USB device (at this time)
  • the specific application scenario is not limited in the present invention.
  • the foregoing descriptions of the scenarios for switching USB driver versions are merely exemplary.
  • the present invention includes, but is not limited to, the scenarios described above for switching USB driver versions, that is, any switch that needs to be switched in the USB driver version.
  • the USB driver version can be switched by using the method of switching the USB driver version provided by the embodiment of the present invention.
  • the second USB driver version used for data transmission by the first USB device and the second USB device in the embodiment is the above S302.
  • a USB device and a second USB device establish a connection for the first time after the third USB driver version negotiated, and the switched USB driver version is the first USB driver version as an example for exemplary description.
  • the scenario in which the first USB device sends the handover request message to the second USB device may be one of the following:
  • the first USB device sends a switching request message to the second USB device, and the first USB driver version is a USB driver version lower than the second USB driver version.
  • the data transmitted by the USB transmission interface may cause interference to the wireless signal transmitted by the wireless module, causing the wireless module to disconnect, thereby causing the wireless module to fail to transmit wirelessly.
  • the wireless module can be a WIFI module or a data card (the data card can be a subscriber identity module (SIM) card).
  • the second USB driver version is the USB3.0 version, in order to eliminate the data transmitted by the first USB device using the USB3.0 version through the USB transmission interface of the first USB device to the wireless module in the first USB device.
  • the interference caused by the wireless signal ensures that the wireless module can transmit the wireless signal normally.
  • the USB driver version can be switched from the USB3.0 version to the USB2.0 version or the lower USB driver by using the method of switching the USB driver version provided by the embodiment of the present invention. version.
  • the first USB device when it is detected that the wireless module in the first USB device does not transmit data, and the USB driver version used by the first USB device to transmit data is not the highest USB driver version supported by the first USB device, the first USB device is in the second The USB device sends a handover request message, and the first USB driver version is a USB driver version higher than the second USB driver version.
  • the USB driver version is switched from the USB 3.0 version to the USB 2.0 version, if the wireless signal transmission of the wireless module in the first USB device is completed, and the first USB device transmits data
  • the USB driver version is not the highest USB driver version supported by the first USB device (the higher the USB driver version, the higher the transmission rate of the data transmitted by the USB transmission interface), in order to improve the transmission rate of the data transmitted by the USB transmission interface, this can be used.
  • the method for switching the USB driver version provided by the embodiment of the invention switches the USB driver version from the USB2.0 version to the USB3.0 version.
  • the first USB device sends a handover request message to the second USB device according to the trigger operation of the user.
  • the triggering operation is triggered by a user operating a driver version switching menu or a driving version switching button.
  • the user may trigger the first USB device to send a handover request message to the second USB device by operating the driver version switching menu or the driving version switching button.
  • the user can trigger the switching process of the USB driver version by selecting any one of the driver version switching menu or the driver version switching button that is different from the second USB driver version.
  • the first USB device may generate a driver version switching menu or a driver version switching button corresponding to the third USB driver version according to the third USB driver version.
  • the driver version switching menu or the driver version switching button includes at least a first USB driver version of the first USB device selection switching. That is, the first USB driver version may be included in the driver version switch menu or the driver version switch button.
  • the first USB driver version and other USB driver versions that the first USB device can support may also be included, which is not specifically limited by the present invention.
  • the user can trigger the switching process of the USB driver version by selecting the first USB driver version; when the driver version switching menu or the driver version switching button includes the first USB
  • the user can trigger the USB driver version switching process by selecting any one of the USB driver versions.
  • the driver version switch menu or the driver version switch button includes all USB driver versions that the first USB can support, that is, all USB driver versions that are lower than the third USB driver version. In this way, since the user can select more USB driver versions to switch, the flexibility of the user to trigger the USB driver version switching process can be increased.
  • the driver version switching menu or the driver version switching button generated by the first USB device includes the USB3.0 version, the USB2.0 version, and the USB1.1 version. That is, the first USB device and the second USB device After the third USB driver version for data transmission is negotiated when the connection is first established, the driver version switching menu or the driver version switching button generated by the first USB device includes a third USB driver version for data transmission after negotiation and The third USB driver version is low for all USB driver versions.
  • These USB driver versions are available for the first USB device to switch when it is necessary to switch the USB driver version.
  • the driver version switching menu generated by the first USB device may be as shown in (a) of FIG. 5; the first USB device generates The driver version switching button can be as shown in (b) of FIG.
  • the second USB device sends a handover response packet corresponding to the handover request message to the first USB device.
  • the switching response message is used to indicate whether the second USB device allows to switch the second USB driver version to the first USB driver version.
  • the second USB driver version is the third USB driver version determined in the above S302.
  • the second USB device can determine whether the second USB device supports the first USB driver version according to the USB driver version supported by the second USB device, if the second USB device supports the second USB device. a USB driver version, the second USB device may allow the second USB driver version to be switched to the first USB driver version; conversely, if the second USB device does not support the first USB driver version, the second USB device does not allow The second USB driver version is switched to the first USB driver version.
  • the first USB device sends a handover confirmation message corresponding to the handover response message to the second USB device.
  • the switch confirmation message is used to confirm that the first USB device switches the second USB driver version to the first USB driver version.
  • the first USB device and the second USB device use the first USB driver version for data transmission.
  • the first USB device may start to send data to the second USB device by using the first USB driver version through the USB transmission interface of the first USB device; correspondingly, the second The USB device also begins to receive data transmitted by the first USB device through the USB transmission interface of the second USB device using the first USB driver version.
  • the second USB device may start to send data to the first USB device by using the first USB driver version through the USB transmission interface of the second USB device; The first USB device also begins to receive data transmitted by the second USB device through the USB transmission interface of the first USB device using the first USB driver version.
  • the first USB device may be a USB host device, and the second USB device may be a USB slave device; or the first USB device may be a USB slave device, and the second USB device may be a USB host device. device.
  • the USB host device provided by the embodiment of the present invention may be a device such as a computer or a television
  • the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
  • the USB host device may initiate a USB driver version switching process
  • the USB slave device may initiate a USB driver version switching process, or the user may trigger the USB host.
  • the device initiates the switching process of the USB driver version, and the user can trigger the USB slave device to initiate the USB driver version switching process.
  • the specific design can be designed according to the actual use requirements, and the present invention is not limited.
  • S307 and S308 shown in FIG. 4 above may specifically include:
  • the switch response message indicates that the second USB device allows the second USB driver version to be switched to the first USB driver version
  • the second USB device switches the second USB driver corresponding to the second USB driver version to the first
  • the USB driver version corresponds to the first USB driver.
  • the second USB device switches the second register corresponding to the second USB driver version to the first register corresponding to the first USB driver version.
  • the second USB device switches the second data transmission line corresponding to the second USB driver version to the first data transmission line corresponding to the first USB driver version.
  • the second USB driver is a USB 3.0 driver
  • the first USB driver is a USB 2.0 driver
  • the second register is a USB 3.0 register
  • the first register is a USB 2.0 register
  • the second data transmission line is a USB3. .0 transmission line
  • the first data transmission line is a USB2.0 transmission line
  • the second USB device can switch the USB3.0 driver to the USB2
  • the .0 driver switches the USB3.0 register to the USB2.0 register and switches the USB3.0 transmission line to the USB2.0 transmission line, thereby completing the process of switching the second USB driver version to the first USB driver version.
  • the switch response message indicates that the second USB device allows the second USB driver version to be switched to the first USB driver version
  • the first USB device switches the second USB driver corresponding to the second USB driver version to the first
  • the USB driver version corresponds to the first USB driver.
  • the first USB device switches the second register corresponding to the second USB driver version to the first register corresponding to the first USB driver version.
  • the first USB device switches the second data transmission line corresponding to the second USB driver version to the first data transmission line corresponding to the first USB driver version.
  • the method for the first USB device to switch the USB driver version is similar to the method for the second USB device to switch the USB driver version.
  • the method for the first USB device to switch the USB driver version refer to the foregoing S307a-S307c for the second method. A description of the method for the USB device to switch the USB driver version will not be described here.
  • the switching process of the above USB driver version is only The USB transmission interface of the USB device is logically switched, and the switching process of the USB driver version can be implemented by a software program.
  • the first USB device and the second USB device can negotiate whether the USB driver version can be switched by using the switch request message and the switch response message, and the USB driver version can be switched when the first USB device and the second USB device negotiate. Thereafter, the first USB device and the second USB device can switch the USB driver version by switching the USB driver, the USB register, and the USB transmission line.
  • the first USB device and the second USB device can pass the driver, the register, and the transmission line corresponding to the USB 3.0 version.
  • Switch to the driver, register and transmission line corresponding to the USB2.0 version to logically switch the USB transmission interface from USB3.0 to USB2.0.
  • the first USB device and the second USB device can implement switching of the USB driver version by modifying configuration information corresponding to the USB driver version (for example, the above-mentioned driver, various parameter values in the register, and transmission rate of the transmission line).
  • the second USB device modifies the configuration information corresponding to the USB 3.0 version to the configuration information corresponding to the USB 2.0 version
  • the second USB device can load the USB 3.0 driver to replace the USB 2.0 driver
  • the values of the parameters of USB3.0 in the register are all changed to the values of the parameters of USB2.0, and the transmission rate of the transmission line of USB3.0 is modified to the transmission rate of the transmission line of USB2.0.
  • the method for the first USB device and the second USB device to switch the USB driver version may include, but is not limited to, the method listed above, that is, the USB can be switched by the method for switching the USB driver version provided by the embodiment of the present invention.
  • the USB driver version can be switched by other possible switching methods in the specific implementation, and the present invention will not be described in detail.
  • the USB driver versions mentioned in the embodiments of the present invention all refer to the hardware version of the USB.
  • the hardware version of the USB may include a USB hardware driver (such as the first USB driver and the second USB driver described above), a USB register (such as the first register and the second register described above), and a USB data transmission line (such as the above). The first data transmission line and the second data transmission line) and the like.
  • the first USB device After the switch sends the switch request message to the second USB device, the first USB device can temporarily stop sending data to the second USB device, but the first USB device can still receive the data sent by the second USB device and the received data.
  • the second USB device After the second USB device receives the switch request message sent by the first USB device, the second USB device can temporarily stop sending data to the first USB device, and continue processing the data that has been received before, and The second USB device responds to the handover request message, that is, the second USB device sends a handover response message to the first USB device.
  • the switch request message and the switch response message exchanged by the first USB device and the second USB device are transmitted through the USB control channel. Therefore, in the process, the first USB device and the second USB device are not disconnected, so that the first USB device and the second USB device can directly switch the USB driver version after negotiating to switch the USB driver version, and After switching the USB driver version, you can continue to transfer data without re-establishing the connection and without renegotiating the USB driver version for data transmission, thus ensuring that the first USB device and the second USB device guarantee two USBs when switching the USB driver version.
  • the services transmitted between devices are not interrupted.
  • the method for switching the USB driver version provided by the embodiment of the present invention, because the first USB device and the second USB device negotiate whether to switch the USB driver version through the switch request message and the switch response message, so the switch request message and the switch response report are During the file transmission process, the first USB device and the second USB device are not disconnected, so that the first USB device and the second USB device can switch the USB driver version after negotiating through the switch request message and the switch response message. It can directly switch the USB driver version and use the switched USB driver version for data transmission.
  • the method for switching the USB driver version provided by the embodiment of the present invention does not disconnect the connection between the first USB device and the second USB device during the process of switching the USB driver version, so the USB is switched.
  • USB driver version After the driver version, there is no need to re-establish the connection and renegotiate the USB driver version for data transmission between the first USB device and the second USB device, thereby ensuring that the first USB device and the second USB device guarantee two when switching the USB driver version.
  • the services transmitted between the USB devices are not interrupted.
  • an embodiment of the present invention provides a USB device, where the USB device may include:
  • the transceiver unit 10 is configured to send a handover request message to the second USB device, and receive a handover response packet corresponding to the handover request packet sent by the second USB device, where the handover request packet carries the a USB driver version, the switch request message is used to request the second USB device to switch the second USB driver version to the first USB driver version, and the second USB driver version is the USB device and the The USB driver version currently used by the second USB device, the switch response message is used to indicate whether the second USB device allows to switch the second USB driver version to the first USB driver version; For the second USB device if the switch response message received by the transceiver unit 10 indicates that the second USB device allows the second USB driver version to be switched to the first USB driver version. The driver version is switched to the first USB driver version.
  • the switching unit 11 is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; a second register corresponding to the second USB driver version is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to be the first The first data transmission line corresponding to the USB driver version.
  • the transceiver unit 10 is configured to: when the USB transmission interface in the USB device transmits data simultaneously with the wireless module in the USB device, send the handover request report to the second USB device.
  • the first USB driver version is a USB driver version lower than the second USB driver version.
  • the transceiver unit 10 is configured to detect that the wireless module in the USB device does not transmit data, and the USB driver version used by the USB device to transmit data is not the highest USB driver version supported by the USB device. And transmitting, by the second USB device, the switching request message, where the first USB driver version is a USB driver version higher than the second USB driver version.
  • the transceiver unit 10 is configured to send the switch request message to the second USB device according to a triggering operation of the user, where the trigger operation is the user operating a driver version switch menu or a driver version. Toggle button triggered.
  • the USB device further includes a generating unit 12,
  • the generating unit 12 is configured to generate the driver version switching menu or the driver version switching according to the third USB driver version before the transceiver unit 10 sends the switching request message to the second USB device.
  • a button, the driver version switching menu or the driver version switching button at least comprising the first USB driver version selected by the switching unit 11 to switch, the third USB driver version being the USB device and the second The USB driver version that is used after the USB device establishes the connection for the first time.
  • the transceiver unit 10 is further configured to: after the switching unit 11 switches the second USB driver version to the first USB driver version, send the switch to the second USB device And responding to the handover confirmation message corresponding to the message, the handover confirmation message is used to confirm that the USB device switches the second USB driver version to the first USB driver version.
  • the USB device further includes a transmission unit 13,
  • the transmitting unit 13 is configured to: after the sending and receiving unit 10 sends the switching confirmation message to the second USB device, adopt the first USB driver version that is switched by the switching unit 11 and the first Two USB devices for data transmission.
  • USB device in this embodiment may be the first USB device in the foregoing Embodiment 1 and Embodiment 2.
  • the USB device provided by the embodiment of the present invention is a USB host device, and the second USB device is a USB slave device; or the USB device is a USB slave device, and the second USB device is a USB master device. .
  • the USB host device provided by the embodiment of the present invention may be a device such as a computer or a television
  • the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
  • the embodiment of the invention provides a USB device, because the USB device and the second USB The device negotiates whether to switch the USB driver version through the switch request message and the switch response message. Therefore, during the process of switching the request message and the switch response message, the USB device and the second USB device are not disconnected. After the USB device version can be switched through the switch request message and the switch response message negotiation, the USB device and the second USB device can directly switch the USB driver version and use the switched USB driver version for data transmission.
  • the embodiment of the present invention does not disconnect the USB device and the second USB device during the process of switching the USB driver version, after switching the USB driver version, the USB device and the The USB driver version for data transmission between the two USB devices does not need to be re-established and renegotiated, so that the USB device and the second USB device can ensure that the services transmitted between the two USB devices are not interrupted when the USB driver version is switched.
  • an embodiment of the present invention provides another USB device, where the USB device may include:
  • the transceiver unit 20 is configured to receive a handover request packet sent by the first USB device, and send a handover response packet corresponding to the handover request packet to the first USB device, where the handover request packet carries the a USB driver version, the switch request message is used to request the USB device to switch a second USB driver version to the first USB driver version, and the second USB driver version is the first USB device and The USB driver version currently used by the USB device, the switch response message is used to indicate whether the USB device allows to switch the second USB driver version to the first USB driver version; and the switching unit 21 is configured to: The switching response message sent by the transceiver unit 20 indicates that the USB device allows to switch the second USB driver version to the first USB driver version, and then switches the second USB driver version to the The first USB driver version.
  • the switching unit 21 is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; a second register corresponding to the second USB driver version is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to be the first USB driver version Corresponding first data transmission line.
  • the transceiver unit 20 is further configured to: if the switch response message indicates that the USB device allows to switch the second USB driver version to the first USB driver version, Receiving, by the USB device, a handover response message corresponding to the handover request message, receiving a handover confirmation message sent by the first USB device, where the handover confirmation message is used to confirm that the first USB device is to be The second USB driver version is switched to the first USB driver version.
  • the USB device may further include a transmission unit 22,
  • the transmitting unit 22 is configured to: after the transceiver unit 20 receives the handover confirmation message sent by the first USB device, use the first USB driver version that is switched by the switching unit 21 and the The first USB device performs data transmission.
  • the first USB device provided by the embodiment of the present invention is a USB host device, and the USB device is a USB slave device; or the first USB device is a USB slave device, and the USB device is a USB master device. .
  • USB device in this embodiment may be the second USB device in the first embodiment and the second embodiment.
  • the USB host device provided by the embodiment of the present invention may be a device such as a computer or a television
  • the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
  • the embodiment of the present invention provides another USB device. Since the USB device and the first USB device negotiate whether to switch the USB driver version by using the handover request message and the handover response message, the handover request message and the handover response message transmission process are performed. The USB device and the first USB device are not disconnected, so that the USB device and the first USB device can directly switch the USB after switching the USB driver version through the negotiation of the switch request message and the switch response message. Drive version and use the switched USB driver version for data transfer. Compared with the prior art, since the USB connection between the USB device and the first USB device is not disconnected during the process of switching the USB driver version, the USB device and the USB device are switched after the USB driver version is switched.
  • USB device and the first USB device ensure that the services transmitted between the two USB devices are not interrupted when the USB driver version is switched.
  • an embodiment of the present invention provides a USB device, which may include a processor 30, a memory 31, a USB transmission interface 32, and a transmission bus 33, wherein the processor 30, the memory 31, and the USB are provided.
  • the transmission interfaces 32 are connected by the transmission bus 33 and complete communication with each other.
  • the processor 30 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. .
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • the USB transmission interface 32 may be an interface for data transmission between the USB device and other USB devices.
  • the memory 31 may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviation: RAM); the memory 31 may also include a non-volatile memory (English: Non-volatile memory, such as read-only memory (English: read-only memory, abbreviation: ROM), flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state drive (English) : solid-state drive, abbreviated: SSD); the memory 31 may also include a combination of the above types of memories.
  • a volatile memory such as a random access memory (English: random-access memory, abbreviation: RAM)
  • the memory 31 may also include a non-volatile memory (English: Non-volatile memory, such as read-only memory (English: read-only memory, abbreviation: ROM), flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state drive (English)
  • the processor 30 may perform the method flow described in FIG. 1, FIG. 4 or FIG.
  • the processor 30 is configured to send, by using the USB transmission interface 32, a handover request message to the second USB device, and receive, by using the USB transmission interface 32, the second USB device corresponding to the handover request message. And switching a response message, where the switch request message carries a first USB driver version, where the switch request message is used to request the second USB device to switch the second USB driver version to the first USB driver version,
  • the second USB driver version is a USB driver version currently used by the USB device and the second USB device, and the switch response message is used to indicate that the second USB device is Whether the second USB driver version is allowed to be switched to the first USB driver version;
  • the processor 30 is further configured to: if the switch response message indicates that the second USB device allows the second USB The driver version is switched to the first USB driver version, and the second USB driver version is switched to the first USB driver version;
  • the memory 31 is configured to store the code of the handover request message, the Switching a code of the response message, the first USB driver version, the second USB driver version, and
  • the processor 30 is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; a second register corresponding to the second USB driver version is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to be the first The first data transmission line corresponding to the USB driver version.
  • the processor 30 is configured to: when the USB transmission interface in the USB device transmits data simultaneously with the wireless module in the USB device, use the USB transmission interface to the second USB device Sending the switching request message, the first USB driver version is a USB driver version lower than the second USB driver version.
  • the processor 30 is configured to: when detecting that the wireless module in the USB device does not transmit data, and the USB device that uses the USB driver to transmit data is not the highest USB driver supported by the USB device.
  • the switching request message is sent to the second USB device by using the USB transmission interface, where the first USB driver version is a USB driver version higher than the second USB driver version.
  • the processor 30 is configured to send, by using the USB transmission interface 32, the handover request packet to the second USB device according to a trigger operation of the user, where the trigger operation is the user operation.
  • the driver version switch menu or the driver version switch button is triggered.
  • the processor 30 is further configured to generate the driver version switch menu or the driver version switch according to the third USB driver version before sending the switch request message to the second USB device.
  • a button, the driver version switching menu or the driver version switching button at least comprising the first USB driver version selected by the processor 30 to switch, the third USB driver version being the USB device and the second The USB driver version that is used after the USB device establishes the connection for the first time.
  • the processor 30 is further configured to send, by using the USB transmission interface 32, the second USB device after switching the second USB driver version to the first USB driver version. And a handover confirmation message corresponding to the handover response message, where the handover confirmation message is used to confirm that the USB device switches the second USB driver version to the first USB driver version.
  • the processor 30 is further configured to adopt, by using the USB transmission interface 32, the first USB driver version and the second after sending the handover confirmation message to the second USB device. USB devices for data transfer.
  • the USB device provided by the embodiment of the present invention is a USB host device, and the second USB device is a USB slave device; or the USB device is a USB slave device, and the second USB device is a USB master device. .
  • USB device in this embodiment may be the first USB device in the foregoing Embodiment 1 and Embodiment 2.
  • the USB host device provided by the embodiment of the present invention may be a device such as a computer or a television
  • the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
  • the embodiment of the present invention provides a USB device.
  • the USB device and the second USB device negotiate whether to switch the USB driver version by using the handover request message and the handover response message. Therefore, during the transmission of the handover request message and the handover response message, The USB device and the second USB device are not disconnected, so that the USB device and the second USB device can directly switch the USB driver after switching the USB driver version through the switch request message and the switch response message negotiation. Version, and use the switched USB driver version for data transfer.
  • the embodiment of the present invention does not disconnect the USB device and the second USB device during the process of switching the USB driver version.
  • USB driver version After switching the USB driver version, there is no need to re-establish connection and renegotiate the USB driver version for data transmission between the USB device and the second USB device, thereby ensuring that the USB device and the second USB device are switched when the USB driver version is switched. Ensure that the services transmitted between the two USB devices are not interrupted.
  • the embodiment of the present invention provides another USB device, which may include a processor 40, a memory 41, a USB transmission interface 42, and a transmission bus 43, wherein the processor 40, the memory 41, and the USB The transmission interfaces 42 are connected by the transmission bus 43 and complete communication with each other.
  • the processor 40 can be a CPU, or an ASIC, or one or more integrated circuits configured to implement embodiments of the present invention.
  • the USB transmission interface 42 may be an interface for data transmission between the USB device and other USB devices.
  • the memory 41 may include a volatile memory such as a RAM; the memory 41 may also include a non-volatile memory such as a ROM, a flash memory, an HDD or an SSD; the memory 41 may also include a memory of the above kind combination.
  • a volatile memory such as a RAM
  • the memory 41 may also include a non-volatile memory such as a ROM, a flash memory, an HDD or an SSD
  • the memory 41 may also include a memory of the above kind combination.
  • the processor 40 may perform the method and the process described in FIG. 3, FIG. 4 or FIG.
  • the processor 40 is configured to receive, by using the USB transmission interface 42, a handover request message sent by the first USB device, and send, by using the USB transmission interface 42 to the first USB device, a message corresponding to the handover request message. And switching a response message, where the switch request message carries a first USB driver version, where the switch request message is used to request the USB device to switch the second USB driver version to the first USB driver version, The second USB driver version is a USB driver version currently used by the first USB device and the USB device, and the switch response message is used to indicate whether the USB device allows to switch the second USB driver version to The first USB driver version; the processor 40 is further configured to: if the switch response message indicates that the USB device allows to switch the second USB driver version to the first USB driver version, The second USB driver version is switched to the first USB driver version; the memory 41 is configured to store a code of the handover request message, a code of the handover response message, and the first USB driver The version, the second USB driver version, and a software program that controls the processor 40
  • the processor 40 is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; a second register corresponding to the second USB driver version is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to be the first The first data transmission line corresponding to the USB driver version.
  • the processor 40 is further configured to: if the switch response message indicates that the USB device allows to switch the second USB driver version to the first USB driver version, After the USB device sends the handover response message corresponding to the handover request message, the USB transmission interface 42 receives the handover confirmation message sent by the first USB device, where the handover confirmation message is used to confirm the The first USB device switches the second USB driver version to the first USB driver version.
  • the processor 40 is further configured to: after receiving the handover confirmation message sent by the first USB device, adopt the first USB driver version and the first A USB device performs data transmission.
  • the first USB device provided by the embodiment of the present invention is a USB host device, and the USB device is a USB slave device; or the first USB device is a USB slave device, and the USB device is a USB master device. .
  • USB device in this embodiment may be the second USB device in the first embodiment and the second embodiment.
  • the USB host device provided by the embodiment of the present invention may be a device such as a computer or a television
  • the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
  • An embodiment of the present invention provides another USB device, because the USB device and the first USB device negotiate whether to switch the USB driver version by using a handover request message and a handover response message. Therefore, during the transmission of the handover request message and the handover response message, the USB device and the first USB device are not disconnected, so that the USB device and the first USB device are in the process of switching the request message and switching. After the USB message version can be switched in response to the message negotiation, the USB driver version can be directly switched, and the switched USB driver version is used for data transmission. Compared with the prior art, since the USB connection between the USB device and the first USB device is not disconnected during the process of switching the USB driver version, the USB device and the USB device are switched after the USB driver version is switched. The USB driver version of the first USB device does not need to be re-established and renegotiated for data transmission, thereby ensuring that the USB device and the first USB device ensure uninterrupted service transmission between the two USB devices when switching the USB driver version. .
  • an embodiment of the present invention provides a USB data transmission system, which may include a first USB device and a second USB device. Data transmission is performed between the first USB device and the second USB device through respective USB transmission interfaces.
  • FIG. 14 is merely an exemplary example, and the first USB device and the second USB device in FIG. 14 are also interchangeable.
  • the first USB device may be the USB device according to any one of the foregoing embodiments of FIG. 7 to FIG. 9; the second USB device may be any one of the foregoing third embodiment, as shown in any one of FIG. 10 to FIG. USB device.
  • the USB device as described in any one of FIG. 7 to FIG. 9 may be a USB slave device, and the USB device as described in any one of FIG. 10 to FIG. 11 may be a USB slave device; or, as shown in FIG. 7 to FIG. 9
  • the USB device can be a USB slave device, and the USB device can be a USB host device according to any one of the embodiments of the present invention. The specific invention is not limited.
  • the first USB device may be the USB device as described in FIG. 12 in the above embodiment 4; the second USB device may be the USB device as described in FIG. 13 in the fourth embodiment, wherein, as shown in FIG.
  • the USB device may be a USB host device, and the USB device as shown in FIG. 13 may be a USB slave device; or the USB device as shown in FIG. 12 may be a USB slave device, and the USB device as shown in FIG. 13 may be a USB host.
  • the device is not limited by the specific invention.
  • first USB device and the second USB device refer to the related descriptions of the first USB device and the second USB device in the foregoing Embodiment 3 and Embodiment 4, and details are not described herein again.
  • the USB host device provided by the embodiment of the present invention may be a device such as a computer or a television
  • the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
  • the first USB device and the second USB device use the second USB driver version for data transmission
  • the first USB device may send a handover request message to the second USB device, where the handover request message carries a first USB driver version, and the handover request message is used to request the second USB device to switch the second USB driver version to the first
  • the USB driver version after the second USB device receives the switch request message, the second USB device sends a switch response message to the first USB device, where the switch response message is used to indicate whether the second USB device supports switching the second USB driver version.
  • the second USB device For the first USB driver version, if the second USB device supports switching the second USB driver version to the first USB driver version, the second USB device switches the second USB driver version to the first USB driver version, and the first USB After the device receives the switch response message, the first USB device switches the second USB driver version to the first USB driver version, so that the first USB device and the second USB device A first data transmission with USB driver version.
  • An embodiment of the present invention provides a USB data transmission system, where the USB data transmission system may include a first USB device and a second USB device, because the first USB device and the second USB device pass the handover request message and the handover response report.
  • the USB driver version is switched, whether the first USB device and the second USB device are not disconnected during the switching request message and the switching response message transmission, so that the first USB device and the second USB device
  • the USB driver version can be directly switched, and the switched USB driver version is used for data transmission.
  • the first USB device and the second USB device do not need to re-establish connection and renegotiate for data transmission after switching the USB driver version.
  • the USB driver version ensures that the first USB device and the second USB device ensure that the services transmitted between the two USB devices are not interrupted when the USB driver version is switched.
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be another division manner for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention may contribute to the prior art or all or part of the technical solution may be embodied in the form of a software product.
  • the computer software product is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all of the methods described in various embodiments of the present invention. Or part of the steps.
  • the foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.

Abstract

A method for switching a USB driver version and a USB device, which relate to the technical field of USBs, and can ensure that a service transmitted between two USB devices is uninterrupted when a USB driver version is switched. The method comprises: a first USB device sends a switching request packet to a second USB device, wherein the switching request packet carries a first USB driver version, the switching request packet is used for requesting the second USB device to switch a second USB driver version into the first USB driver version, and the second USB driver version is a USB driver version currently adopted by the first USB device and the second USB device (S101); the first USB device receives a switching response packet which is sent by the second USB device and corresponds to the switching request packet, wherein the switching response packet is used for indicating whether the second USB device allows switching the second USB driver version into the first USB driver version (S102); and if the switching response packet indicates that the second USB device allows switching the second USB driver version into the first USB driver version, then the first USB device switches the second USB driver version into the first USB driver version (S103).

Description

一种切换USB驱动版本的方法及USB设备Method for switching USB driver version and USB device 技术领域Technical field
本发明涉及通用串行总线(英文:universal serial bus,缩写:USB)技术领域,尤其涉及一种切换USB驱动版本的方法及USB设备。The present invention relates to the field of universal serial bus (English: universal serial bus, abbreviated as USB), and in particular, to a method for switching a USB driver version and a USB device.
背景技术Background technique
随着USB技术的不断发展,USB3.0标准的应用越来越广泛。通常,USB主设备和USB从设备在首次建立连接时会以各自支持的最高USB驱动版本来协商数据传输时采用的USB驱动版本。例如,USB主设备最高支持USB3.0版本,USB从设备也最高支持USB3.0版本,则USB主设备和USB从设备协商后采用USB3.0版本进行数据传输。虽然采用USB3.0版本进行数据传输时可以达到很高的数据传输速率,但是在某些频段内,采用USB3.0版本的USB设备(包括USB主设备和USB从设备)传输的数据会对该USB设备中的无线模块传输的无线信号造成干扰。With the continuous development of USB technology, the application of the USB3.0 standard has become more and more extensive. Typically, USB masters and USB slaves negotiate the USB driver version used for data transfer with the highest supported USB driver version when they first establish a connection. For example, the USB host device supports up to USB version 3.0, and the USB slave device also supports USB version 3.0. After the USB host device and the USB slave device negotiate, the USB3.0 version is used for data transmission. Although the USB 3.0 version can achieve high data transfer rate when data is transmitted, in some frequency bands, data transmitted by USB 3.0 version USB devices (including USB host devices and USB slave devices) will be used. The wireless signal transmitted by the wireless module in the USB device causes interference.
目前,USB主设备采用USB3.0版本进行数据传输时,为了避免该数据对该USB主设备中的无线模块传输的无线信号造成的干扰,可通过手动修改USB主设备支持的最高USB驱动版本,来降低USB主设备与USB从设备进行数据传输时采用的USB驱动版本。At present, when the USB host device uses USB3.0 version for data transmission, in order to avoid the interference caused by the data to the wireless signal transmitted by the wireless module in the USB host device, the highest USB driver version supported by the USB host device can be manually modified. To reduce the USB driver version used for data transfer between the USB host device and the USB slave device.
然而,上述方法中,在手动修改USB主设备支持的最高USB驱动版本后,USB主设备支持的最高USB驱动版本会发生变化,由于该变化会导致USB主设备与USB从设备之间断开连接,因此USB主设备与USB从设备之间需要重新建立连接和重新协商进行数据传输的USB驱动版本,从而会中断USB主设备与USB从设备之间传输的业务。However, in the above method, after manually modifying the highest USB driver version supported by the USB host device, the highest USB driver version supported by the USB host device changes, and the change may cause the USB host device to disconnect from the USB slave device. Therefore, the USB host device and the USB slave device need to re-establish a connection and renegotiate the USB driver version for data transmission, thereby interrupting the service transmitted between the USB host device and the USB slave device.
发明内容Summary of the invention
本发明提供一种切换USB驱动版本的方法及USB设备,能够保证在切换USB驱动版本时保障USB主设备与USB从设备之间传输的 业务不中断。The invention provides a method for switching a USB driver version and a USB device, which can ensure the transmission between the USB host device and the USB slave device when switching the USB driver version. Business is not interrupted.
为达到上述目的,本发明采用如下技术方案:In order to achieve the above object, the present invention adopts the following technical solutions:
第一方面,本发明提供一种切换通用串行总线USB驱动版本的方法,包括:In a first aspect, the present invention provides a method for switching a universal serial bus USB driver version, including:
第一USB设备向第二USB设备发送切换请求报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述第二USB设备将第二USB驱动版本切换为所述第一USB驱动版本,所述第二USB驱动版本为所述第一USB设备和所述第二USB设备当前采用的USB驱动版本;The first USB device sends a switch request message to the second USB device, where the switch request message carries a first USB driver version, and the switch request message is used to request the second USB device to use the second USB driver version. Switching to the first USB driver version, the second USB driver version being a USB driver version currently used by the first USB device and the second USB device;
所述第一USB设备接收所述第二USB设备发送的与所述切换请求报文对应的切换响应报文,所述切换响应报文用于指示所述第二USB设备是否允许将所述第二USB驱动版本切换为所述第一USB驱动版本;The first USB device receives a handover response message corresponding to the handover request message sent by the second USB device, where the handover response message is used to indicate whether the second USB device allows the Switching the second USB driver version to the first USB driver version;
若所述切换响应报文指示所述第二USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则所述第一USB设备将所述第二USB驱动版本切换为所述第一USB驱动版本。If the switch response message indicates that the second USB device allows to switch the second USB driver version to the first USB driver version, the first USB device switches the second USB driver version to The first USB driver version.
在第一方面的第一种可能的实现方式中,所述第一USB设备将所述第二USB驱动版本切换为所述第一USB驱动版本,包括:In a first possible implementation manner of the first aspect, the first USB device switches the second USB driver version to the first USB driver version, including:
所述第一USB设备将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;The first USB device switches a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version;
所述第一USB设备将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;The first USB device switches a second register corresponding to the second USB driver version to a first register corresponding to the first USB driver version;
所述第一USB设备将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本对应的第一数据传输线路。The first USB device switches a second data transmission line corresponding to the second USB driver version to a first data transmission line corresponding to the first USB driver version.
结合第一方面或第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述第一USB设备向第二USB设备发送切换请求报文,包括:With reference to the first aspect, or the first possible implementation manner of the first aspect, in a second possible implementation manner, the first USB device sends a handover request message to the second USB device, including:
当所述第一USB设备中的USB传输接口与所述第一USB设备中 的无线模块同时传输数据时,所述第一USB设备向所述第二USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本低的USB驱动版本。When the USB transmission interface in the first USB device is in the first USB device When the wireless module simultaneously transmits data, the first USB device sends the switching request message to the second USB device, where the first USB driver version is a USB driver version lower than the second USB driver version. .
结合第一方面或第一方面的第一种可能的实现方式,在第三种可能的实现方式中,所述第一USB设备向第二USB设备发送切换请求报文,包括:With the first aspect or the first possible implementation manner of the first aspect, in a third possible implementation manner, the first USB device sends a handover request message to the second USB device, including:
当检测到所述第一USB设备中的无线模块未传输数据,且所述第一USB设备传输数据采用的USB驱动版本不是所述第一USB设备支持的最高USB驱动版本时,所述第一USB设备向所述第二USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本高的USB驱动版本。When it is detected that the wireless module in the first USB device does not transmit data, and the USB driver version used by the first USB device to transmit data is not the highest USB driver version supported by the first USB device, the first The USB device sends the switching request message to the second USB device, the first USB driver version being a USB driver version higher than the second USB driver version.
结合第一方面或第一方面的第一种可能的实现方式,在第四种可能的实现方式中,所述第一USB设备向第二USB设备发送切换请求报文,包括:With reference to the first aspect, or the first possible implementation manner of the first aspect, in a fourth possible implementation, the first USB device sends a handover request message to the second USB device, including:
所述第一USB设备根据用户的触发操作,向所述第二USB设备发送所述切换请求报文,所述触发操作为所述用户操作驱动版本切换菜单或驱动版本切换按钮触发的。The first USB device sends the switching request message to the second USB device according to a triggering operation of the user, where the triggering operation is triggered by the user operating a driving version switching menu or a driving version switching button.
结合第一方面的第四种可能的实现方式,在第五种可能的实现方式中,所述第一USB设备向第二USB设备发送切换请求报文之前,所述方法还包括:With the fourth possible implementation of the first aspect, in a fifth possible implementation, before the first USB device sends a handover request message to the second USB device, the method further includes:
所述第一USB设备根据第三USB驱动版本,生成所述驱动版本切换菜单或所述驱动版本切换按钮,所述驱动版本切换菜单或所述驱动版本切换按钮至少包括所述第一USB设备选择切换的所述第一USB驱动版本,所述第三USB驱动版本为所述第一USB设备和所述第二USB设备首次建立连接时协商后采用的USB驱动版本。The first USB device generates the driver version switching menu or the driver version switching button according to a third USB driver version, and the driving version switching menu or the driving version switching button includes at least the first USB device selection Switching the first USB driver version, the third USB driver version is a USB driver version adopted after the first USB device and the second USB device establish a connection for the first time.
结合第一方面或第一方面的第一种可能的实现方式至第五种可能的实现方式中的任一种实现方式,在第六种可能的实现方式中,With reference to the first aspect or the first possible implementation manner of the first aspect to any one of the fifth possible implementation manners, in a sixth possible implementation manner,
所述第一USB设备为USB主设备,所述第二USB设备为USB从设备;或者 The first USB device is a USB host device, and the second USB device is a USB slave device; or
所述第一USB设备为USB从设备,所述第二USB设备为USB主设备。The first USB device is a USB slave device, and the second USB device is a USB master device.
第二方面,本发明提供一种切换通用串行总线USB驱动版本的方法,包括:In a second aspect, the present invention provides a method for switching a universal serial bus USB driver version, including:
第二USB设备接收第一USB设备发送的切换请求报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述第二USB设备将第二USB驱动版本切换为所述第一USB驱动版本,所述第二USB驱动版本为所述第一USB设备和所述第二USB设备当前采用的USB驱动版本;The second USB device receives the switch request message sent by the first USB device, where the switch request message carries the first USB driver version, and the switch request message is used to request the second USB device to drive the second USB drive The version is switched to the first USB driver version, and the second USB driver version is a USB driver version currently adopted by the first USB device and the second USB device;
所述第二USB设备向所述第一USB设备发送与所述切换请求报文对应的切换响应报文,所述切换响应报文用于指示所述第二USB设备是否允许将所述第二USB驱动版本切换为所述第一USB驱动版本;The second USB device sends a handover response message corresponding to the handover request message to the first USB device, where the handover response message is used to indicate whether the second USB device allows the second The USB driver version is switched to the first USB driver version;
若所述切换响应报文指示所述第二USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则所述第二USB设备将所述第二USB驱动版本切换为所述第一USB驱动版本。If the switch response message indicates that the second USB device allows to switch the second USB driver version to the first USB driver version, the second USB device switches the second USB driver version to The first USB driver version.
在第二方面的第一种可能的实现方式中,所述第二USB设备将所述第二USB驱动版本切换为所述第一USB驱动版本,包括:In a first possible implementation manner of the second aspect, the second USB device switches the second USB driver version to the first USB driver version, including:
所述第二USB设备将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;The second USB device switches a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version;
所述第二USB设备将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;The second USB device switches a second register corresponding to the second USB driver version to a first register corresponding to the first USB driver version;
所述第二USB设备将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本对应的第一数据传输线路。The second USB device switches a second data transmission line corresponding to the second USB driver version to a first data transmission line corresponding to the first USB driver version.
结合第二方面或第二方面的第一种可能的实现方式,在第二种可能的实现方式中,With reference to the second aspect or the first possible implementation manner of the second aspect, in a second possible implementation manner,
所述第一USB设备为USB主设备,所述第二USB设备为USB从设备;或者 The first USB device is a USB host device, and the second USB device is a USB slave device; or
所述第一USB设备为USB从设备,所述第二USB设备为USB主设备。The first USB device is a USB slave device, and the second USB device is a USB master device.
第三方面,本发明提供一种通用串行总线USB设备,包括:In a third aspect, the present invention provides a universal serial bus USB device, including:
收发单元,用于向第二USB设备发送切换请求报文,并接收所述第二USB设备发送的与所述切换请求报文对应的切换响应报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述第二USB设备将第二USB驱动版本切换为所述第一USB驱动版本,所述第二USB驱动版本为所述USB设备和所述第二USB设备当前采用的USB驱动版本,所述切换响应报文用于指示所述第二USB设备是否允许将所述第二USB驱动版本切换为所述第一USB驱动版本;a transceiver unit, configured to send a handover request message to the second USB device, and receive a handover response packet corresponding to the handover request packet sent by the second USB device, where the handover request packet carries the first a USB driver version, the switch request message is used to request the second USB device to switch the second USB driver version to the first USB driver version, the second USB driver version is the USB device and the a USB driver version currently used by the second USB device, the switch response message being used to indicate whether the second USB device allows to switch the second USB driver version to the first USB driver version;
切换单元,用于若所述收发单元接收的所述切换响应报文指示所述第二USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则将所述第二USB驱动版本切换为所述第一USB驱动版本。a switching unit, configured to: if the switch response message received by the transceiver unit indicates that the second USB device allows to switch the second USB driver version to the first USB driver version, The USB driver version is switched to the first USB driver version.
在第三方面的第一种可能的实现方式中,In a first possible implementation of the third aspect,
所述切换单元,具体用于将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;并将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;以及将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本对应的第一数据传输线路。The switching unit is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; and to be associated with the second USB driver version Corresponding second register is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to correspond to the first USB driver version The first data transmission line.
结合第三方面或第三方面的第一种可能的实现方式,在第二种可能的实现方式中,With reference to the third aspect or the first possible implementation manner of the third aspect, in a second possible implementation manner,
所述收发单元,具体用于当所述USB设备中的USB传输接口与所述USB设备中的无线模块同时传输数据时,向所述第二USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本低的USB驱动版本。The transceiver unit is configured to: when the USB transmission interface in the USB device transmits data simultaneously with the wireless module in the USB device, send the handover request message to the second USB device, where the A USB driver version is a lower USB driver version than the second USB driver version.
结合第三方面或第三方面的第一种可能的实现方式,在第三种 可能的实现方式中,In combination with the third aspect or the first possible implementation of the third aspect, in the third Possible implementations,
所述收发单元,具体用于当检测到所述USB设备中的无线模块未传输数据,且所述USB设备传输数据采用的USB驱动版本不是所述USB设备支持的最高USB驱动版本时,向所述第二USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本高的USB驱动版本。The transceiver unit is specifically configured to: when detecting that the wireless module in the USB device does not transmit data, and the USB driver version used by the USB device to transmit data is not the highest USB driver version supported by the USB device, The second USB device sends the switching request message, and the first USB driver version is a USB driver version higher than the second USB driver version.
结合第三方面或第三方面的第一种可能的实现方式,在第四种可能的实现方式中,With reference to the third aspect or the first possible implementation manner of the third aspect, in a fourth possible implementation manner,
所述收发单元,具体用于根据用户的触发操作,向所述第二USB设备发送所述切换请求报文,所述触发操作为所述用户操作驱动版本切换菜单或驱动版本切换按钮触发的。The transceiver unit is configured to send the switch request message to the second USB device according to a trigger operation of the user, where the trigger operation is triggered by the user operating a driver version switch menu or a driver version switch button.
结合第三方面的第四种可能的实现方式,在第五种可能的实现方式中,所述USB设备还包括生成单元,In conjunction with the fourth possible implementation of the third aspect, in a fifth possible implementation, the USB device further includes a generating unit,
所述生成单元,用于在所述收发单元向所述第二USB设备发送所述切换请求报文之前,根据第三USB驱动版本,生成所述驱动版本切换菜单或所述驱动版本切换按钮,所述驱动版本切换菜单或所述驱动版本切换按钮至少包括所述切换单元选择切换的所述第一USB驱动版本,所述第三USB驱动版本为所述USB设备和所述第二USB设备首次建立连接时协商后采用的USB驱动版本。The generating unit is configured to generate the driving version switching menu or the driving version switching button according to the third USB driver version before the sending and receiving unit sends the switching request message to the second USB device, The driving version switching menu or the driving version switching button includes at least the first USB driving version that the switching unit selects to switch, and the third USB driving version is the USB device and the second USB device for the first time. The USB driver version used after negotiation to establish a connection.
结合第三方面或第三方面的第一种可能的实现方式至第五种可能的实现方式中的任一种实现方式,在第六种可能的实现方式中,With reference to the third aspect or any one of the first possible implementation manner of the third aspect to the fifth possible implementation manner, in a sixth possible implementation manner,
所述USB设备为USB主设备,所述第二USB设备为USB从设备;或者The USB device is a USB host device, and the second USB device is a USB slave device; or
所述USB设备为USB从设备,所述第二USB设备为USB主设备。The USB device is a USB slave device, and the second USB device is a USB master device.
第四方面,本发明提供一种通用串行总线USB设备,包括:In a fourth aspect, the present invention provides a universal serial bus USB device, including:
收发单元,用于接收第一USB设备发送的切换请求报文,并向所述第一USB设备发送与所述切换请求报文对应的切换响应报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述USB设备将第二USB驱动版本切换为所述第一USB驱动 版本,所述第二USB驱动版本为所述第一USB设备和所述USB设备当前采用的USB驱动版本,所述切换响应报文用于指示所述USB设备是否允许将所述第二USB驱动版本切换为所述第一USB驱动版本;The transceiver unit is configured to receive a handover request packet sent by the first USB device, and send a handover response packet corresponding to the handover request packet to the first USB device, where the handover request packet carries the first a USB driver version, the switch request message is used to request the USB device to switch the second USB driver version to the first USB driver The second USB driver version is a USB driver version currently used by the first USB device and the USB device, and the switch response message is used to indicate whether the USB device allows the second USB driver The version is switched to the first USB driver version;
切换单元,用于若所述收发单元发送的所述切换响应报文指示所述USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则将所述第二USB驱动版本切换为所述第一USB驱动版本。a switching unit, configured to: if the switching response message sent by the transceiver unit indicates that the USB device allows to switch the second USB driver version to the first USB driver version, then the second USB driver The version is switched to the first USB driver version.
在第四方面的第一种可能的实现方式中,In a first possible implementation of the fourth aspect,
所述切换单元,具体用于将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;并将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;以及将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本对应的第一数据传输线路。The switching unit is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; and to be associated with the second USB driver version Corresponding second register is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to correspond to the first USB driver version The first data transmission line.
结合第四方面或第四方面的第一种可能的实现方式,在第二种可能的实现方式中,With reference to the fourth aspect or the first possible implementation manner of the fourth aspect, in a second possible implementation manner,
所述第一USB设备为USB主设备,所述USB设备为USB从设备;或者The first USB device is a USB host device, and the USB device is a USB slave device; or
所述第一USB设备为USB从设备,所述USB设备为USB主设备。The first USB device is a USB slave device, and the USB device is a USB master device.
第五方面,本发明提供一种通用串行总线USB设备,包括:In a fifth aspect, the present invention provides a universal serial bus USB device, including:
处理器,用于通过USB传输接口向第二USB设备发送切换请求报文,并通过所述USB传输接口接收所述第二USB设备发送的与所述切换请求报文对应的切换响应报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述第二USB设备将第二USB驱动版本切换为所述第一USB驱动版本,所述第二USB驱动版本为所述USB设备和所述第二USB设备当前采用的USB驱动版本,所述切换响应报文用于指示所述第二USB设备是否允许将所述第二USB驱动版本切换为所述第一USB驱动版本;a processor, configured to send, by using a USB transmission interface, a handover request message to the second USB device, and receive, by using the USB transmission interface, a handover response message that is sent by the second USB device and corresponding to the handover request message, The switching request message carries a first USB driver version, and the switching request message is used to request the second USB device to switch the second USB driver version to the first USB driver version, the second USB The driver version is a USB driver version currently used by the USB device and the second USB device, and the switch response message is used to indicate whether the second USB device allows to switch the second USB driver version to the First USB driver version;
所述处理器,还用于若所述切换响应报文指示所述第二USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则 将所述第二USB驱动版本切换为所述第一USB驱动版本。The processor is further configured to: if the switch response message indicates that the second USB device allows to switch the second USB driver version to the first USB driver version, Switching the second USB driver version to the first USB driver version.
在第五方面的第一种可能的实现方式中,In a first possible implementation of the fifth aspect,
所述处理器,具体用于将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;并将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;以及将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本对应的第一数据传输线路。The processor is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; and to be associated with the second USB driver version Corresponding second register is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to correspond to the first USB driver version The first data transmission line.
结合第五方面或第五方面的第一种可能的实现方式,在第二种可能的实现方式中,With reference to the fifth aspect or the first possible implementation manner of the fifth aspect, in a second possible implementation manner,
所述处理器,具体用于当所述USB设备中的USB传输接口与所述USB设备中的无线模块同时传输数据时,通过所述USB传输接口向所述第二USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本低的USB驱动版本。The processor is configured to: when the USB transmission interface in the USB device transmits data simultaneously with the wireless module in the USB device, send the switching request to the second USB device by using the USB transmission interface The message, the first USB driver version is a USB driver version lower than the second USB driver version.
结合第五方面或第五方面的第一种可能的实现方式,在第三种可能的实现方式中,With reference to the fifth aspect or the first possible implementation manner of the fifth aspect, in a third possible implementation manner,
所述处理器,具体用于当检测到所述USB设备中的无线模块未传输数据,且所述USB设备传输数据采用的USB驱动版本不是所述USB设备支持的最高USB驱动版本时,通过所述USB传输接口向所述第二USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本高的USB驱动版本。The processor is specifically configured to: when detecting that the wireless module in the USB device does not transmit data, and the USB driver version used by the USB device to transmit data is not the highest USB driver version supported by the USB device, The USB transmission interface sends the switching request message to the second USB device, where the first USB driver version is a USB driver version higher than the second USB driver version.
结合第五方面或第五方面的第一种可能的实现方式,在第四种可能的实现方式中,With reference to the fifth aspect or the first possible implementation manner of the fifth aspect, in a fourth possible implementation manner,
所述处理器,具体用于根据用户的触发操作,通过所述USB传输接口向所述第二USB设备发送所述切换请求报文,所述触发操作为所述用户操作驱动版本切换菜单或驱动版本切换按钮触发的。The processor is specifically configured to send, by using the USB transmission interface, the handover request message to the second USB device according to a trigger operation of the user, where the trigger operation is the user operating a driver version switching menu or driver The version switch button is triggered.
结合第五方面的第四种可能的实现方式,在第五种可能的实现方式中,With reference to the fourth possible implementation manner of the fifth aspect, in a fifth possible implementation manner,
所述处理器,还用于在向所述第二USB设备发送所述切换请求 报文之前,根据第三USB驱动版本,生成所述驱动版本切换菜单或所述驱动版本切换按钮,所述驱动版本切换菜单或所述驱动版本切换按钮至少包括所述处理器选择切换的所述第一USB驱动版本,所述第三USB驱动版本为所述USB设备和所述第二USB设备首次建立连接时协商后采用的USB驱动版本。The processor is further configured to send the handover request to the second USB device Before the message, generating the driver version switching menu or the driver version switching button according to the third USB driver version, the driving version switching menu or the driving version switching button at least including the processor selection switching a first USB driver version, wherein the third USB driver version is a USB driver version adopted after the USB device and the second USB device establish a connection for the first time.
结合第五方面或第五方面的第一种可能的实现方式至第五种可能的实现方式中的任一种实现方式,在第六种可能的实现方式中,With reference to the implementation of any one of the first possible implementation to the fifth possible implementation of the fifth aspect or the fifth aspect, in a sixth possible implementation manner,
所述USB设备为USB主设备,所述第二USB设备为USB从设备;或者The USB device is a USB host device, and the second USB device is a USB slave device; or
所述USB设备为USB从设备,所述第二USB设备为USB主设备。The USB device is a USB slave device, and the second USB device is a USB master device.
第六方面,本发明提供一种通用串行总线USB设备,包括:In a sixth aspect, the present invention provides a universal serial bus USB device, including:
处理器,用于通过USB传输接口接收第一USB设备发送的切换请求报文,并通过所述USB传输接口向所述第一USB设备发送与所述切换请求报文对应的切换响应报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述USB设备将第二USB驱动版本切换为所述第一USB驱动版本,所述第二USB驱动版本为所述第一USB设备和所述USB设备当前采用的USB驱动版本,所述切换响应报文用于指示所述USB设备是否允许将所述第二USB驱动版本切换为所述第一USB驱动版本;a processor, configured to receive, by using a USB transmission interface, a handover request message sent by the first USB device, and send, by using the USB transmission interface, a handover response message corresponding to the handover request message to the first USB device, The switching request message carries a first USB driver version, and the switching request message is used to request the USB device to switch the second USB driver version to the first USB driver version, and the second USB driver version The switching response message is used to indicate whether the USB device allows to switch the second USB driver version to the first USB driver for the USB driver version currently used by the first USB device and the USB device. version;
所述处理器,还用于若所述切换响应报文指示所述USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则将所述第二USB驱动版本切换为所述第一USB驱动版本。The processor is further configured to: if the switch response message indicates that the USB device allows to switch the second USB driver version to the first USB driver version, switch the second USB driver version to The first USB driver version.
在第六方面的第一种可能的实现方式中,In a first possible implementation of the sixth aspect,
所述处理器,具体用于将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;并将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;以及将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本对应的第一数据传输线路。 The processor is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; and to be associated with the second USB driver version Corresponding second register is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to correspond to the first USB driver version The first data transmission line.
结合第六方面或第六方面的第一种可能的实现方式,在第二种可能的实现方式中,With reference to the sixth aspect or the first possible implementation manner of the sixth aspect, in a second possible implementation manner,
所述第一USB设备为USB主设备,所述USB设备为USB从设备;或者The first USB device is a USB host device, and the USB device is a USB slave device; or
所述第一USB设备为USB从设备,所述USB设备为USB主设备。The first USB device is a USB slave device, and the USB device is a USB master device.
本发明提供一种切换USB驱动版本的方法及USB设备,通过第一USB设备向第二USB设备发送切换请求报文,该切换请求报文中携带第一USB驱动版本,该切换请求报文用于请求第二USB设备将第二USB驱动版本切换为第一USB驱动版本,第二USB驱动版本为第一USB设备和第二USB设备当前采用的USB驱动版本;且第一USB设备接收第二USB设备发送的与该切换请求报文对应的切换响应报文,该切换响应报文用于指示第二USB设备是否允许将第二USB驱动版本切换为第一USB驱动版本;以及若该切换响应报文指示第二USB设备允许将第二USB驱动版本切换为第一USB驱动版本,则第一USB设备将第二USB驱动版本切换为第一USB驱动版本。通过该方案,由于第一USB设备和第二USB设备通过切换请求报文和切换响应报文协商是否切换USB驱动版本,因此在切换请求报文和切换响应报文传输过程中,第一USB设备和第二USB设备之间不会断开连接,从而第一USB设备和第二USB设备在协商可以切换USB驱动版本后,能够直接切换USB驱动版本,并采用切换后的USB驱动版本进行数据传输。与现有技术相比,本发明在切换USB驱动版本后,第一USB设备和第二USB设备之间无需重新建立连接和重新协商进行数据传输的USB驱动版本,从而可以保证第一USB设备和第二USB设备在切换USB驱动版本时保障两个USB设备之间传输的业务不中断。The present invention provides a method for switching a USB driver version and a USB device. The first USB device sends a switch request message to the second USB device, where the switch request message carries the first USB driver version, and the switch request message is used by the switch request message. And requesting the second USB device to switch the second USB driver version to the first USB driver version, the second USB driver version is the USB driver version currently adopted by the first USB device and the second USB device; and the first USB device receives the second a switching response message corresponding to the switching request message sent by the USB device, the switching response message is used to indicate whether the second USB device allows to switch the second USB driver version to the first USB driver version; and if the switching response is The message indicates that the second USB device allows the second USB driver version to be switched to the first USB driver version, and the first USB device switches the second USB driver version to the first USB driver version. With the solution, the first USB device and the second USB device negotiate whether to switch the USB driver version by using the handover request message and the handover response message, so in the process of switching the handover request message and the handover response message, the first USB device The connection between the second USB device and the second USB device is not disconnected, so that the first USB device and the second USB device can directly switch the USB driver version after negotiating to switch the USB driver version, and use the switched USB driver version for data transmission. . Compared with the prior art, after switching the USB driver version, the present invention does not need to re-establish connection and renegotiate the USB driver version for data transmission between the first USB device and the second USB device, thereby ensuring the first USB device and The second USB device ensures that the services transmitted between the two USB devices are not interrupted when the USB driver version is switched.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例。 In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is some embodiments of the invention.
图1为本发明实施例提供的一种切换USB驱动版本的方法流程图;FIG. 1 is a flowchart of a method for switching a USB driver version according to an embodiment of the present invention;
图2中的(a)为本发明实施例提供的切换请求报文的结构示意图;FIG. 2 is a schematic structural diagram of a handover request packet according to an embodiment of the present invention;
图2中的(b)为本发明实施例提供的切换响应报文的结构示意图;FIG. 2(b) is a schematic structural diagram of a handover response packet according to an embodiment of the present invention;
图3为本发明实施例提供的一种切换USB驱动版本的方法流程图;FIG. 3 is a flowchart of a method for switching a USB driver version according to an embodiment of the present invention;
图4为本发明实施例提供的一种切换USB驱动版本的方法交互图;4 is an interaction diagram of a method for switching a USB driver version according to an embodiment of the present invention;
图5中的(a)为本发明实施例提供的驱动版本切换菜单的示意图;FIG. 5 is a schematic diagram of a driving version switching menu according to an embodiment of the present invention;
图5中的(b)为本发明实施例提供的驱动版本切换按钮的示意图;FIG. 5(b) is a schematic diagram of a driving version switching button according to an embodiment of the present invention;
图6为本发明实施例提供的一种切换USB驱动版本的方法交互图;FIG. 6 is an interaction diagram of a method for switching a USB driver version according to an embodiment of the present invention;
图7为本发明实施例提供的一种USB设备的结构示意图一;FIG. 7 is a schematic structural diagram 1 of a USB device according to an embodiment of the present disclosure;
图8为本发明实施例提供的一种USB设备的结构示意图二;FIG. 8 is a schematic structural diagram 2 of a USB device according to an embodiment of the present disclosure;
图9为本发明实施例提供的一种USB设备的结构示意图三;FIG. 9 is a schematic structural diagram 3 of a USB device according to an embodiment of the present disclosure;
图10为本发明实施例提供的另一种USB设备的结构示意图一;FIG. 10 is a schematic structural diagram 1 of another USB device according to an embodiment of the present disclosure;
图11为本发明实施例提供的另一种USB设备的结构示意图二;FIG. 11 is a schematic structural diagram 2 of another USB device according to an embodiment of the present disclosure;
图12为本发明实施例提供的一种USB设备的硬件示意图;FIG. 12 is a schematic diagram of hardware of a USB device according to an embodiment of the present disclosure;
图13为本发明实施例提供的另一种USB设备的硬件示意图;FIG. 13 is a schematic diagram of hardware of another USB device according to an embodiment of the present disclosure;
图14为本发明实施例提供的USB数据传输系统的架构图。FIG. 14 is a structural diagram of a USB data transmission system according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明的一部分实施例,而不是全部的实施例。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
目前,由于采用USB3.0版本进行数据传输时可以达到很高的数 据传输速率(一般可达到640MB/S),因此使得USB3.0标准的应用越来越广泛。通常,如果需要传输数据的两个USB设备均支持某个USB驱动版本,那么这两个USB设备首次建立连接时,会将这两个USB设备均支持的最高USB驱动版本协商为这两个USB设备进行数据传输时所采用的USB驱动版本。例如,如果这两个USB设备均支持USB3.0版本,那么这两个USB设备首次建立连接时协商后将采用USB3.0版本传输数据。然而,在实际应用中,虽然采用USB3.0版本可以达到很高的数据传输速率,但是在某些场景下并不适合采用USB3.0版本传输数据,例如由于在0-5GHz的频段内,采用USB3.0版本的USB设备传输的数据会对该USB设备中的无线模块传输的无线信号造成很大干扰,因此,当无线模块在0-5GHz的频段内传输无线信号时,并不适合同时采用USB3.0版本传输数据。在这些场景下,可能需要将USB设备正在采用的USB3.0版本修改为其他USB驱动版本,例如修改为USB2.0,然而目前只能通过手动重新配置的方式修改USB驱动版本,而在手动修改USB驱动版本后,由于两个USB设备之间会断开连接,因此两个USB设备之间需要重新建立连接和重新协商进行数据传输的USB驱动版本,从而会导致两个USB设备之间传输的业务中断。At present, a high number can be achieved due to the USB 3.0 version for data transmission. According to the transmission rate (generally up to 640MB / S), the application of the USB3.0 standard is becoming more and more extensive. Usually, if two USB devices that need to transfer data support a certain USB driver version, when the two USB devices establish a connection for the first time, the highest USB driver versions supported by the two USB devices are negotiated as the two USBs. The USB driver version used by the device for data transfer. For example, if both USB devices support the USB 3.0 version, then the two USB devices will use the USB 3.0 version to transfer data after the first connection is established. However, in practical applications, although the USB3.0 version can achieve high data transmission rate, in some scenarios, it is not suitable to use USB3.0 version to transmit data, for example, in the frequency band of 0-5 GHz. The data transmitted by the USB device of USB3.0 will cause great interference to the wireless signal transmitted by the wireless module in the USB device. Therefore, when the wireless module transmits wireless signals in the frequency band of 0-5 GHz, it is not suitable for simultaneous use. USB3.0 version transfers data. In these scenarios, it may be necessary to modify the USB 3.0 version that the USB device is using to other USB driver versions, for example, to USB 2.0. However, the USB driver version can only be modified by manual reconfiguration, but manually modified. After the USB driver version, since the two USB devices are disconnected, the USB devices need to be re-established and renegotiated for data transfer between the two USB devices, which will result in transmission between the two USB devices. Business disruption.
本发明实施例为了解决当改变USB驱动版本时会导致进行数据传输的两个USB设备之间传输的业务中断的问题,提出一种通过两个USB设备自行协商并自动切换USB驱动版本的方法,能够保证两个USB设备在切换USB驱动版本时保障两个USB设备之间传输的业务不中断。In order to solve the problem of service interruption between two USB devices that cause data transmission when changing the USB driver version, the embodiment of the present invention proposes a method for self-negotiating and automatically switching the USB driver version through two USB devices. It can ensure that the two USB devices ensure that the services transmitted between the two USB devices are not interrupted when switching the USB driver version.
本发明实施例提供的切换USB驱动版本的方法应用的一种可能的硬件架构为:具有无线模块和USB传输接口,且支持USB3.0版本的USB设备。示例性的,当该USB设备采用USB3.0版本与其他USB设备传输数据时,若该USB设备需要同时通过无线模块传输无线信号,且通过无线模块传输的无线信号的数据量较大并对延时要求较高,即该USB设备需要优先保证无线模块传输的无线信号正常传输, 则该USB设备可采用本发明实施例提供的切换USB驱动版本的方法将该USB设备采用的USB驱动版本降低,例如可将该USB设备当前采用的USB3.0版本切换为USB2.0版本,这样既能保证通过USB传输接口传输的数据正常传输,又能够保证通过无线模块传输的无线信号正常传输。One possible hardware architecture of the method for switching the USB driver version provided by the embodiment of the present invention is: a USB device having a wireless module and a USB transmission interface and supporting the USB 3.0 version. Exemplarily, when the USB device uses USB 3.0 version to transmit data with other USB devices, if the USB device needs to transmit wireless signals through the wireless module at the same time, and the wireless signal transmitted by the wireless module has a large amount of data and delays The requirement is higher, that is, the USB device needs to preferentially ensure the normal transmission of the wireless signal transmitted by the wireless module. The USB device can be used to reduce the USB driver version used by the USB device by using the method of switching the USB driver version provided by the embodiment of the present invention. For example, the USB 3.0 version currently used by the USB device can be switched to the USB 2.0 version. It can ensure the normal transmission of data transmitted through the USB transmission interface, and can ensure the normal transmission of wireless signals transmitted through the wireless module.
进一步地,当该USB设备通过无线模块传输无线信号完成后,为了保证该USB设备通过USB传输接口传输的数据的传输速率,本发明实施例提供的切换USB驱动版本的方法还可以将该USB设备采用的USB驱动版本升高,例如可将该USB设备当前采用的USB2.0版本切换为USB3.0版本。Further, after the USB device is configured to transmit the wireless signal through the wireless module, in order to ensure the transmission rate of the data transmitted by the USB device through the USB transmission interface, the method for switching the USB driver version provided by the embodiment of the present invention may also be the USB device. The adopted USB driver version is increased, for example, the USB2.0 version currently adopted by the USB device can be switched to the USB3.0 version.
下面结合附图对本发明实施例提供的切换USB驱动版本的方法及USB设备进行详细地描述。The method for switching the USB driver version and the USB device provided by the embodiment of the present invention are described in detail below with reference to the accompanying drawings.
实施例一Embodiment 1
本发明实施例提供一种切换USB驱动版本的方法,如图1所示,该方法可以包括:The embodiment of the invention provides a method for switching a USB driver version. As shown in FIG. 1 , the method may include:
S101、第一USB设备向第二USB设备发送切换请求报文,该切换请求报文中携带第一USB驱动版本,该切换请求报文用于请求第二USB设备将第二USB驱动版本切换为第一USB驱动版本,第二USB驱动版本为第一USB设备和第二USB设备当前采用的USB驱动版本。S101. The first USB device sends a switch request message to the second USB device, where the switch request message carries a first USB driver version, where the switch request message is used to request the second USB device to switch the second USB driver version to The first USB driver version, the second USB driver version is the USB driver version currently used by the first USB device and the second USB device.
S102、第一USB设备接收第二USB设备发送的与该切换请求报文对应的切换响应报文,该切换响应报文用于指示第二USB设备是否允许将第二USB驱动版本切换为第一USB驱动版本。S102. The first USB device receives, by the second USB device, a handover response packet corresponding to the handover request packet, where the handover response packet is used to indicate whether the second USB device allows to switch the second USB driver version to the first USB driver version.
S103、若该切换响应报文指示第二USB设备允许将第二USB驱动版本切换为第一USB驱动版本,则第一USB设备将第二USB驱动版本切换为第一USB驱动版本。S103. If the switch response message indicates that the second USB device allows the second USB driver version to be switched to the first USB driver version, the first USB device switches the second USB driver version to the first USB driver version.
其中,第一USB设备可以为USB主设备,第二USB设备可以为USB从设备;或者第一USB设备可以为USB从设备,第二USB设备可以为USB主设备。即USB主设备可以发起USB驱动版本的切换,USB从设备也可以发起USB驱动版本的切换,具体的应用场景本发 明不作限制。The first USB device may be a USB host device, and the second USB device may be a USB slave device; or the first USB device may be a USB slave device, and the second USB device may be a USB host device. That is, the USB host device can initiate the switching of the USB driver version, and the USB slave device can also initiate the switching of the USB driver version. There are no restrictions.
进一步地,本发明实施例提供的USB主设备可以为计算机或电视机等设备,USB从设备可以为手机、键盘、鼠标或U盘等设备。Further, the USB host device provided by the embodiment of the present invention may be a device such as a computer or a television, and the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
举例来说,当第一USB设备和第二USB设备在采用USB3.0版本进行数据传输的过程中,若第一USB设备需要同时通过无线模块(例如无线保真模块(英文:WIreless-Fidelity,缩写:WIFI)传输无线信号,则由于采用USB3.0版本的USB设备传输的数据会对该USB设备中的无线模块传输的无线信号造成干扰,因此,第一USB设备可以采用本发明实施例提供的切换USB驱动版本的方法切换第一USB设备和第二USB设备当前进行数据传输采用的USB驱动版本,例如第一USB设备可以将USB驱动版本从USB3.0版本降低为USB2.0版本,使得在满足第一USB设备通过USB传输接口传输的数据正常传输的同时,保证第一USB设备通过无线模块传输的无线信号正常传输。For example, when the first USB device and the second USB device are in the process of data transmission using the USB3.0 version, if the first USB device needs to pass through the wireless module at the same time (for example, the wireless fidelity module (English: WIreless-Fidelity, The abbreviation: WIFI) transmits a wireless signal, and the data transmitted by the USB device of the USB 3.0 version may interfere with the wireless signal transmitted by the wireless module in the USB device. Therefore, the first USB device may be provided by using the embodiment of the present invention. The method of switching the USB driver version switches the USB driver version used by the first USB device and the second USB device for data transmission. For example, the first USB device can reduce the USB driver version from the USB 3.0 version to the USB 2.0 version, so that While the data transmitted by the first USB device through the USB transmission interface is normally transmitted, the wireless signal transmitted by the first USB device through the wireless module is normally transmitted.
本发明实施例中,第一USB设备在确定需要切换第一USB设备和第二USB设备当前进行数据传输的第二USB驱动版本时,第一USB设备可发起USB驱动版本的切换,具体的第一USB设备可向第二USB设备发送切换请求报文,该切换请求报文中携带第一USB驱动版本,该切换请求报文可以用于请求第二USB设备将第二USB驱动版本切换为第一USB驱动版本。第二USB设备接收到该切换请求报文后,第二USB设备可根据自身支持的USB驱动版本向第一USB设备发送与该切换请求报文对应的切换响应报文,该切换响应报文可用于指示第二USB设备是否允许将第二USB驱动版本切换为第一USB驱动版本,其中,具体的第二USB设备是否支持第一USB驱动版本的说明将在下述实施例中进行详细的列举。In the embodiment of the present invention, when determining that the first USB device needs to switch the second USB driver version of the first USB device and the second USB device for data transmission, the first USB device may initiate a USB driver version switching, the specific A USB device can send a switch request message to the second USB device, where the switch request message carries a first USB driver version, and the switch request message can be used to request the second USB device to switch the second USB driver version to the first A USB driver version. After the second USB device receives the switch request message, the second USB device can send a switch response message corresponding to the switch request message to the first USB device according to the USB drive version supported by the second USB device, and the switch response message is available. Instructing the second USB device whether to allow the second USB driver version to be switched to the first USB driver version, wherein the description of whether the specific second USB device supports the first USB driver version will be enumerated in detail in the following embodiments.
当第一USB设备接收的切换响应报文指示第二USB设备允许将第二USB驱动版本切换为第一USB驱动版本时,第一USB设备可将第一USB设备与第二USB设备当前进行数据传输采用的第二USB驱动版本切换为第一USB驱动版本。 When the switch response message received by the first USB device indicates that the second USB device allows the second USB driver version to be switched to the first USB driver version, the first USB device may perform current data between the first USB device and the second USB device. The second USB driver version used for the transfer is switched to the first USB driver version.
可选的,本发明实施例提供的切换请求报文和切换响应报文可以通过在USB标准中定义的报文,例如控制传输(英文:control transfer)报文中扩展一个字段实现;也可以按照USB标准定义的报文的格式重新定义一个新的报文实现,具体的切换请求报文和切换响应报文的实现方式本发明不作限制。Optionally, the handover request packet and the handover response packet provided by the embodiment of the present invention may be implemented by extending a field in a packet defined in the USB standard, for example, a control transfer (English: control transfer) message; The format of the packet defined by the USB standard redefines a new packet implementation, and the implementation manner of the specific handover request packet and the handover response packet is not limited in the present invention.
在USB标准协议中,一个USB事务通常由三个报文(也称为封包或者时期)组成,这三个报文分别为标记报文(英文:token packet)、数据报文(英文:data packet)和握手报文(hand shake packet)。本发明实施例中,可以通过在标记报文中扩展一个字段,并在该字段中设置切换请求报文或切换响应报文的标识实现切换请求报文和切换响应报文。当然,本发明实施例也可以重新定义一个新的报文,并在新的报文中设置切换请求报文或切换响应报文的标识实现切换请求报文和切换响应报文。In the USB standard protocol, a USB transaction is usually composed of three messages (also called packets or periods), which are marked packets (English: token packet) and data packets (English: data packet) ) and handshake packet. In the embodiment of the present invention, the switch request message and the handover response message are implemented by extending a field in the tagged message and setting the identifier of the handover request message or the handover response message in the field. Certainly, the embodiment of the present invention may also re-define a new packet, and set the identifier of the handover request packet or the handover response packet in the new packet to implement the handover request packet and the handover response packet.
示例性的,以在标记报文中扩展一个字段,并在该字段中设置切换请求报文或切换响应报文的标识实现切换请求报文和切换响应报文为例,本发明实施例提供的切换请求报文和切换响应报文的结构示意图如图2所示。其中,图2中的(a)为切换请求报文的结构示意图;图2中的(b)为切换响应报文的结构示意图。具体的,可通过在扩展字段中设置不同的数值来表示标记报文是切换请求报文还是切换响应报文。For example, the extension of a field in the tagged message, and the setting of the handover request message or the handover response message in the field to implement the handover request message and the handover response message, as an example, provided by the embodiment of the present invention The structure diagram of the handover request message and the handover response message is shown in FIG. 2. (a) in FIG. 2 is a schematic structural diagram of a handover request message; (b) in FIG. 2 is a schematic structural diagram of a handover response message. Specifically, whether the marked message is a handover request message or a handover response message can be indicated by setting different values in the extension field.
特别的,本发明实施例中所提到的USB驱动版本均是指USB的硬件版本。USB的硬件版本可以包括USB的硬件驱动、USB的寄存器以及USB的传输线路等。In particular, the USB driver versions mentioned in the embodiments of the present invention all refer to the hardware version of the USB. The hardware version of the USB can include a USB hardware driver, a USB register, and a USB transmission line.
本发明实施例提供的切换USB驱动版本的方法中,第一USB设备向第二USB设备发送切换请求报文后,第一USB设备可以暂时停止向第二USB设备发送数据,但是第一USB设备仍然可以接收第二USB设备发送的数据,并对已经接收的数据继续进行处理;第二USB设备接收到第一USB设备发送的切换请求报文后,第二USB设备可以暂时停止向第一USB设备发送数据,并对之前已经接收的数据继 续进行处理,以及第二USB设备响应该切换请求报文,即第二USB设备向第一USB设备发送切换响应报文。第一USB设备和第二USB设备在协商并切换USB驱动版本后,可以通过各自的USB传输接口采用切换后的USB驱动版本继续传输数据。在上述第一USB设备和第二USB设备协商是否可以切换USB驱动版本的过程中,由于第一USB设备和第二USB设备交互的切换请求报文和切换响应报文是通过USB控制通道传输的,因此在该过程中第一USB设备和第二USB设备之间并没有断开连接,从而第一USB设备和第二USB设备在协商可以切换USB驱动版本后,能够直接切换USB驱动版本,且在切换USB驱动版本后可以继续传输数据,而无需重新建立连接以及无需重新协商进行数据传输的USB驱动版本,从而可以保证第一USB设备和第二USB设备在切换USB驱动版本时保障两个USB设备之间传输的业务不中断。In the method for switching the USB driver version provided by the embodiment of the present invention, after the first USB device sends the switching request message to the second USB device, the first USB device may temporarily stop sending data to the second USB device, but the first USB device The data sent by the second USB device can still be received, and the data that has been received is processed; after the second USB device receives the switch request message sent by the first USB device, the second USB device can temporarily stop the first USB device. The device sends data and continues the data that has been received before. The processing continues, and the second USB device responds to the handover request message, that is, the second USB device sends a handover response message to the first USB device. After the first USB device and the second USB device negotiate and switch the USB driver version, the data can be continuously transmitted through the respective USB transmission interface using the switched USB driver version. During the process of negotiating whether the first USB device and the second USB device can switch the USB driver version, the switch request message and the switch response message exchanged by the first USB device and the second USB device are transmitted through the USB control channel. Therefore, in the process, the first USB device and the second USB device are not disconnected, so that the first USB device and the second USB device can directly switch the USB driver version after negotiating to switch the USB driver version, and After switching the USB driver version, you can continue to transfer data without re-establishing the connection and without renegotiating the USB driver version for data transmission, thus ensuring that the first USB device and the second USB device guarantee two USBs when switching the USB driver version. The services transmitted between devices are not interrupted.
本发明实施例提供的切换USB驱动版本的方法,由于第一USB设备和第二USB设备通过切换请求报文和切换响应报文协商是否切换USB驱动版本,因此在切换请求报文和切换响应报文传输过程中,第一USB设备和第二USB设备之间不会断开连接,从而第一USB设备和第二USB设备在通过切换请求报文和切换响应报文协商可以切换USB驱动版本后,能够直接切换USB驱动版本,并采用切换后的USB驱动版本进行数据传输。与现有技术相比,本发明实施例提供的切换USB驱动版本的方法由于在切换USB驱动版本的过程中并没有断开第一USB设备和第二USB设备之间的连接,因此在切换USB驱动版本后,第一USB设备和第二USB设备之间无需重新建立连接和重新协商进行数据传输的USB驱动版本,从而可以保证第一USB设备和第二USB设备在切换USB驱动版本时保障两个USB设备之间传输的业务不中断。The method for switching the USB driver version provided by the embodiment of the present invention, because the first USB device and the second USB device negotiate whether to switch the USB driver version through the switch request message and the switch response message, so the switch request message and the switch response report are During the file transmission process, the first USB device and the second USB device are not disconnected, so that the first USB device and the second USB device can switch the USB driver version after negotiating through the switch request message and the switch response message. It can directly switch the USB driver version and use the switched USB driver version for data transmission. Compared with the prior art, the method for switching the USB driver version provided by the embodiment of the present invention does not disconnect the connection between the first USB device and the second USB device during the process of switching the USB driver version, so the USB is switched. After the driver version, there is no need to re-establish the connection and renegotiate the USB driver version for data transmission between the first USB device and the second USB device, thereby ensuring that the first USB device and the second USB device guarantee two when switching the USB driver version. The services transmitted between the USB devices are not interrupted.
本发明实施例提供一种切换USB驱动版本的方法,如图3所示,该方法可以包括:An embodiment of the present invention provides a method for switching a USB driver version. As shown in FIG. 3, the method may include:
S201、第二USB设备接收第一USB设备发送的切换请求报文, 该切换请求报文中携带第一USB驱动版本,该切换请求报文用于请求第二USB设备将第二USB驱动版本切换为第一USB驱动版本,第二USB驱动版本为第一USB设备和第二USB设备当前采用的USB驱动版本。S201. The second USB device receives the handover request packet sent by the first USB device. The switch request message carries a first USB driver version, and the switch request message is used to request the second USB device to switch the second USB driver version to the first USB driver version, and the second USB driver version is the first USB device and The USB driver version currently used by the second USB device.
S202、第二USB设备向第一USB设备发送与该切换请求报文对应的切换响应报文,该切换响应报文用于指示第二USB设备是否允许将第二USB驱动版本切换为第一USB驱动版本。S202. The second USB device sends a handover response packet corresponding to the handover request packet to the first USB device, where the handover response packet is used to indicate whether the second USB device allows to switch the second USB driver version to the first USB. Driver version.
S203、若该切换响应报文指示第二USB设备允许将第二USB驱动版本切换为第一USB驱动版本,则第二USB设备将第二USB驱动版本切换为第一USB驱动版本。S203. If the switch response message indicates that the second USB device allows to switch the second USB driver version to the first USB driver version, the second USB device switches the second USB driver version to the first USB driver version.
第二USB设备接收到第一USB设备发送的切换请求报文后,第二USB设备可根据自身支持的USB驱动版本确定第二USB设备是否支持第一USB驱动版本,若第二USB设备支持第一USB驱动版本,则第二USB设备可允许将第二USB驱动版本切换为第一USB驱动版本;相反的,若第二USB设备不支持第一USB驱动版本,则第二USB设备不允许将第二USB驱动版本切换为第一USB驱动版本。After the second USB device receives the switch request message sent by the first USB device, the second USB device can determine whether the second USB device supports the first USB driver version according to the USB driver version supported by the second USB device, if the second USB device supports the second USB device. a USB driver version, the second USB device may allow the second USB driver version to be switched to the first USB driver version; conversely, if the second USB device does not support the first USB driver version, the second USB device does not allow The second USB driver version is switched to the first USB driver version.
举例来说,若第一USB设备与第二USB设备当前进行数据传输采用的USB驱动版本为USB3.0版本,且USB3.0版本为第一USB设备和第二USB设备首次建立连接时协商后的USB驱动版本,则第一USB设备可以支持的USB驱动版本包括USB3.0版本、USB2.0版本和USB1.1版本;第二USB设备可以支持的USB驱动版本也包括USB3.0版本、USB2.0版本和USB1.1版本。当第一USB设备发送的切换请求报文中携带的第一USB驱动版本为USB2.0版本时,由于第二USB设备支持USB2.0版本,因此第二USB设备可以允许将USB3.0版本切换为USB2.0版本。For example, if the first USB device and the second USB device are currently performing data transmission, the USB driver version is USB3.0 version, and the USB3.0 version is negotiated after the first USB device and the second USB device establish a connection for the first time. The USB driver version, the USB driver version that the first USB device can support includes USB3.0 version, USB2.0 version and USB1.1 version; the second USB device can support the USB driver version also includes USB3.0 version, USB2 .0 version and USB 1.1 version. When the first USB driver version carried in the handover request message sent by the first USB device is the USB2.0 version, since the second USB device supports the USB2.0 version, the second USB device can allow the USB 3.0 version to be switched. For the USB2.0 version.
若第一USB设备与第二USB设备当前进行数据传输采用的USB驱动版本为USB2.0版本,且USB2.0版本为第一USB设备和第二USB设备首次建立连接时协商后的USB驱动版本,则假设第一USB设备可以支持的USB驱动版本包括USB3.0版本、USB2.0版本和USB1.1 版本;第二USB设备可以支持的USB驱动版本包括USB2.0版本和USB1.1版本。当第一USB设备发送的切换请求报文中携带的第一USB驱动版本为USB3.0版本时,由于第二USB设备不支持USB3.0版本,因此第二USB设备不允许将USB2.0版本切换为USB3.0版本。If the first USB device and the second USB device are currently performing data transmission, the USB driver version is USB2.0 version, and the USB2.0 version is the negotiated USB driver version when the first USB device and the second USB device establish a connection for the first time. , assuming that the USB driver version that the first USB device can support includes USB3.0 version, USB2.0 version and USB1.1. Version; the USB driver version that the second USB device can support includes USB2.0 version and USB1.1 version. When the first USB driver version carried in the handover request message sent by the first USB device is the USB3.0 version, since the second USB device does not support the USB3.0 version, the second USB device does not allow the USB2.0 version. Switch to USB3.0 version.
若第一USB设备与第二USB设备当前进行数据传输采用的USB驱动版本为USB2.0版本,且USB2.0版本为第一USB设备和第二USB设备在数据传输过程中将USB3.0版本切换后的USB驱动版本,则第一USB设备可以支持的USB驱动版本包括USB3.0版本、USB2.0版本和USB1.1版本;第二USB设备可以支持的USB驱动版本也包括USB3.0版本、USB2.0版本和USB1.1版本。当第一USB设备发送的切换请求报文中携带的第一USB驱动版本为USB3.0版本时,由于第二USB设备支持USB3.0版本,因此第二USB设备可以允许将USB2.0版本切换为USB3.0版本。If the first USB device and the second USB device are currently performing data transmission, the USB driver version is USB2.0 version, and the USB2.0 version is the first USB device and the second USB device will be USB3.0 version during data transmission. After switching the USB driver version, the USB driver version that the first USB device can support includes USB3.0 version, USB2.0 version and USB1.1 version; the second USB device can support the USB driver version also includes USB3.0 version. , USB2.0 version and USB1.1 version. When the first USB driver version carried in the switch request message sent by the first USB device is the USB3.0 version, since the second USB device supports the USB3.0 version, the second USB device can allow the USB2.0 version to be switched. For the USB3.0 version.
具体的,第一USB设备可以支持的USB驱动版本与第一USB设备实际的硬件支持能力有关;第二USB设备可以支持的USB驱动版本与第二USB设备实际的硬件支持能力有关,本发明不作具体限制。Specifically, the USB driver version that the first USB device can support is related to the actual hardware support capability of the first USB device; the USB driver version that the second USB device can support is related to the actual hardware support capability of the second USB device, and the present invention does not Specific restrictions.
本领域技术人员可以理解,若第一USB设备或第二USB设备支持某个USB驱动版本,则第一USB设备或第二USB设备也可以支持比该USB驱动版本低的所有USB驱动版本。例如,若第一USB设备或第二USB设备支持USB3.0版本,则第一USB设备或第二USB设备也可以支持比USB3.0版本低的所有USB驱动版本,如USB2.0版本和USB1.1版本。Those skilled in the art can understand that if the first USB device or the second USB device supports a certain USB driver version, the first USB device or the second USB device can also support all USB driver versions lower than the USB driver version. For example, if the first USB device or the second USB device supports the USB 3.0 version, the first USB device or the second USB device can also support all USB driver versions lower than the USB 3.0 version, such as the USB 2.0 version and the USB1. .1 version.
进一步地,若第二USB设备允许将第二USB驱动版本切换为第一USB驱动版本,则第二USB设备可在向第一USB设备发送切换响应报文后将当前进行数据传输采用的第二USB驱动版本切换为第一USB驱动版本。Further, if the second USB device allows the second USB driver version to be switched to the first USB driver version, the second USB device may use the second data transmission currently after transmitting the handover response message to the first USB device. The USB driver version is switched to the first USB driver version.
需要说明的是,对于切换请求报文和切换响应报文的描述可参见上述如图1和图2所示的实施例中对切换请求报文和切换响应报文的相关描述,此处不再赘述。 It should be noted that, for the description of the handover request packet and the handover response packet, refer to the descriptions of the handover request packet and the handover response packet in the foregoing embodiment shown in FIG. 1 and FIG. Narration.
本发明实施例提供的切换USB驱动版本的方法,由于第一USB设备和第二USB设备通过切换请求报文和切换响应报文协商是否切换USB驱动版本,因此在切换请求报文和切换响应报文传输过程中,第一USB设备和第二USB设备之间不会断开连接,从而第一USB设备和第二USB设备在通过切换请求报文和切换响应报文协商可以切换USB驱动版本后,能够直接切换USB驱动版本,并采用切换后的USB驱动版本进行数据传输。与现有技术相比,本发明实施例提供的切换USB驱动版本的方法由于在切换USB驱动版本的过程中并没有断开第一USB设备和第二USB设备之间的连接,因此在切换USB驱动版本后,第一USB设备和第二USB设备之间无需重新建立连接和重新协商进行数据传输的USB驱动版本,从而可以保证第一USB设备和第二USB设备在切换USB驱动版本时保障两个USB设备之间传输的业务不中断。The method for switching the USB driver version provided by the embodiment of the present invention, because the first USB device and the second USB device negotiate whether to switch the USB driver version through the switch request message and the switch response message, so the switch request message and the switch response report are During the file transmission process, the first USB device and the second USB device are not disconnected, so that the first USB device and the second USB device can switch the USB driver version after negotiating through the switch request message and the switch response message. It can directly switch the USB driver version and use the switched USB driver version for data transmission. Compared with the prior art, the method for switching the USB driver version provided by the embodiment of the present invention does not disconnect the connection between the first USB device and the second USB device during the process of switching the USB driver version, so the USB is switched. After the driver version, there is no need to re-establish the connection and renegotiate the USB driver version for data transmission between the first USB device and the second USB device, thereby ensuring that the first USB device and the second USB device guarantee two when switching the USB driver version. The services transmitted between the USB devices are not interrupted.
实施例二Embodiment 2
本发明实施例提供一种切换USB驱动版本的方法,如图4所示,该方法可以包括:An embodiment of the present invention provides a method for switching a USB driver version. As shown in FIG. 4, the method may include:
S301、第一USB设备接收第二USB设备发送的第一协商报文,该第一协商报文中携带第二USB设备支持的最高USB驱动版本。S301: The first USB device receives the first negotiation message sent by the second USB device, where the first negotiation message carries the highest USB driver version supported by the second USB device.
其中,该第一协商报文用于第二USB设备与第一USB设备协商进行数据传输的USB驱动版本。The first negotiation message is used by the second USB device to negotiate with the first USB device for the USB driver version for data transmission.
进一步地,该第一协商报文中还可以携带第二USB设备的类型等信息。第二USB设备的类型可以为鼠标、U盘或键盘等。第二USB设备的类型等信息可以使得第一USB设备接收到第二USB设备发送的第一协商报文后,确定第二USB设备为哪一类设备,从而第一USB设备可以在协商进行数据传输的USB驱动版本后加载与该类设备对应的硬件驱动和控制命令。例如,若第二USB设备的类型为鼠标,则第一USB设备可以在协商进行数据传输的USB驱动版本后加载与鼠标对应的硬件驱动和控制命令。Further, the first negotiation packet may further carry information such as the type of the second USB device. The type of the second USB device can be a mouse, a USB flash drive, a keyboard, or the like. The information of the type of the second USB device may be such that after the first USB device receives the first negotiation message sent by the second USB device, it determines which device the second USB device is, so that the first USB device can negotiate data. After the USB driver version is transferred, the hardware drivers and control commands corresponding to the device are loaded. For example, if the type of the second USB device is a mouse, the first USB device can load the hardware driver and control commands corresponding to the mouse after negotiating the USB driver version for data transmission.
S302、第一USB设备根据第二USB设备支持的最高USB驱动版 本和第一USB设备支持的最高USB驱动版本,确定进行数据传输的第三USB驱动版本。S302. The first USB device is supported by the highest USB driver version supported by the second USB device. This and the highest USB driver version supported by the first USB device determine the third USB driver version for data transfer.
其中,该进行数据传输的第三USB驱动版本为第一USB设备和第二USB设备均支持的最高USB驱动版本。例如,若第一USB设备和第二USB设备均支持的最高USB驱动版本为USB3.0版本,则该进行数据传输的第三USB驱动版本为USB3.0版本;若第一USB设备支持的最高USB驱动版本为USB3.0版本,第二USB设备支持的最高USB驱动版本为USB2.0版本,则该进行数据传输的第三USB驱动版本为USB2.0版本。The third USB driver version for performing data transmission is the highest USB driver version supported by the first USB device and the second USB device. For example, if the highest USB driver version supported by the first USB device and the second USB device is the USB3.0 version, the third USB driver version for data transmission is the USB3.0 version; if the first USB device supports the highest The USB driver version is USB3.0 version, and the second USB device supports the highest USB driver version as USB2.0 version. The third USB driver version for data transmission is USB2.0 version.
S303、第一USB设备向第二USB设备发送第二协商报文,该第二协商报文中携带该第三USB驱动版本。S303. The first USB device sends a second negotiation message to the second USB device, where the second negotiation message carries the third USB driver version.
其中,该第二协商报文用于向第二USB设备指示第一USB设备和第二USB设备进行数据传输采用的USB驱动版本为该第三USB驱动版本。The second negotiation message is used to indicate to the second USB device that the USB driver version used for data transmission by the first USB device and the second USB device is the third USB driver version.
其中,上述S301-S303中,第一USB设备为USB主设备,第二USB设备为USB从设备。In the above S301-S303, the first USB device is a USB host device, and the second USB device is a USB slave device.
进一步地,本发明实施例提供的USB主设备可以为计算机或电视机等设备,USB从设备可以为手机、键盘、鼠标或U盘等设备。Further, the USB host device provided by the embodiment of the present invention may be a device such as a computer or a television, and the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
根据USB标准的规定,上述S301-S303中所述的第一USB设备和第二USB设备协商进行数据传输采用的USB驱动版本时,可以协商为第一USB设备和第二USB设备均支持的最高USB驱动版本,这是因为USB驱动版本越高,USB传输接口的数据传输速率就越大,这样可以尽可能地保证通过USB传输接口传输的数据可以达到比较大的传输速率。According to the provisions of the USB standard, when the first USB device and the second USB device described in the above S301-S303 negotiate a USB driver version for data transmission, the highest supported by both the first USB device and the second USB device can be negotiated. USB driver version, this is because the higher the USB driver version, the higher the data transfer rate of the USB transfer interface, so as to ensure that the data transmitted through the USB transfer interface can achieve a relatively large transfer rate.
S304、第一USB设备和第二USB设备采用该第三USB驱动版本进行数据传输。S304. The first USB device and the second USB device use the third USB driver version for data transmission.
S305、第一USB设备向第二USB设备发送切换请求报文,该切换请求报文中携带第一USB驱动版本。S305. The first USB device sends a handover request message to the second USB device, where the handover request message carries the first USB driver version.
其中,该切换请求报文用于请求第二USB设备将第二USB驱动 版本切换为第一USB驱动版本,第二USB驱动版本为第一USB设备和第二USB设备当前采用的USB驱动版本。The switching request message is used to request the second USB device to drive the second USB The version is switched to the first USB driver version, and the second USB driver version is the USB driver version currently used by the first USB device and the second USB device.
本发明实施例中,第二USB驱动版本可以为第一USB设备和第二USB设备首次建立连接时协商后的USB驱动版本,即第二USB驱动版本可以为上述S302中确定的第三USB驱动版本;第二USB驱动版本也可以为第一USB设备和第二USB设备在数据传输过程中将首次建立连接时协商后的第三USB驱动版本切换后的USB驱动版本。即本发明实施例提供的切换USB驱动版本的方法,可以应用于第一USB设备和第二USB设备首次建立连接时协商后的第三USB驱动版本(此时的第三USB驱动版本为第二USB驱动版本)需要切换的场景中;也可以应用于第一USB设备需要将切换后的第一USB驱动版本(此时的第一USB驱动版本为第二USB驱动版本)再切换到首次建立连接时协商后的第三USB驱动版本(此时的第三USB驱动版本为第一USB驱动版本)的场景中;还可以应用于第一USB设备需要将切换后的第一USB驱动版本(此时的第一USB驱动版本为第二USB驱动版本)再切换到其他USB驱动版本(此时的其他USB驱动版本为第一USB驱动版本)的场景中,具体的应用场景本发明不作限制。In the embodiment of the present invention, the second USB driver version may be a USB driver version negotiated when the first USB device and the second USB device are first established, that is, the second USB driver version may be the third USB driver determined in the above S302. The second USB driver version may also be a USB driver version after the third USB driver version is negotiated after the first USB device and the second USB device are first established in the data transmission process. The method for switching the USB driver version provided by the embodiment of the present invention may be applied to the third USB driver version negotiated when the first USB device and the second USB device are first established. (The third USB driver version is the second at this time. USB driver version) In the scenario that needs to be switched; it can also be applied to the first USB device to switch the first USB driver version after switching (the first USB driver version is the second USB driver version) to the first connection. In the scenario of the third USB driver version after negotiation (the third USB driver version is the first USB driver version at this time); it can also be applied to the first USB driver version that needs to be switched after the first USB device (at this time) In the scenario where the first USB driver version is the second USB driver version and then switched to the other USB driver version (the other USB driver version is the first USB driver version), the specific application scenario is not limited in the present invention.
需要说明的是,上述描述的切换USB驱动版本的几种场景仅是示例性的列举,本发明包括但不限于上述描述的切换USB驱动版本的几种场景,即在USB驱动版本需要切换的任何场景中,都可以使用本发明实施例提供的切换USB驱动版本的方法切换USB驱动版本。It should be noted that the foregoing descriptions of the scenarios for switching USB driver versions are merely exemplary. The present invention includes, but is not limited to, the scenarios described above for switching USB driver versions, that is, any switch that needs to be switched in the USB driver version. In the scenario, the USB driver version can be switched by using the method of switching the USB driver version provided by the embodiment of the present invention.
为了更清楚地理解本发明实施例提供的切换USB驱动版本的方法,本实施例中将以第一USB设备和第二USB设备当前进行数据传输采用的第二USB驱动版本为上述S302中,第一USB设备和第二USB设备首次建立连接时协商后的第三USB驱动版本,且切换后的USB驱动版本为第一USB驱动版本为例进行示例性的说明。In order to more clearly understand the method for switching the USB driver version provided by the embodiment of the present invention, the second USB driver version used for data transmission by the first USB device and the second USB device in the embodiment is the above S302. A USB device and a second USB device establish a connection for the first time after the third USB driver version negotiated, and the switched USB driver version is the first USB driver version as an example for exemplary description.
具体的,第一USB设备向第二USB设备发送切换请求报文的场景可以为下述的一种:Specifically, the scenario in which the first USB device sends the handover request message to the second USB device may be one of the following:
(1)当第一USB设备中的USB传输接口与该第一USB设备中的 无线模块同时传输数据时,第一USB设备向第二USB设备发送切换请求报文,此时第一USB驱动版本为比第二USB驱动版本低的USB驱动版本。(1) when the USB transmission interface in the first USB device is in the first USB device When the wireless module simultaneously transmits data, the first USB device sends a switching request message to the second USB device, and the first USB driver version is a USB driver version lower than the second USB driver version.
具体的,当USB设备同时采用USB传输接口和无线模块传输数据时,USB传输接口传输的数据会对无线模块传输的无线信号造成干扰,使得无线模块断开连接,从而导致无线模块无法正常传输无线信号。该无线模块可以为WIFI模块或数据卡(数据卡可以为客户识别模块(英文:subscriber identity module,缩写:SIM)卡)等。Specifically, when the USB device simultaneously uses the USB transmission interface and the wireless module to transmit data, the data transmitted by the USB transmission interface may cause interference to the wireless signal transmitted by the wireless module, causing the wireless module to disconnect, thereby causing the wireless module to fail to transmit wirelessly. signal. The wireless module can be a WIFI module or a data card (the data card can be a subscriber identity module (SIM) card).
例如,第二USB驱动版本为USB3.0版本,则为了消除采用USB3.0版本的第一USB设备通过该第一USB设备的USB传输接口传输的数据对该第一USB设备中的无线模块传输的无线信号造成的干扰,保证无线模块能够正常传输无线信号,可以采用本发明实施例提供的切换USB驱动版本的方法将USB驱动版本从USB3.0版本切换为USB2.0版本或更低USB驱动版本。For example, the second USB driver version is the USB3.0 version, in order to eliminate the data transmitted by the first USB device using the USB3.0 version through the USB transmission interface of the first USB device to the wireless module in the first USB device. The interference caused by the wireless signal ensures that the wireless module can transmit the wireless signal normally. The USB driver version can be switched from the USB3.0 version to the USB2.0 version or the lower USB driver by using the method of switching the USB driver version provided by the embodiment of the present invention. version.
(2)当检测到第一USB设备中的无线模块未传输数据,且第一USB设备传输数据采用的USB驱动版本不是第一USB设备支持的最高USB驱动版本时,第一USB设备向第二USB设备发送切换请求报文,此时第一USB驱动版本为比第二USB驱动版本高的USB驱动版本。(2) when it is detected that the wireless module in the first USB device does not transmit data, and the USB driver version used by the first USB device to transmit data is not the highest USB driver version supported by the first USB device, the first USB device is in the second The USB device sends a handover request message, and the first USB driver version is a USB driver version higher than the second USB driver version.
例如,在上述(1)中,在将USB驱动版本从USB3.0版本切换为USB2.0版本之后,若第一USB设备中的无线模块的无线信号传输完成,且第一USB设备传输数据采用的USB驱动版本不是第一USB设备支持的最高USB驱动版本(USB驱动版本越高,USB传输接口传输数据的传输速率就越大),则为了提高USB传输接口传输数据的传输速率,可以采用本发明实施例提供的切换USB驱动版本的方法将USB驱动版本从USB2.0版本切换为USB3.0版本。For example, in the above (1), after the USB driver version is switched from the USB 3.0 version to the USB 2.0 version, if the wireless signal transmission of the wireless module in the first USB device is completed, and the first USB device transmits data, The USB driver version is not the highest USB driver version supported by the first USB device (the higher the USB driver version, the higher the transmission rate of the data transmitted by the USB transmission interface), in order to improve the transmission rate of the data transmitted by the USB transmission interface, this can be used. The method for switching the USB driver version provided by the embodiment of the invention switches the USB driver version from the USB2.0 version to the USB3.0 version.
(3)第一USB设备根据用户的触发操作,向第二USB设备发送切换请求报文。 (3) The first USB device sends a handover request message to the second USB device according to the trigger operation of the user.
其中,上述触发操作为用户操作驱动版本切换菜单或驱动版本切换按钮触发的。具体的,当用户确定需要对当前采用的第二USB驱动版本进行切换时,用户可通过操作驱动版本切换菜单或驱动版本切换按钮触发第一USB设备向第二USB设备发送切换请求报文。示例性的,用户可通过选择驱动版本切换菜单或驱动版本切换按钮中与第二USB驱动版本不同的任意一个USB驱动版本触发USB驱动版本的切换过程。The triggering operation is triggered by a user operating a driver version switching menu or a driving version switching button. Specifically, when the user determines that the currently used second USB driver version needs to be switched, the user may trigger the first USB device to send a handover request message to the second USB device by operating the driver version switching menu or the driving version switching button. Exemplarily, the user can trigger the switching process of the USB driver version by selecting any one of the driver version switching menu or the driver version switching button that is different from the second USB driver version.
进一步地,当第一USB设备和第二USB设备在首次建立连接时协商进行数据传输的第三USB驱动版本(此时第三USB驱动版本可以为上述的第二USB驱动版本)后,第一USB设备可根据第三USB驱动版本,生成与第三USB驱动版本对应的驱动版本切换菜单或驱动版本切换按钮。其中,驱动版本切换菜单或驱动版本切换按钮至少包括第一USB设备选择切换的第一USB驱动版本。即驱动版本切换菜单或驱动版本切换按钮中可以包括第一USB驱动版本;也可以包括第一USB驱动版本和第一USB设备能够支持的其他USB驱动版本,本发明不作具体限定。Further, after the first USB device and the second USB device negotiate the third USB driver version for data transmission when the connection is first established (the third USB driver version may be the second USB driver version described above), the first The USB device may generate a driver version switching menu or a driver version switching button corresponding to the third USB driver version according to the third USB driver version. The driver version switching menu or the driver version switching button includes at least a first USB driver version of the first USB device selection switching. That is, the first USB driver version may be included in the driver version switch menu or the driver version switch button. The first USB driver version and other USB driver versions that the first USB device can support may also be included, which is not specifically limited by the present invention.
当驱动版本切换菜单或驱动版本切换按钮包括第一USB驱动版本时,用户可通过选择第一USB驱动版本,触发USB驱动版本的切换过程;当驱动版本切换菜单或驱动版本切换按钮包括第一USB驱动版本和第一USB设备能够支持的其他USB驱动版本时,用户可通过选择这些USB驱动版本中的任意一个USB驱动版本触发USB驱动版本的切换过程。When the driver version switching menu or the driver version switching button includes the first USB driver version, the user can trigger the switching process of the USB driver version by selecting the first USB driver version; when the driver version switching menu or the driver version switching button includes the first USB When the driver version and other USB driver versions that the first USB device can support, the user can trigger the USB driver version switching process by selecting any one of the USB driver versions.
优选的,驱动版本切换菜单或驱动版本切换按钮包括第一USB能够支持的所有USB驱动版本,即比第三USB驱动版本低的所有USB驱动版本。这样,由于用户可选择切换的USB驱动版本较多,因此能够增加用户触发USB驱动版本切换过程的灵活性。Preferably, the driver version switch menu or the driver version switch button includes all USB driver versions that the first USB can support, that is, all USB driver versions that are lower than the third USB driver version. In this way, since the user can select more USB driver versions to switch, the flexibility of the user to trigger the USB driver version switching process can be increased.
举例来说,当第三USB驱动版本为USB3.0版本时,第一USB设备生成的驱动版本切换菜单或驱动版本切换按钮中均包含USB3.0版本、USB2.0版本和USB1.1版本。即第一USB设备与第二USB设 备在首次建立连接时协商进行数据传输的第三USB驱动版本后,第一USB设备生成的驱动版本切换菜单或驱动版本切换按钮中均包含协商后进行数据传输的第三USB驱动版本以及比该第三USB驱动版本低的所有USB驱动版本。这些USB驱动版本可用于第一USB设备在需要切换USB驱动版本时选择切换。For example, when the third USB driver version is the USB3.0 version, the driver version switching menu or the driver version switching button generated by the first USB device includes the USB3.0 version, the USB2.0 version, and the USB1.1 version. That is, the first USB device and the second USB device After the third USB driver version for data transmission is negotiated when the connection is first established, the driver version switching menu or the driver version switching button generated by the first USB device includes a third USB driver version for data transmission after negotiation and The third USB driver version is low for all USB driver versions. These USB driver versions are available for the first USB device to switch when it is necessary to switch the USB driver version.
示例性的,如图5所示,当第三USB驱动版本为USB3.0版本时,第一USB设备生成的驱动版本切换菜单可以为图5中的(a)所示;第一USB设备生成的驱动版本切换按钮可以为图5中的(b)所示。Exemplarily, as shown in FIG. 5, when the third USB driver version is the USB3.0 version, the driver version switching menu generated by the first USB device may be as shown in (a) of FIG. 5; the first USB device generates The driver version switching button can be as shown in (b) of FIG.
S306、第二USB设备向第一USB设备发送与该切换请求报文对应的切换响应报文。S306. The second USB device sends a handover response packet corresponding to the handover request message to the first USB device.
其中,该切换响应报文用于指示第二USB设备是否允许将第二USB驱动版本切换为第一USB驱动版本。本实施例中,该第二USB驱动版本即为上述S302中确定的第三USB驱动版本。The switching response message is used to indicate whether the second USB device allows to switch the second USB driver version to the first USB driver version. In this embodiment, the second USB driver version is the third USB driver version determined in the above S302.
需要说明的是,对于切换请求报文和切换响应报文的描述可参见上述如图1和图2所示的实施例中对切换请求报文和切换响应报文的相关描述,此处不再赘述。It should be noted that, for the description of the handover request packet and the handover response packet, refer to the descriptions of the handover request packet and the handover response packet in the foregoing embodiment shown in FIG. 1 and FIG. Narration.
S307、若该切换响应报文指示第二USB设备允许将第二USB驱动版本切换为第一USB驱动版本,则第二USB设备将第二USB驱动版本切换为第一USB驱动版本。S307. If the switch response message indicates that the second USB device allows the second USB driver version to be switched to the first USB driver version, the second USB device switches the second USB driver version to the first USB driver version.
S308、若该切换响应报文指示第二USB设备允许将第二USB驱动版本切换为第一USB驱动版本,则第一USB设备将第二USB驱动版本切换为第一USB驱动版本。S308. If the switch response message indicates that the second USB device allows the second USB driver version to be switched to the first USB driver version, the first USB device switches the second USB driver version to the first USB driver version.
第二USB设备接收到第一USB设备发送的切换请求报文后,第二USB设备可根据自身支持的USB驱动版本确定第二USB设备是否支持第一USB驱动版本,若第二USB设备支持第一USB驱动版本,则第二USB设备可允许将第二USB驱动版本切换为第一USB驱动版本;相反的,若第二USB设备不支持第一USB驱动版本,则第二USB设备不允许将第二USB驱动版本切换为第一USB驱动版本。After the second USB device receives the switch request message sent by the first USB device, the second USB device can determine whether the second USB device supports the first USB driver version according to the USB driver version supported by the second USB device, if the second USB device supports the second USB device. a USB driver version, the second USB device may allow the second USB driver version to be switched to the first USB driver version; conversely, if the second USB device does not support the first USB driver version, the second USB device does not allow The second USB driver version is switched to the first USB driver version.
具体的,对于第二USB设备是否允许将第二USB驱动版本切换 为第一USB驱动版本的描述,可参见上述如图3所示的实施例中的相关描述,此处不再赘述。Specifically, whether the second USB device is allowed to switch the second USB driver version For the description of the first USB driver version, refer to the related description in the embodiment shown in FIG. 3 above, and details are not described herein again.
S309、第一USB设备向第二USB设备发送与该切换响应报文对应的切换确认报文。S309. The first USB device sends a handover confirmation message corresponding to the handover response message to the second USB device.
其中,该切换确认报文用于确认第一USB设备将第二USB驱动版本切换为第一USB驱动版本。The switch confirmation message is used to confirm that the first USB device switches the second USB driver version to the first USB driver version.
S310、第一USB设备与第二USB设备采用第一USB驱动版本进行数据传输。S310. The first USB device and the second USB device use the first USB driver version for data transmission.
第一USB设备向第二USB设备发送切换确认报文之后,第一USB设备可开始通过第一USB设备的USB传输接口采用第一USB驱动版本向第二USB设备发送数据;相应的,第二USB设备也开始通过第二USB设备的USB传输接口采用第一USB驱动版本接收第一USB设备发送的数据。第二USB设备接收到第一USB设备发送的切换确认报文之后,第二USB设备可开始通过第二USB设备的USB传输接口采用第一USB驱动版本向第一USB设备发送数据;相应的,第一USB设备也开始通过第一USB设备的USB传输接口采用第一USB驱动版本接收第二USB设备发送的数据。After the first USB device sends the handover confirmation message to the second USB device, the first USB device may start to send data to the second USB device by using the first USB driver version through the USB transmission interface of the first USB device; correspondingly, the second The USB device also begins to receive data transmitted by the first USB device through the USB transmission interface of the second USB device using the first USB driver version. After the second USB device receives the switch confirmation message sent by the first USB device, the second USB device may start to send data to the first USB device by using the first USB driver version through the USB transmission interface of the second USB device; The first USB device also begins to receive data transmitted by the second USB device through the USB transmission interface of the first USB device using the first USB driver version.
需要说明的是,上述S304-S310中,第一USB设备可以为USB主设备,第二USB设备可以为USB从设备;或者第一USB设备可以为USB从设备,第二USB设备可以为USB主设备。It should be noted that, in the above S304-S310, the first USB device may be a USB host device, and the second USB device may be a USB slave device; or the first USB device may be a USB slave device, and the second USB device may be a USB host device. device.
进一步地,本发明实施例提供的USB主设备可以为计算机或电视机等设备,USB从设备可以为手机、键盘、鼠标或U盘等设备。Further, the USB host device provided by the embodiment of the present invention may be a device such as a computer or a television, and the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
进一步地,本发明实施例提供的切换USB驱动版本的方法中,可以由USB主设备发起USB驱动版本的切换过程,可以由USB从设备发起USB驱动版本的切换过程,也可以由用户触发USB主设备发起USB驱动版本的切换过程,还可以由用户触发USB从设备发起USB驱动版本的切换过程,具体的可根据实际使用需求进行设计,本发明不作限制。Further, in the method for switching the USB driver version provided by the embodiment of the present invention, the USB host device may initiate a USB driver version switching process, and the USB slave device may initiate a USB driver version switching process, or the user may trigger the USB host. The device initiates the switching process of the USB driver version, and the user can trigger the USB slave device to initiate the USB driver version switching process. The specific design can be designed according to the actual use requirements, and the present invention is not limited.
如图6所示,上述图4所示的S307和S308具体可以包括: As shown in FIG. 6, S307 and S308 shown in FIG. 4 above may specifically include:
S307a、若该切换响应报文指示第二USB设备允许将第二USB驱动版本切换为第一USB驱动版本,第二USB设备将与第二USB驱动版本对应的第二USB驱动切换为与第一USB驱动版本对应的第一USB驱动。S307a. If the switch response message indicates that the second USB device allows the second USB driver version to be switched to the first USB driver version, the second USB device switches the second USB driver corresponding to the second USB driver version to the first The USB driver version corresponds to the first USB driver.
S307b、第二USB设备将与第二USB驱动版本对应的第二寄存器切换为与第一USB驱动版本对应的第一寄存器。S307b. The second USB device switches the second register corresponding to the second USB driver version to the first register corresponding to the first USB driver version.
S307c、第二USB设备将与第二USB驱动版本对应的第二数据传输线路切换为与第一USB驱动版本对应的第一数据传输线路。S307c. The second USB device switches the second data transmission line corresponding to the second USB driver version to the first data transmission line corresponding to the first USB driver version.
示例性的,假设第二USB驱动为USB3.0驱动,第一USB驱动为USB2.0驱动,第二寄存器为USB3.0寄存器,第一寄存器为USB2.0寄存器,第二数据传输线路为USB3.0传输线路,第一数据传输线路为USB2.0传输线路;当第二USB设备将第二USB驱动版本切换为第一USB驱动版本时,第二USB设备可将USB3.0驱动切换为USB2.0驱动,将USB3.0寄存器切换为USB2.0寄存器,将USB3.0传输线路切换为USB2.0传输线路,从而完成将第二USB驱动版本切换为第一USB驱动版本的过程。Exemplarily, assume that the second USB driver is a USB 3.0 driver, the first USB driver is a USB 2.0 driver, the second register is a USB 3.0 register, the first register is a USB 2.0 register, and the second data transmission line is a USB3. .0 transmission line, the first data transmission line is a USB2.0 transmission line; when the second USB device switches the second USB driver version to the first USB driver version, the second USB device can switch the USB3.0 driver to the USB2 The .0 driver switches the USB3.0 register to the USB2.0 register and switches the USB3.0 transmission line to the USB2.0 transmission line, thereby completing the process of switching the second USB driver version to the first USB driver version.
S308a、若该切换响应报文指示第二USB设备允许将第二USB驱动版本切换为第一USB驱动版本,第一USB设备将与第二USB驱动版本对应的第二USB驱动切换为与第一USB驱动版本对应的第一USB驱动。S308a. If the switch response message indicates that the second USB device allows the second USB driver version to be switched to the first USB driver version, the first USB device switches the second USB driver corresponding to the second USB driver version to the first The USB driver version corresponds to the first USB driver.
S308b、第一USB设备将与第二USB驱动版本对应的第二寄存器切换为与第一USB驱动版本对应的第一寄存器。S308b. The first USB device switches the second register corresponding to the second USB driver version to the first register corresponding to the first USB driver version.
S308c、第一USB设备将与第二USB驱动版本对应的第二数据传输线路切换为与第一USB驱动版本对应的第一数据传输线路。S308c. The first USB device switches the second data transmission line corresponding to the second USB driver version to the first data transmission line corresponding to the first USB driver version.
需要说明的是,第一USB设备切换USB驱动版本的方法与第二USB设备切换USB驱动版本的方法类似,具体的第一USB设备切换USB驱动版本的方法可参见上述S307a-S307c中对第二USB设备切换USB驱动版本的方法的描述,此处不再赘述。It should be noted that the method for the first USB device to switch the USB driver version is similar to the method for the second USB device to switch the USB driver version. For the method for the first USB device to switch the USB driver version, refer to the foregoing S307a-S307c for the second method. A description of the method for the USB device to switch the USB driver version will not be described here.
本领域技术人员可以理解,上述USB驱动版本的切换过程仅是 在逻辑上切换USB设备的USB传输接口,该USB驱动版本的切换过程均可通过软件程序实现。具体的,第一USB设备和第二USB设备之间可通过切换请求报文和切换响应报文协商是否可以切换USB驱动版本,并在第一USB设备和第二USB设备协商可以切换USB驱动版本之后,第一USB设备和第二USB设备可通过切换USB驱动、USB寄存器和USB传输线路,切换USB驱动版本。例如,若第一USB设备和第二USB设备从USB3.0版本切换到USB2.0版本,则第一USB设备和第二USB设备可通过将与USB3.0版本对应的驱动、寄存器和传输线路切换到与USB2.0版本对应的驱动、寄存器和传输线路,以实现在逻辑上将USB传输接口从USB3.0版本切换到USB2.0版本。Those skilled in the art can understand that the switching process of the above USB driver version is only The USB transmission interface of the USB device is logically switched, and the switching process of the USB driver version can be implemented by a software program. Specifically, the first USB device and the second USB device can negotiate whether the USB driver version can be switched by using the switch request message and the switch response message, and the USB driver version can be switched when the first USB device and the second USB device negotiate. Thereafter, the first USB device and the second USB device can switch the USB driver version by switching the USB driver, the USB register, and the USB transmission line. For example, if the first USB device and the second USB device are switched from the USB 3.0 version to the USB 2.0 version, the first USB device and the second USB device can pass the driver, the register, and the transmission line corresponding to the USB 3.0 version. Switch to the driver, register and transmission line corresponding to the USB2.0 version to logically switch the USB transmission interface from USB3.0 to USB2.0.
其中,第一USB设备和第二USB设备可通过修改与USB驱动版本对应的配置信息(例如上述的驱动、寄存器中的各项参数值和传输线路的传输速率),实现USB驱动版本的切换。The first USB device and the second USB device can implement switching of the USB driver version by modifying configuration information corresponding to the USB driver version (for example, the above-mentioned driver, various parameter values in the register, and transmission rate of the transmission line).
示例性的,假设第二USB设备将与USB3.0版本对应的配置信息修改为与USB2.0版本对应的配置信息,第二USB设备可加载USB3.0驱动以替换USB2.0驱动,并将寄存器中USB3.0的各项参数的值均修改为USB2.0的各项参数值,以及将USB3.0的传输线路的传输速率修改为USB2.0的传输线路的传输速率。Exemplarily, assuming that the second USB device modifies the configuration information corresponding to the USB 3.0 version to the configuration information corresponding to the USB 2.0 version, the second USB device can load the USB 3.0 driver to replace the USB 2.0 driver, and The values of the parameters of USB3.0 in the register are all changed to the values of the parameters of USB2.0, and the transmission rate of the transmission line of USB3.0 is modified to the transmission rate of the transmission line of USB2.0.
需要说明的是,第一USB设备和第二USB设备切换USB驱动版本的方法,可以包括但不限于上述列举的方法,即只要通过本发明实施例提供的切换USB驱动版本的方法协商可以切换USB驱动版本,那么具体实现中也可以由其他可能的切换方法实现USB驱动版本的切换,对此本发明不再详述。It should be noted that the method for the first USB device and the second USB device to switch the USB driver version may include, but is not limited to, the method listed above, that is, the USB can be switched by the method for switching the USB driver version provided by the embodiment of the present invention. For the driver version, the USB driver version can be switched by other possible switching methods in the specific implementation, and the present invention will not be described in detail.
特别的,本发明实施例中所提到的USB驱动版本均是指USB的硬件版本。USB的硬件版本可以包括USB的硬件驱动(例如上述的第一USB驱动和第二USB驱动)、USB的寄存器(例如上述的第一寄存器和第二寄存器)以及USB的数据传输线路(例如上述的第一数据传输线路和第二数据传输线路)等。In particular, the USB driver versions mentioned in the embodiments of the present invention all refer to the hardware version of the USB. The hardware version of the USB may include a USB hardware driver (such as the first USB driver and the second USB driver described above), a USB register (such as the first register and the second register described above), and a USB data transmission line (such as the above). The first data transmission line and the second data transmission line) and the like.
本发明实施例提供的切换USB驱动版本的方法中,第一USB设 备向第二USB设备发送切换请求报文后,第一USB设备可以暂时停止向第二USB设备发送数据,但是第一USB设备仍然可以接收第二USB设备发送的数据,并对已经接收的数据继续进行处理;第二USB设备接收到第一USB设备发送的切换请求报文后,第二USB设备可以暂时停止向第一USB设备发送数据,并对之前已经接收的数据继续进行处理,以及第二USB设备响应该切换请求报文,即第二USB设备向第一USB设备发送切换响应报文。在上述第一USB设备和第二USB设备协商是否可以切换USB驱动版本的过程中,由于第一USB设备和第二USB设备交互的切换请求报文和切换响应报文是通过USB控制通道传输的,因此在该过程中第一USB设备和第二USB设备之间并没有断开连接,从而第一USB设备和第二USB设备在协商可以切换USB驱动版本后,能够直接切换USB驱动版本,且在切换USB驱动版本后可以继续传输数据,而无需重新建立连接以及无需重新协商进行数据传输的USB驱动版本,从而可以保证第一USB设备和第二USB设备在切换USB驱动版本时保障两个USB设备之间传输的业务不中断。In the method for switching the USB driver version provided by the embodiment of the present invention, the first USB device After the switch sends the switch request message to the second USB device, the first USB device can temporarily stop sending data to the second USB device, but the first USB device can still receive the data sent by the second USB device and the received data. After the second USB device receives the switch request message sent by the first USB device, the second USB device can temporarily stop sending data to the first USB device, and continue processing the data that has been received before, and The second USB device responds to the handover request message, that is, the second USB device sends a handover response message to the first USB device. During the process of negotiating whether the first USB device and the second USB device can switch the USB driver version, the switch request message and the switch response message exchanged by the first USB device and the second USB device are transmitted through the USB control channel. Therefore, in the process, the first USB device and the second USB device are not disconnected, so that the first USB device and the second USB device can directly switch the USB driver version after negotiating to switch the USB driver version, and After switching the USB driver version, you can continue to transfer data without re-establishing the connection and without renegotiating the USB driver version for data transmission, thus ensuring that the first USB device and the second USB device guarantee two USBs when switching the USB driver version. The services transmitted between devices are not interrupted.
本发明实施例提供的切换USB驱动版本的方法,由于第一USB设备和第二USB设备通过切换请求报文和切换响应报文协商是否切换USB驱动版本,因此在切换请求报文和切换响应报文传输过程中,第一USB设备和第二USB设备之间不会断开连接,从而第一USB设备和第二USB设备在通过切换请求报文和切换响应报文协商可以切换USB驱动版本后,能够直接切换USB驱动版本,并采用切换后的USB驱动版本进行数据传输。与现有技术相比,本发明实施例提供的切换USB驱动版本的方法由于在切换USB驱动版本的过程中并没有断开第一USB设备和第二USB设备之间的连接,因此在切换USB驱动版本后,第一USB设备和第二USB设备之间无需重新建立连接和重新协商进行数据传输的USB驱动版本,从而可以保证第一USB设备和第二USB设备在切换USB驱动版本时保障两个USB设备之间传输的业务不中断。 The method for switching the USB driver version provided by the embodiment of the present invention, because the first USB device and the second USB device negotiate whether to switch the USB driver version through the switch request message and the switch response message, so the switch request message and the switch response report are During the file transmission process, the first USB device and the second USB device are not disconnected, so that the first USB device and the second USB device can switch the USB driver version after negotiating through the switch request message and the switch response message. It can directly switch the USB driver version and use the switched USB driver version for data transmission. Compared with the prior art, the method for switching the USB driver version provided by the embodiment of the present invention does not disconnect the connection between the first USB device and the second USB device during the process of switching the USB driver version, so the USB is switched. After the driver version, there is no need to re-establish the connection and renegotiate the USB driver version for data transmission between the first USB device and the second USB device, thereby ensuring that the first USB device and the second USB device guarantee two when switching the USB driver version. The services transmitted between the USB devices are not interrupted.
实施例三Embodiment 3
如图7所示,本发明实施例提供一种USB设备,所述USB设备可以包括:As shown in FIG. 7, an embodiment of the present invention provides a USB device, where the USB device may include:
收发单元10,用于向第二USB设备发送切换请求报文,并接收所述第二USB设备发送的与所述切换请求报文对应的切换响应报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述第二USB设备将第二USB驱动版本切换为所述第一USB驱动版本,所述第二USB驱动版本为所述USB设备和所述第二USB设备当前采用的USB驱动版本,所述切换响应报文用于指示所述第二USB设备是否允许将所述第二USB驱动版本切换为所述第一USB驱动版本;切换单元11,用于若所述收发单元10接收的所述切换响应报文指示所述第二USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则将所述第二USB驱动版本切换为所述第一USB驱动版本。The transceiver unit 10 is configured to send a handover request message to the second USB device, and receive a handover response packet corresponding to the handover request packet sent by the second USB device, where the handover request packet carries the a USB driver version, the switch request message is used to request the second USB device to switch the second USB driver version to the first USB driver version, and the second USB driver version is the USB device and the The USB driver version currently used by the second USB device, the switch response message is used to indicate whether the second USB device allows to switch the second USB driver version to the first USB driver version; For the second USB device if the switch response message received by the transceiver unit 10 indicates that the second USB device allows the second USB driver version to be switched to the first USB driver version. The driver version is switched to the first USB driver version.
可选的,所述切换单元11,具体用于将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;并将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;以及将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本对应的第一数据传输线路。Optionally, the switching unit 11 is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; a second register corresponding to the second USB driver version is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to be the first The first data transmission line corresponding to the USB driver version.
可选的,所述收发单元10,具体用于当所述USB设备中的USB传输接口与所述USB设备中的无线模块同时传输数据时,向所述第二USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本低的USB驱动版本。Optionally, the transceiver unit 10 is configured to: when the USB transmission interface in the USB device transmits data simultaneously with the wireless module in the USB device, send the handover request report to the second USB device. The first USB driver version is a USB driver version lower than the second USB driver version.
可选的,所述收发单元10,具体用于检测到所述USB设备中的无线模块未传输数据,且所述USB设备传输数据采用的USB驱动版本不是所述USB设备支持的最高USB驱动版本时,向所述第二USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本高的USB驱动版本。 Optionally, the transceiver unit 10 is configured to detect that the wireless module in the USB device does not transmit data, and the USB driver version used by the USB device to transmit data is not the highest USB driver version supported by the USB device. And transmitting, by the second USB device, the switching request message, where the first USB driver version is a USB driver version higher than the second USB driver version.
可选的,所述收发单元10,具体用于根据用户的触发操作,向所述第二USB设备发送所述切换请求报文,所述触发操作为所述用户操作驱动版本切换菜单或驱动版本切换按钮触发的。Optionally, the transceiver unit 10 is configured to send the switch request message to the second USB device according to a triggering operation of the user, where the trigger operation is the user operating a driver version switch menu or a driver version. Toggle button triggered.
可选的,在图7的基础上,如图8所示,所述USB设备还包括生成单元12,Optionally, on the basis of FIG. 7, as shown in FIG. 8, the USB device further includes a generating unit 12,
所述生成单元12,用于在所述收发单元10向所述第二USB设备发送所述切换请求报文之前,根据第三USB驱动版本,生成所述驱动版本切换菜单或所述驱动版本切换按钮,所述驱动版本切换菜单或所述驱动版本切换按钮至少包括所述切换单元11选择切换的所述第一USB驱动版本,所述第三USB驱动版本为所述USB设备和所述第二USB设备首次建立连接时协商后采用的USB驱动版本。The generating unit 12 is configured to generate the driver version switching menu or the driver version switching according to the third USB driver version before the transceiver unit 10 sends the switching request message to the second USB device. a button, the driver version switching menu or the driver version switching button at least comprising the first USB driver version selected by the switching unit 11 to switch, the third USB driver version being the USB device and the second The USB driver version that is used after the USB device establishes the connection for the first time.
可选的,所述收发单元10,还用于在所述切换单元11将所述第二USB驱动版本切换为所述第一USB驱动版本之后,向所述第二USB设备发送与所述切换响应报文对应的切换确认报文,所述切换确认报文用于确认所述USB设备将所述第二USB驱动版本切换为所述第一USB驱动版本。Optionally, the transceiver unit 10 is further configured to: after the switching unit 11 switches the second USB driver version to the first USB driver version, send the switch to the second USB device And responding to the handover confirmation message corresponding to the message, the handover confirmation message is used to confirm that the USB device switches the second USB driver version to the first USB driver version.
可选的,在图8的基础上,如图9所示,所述USB设备还包括传输单元13,Optionally, on the basis of FIG. 8, as shown in FIG. 9, the USB device further includes a transmission unit 13,
所述传输单元13,用于在所述收发单元10向所述第二USB设备发送所述切换确认报文之后,采用所述切换单元11切换后的所述第一USB驱动版本与所述第二USB设备进行数据传输。The transmitting unit 13 is configured to: after the sending and receiving unit 10 sends the switching confirmation message to the second USB device, adopt the first USB driver version that is switched by the switching unit 11 and the first Two USB devices for data transmission.
需要说明的是,本实施例中的所述USB设备可以为上述实施例一和实施例二中的第一USB设备。It should be noted that the USB device in this embodiment may be the first USB device in the foregoing Embodiment 1 and Embodiment 2.
可选的,本发明实施例提供的所述USB设备为USB主设备,所述第二USB设备为USB从设备;或者所述USB设备为USB从设备,所述第二USB设备为USB主设备。Optionally, the USB device provided by the embodiment of the present invention is a USB host device, and the second USB device is a USB slave device; or the USB device is a USB slave device, and the second USB device is a USB master device. .
本发明实施例提供的USB主设备可以为可以为计算机或电视机等设备,USB从设备可以为手机、键盘、鼠标或U盘等设备。The USB host device provided by the embodiment of the present invention may be a device such as a computer or a television, and the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
本发明实施例提供一种USB设备,由于该USB设备和第二USB 设备通过切换请求报文和切换响应报文协商是否切换USB驱动版本,因此在切换请求报文和切换响应报文传输过程中,该USB设备和第二USB设备之间不会断开连接,从而该USB设备和第二USB设备在通过切换请求报文和切换响应报文协商可以切换USB驱动版本后,能够直接切换USB驱动版本,并采用切换后的USB驱动版本进行数据传输。与现有技术相比,由于本发明实施例在切换USB驱动版本的过程中并没有断开该USB设备和第二USB设备之间的连接,因此在切换USB驱动版本后,该USB设备和第二USB设备之间无需重新建立连接和重新协商进行数据传输的USB驱动版本,从而可以保证该USB设备和第二USB设备在切换USB驱动版本时保障两个USB设备之间传输的业务不中断。The embodiment of the invention provides a USB device, because the USB device and the second USB The device negotiates whether to switch the USB driver version through the switch request message and the switch response message. Therefore, during the process of switching the request message and the switch response message, the USB device and the second USB device are not disconnected. After the USB device version can be switched through the switch request message and the switch response message negotiation, the USB device and the second USB device can directly switch the USB driver version and use the switched USB driver version for data transmission. Compared with the prior art, since the embodiment of the present invention does not disconnect the USB device and the second USB device during the process of switching the USB driver version, after switching the USB driver version, the USB device and the The USB driver version for data transmission between the two USB devices does not need to be re-established and renegotiated, so that the USB device and the second USB device can ensure that the services transmitted between the two USB devices are not interrupted when the USB driver version is switched.
如图10所示,本发明实施例提供另一种USB设备,所述USB设备可以包括:As shown in FIG. 10, an embodiment of the present invention provides another USB device, where the USB device may include:
收发单元20,用于接收第一USB设备发送的切换请求报文,并向所述第一USB设备发送与所述切换请求报文对应的切换响应报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述USB设备将第二USB驱动版本切换为所述第一USB驱动版本,所述第二USB驱动版本为所述第一USB设备和所述USB设备当前采用的USB驱动版本,所述切换响应报文用于指示所述USB设备是否允许将所述第二USB驱动版本切换为所述第一USB驱动版本;切换单元21,用于若所述收发单元20发送的所述切换响应报文指示所述USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则将所述第二USB驱动版本切换为所述第一USB驱动版本。The transceiver unit 20 is configured to receive a handover request packet sent by the first USB device, and send a handover response packet corresponding to the handover request packet to the first USB device, where the handover request packet carries the a USB driver version, the switch request message is used to request the USB device to switch a second USB driver version to the first USB driver version, and the second USB driver version is the first USB device and The USB driver version currently used by the USB device, the switch response message is used to indicate whether the USB device allows to switch the second USB driver version to the first USB driver version; and the switching unit 21 is configured to: The switching response message sent by the transceiver unit 20 indicates that the USB device allows to switch the second USB driver version to the first USB driver version, and then switches the second USB driver version to the The first USB driver version.
可选的,所述切换单元21,具体用于将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;并将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;以及将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本 对应的第一数据传输线路。Optionally, the switching unit 21 is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; a second register corresponding to the second USB driver version is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to be the first USB driver version Corresponding first data transmission line.
可选的,所述收发单元20,还用于若所述切换响应报文指示所述USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则在向所述第一USB设备发送与所述切换请求报文对应的切换响应报文之后,接收所述第一USB设备发送的切换确认报文,所述切换确认报文用于确认所述第一USB设备将所述第二USB驱动版本切换为所述第一USB驱动版本。Optionally, the transceiver unit 20 is further configured to: if the switch response message indicates that the USB device allows to switch the second USB driver version to the first USB driver version, Receiving, by the USB device, a handover response message corresponding to the handover request message, receiving a handover confirmation message sent by the first USB device, where the handover confirmation message is used to confirm that the first USB device is to be The second USB driver version is switched to the first USB driver version.
可选的,在图10的基础上,如图11所示,所述USB设备还可以包括传输单元22,Optionally, on the basis of FIG. 10, as shown in FIG. 11, the USB device may further include a transmission unit 22,
所述传输单元22,用于在所述收发单元20接收所述第一USB设备发送的所述切换确认报文之后,采用所述切换单元21切换后的所述第一USB驱动版本与所述第一USB设备进行数据传输。The transmitting unit 22 is configured to: after the transceiver unit 20 receives the handover confirmation message sent by the first USB device, use the first USB driver version that is switched by the switching unit 21 and the The first USB device performs data transmission.
可选的,本发明实施例提供的所述第一USB设备为USB主设备,所述USB设备为USB从设备;或者所述第一USB设备为USB从设备,所述USB设备为USB主设备。Optionally, the first USB device provided by the embodiment of the present invention is a USB host device, and the USB device is a USB slave device; or the first USB device is a USB slave device, and the USB device is a USB master device. .
需要说明的是,本实施例中的所述USB设备可以为上述实施例一和实施例二中的第二USB设备。It should be noted that the USB device in this embodiment may be the second USB device in the first embodiment and the second embodiment.
本发明实施例提供的USB主设备可以为可以为计算机或电视机等设备,USB从设备可以为手机、键盘、鼠标或U盘等设备。The USB host device provided by the embodiment of the present invention may be a device such as a computer or a television, and the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
本发明实施例提供另一种USB设备,由于该USB设备和第一USB设备通过切换请求报文和切换响应报文协商是否切换USB驱动版本,因此在切换请求报文和切换响应报文传输过程中,该USB设备和第一USB设备之间不会断开连接,从而该USB设备和第一USB设备在通过切换请求报文和切换响应报文协商可以切换USB驱动版本后,能够直接切换USB驱动版本,并采用切换后的USB驱动版本进行数据传输。与现有技术相比,由于本发明实施例在切换USB驱动版本的过程中并没有断开该USB设备和第一USB设备之间的USB连接,因此在切换USB驱动版本后,该USB设备和第一USB设备之间无需重新建立连接和重新协商进行数据传输的USB驱动版本,从而 可以保证该USB设备和第一USB设备在切换USB驱动版本时保障两个USB设备之间传输的业务不中断。The embodiment of the present invention provides another USB device. Since the USB device and the first USB device negotiate whether to switch the USB driver version by using the handover request message and the handover response message, the handover request message and the handover response message transmission process are performed. The USB device and the first USB device are not disconnected, so that the USB device and the first USB device can directly switch the USB after switching the USB driver version through the negotiation of the switch request message and the switch response message. Drive version and use the switched USB driver version for data transfer. Compared with the prior art, since the USB connection between the USB device and the first USB device is not disconnected during the process of switching the USB driver version, the USB device and the USB device are switched after the USB driver version is switched. There is no need to re-establish connection and renegotiate the USB driver version for data transfer between the first USB devices, thus It can be ensured that the USB device and the first USB device ensure that the services transmitted between the two USB devices are not interrupted when the USB driver version is switched.
实施例四Embodiment 4
如图12所示,本发明实施例提供一种USB设备,所述USB设备可以包括处理器30、存储器31、USB传输接口32和传输总线33,其中,所述处理器30、存储器31以及USB传输接口32之间通过所述传输总线33连接并完成相互间的通信。As shown in FIG. 12, an embodiment of the present invention provides a USB device, which may include a processor 30, a memory 31, a USB transmission interface 32, and a transmission bus 33, wherein the processor 30, the memory 31, and the USB are provided. The transmission interfaces 32 are connected by the transmission bus 33 and complete communication with each other.
所述处理器30可以是一个中央处理器(Central Processing Unit,CPU),或者是特定集成电路(Application Specific Integrated Circuit,ASIC),或者是被配置成实施本发明实施例的一个或多个集成电路。The processor 30 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. .
所述USB传输接口32可以为所述USB设备与其他USB设备之间进行数据传输的接口。The USB transmission interface 32 may be an interface for data transmission between the USB device and other USB devices.
所述存储器31可以包括易失性存储器(英文:volatile memory),例如随机存取存储器(英文:random-access memory,缩写:RAM);所述存储器31也可以包括非易失性存储器(英文:non-volatile memory),例如只读存储器(英文:read-only memory,缩写:ROM),快闪存储器(英文:flash memory),硬盘(英文:hard disk drive,缩写:HDD)或固态硬盘(英文:solid-state drive,缩写:SSD);所述存储器31还可以包括上述种类的存储器的组合。The memory 31 may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviation: RAM); the memory 31 may also include a non-volatile memory (English: Non-volatile memory, such as read-only memory (English: read-only memory, abbreviation: ROM), flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state drive (English) : solid-state drive, abbreviated: SSD); the memory 31 may also include a combination of the above types of memories.
当所述USB设备运行时,所述处理器30可以执行图1、图4或图6所述的方法流程,具体包括:When the USB device is in operation, the processor 30 may perform the method flow described in FIG. 1, FIG. 4 or FIG.
所述处理器30,用于通过USB传输接口32向第二USB设备发送切换请求报文,并通过所述USB传输接口32接收所述第二USB设备发送的与所述切换请求报文对应的切换响应报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述第二USB设备将第二USB驱动版本切换为所述第一USB驱动版本,所述第二USB驱动版本为所述USB设备和所述第二USB设备当前采用的USB驱动版本,所述切换响应报文用于指示所述第二USB设备是 否允许将所述第二USB驱动版本切换为所述第一USB驱动版本;所述处理器30,还用于若所述切换响应报文指示所述第二USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则将所述第二USB驱动版本切换为所述第一USB驱动版本;所述存储器31,用于存储所述切换请求报文的代码、所述切换响应报文的代码、所述第一USB驱动版本、所述第二USB驱动版本,以及控制所述处理器30完成上述过程的软件程序,所述处理器30通过执行所述软件程序并调用上述代码和USB驱动版本完成上述过程。其中,上述代码可以包括切换请求报文的代码和切换响应报文的代码;USB驱动版本可以包括第一USB驱动版本和第二USB驱动版本。The processor 30 is configured to send, by using the USB transmission interface 32, a handover request message to the second USB device, and receive, by using the USB transmission interface 32, the second USB device corresponding to the handover request message. And switching a response message, where the switch request message carries a first USB driver version, where the switch request message is used to request the second USB device to switch the second USB driver version to the first USB driver version, The second USB driver version is a USB driver version currently used by the USB device and the second USB device, and the switch response message is used to indicate that the second USB device is Whether the second USB driver version is allowed to be switched to the first USB driver version; the processor 30 is further configured to: if the switch response message indicates that the second USB device allows the second USB The driver version is switched to the first USB driver version, and the second USB driver version is switched to the first USB driver version; the memory 31 is configured to store the code of the handover request message, the Switching a code of the response message, the first USB driver version, the second USB driver version, and a software program controlling the processor 30 to complete the process, the processor 30 executing the software program and calling The above code and USB driver version complete the above process. The code may include a code for switching the request message and a code for switching the response message; the USB driver version may include the first USB driver version and the second USB driver version.
可选的,所述处理器30,具体用于将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;并将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;以及将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本对应的第一数据传输线路。Optionally, the processor 30 is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; a second register corresponding to the second USB driver version is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to be the first The first data transmission line corresponding to the USB driver version.
可选的,所述处理器30,具体用于当所述USB设备中的USB传输接口与所述USB设备中的无线模块同时传输数据时,通过所述USB传输接口向所述第二USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本低的USB驱动版本。Optionally, the processor 30 is configured to: when the USB transmission interface in the USB device transmits data simultaneously with the wireless module in the USB device, use the USB transmission interface to the second USB device Sending the switching request message, the first USB driver version is a USB driver version lower than the second USB driver version.
可选的,所述处理器30,具体用于当检测到所述USB设备中的无线模块未传输数据,且所述USB设备传输数据采用的USB驱动版本不是所述USB设备支持的最高USB驱动版本时,通过所述USB传输接口向所述第二USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本高的USB驱动版本。Optionally, the processor 30 is configured to: when detecting that the wireless module in the USB device does not transmit data, and the USB device that uses the USB driver to transmit data is not the highest USB driver supported by the USB device. In the version, the switching request message is sent to the second USB device by using the USB transmission interface, where the first USB driver version is a USB driver version higher than the second USB driver version.
可选的,所述处理器30,具体用于根据用户的触发操作,通过所述USB传输接口32向所述第二USB设备发送所述切换请求报文,所述触发操作为所述用户操作驱动版本切换菜单或驱动版本切换按钮触发的。 Optionally, the processor 30 is configured to send, by using the USB transmission interface 32, the handover request packet to the second USB device according to a trigger operation of the user, where the trigger operation is the user operation. The driver version switch menu or the driver version switch button is triggered.
可选的,所述处理器30,还用于在向所述第二USB设备发送所述切换请求报文之前,根据第三USB驱动版本,生成所述驱动版本切换菜单或所述驱动版本切换按钮,所述驱动版本切换菜单或所述驱动版本切换按钮至少包括所述处理器30选择切换的所述第一USB驱动版本,所述第三USB驱动版本为所述USB设备和所述第二USB设备首次建立连接时协商后采用的USB驱动版本。Optionally, the processor 30 is further configured to generate the driver version switch menu or the driver version switch according to the third USB driver version before sending the switch request message to the second USB device. a button, the driver version switching menu or the driver version switching button at least comprising the first USB driver version selected by the processor 30 to switch, the third USB driver version being the USB device and the second The USB driver version that is used after the USB device establishes the connection for the first time.
可选的,所述处理器30,还用于在将所述第二USB驱动版本切换为所述第一USB驱动版本之后,通过所述USB传输接口32向所述第二USB设备发送与所述切换响应报文对应的切换确认报文,所述切换确认报文用于确认所述USB设备将所述第二USB驱动版本切换为所述第一USB驱动版本。Optionally, the processor 30 is further configured to send, by using the USB transmission interface 32, the second USB device after switching the second USB driver version to the first USB driver version. And a handover confirmation message corresponding to the handover response message, where the handover confirmation message is used to confirm that the USB device switches the second USB driver version to the first USB driver version.
可选的,所述处理器30,还用于在向所述第二USB设备发送所述切换确认报文之后,通过所述USB传输接口32采用所述第一USB驱动版本与所述第二USB设备进行数据传输。Optionally, the processor 30 is further configured to adopt, by using the USB transmission interface 32, the first USB driver version and the second after sending the handover confirmation message to the second USB device. USB devices for data transfer.
可选的,本发明实施例提供的所述USB设备为USB主设备,所述第二USB设备为USB从设备;或者所述USB设备为USB从设备,所述第二USB设备为USB主设备。Optionally, the USB device provided by the embodiment of the present invention is a USB host device, and the second USB device is a USB slave device; or the USB device is a USB slave device, and the second USB device is a USB master device. .
需要说明的是,本实施例中的所述USB设备可以为上述实施例一和实施例二中的第一USB设备。It should be noted that the USB device in this embodiment may be the first USB device in the foregoing Embodiment 1 and Embodiment 2.
本发明实施例提供的USB主设备可以为可以为计算机或电视机等设备,USB从设备可以为手机、键盘、鼠标或U盘等设备。The USB host device provided by the embodiment of the present invention may be a device such as a computer or a television, and the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
本发明实施例提供一种USB设备,由于该USB设备和第二USB设备通过切换请求报文和切换响应报文协商是否切换USB驱动版本,因此在切换请求报文和切换响应报文传输过程中,该USB设备和第二USB设备之间不会断开连接,从而该USB设备和第二USB设备在通过切换请求报文和切换响应报文协商可以切换USB驱动版本后,能够直接切换USB驱动版本,并采用切换后的USB驱动版本进行数据传输。与现有技术相比,由于本发明实施例在切换USB驱动版本的过程中并没有断开该USB设备和第二USB设备之间的连接, 因此在切换USB驱动版本后,该USB设备和第二USB设备之间无需重新建立连接和重新协商进行数据传输的USB驱动版本,从而可以保证该USB设备和第二USB设备在切换USB驱动版本时保障两个USB设备之间传输的业务不中断。The embodiment of the present invention provides a USB device. The USB device and the second USB device negotiate whether to switch the USB driver version by using the handover request message and the handover response message. Therefore, during the transmission of the handover request message and the handover response message, The USB device and the second USB device are not disconnected, so that the USB device and the second USB device can directly switch the USB driver after switching the USB driver version through the switch request message and the switch response message negotiation. Version, and use the switched USB driver version for data transfer. Compared with the prior art, the embodiment of the present invention does not disconnect the USB device and the second USB device during the process of switching the USB driver version. Therefore, after switching the USB driver version, there is no need to re-establish connection and renegotiate the USB driver version for data transmission between the USB device and the second USB device, thereby ensuring that the USB device and the second USB device are switched when the USB driver version is switched. Ensure that the services transmitted between the two USB devices are not interrupted.
如图13所示,本发明实施例提供另一种USB设备,该USB设备可以包括处理器40、存储器41、USB传输接口42和传输总线43,其中,所述处理器40、存储器41以及USB传输接口42之间通过所述传输总线43连接并完成相互间的通信。As shown in FIG. 13, the embodiment of the present invention provides another USB device, which may include a processor 40, a memory 41, a USB transmission interface 42, and a transmission bus 43, wherein the processor 40, the memory 41, and the USB The transmission interfaces 42 are connected by the transmission bus 43 and complete communication with each other.
所述处理器40可以是一个CPU,或者是ASIC,或者是被配置成实施本发明实施例的一个或多个集成电路。The processor 40 can be a CPU, or an ASIC, or one or more integrated circuits configured to implement embodiments of the present invention.
所述USB传输接口42可以为所述USB设备与其他USB设备之间进行数据传输的接口。The USB transmission interface 42 may be an interface for data transmission between the USB device and other USB devices.
所述存储器41可以包括易失性存储器,例如RAM;所述存储器41也可以包括非易失性存储器,例如ROM,快闪存储器,HDD或SSD;所述存储器41还可以包括上述种类的存储器的组合。The memory 41 may include a volatile memory such as a RAM; the memory 41 may also include a non-volatile memory such as a ROM, a flash memory, an HDD or an SSD; the memory 41 may also include a memory of the above kind combination.
当所述USB设备运行时,所述处理器40可以执行图3、图4或图6所述的方法流程,具体包括:When the USB device is running, the processor 40 may perform the method and the process described in FIG. 3, FIG. 4 or FIG.
所述处理器40,用于通过USB传输接口42接收第一USB设备发送的切换请求报文,并通过所述USB传输接口42向所述第一USB设备发送与所述切换请求报文对应的切换响应报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述USB设备将第二USB驱动版本切换为所述第一USB驱动版本,所述第二USB驱动版本为所述第一USB设备和所述USB设备当前采用的USB驱动版本,所述切换响应报文用于指示所述USB设备是否允许将所述第二USB驱动版本切换为所述第一USB驱动版本;所述处理器40,还用于若所述切换响应报文指示所述USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则将所述第二USB驱动版本切换为所述第一USB驱动版本;所述存储器41,用于存储所述切换请求报文的代码、所述切换响应报文的代码、所述第一USB驱动 版本、所述第二USB驱动版本,以及控制所述处理器40完成上述过程的软件程序,所述处理器40通过执行所述软件程序并调用上述代码和USB驱动版本完成上述过程。其中,上述代码可以包括切换请求报文的代码和切换响应报文的代码;USB驱动版本可以包括第一USB驱动版本和第二USB驱动版本。The processor 40 is configured to receive, by using the USB transmission interface 42, a handover request message sent by the first USB device, and send, by using the USB transmission interface 42 to the first USB device, a message corresponding to the handover request message. And switching a response message, where the switch request message carries a first USB driver version, where the switch request message is used to request the USB device to switch the second USB driver version to the first USB driver version, The second USB driver version is a USB driver version currently used by the first USB device and the USB device, and the switch response message is used to indicate whether the USB device allows to switch the second USB driver version to The first USB driver version; the processor 40 is further configured to: if the switch response message indicates that the USB device allows to switch the second USB driver version to the first USB driver version, The second USB driver version is switched to the first USB driver version; the memory 41 is configured to store a code of the handover request message, a code of the handover response message, and the first USB driver The version, the second USB driver version, and a software program that controls the processor 40 to perform the above process, the processor 40 accomplishes the above process by executing the software program and calling the above code and USB driver version. The code may include a code for switching the request message and a code for switching the response message; the USB driver version may include the first USB driver version and the second USB driver version.
可选的,所述处理器40,具体用于将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;并将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;以及将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本对应的第一数据传输线路。Optionally, the processor 40 is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; a second register corresponding to the second USB driver version is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to be the first The first data transmission line corresponding to the USB driver version.
可选的,所述处理器40,还用于若所述切换响应报文指示所述USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则在向所述第一USB设备发送与所述切换请求报文对应的切换响应报文之后,通过所述USB传输接口42接收所述第一USB设备发送的切换确认报文,所述切换确认报文用于确认所述第一USB设备将所述第二USB驱动版本切换为所述第一USB驱动版本。Optionally, the processor 40 is further configured to: if the switch response message indicates that the USB device allows to switch the second USB driver version to the first USB driver version, After the USB device sends the handover response message corresponding to the handover request message, the USB transmission interface 42 receives the handover confirmation message sent by the first USB device, where the handover confirmation message is used to confirm the The first USB device switches the second USB driver version to the first USB driver version.
可选的,所述处理器40,还用于在接收所述第一USB设备发送的所述切换确认报文之后,通过所述USB传输接口42采用所述第一USB驱动版本与所述第一USB设备进行数据传输。Optionally, the processor 40 is further configured to: after receiving the handover confirmation message sent by the first USB device, adopt the first USB driver version and the first A USB device performs data transmission.
可选的,本发明实施例提供的所述第一USB设备为USB主设备,所述USB设备为USB从设备;或者所述第一USB设备为USB从设备,所述USB设备为USB主设备。Optionally, the first USB device provided by the embodiment of the present invention is a USB host device, and the USB device is a USB slave device; or the first USB device is a USB slave device, and the USB device is a USB master device. .
需要说明的是,本实施例中的所述USB设备可以为上述实施例一和实施例二中的第二USB设备。It should be noted that the USB device in this embodiment may be the second USB device in the first embodiment and the second embodiment.
本发明实施例提供的USB主设备可以为可以为计算机或电视机等设备,USB从设备可以为手机、键盘、鼠标或U盘等设备。The USB host device provided by the embodiment of the present invention may be a device such as a computer or a television, and the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
本发明实施例提供另一种USB设备,由于该USB设备和第一USB设备通过切换请求报文和切换响应报文协商是否切换USB驱动版 本,因此在切换请求报文和切换响应报文传输过程中,该USB设备和第一USB设备之间不会断开连接,从而该USB设备和第一USB设备在通过切换请求报文和切换响应报文协商可以切换USB驱动版本后,能够直接切换USB驱动版本,并采用切换后的USB驱动版本进行数据传输。与现有技术相比,由于本发明实施例在切换USB驱动版本的过程中并没有断开该USB设备和第一USB设备之间的USB连接,因此在切换USB驱动版本后,该USB设备和第一USB设备之间无需重新建立连接和重新协商进行数据传输的USB驱动版本,从而可以保证该USB设备和第一USB设备在切换USB驱动版本时保障两个USB设备之间传输的业务不中断。An embodiment of the present invention provides another USB device, because the USB device and the first USB device negotiate whether to switch the USB driver version by using a handover request message and a handover response message. Therefore, during the transmission of the handover request message and the handover response message, the USB device and the first USB device are not disconnected, so that the USB device and the first USB device are in the process of switching the request message and switching. After the USB message version can be switched in response to the message negotiation, the USB driver version can be directly switched, and the switched USB driver version is used for data transmission. Compared with the prior art, since the USB connection between the USB device and the first USB device is not disconnected during the process of switching the USB driver version, the USB device and the USB device are switched after the USB driver version is switched. The USB driver version of the first USB device does not need to be re-established and renegotiated for data transmission, thereby ensuring that the USB device and the first USB device ensure uninterrupted service transmission between the two USB devices when switching the USB driver version. .
实施例五Embodiment 5
如图14所示,本发明实施例提供一种USB数据传输系统,该USB数据传输系统可以包括第一USB设备和第二USB设备。第一USB设备和第二USB设备之间通过各自的USB传输接口进行数据传输。As shown in FIG. 14, an embodiment of the present invention provides a USB data transmission system, which may include a first USB device and a second USB device. Data transmission is performed between the first USB device and the second USB device through respective USB transmission interfaces.
需要说明的是,图14仅是示例性的举例,具体的图14中的第一USB设备和第二USB设备也可以互换。It should be noted that FIG. 14 is merely an exemplary example, and the first USB device and the second USB device in FIG. 14 are also interchangeable.
其中,第一USB设备可以为上述实施例三中如图7至图9任意之一所述的USB设备;第二USB设备可以为上述实施例三中如图10至图11任意之一所述的USB设备。其中,如图7至图9任意之一所述的USB设备可以为USB主设备,如图10至图11任意之一所述的USB设备可以为USB从设备;或者,如图7至图9任意之一所述的USB设备可以为USB从设备,如图10至图11任意之一所述的USB设备可以为USB主设备,具体的本发明不作限制。The first USB device may be the USB device according to any one of the foregoing embodiments of FIG. 7 to FIG. 9; the second USB device may be any one of the foregoing third embodiment, as shown in any one of FIG. 10 to FIG. USB device. The USB device as described in any one of FIG. 7 to FIG. 9 may be a USB slave device, and the USB device as described in any one of FIG. 10 to FIG. 11 may be a USB slave device; or, as shown in FIG. 7 to FIG. 9 The USB device can be a USB slave device, and the USB device can be a USB host device according to any one of the embodiments of the present invention. The specific invention is not limited.
或者,第一USB设备可以为上述实施例四中如图12所述的USB设备;第二USB设备可以为上述实施例四中如图13所述的USB设备,其中,如图12所述的USB设备可以为USB主设备,如图13所述的USB设备可以为USB从设备;或者,如图12所述的USB设备可以为USB从设备,如图13所述的USB设备可以为USB主设备,具体的本发明不作限制。 Alternatively, the first USB device may be the USB device as described in FIG. 12 in the above embodiment 4; the second USB device may be the USB device as described in FIG. 13 in the fourth embodiment, wherein, as shown in FIG. The USB device may be a USB host device, and the USB device as shown in FIG. 13 may be a USB slave device; or the USB device as shown in FIG. 12 may be a USB slave device, and the USB device as shown in FIG. 13 may be a USB host. The device is not limited by the specific invention.
需要说明的是,关于第一USB设备和第二USB设备的描述可参见上述实施例三和实施例四中对第一USB设备和第二USB设备的相关描述,此处不再赘述。It should be noted that, for the descriptions of the first USB device and the second USB device, refer to the related descriptions of the first USB device and the second USB device in the foregoing Embodiment 3 and Embodiment 4, and details are not described herein again.
进一步地,本发明实施例提供的USB主设备可以为可以为计算机或电视机等设备,USB从设备可以为手机、键盘、鼠标或U盘等设备。Further, the USB host device provided by the embodiment of the present invention may be a device such as a computer or a television, and the USB slave device may be a device such as a mobile phone, a keyboard, a mouse, or a USB flash drive.
本发明实施例提供的USB数据传输系统中,当第一USB设备和第二USB设备采用第二USB驱动版本进行数据传输时,若第一USB设备检测到第二USB驱动版本无法满足数据传输要求,则第一USB设备可向第二USB设备发送切换请求消息,该切换请求消息中携带第一USB驱动版本,该切换请求消息用于请求第二USB设备将第二USB驱动版本切换到第一USB驱动版本,第二USB设备接收到该切换请求消息后,第二USB设备向第一USB设备发送切换响应消息,该切换响应消息用于指示第二USB设备是否支持将第二USB驱动版本切换为第一USB驱动版本,若第二USB设备支持将第二USB驱动版本切换为第一USB驱动版本,则第二USB设备将第二USB驱动版本切换为第一USB驱动版本,以及第一USB设备接收到该切换响应消息后,第一USB设备将第二USB驱动版本切换为第一USB驱动版本,从而第一USB设备和第二USB设备采用第一USB驱动版本进行数据传输。In the USB data transmission system provided by the embodiment of the present invention, when the first USB device and the second USB device use the second USB driver version for data transmission, if the first USB device detects that the second USB driver version cannot meet the data transmission requirement The first USB device may send a handover request message to the second USB device, where the handover request message carries a first USB driver version, and the handover request message is used to request the second USB device to switch the second USB driver version to the first The USB driver version, after the second USB device receives the switch request message, the second USB device sends a switch response message to the first USB device, where the switch response message is used to indicate whether the second USB device supports switching the second USB driver version. For the first USB driver version, if the second USB device supports switching the second USB driver version to the first USB driver version, the second USB device switches the second USB driver version to the first USB driver version, and the first USB After the device receives the switch response message, the first USB device switches the second USB driver version to the first USB driver version, so that the first USB device and the second USB device A first data transmission with USB driver version.
本发明实施例提供一种USB数据传输系统,该USB数据传输系统可以包括第一USB设备和第二USB设备,由于第一USB设备和第二USB设备之间通过切换请求报文和切换响应报文协商是否切换USB驱动版本,因此在切换请求报文和切换响应报文传输过程中,第一USB设备和第二USB设备之间不会断开连接,从而第一USB设备和第二USB设备在协商可以切换USB驱动版本后,能够直接切换USB驱动版本,并采用切换后的USB驱动版本进行数据传输。与现有技术相比,本发明实施例在切换USB驱动版本后,第一USB设备和第二USB设备之间无需重新建立连接和重新协商进行数据传输的 USB驱动版本,进而保证了第一USB设备和第二USB设备在切换USB驱动版本时保障两个USB设备之间传输的业务不中断。An embodiment of the present invention provides a USB data transmission system, where the USB data transmission system may include a first USB device and a second USB device, because the first USB device and the second USB device pass the handover request message and the handover response report. Whether the USB driver version is switched, whether the first USB device and the second USB device are not disconnected during the switching request message and the switching response message transmission, so that the first USB device and the second USB device After the USB driver version can be switched after negotiation, the USB driver version can be directly switched, and the switched USB driver version is used for data transmission. Compared with the prior art, after switching the USB driver version, the first USB device and the second USB device do not need to re-establish connection and renegotiate for data transmission after switching the USB driver version. The USB driver version ensures that the first USB device and the second USB device ensure that the services transmitted between the two USB devices are not interrupted when the USB driver version is switched.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,设备和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。It will be clearly understood by those skilled in the art that for the convenience and brevity of the description, only the division of each functional module described above is exemplified. In practical applications, the above function assignment can be completed by different functional modules as needed. The internal structure of the device is divided into different functional modules to perform all or part of the functions described above. For the specific working process of the system, the device and the unit described above, refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,设备和方法,可以通过其它的方式实现。例如,以上所描述的设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现 出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may contribute to the prior art or all or part of the technical solution may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all of the methods described in various embodiments of the present invention. Or part of the steps. The foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。 The above is only a specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the claims.

Claims (30)

  1. 一种切换通用串行总线USB驱动版本的方法,其特征在于,包括:A method for switching a universal serial bus USB driver version, comprising:
    第一USB设备向第二USB设备发送切换请求报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述第二USB设备将第二USB驱动版本切换为所述第一USB驱动版本,所述第二USB驱动版本为所述第一USB设备和所述第二USB设备当前采用的USB驱动版本;The first USB device sends a switch request message to the second USB device, where the switch request message carries a first USB driver version, and the switch request message is used to request the second USB device to use the second USB driver version. Switching to the first USB driver version, the second USB driver version being a USB driver version currently used by the first USB device and the second USB device;
    所述第一USB设备接收所述第二USB设备发送的与所述切换请求报文对应的切换响应报文,所述切换响应报文用于指示所述第二USB设备是否允许将所述第二USB驱动版本切换为所述第一USB驱动版本;The first USB device receives a handover response message corresponding to the handover request message sent by the second USB device, where the handover response message is used to indicate whether the second USB device allows the Switching the second USB driver version to the first USB driver version;
    若所述切换响应报文指示所述第二USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则所述第一USB设备将所述第二USB驱动版本切换为所述第一USB驱动版本。If the switch response message indicates that the second USB device allows to switch the second USB driver version to the first USB driver version, the first USB device switches the second USB driver version to The first USB driver version.
  2. 根据权利要求1所述的方法,其特征在于,所述第一USB设备将所述第二USB驱动版本切换为所述第一USB驱动版本,包括:The method of claim 1, wherein the switching, by the first USB device, the second USB driver version to the first USB driver version comprises:
    所述第一USB设备将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;The first USB device switches a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version;
    所述第一USB设备将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;The first USB device switches a second register corresponding to the second USB driver version to a first register corresponding to the first USB driver version;
    所述第一USB设备将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本对应的第一数据传输线路。The first USB device switches a second data transmission line corresponding to the second USB driver version to a first data transmission line corresponding to the first USB driver version.
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一USB设备向第二USB设备发送切换请求报文,包括:The method according to claim 1 or 2, wherein the first USB device sends a handover request message to the second USB device, including:
    当所述第一USB设备中的USB传输接口与所述第一USB设备中的无线模块同时传输数据时,所述第一USB设备向所述第二USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本低的USB驱动版本。 When the USB transmission interface in the first USB device transmits data simultaneously with the wireless module in the first USB device, the first USB device sends the handover request message to the second USB device, where The first USB driver version is a USB driver version lower than the second USB driver version.
  4. 根据权利要求1或2所述的方法,其特征在于,所述第一USB设备向第二USB设备发送切换请求报文,包括:The method according to claim 1 or 2, wherein the first USB device sends a handover request message to the second USB device, including:
    当检测到所述第一USB设备中的无线模块未传输数据,且所述第一USB设备传输数据采用的USB驱动版本不是所述第一USB设备支持的最高USB驱动版本时,所述第一USB设备向所述第二USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本高的USB驱动版本。When it is detected that the wireless module in the first USB device does not transmit data, and the USB driver version used by the first USB device to transmit data is not the highest USB driver version supported by the first USB device, the first The USB device sends the switching request message to the second USB device, the first USB driver version being a USB driver version higher than the second USB driver version.
  5. 根据权利要求1或2所述的方法,其特征在于,所述第一USB设备向第二USB设备发送切换请求报文,包括:The method according to claim 1 or 2, wherein the first USB device sends a handover request message to the second USB device, including:
    所述第一USB设备根据用户的触发操作,向所述第二USB设备发送所述切换请求报文,所述触发操作为所述用户操作驱动版本切换菜单或驱动版本切换按钮触发的。The first USB device sends the switching request message to the second USB device according to a triggering operation of the user, where the triggering operation is triggered by the user operating a driving version switching menu or a driving version switching button.
  6. 根据权利要求5所述的方法,其特征在于,所述第一USB设备向第二USB设备发送切换请求报文之前,所述方法还包括:The method according to claim 5, wherein before the first USB device sends a handover request message to the second USB device, the method further includes:
    所述第一USB设备根据第三USB驱动版本,生成所述驱动版本切换菜单或所述驱动版本切换按钮,所述驱动版本切换菜单或所述驱动版本切换按钮至少包括所述第一USB设备选择切换的所述第一USB驱动版本,所述第三USB驱动版本为所述第一USB设备和所述第二USB设备首次建立连接时协商后采用的USB驱动版本。The first USB device generates the driver version switching menu or the driver version switching button according to a third USB driver version, and the driving version switching menu or the driving version switching button includes at least the first USB device selection Switching the first USB driver version, the third USB driver version is a USB driver version adopted after the first USB device and the second USB device establish a connection for the first time.
  7. 根据权利要求1-6任一项所述的方法,其特征在于,A method according to any one of claims 1 to 6, wherein
    所述第一USB设备为USB主设备,所述第二USB设备为USB从设备;或者The first USB device is a USB host device, and the second USB device is a USB slave device; or
    所述第一USB设备为USB从设备,所述第二USB设备为USB主设备。The first USB device is a USB slave device, and the second USB device is a USB master device.
  8. 一种切换通用串行总线USB驱动版本的方法,其特征在于,包括:A method for switching a universal serial bus USB driver version, comprising:
    第二USB设备接收第一USB设备发送的切换请求报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述第二USB设备将第二USB驱动版本切换为所述第一USB驱动版本,所 述第二USB驱动版本为所述第一USB设备和所述第二USB设备当前采用的USB驱动版本;The second USB device receives the switch request message sent by the first USB device, where the switch request message carries the first USB driver version, and the switch request message is used to request the second USB device to drive the second USB drive The version is switched to the first USB driver version, The second USB driver version is a USB driver version currently used by the first USB device and the second USB device;
    所述第二USB设备向所述第一USB设备发送与所述切换请求报文对应的切换响应报文,所述切换响应报文用于指示所述第二USB设备是否允许将所述第二USB驱动版本切换为所述第一USB驱动版本;The second USB device sends a handover response message corresponding to the handover request message to the first USB device, where the handover response message is used to indicate whether the second USB device allows the second The USB driver version is switched to the first USB driver version;
    若所述切换响应报文指示所述第二USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则所述第二USB设备将所述第二USB驱动版本切换为所述第一USB驱动版本。If the switch response message indicates that the second USB device allows to switch the second USB driver version to the first USB driver version, the second USB device switches the second USB driver version to The first USB driver version.
  9. 根据权利要求8所述的方法,其特征在于,所述第二USB设备将所述第二USB驱动版本切换为所述第一USB驱动版本,包括:The method according to claim 8, wherein the second USB device switches the second USB driver version to the first USB driver version, including:
    所述第二USB设备将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;The second USB device switches a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version;
    所述第二USB设备将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;The second USB device switches a second register corresponding to the second USB driver version to a first register corresponding to the first USB driver version;
    所述第二USB设备将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本对应的第一数据传输线路。The second USB device switches a second data transmission line corresponding to the second USB driver version to a first data transmission line corresponding to the first USB driver version.
  10. 根据权利要求8或9所述的方法,其特征在于,Method according to claim 8 or 9, characterized in that
    所述第一USB设备为USB主设备,所述第二USB设备为USB从设备;或者The first USB device is a USB host device, and the second USB device is a USB slave device; or
    所述第一USB设备为USB从设备,所述第二USB设备为USB主设备。The first USB device is a USB slave device, and the second USB device is a USB master device.
  11. 一种通用串行总线USB设备,其特征在于,包括:A universal serial bus USB device, comprising:
    收发单元,用于向第二USB设备发送切换请求报文,并接收所述第二USB设备发送的与所述切换请求报文对应的切换响应报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述第二USB设备将第二USB驱动版本切换为所述第一USB驱动版本,所述第二USB驱动版本为所述USB设备和所述第二USB设备当前采用的USB驱动版本,所述切换响应报文用于指示所述第二USB设备是否允许将所述第二USB驱动版本切换为所述第一USB驱动版本; a transceiver unit, configured to send a handover request message to the second USB device, and receive a handover response packet corresponding to the handover request packet sent by the second USB device, where the handover request packet carries the first a USB driver version, the switch request message is used to request the second USB device to switch the second USB driver version to the first USB driver version, the second USB driver version is the USB device and the a USB driver version currently used by the second USB device, the switch response message being used to indicate whether the second USB device allows to switch the second USB driver version to the first USB driver version;
    切换单元,用于若所述收发单元接收的所述切换响应报文指示所述第二USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则将所述第二USB驱动版本切换为所述第一USB驱动版本。a switching unit, configured to: if the switch response message received by the transceiver unit indicates that the second USB device allows to switch the second USB driver version to the first USB driver version, The USB driver version is switched to the first USB driver version.
  12. 根据权利要求11所述的USB设备,其特征在于,The USB device according to claim 11, wherein
    所述切换单元,具体用于将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;并将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;以及将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本对应的第一数据传输线路。The switching unit is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; and to be associated with the second USB driver version Corresponding second register is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to correspond to the first USB driver version The first data transmission line.
  13. 根据权利要求11或12所述的USB设备,其特征在于,A USB device according to claim 11 or 12, wherein
    所述收发单元,具体用于当所述USB设备中的USB传输接口与所述USB设备中的无线模块同时传输数据时,向所述第二USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本低的USB驱动版本。The transceiver unit is configured to: when the USB transmission interface in the USB device transmits data simultaneously with the wireless module in the USB device, send the handover request message to the second USB device, where the A USB driver version is a lower USB driver version than the second USB driver version.
  14. 根据权利要求11或12所述的USB设备,其特征在于,A USB device according to claim 11 or 12, wherein
    所述收发单元,具体用于当检测到所述USB设备中的无线模块未传输数据,且所述USB设备传输数据采用的USB驱动版本不是所述USB设备支持的最高USB驱动版本时,向所述第二USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本高的USB驱动版本。The transceiver unit is specifically configured to: when detecting that the wireless module in the USB device does not transmit data, and the USB driver version used by the USB device to transmit data is not the highest USB driver version supported by the USB device, The second USB device sends the switching request message, and the first USB driver version is a USB driver version higher than the second USB driver version.
  15. 根据权利要求11或12所述的USB设备,其特征在于,A USB device according to claim 11 or 12, wherein
    所述收发单元,具体用于根据用户的触发操作,向所述第二USB设备发送所述切换请求报文,所述触发操作为所述用户操作驱动版本切换菜单或驱动版本切换按钮触发的。The transceiver unit is configured to send the switch request message to the second USB device according to a trigger operation of the user, where the trigger operation is triggered by the user operating a driver version switch menu or a driver version switch button.
  16. 根据权利要求15所述的USB设备,其特征在于,所述USB设备还包括生成单元,The USB device according to claim 15, wherein the USB device further comprises a generating unit,
    所述生成单元,用于在所述收发单元向所述第二USB设备发送所述切换请求报文之前,根据第三USB驱动版本,生成所述驱动版本切 换菜单或所述驱动版本切换按钮,所述驱动版本切换菜单或所述驱动版本切换按钮至少包括所述切换单元选择切换的所述第一USB驱动版本,所述第三USB驱动版本为所述USB设备和所述第二USB设备首次建立连接时协商后采用的USB驱动版本。The generating unit is configured to generate the driver version cut according to the third USB driver version before the transceiver unit sends the switch request message to the second USB device Changing the menu or the driving version switching button, the driving version switching menu or the driving version switching button at least including the first USB driving version of the switching unit selection switching, the third USB driving version is The USB driver version adopted after the USB device and the second USB device establish a connection for the first time.
  17. 根据权利要求11-16任一项所述的USB设备,其特征在于,A USB device according to any one of claims 11-16, characterized in that
    所述USB设备为USB主设备,所述第二USB设备为USB从设备;或者The USB device is a USB host device, and the second USB device is a USB slave device; or
    所述USB设备为USB从设备,所述第二USB设备为USB主设备。The USB device is a USB slave device, and the second USB device is a USB master device.
  18. 一种通用串行总线USB设备,其特征在于,包括:A universal serial bus USB device, comprising:
    收发单元,用于接收第一USB设备发送的切换请求报文,并向所述第一USB设备发送与所述切换请求报文对应的切换响应报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述USB设备将第二USB驱动版本切换为所述第一USB驱动版本,所述第二USB驱动版本为所述第一USB设备和所述USB设备当前采用的USB驱动版本,所述切换响应报文用于指示所述USB设备是否允许将所述第二USB驱动版本切换为所述第一USB驱动版本;The transceiver unit is configured to receive a handover request packet sent by the first USB device, and send a handover response packet corresponding to the handover request packet to the first USB device, where the handover request packet carries the first a USB driver version, the switch request message is used to request the USB device to switch a second USB driver version to the first USB driver version, and the second USB driver version is the first USB device and the a USB driver version currently used by the USB device, the switch response message is used to indicate whether the USB device allows to switch the second USB driver version to the first USB driver version;
    切换单元,用于若所述收发单元发送的所述切换响应报文指示所述USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则将所述第二USB驱动版本切换为所述第一USB驱动版本。a switching unit, configured to: if the switching response message sent by the transceiver unit indicates that the USB device allows to switch the second USB driver version to the first USB driver version, then the second USB driver The version is switched to the first USB driver version.
  19. 根据权利要求18所述的USB设备,其特征在于,A USB device according to claim 18, wherein
    所述切换单元,具体用于将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;并将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;以及将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本对应的第一数据传输线路。The switching unit is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; and to be associated with the second USB driver version Corresponding second register is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to correspond to the first USB driver version The first data transmission line.
  20. 根据权利要求18或19所述的USB设备,其特征在于,A USB device according to claim 18 or 19, wherein
    所述第一USB设备为USB主设备,所述USB设备为USB从设备;或者 The first USB device is a USB host device, and the USB device is a USB slave device; or
    所述第一USB设备为USB从设备,所述USB设备为USB主设备。The first USB device is a USB slave device, and the USB device is a USB master device.
  21. 一种通用串行总线USB设备,其特征在于,包括:A universal serial bus USB device, comprising:
    处理器,用于通过USB传输接口向第二USB设备发送切换请求报文,并通过所述USB传输接口接收所述第二USB设备发送的与所述切换请求报文对应的切换响应报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述第二USB设备将第二USB驱动版本切换为所述第一USB驱动版本,所述第二USB驱动版本为所述USB设备和所述第二USB设备当前采用的USB驱动版本,所述切换响应报文用于指示所述第二USB设备是否允许将所述第二USB驱动版本切换为所述第一USB驱动版本;a processor, configured to send, by using a USB transmission interface, a handover request message to the second USB device, and receive, by using the USB transmission interface, a handover response message that is sent by the second USB device and corresponding to the handover request message, The switching request message carries a first USB driver version, and the switching request message is used to request the second USB device to switch the second USB driver version to the first USB driver version, the second USB The driver version is a USB driver version currently used by the USB device and the second USB device, and the switch response message is used to indicate whether the second USB device allows to switch the second USB driver version to the First USB driver version;
    所述处理器,还用于若所述切换响应报文指示所述第二USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则将所述第二USB驱动版本切换为所述第一USB驱动版本。The processor is further configured to: if the switch response message indicates that the second USB device allows to switch the second USB driver version to the first USB driver version, then the second USB driver version Switch to the first USB driver version.
  22. 根据权利要求21所述的USB设备,其特征在于,A USB device according to claim 21, wherein
    所述处理器,具体用于将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;并将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;以及将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本对应的第一数据传输线路。The processor is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; and to be associated with the second USB driver version Corresponding second register is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to correspond to the first USB driver version The first data transmission line.
  23. 根据权利要求21或22所述的USB设备,其特征在于,A USB device according to claim 21 or 22, wherein
    所述处理器,具体用于当所述USB设备中的USB传输接口与所述USB设备中的无线模块同时传输数据时,通过所述USB传输接口向所述第二USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本低的USB驱动版本。The processor is configured to: when the USB transmission interface in the USB device transmits data simultaneously with the wireless module in the USB device, send the switching request to the second USB device by using the USB transmission interface The message, the first USB driver version is a USB driver version lower than the second USB driver version.
  24. 根据权利要求21或22所述的USB设备,其特征在于,A USB device according to claim 21 or 22, wherein
    所述处理器,具体用于当检测到所述USB设备中的无线模块未传输数据,且所述USB设备传输数据采用的USB驱动版本不是所述USB设备支持的最高USB驱动版本时,通过所述USB传输接口向所述第二 USB设备发送所述切换请求报文,所述第一USB驱动版本为比所述第二USB驱动版本高的USB驱动版本。The processor is specifically configured to: when detecting that the wireless module in the USB device does not transmit data, and the USB driver version used by the USB device to transmit data is not the highest USB driver version supported by the USB device, Said USB transmission interface to said second The USB device sends the switching request message, and the first USB driver version is a USB driver version higher than the second USB driver version.
  25. 根据权利要求21或22所述的USB设备,其特征在于,A USB device according to claim 21 or 22, wherein
    所述处理器,具体用于根据用户的触发操作,通过所述USB传输接口向所述第二USB设备发送所述切换请求报文,所述触发操作为所述用户操作驱动版本切换菜单或驱动版本切换按钮触发的。The processor is specifically configured to send, by using the USB transmission interface, the handover request message to the second USB device according to a trigger operation of the user, where the trigger operation is the user operating a driver version switching menu or driver The version switch button is triggered.
  26. 根据权利要求25所述的USB设备,其特征在于,A USB device according to claim 25, wherein
    所述处理器,还用于在向所述第二USB设备发送所述切换请求报文之前,根据第三USB驱动版本,生成所述驱动版本切换菜单或所述驱动版本切换按钮,所述驱动版本切换菜单或所述驱动版本切换按钮至少包括所述处理器选择切换的所述第一USB驱动版本,所述第三USB驱动版本为所述USB设备和所述第二USB设备首次建立连接时协商后采用的USB驱动版本。The processor is further configured to generate the driver version switching menu or the driver version switching button according to a third USB driver version before sending the switching request message to the second USB device, where the driver The version switching menu or the driver version switching button includes at least the first USB driver version selected by the processor to switch, and the third USB driver version is when the USB device and the second USB device establish a connection for the first time USB driver version adopted after negotiation.
  27. 根据权利要求21-26任一项所述的USB设备,其特征在于,A USB device according to any one of claims 21-26, characterized in that
    所述USB设备为USB主设备,所述第二USB设备为USB从设备;或者The USB device is a USB host device, and the second USB device is a USB slave device; or
    所述USB设备为USB从设备,所述第二USB设备为USB主设备。The USB device is a USB slave device, and the second USB device is a USB master device.
  28. 一种通用串行总线USB设备,其特征在于,包括:A universal serial bus USB device, comprising:
    处理器,用于通过USB传输接口接收第一USB设备发送的切换请求报文,并通过所述USB传输接口向所述第一USB设备发送与所述切换请求报文对应的切换响应报文,所述切换请求报文中携带第一USB驱动版本,所述切换请求报文用于请求所述USB设备将第二USB驱动版本切换为所述第一USB驱动版本,所述第二USB驱动版本为所述第一USB设备和所述USB设备当前采用的USB驱动版本,所述切换响应报文用于指示所述USB设备是否允许将所述第二USB驱动版本切换为所述第一USB驱动版本;a processor, configured to receive, by using a USB transmission interface, a handover request message sent by the first USB device, and send, by using the USB transmission interface, a handover response message corresponding to the handover request message to the first USB device, The switching request message carries a first USB driver version, and the switching request message is used to request the USB device to switch the second USB driver version to the first USB driver version, and the second USB driver version The switching response message is used to indicate whether the USB device allows to switch the second USB driver version to the first USB driver for the USB driver version currently used by the first USB device and the USB device. version;
    所述处理器,还用于若所述切换响应报文指示所述USB设备允许将所述第二USB驱动版本切换为所述第一USB驱动版本,则将所述第二USB驱动版本切换为所述第一USB驱动版本。 The processor is further configured to: if the switch response message indicates that the USB device allows to switch the second USB driver version to the first USB driver version, switch the second USB driver version to The first USB driver version.
  29. 根据权利要求28所述的USB设备,其特征在于,A USB device according to claim 28, wherein
    所述处理器,具体用于将与所述第二USB驱动版本对应的第二USB驱动切换为与所述第一USB驱动版本对应的第一USB驱动;并将与所述第二USB驱动版本对应的第二寄存器切换为与所述第一USB驱动版本对应的第一寄存器;以及将与所述第二USB驱动版本对应的第二数据传输线路切换为与所述第一USB驱动版本对应的第一数据传输线路。The processor is specifically configured to switch a second USB driver corresponding to the second USB driver version to a first USB driver corresponding to the first USB driver version; and to be associated with the second USB driver version Corresponding second register is switched to a first register corresponding to the first USB driver version; and a second data transmission line corresponding to the second USB driver version is switched to correspond to the first USB driver version The first data transmission line.
  30. 根据权利要求28或29所述的USB设备,其特征在于,A USB device according to claim 28 or 29, wherein
    所述第一USB设备为USB主设备,所述USB设备为USB从设备;或者The first USB device is a USB host device, and the USB device is a USB slave device; or
    所述第一USB设备为USB从设备,所述USB设备为USB主设备。 The first USB device is a USB slave device, and the USB device is a USB master device.
PCT/CN2015/073040 2015-02-13 2015-02-13 Method for switching usb driver version and usb device WO2016127402A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201580002425.9A CN106170778B (en) 2015-02-13 2015-02-13 A kind of method and USB device of switching USB driving version
PCT/CN2015/073040 WO2016127402A1 (en) 2015-02-13 2015-02-13 Method for switching usb driver version and usb device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/073040 WO2016127402A1 (en) 2015-02-13 2015-02-13 Method for switching usb driver version and usb device

Publications (1)

Publication Number Publication Date
WO2016127402A1 true WO2016127402A1 (en) 2016-08-18

Family

ID=56614229

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/073040 WO2016127402A1 (en) 2015-02-13 2015-02-13 Method for switching usb driver version and usb device

Country Status (2)

Country Link
CN (1) CN106170778B (en)
WO (1) WO2016127402A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101287219A (en) * 2008-04-15 2008-10-15 深圳华为通信技术有限公司 Method and apparatus for automatic switching port of terminal apparatus, and automatic switching system
CN101452435A (en) * 2008-12-12 2009-06-10 深圳华为通信技术有限公司 USB terminal mode switching method and terminal
CN101777032A (en) * 2009-01-14 2010-07-14 华为终端有限公司 Method and equipment for realizing USB endpoint multiplexing
US20130275640A1 (en) * 2011-12-16 2013-10-17 Jennifer C. Wang Automatic downstream to upstream mode switching at a universal serial bus physical layer
CN104199789A (en) * 2014-08-28 2014-12-10 中兴通讯股份有限公司 Port self-adaptive configuration method and system, management system and driving system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040148450A1 (en) * 2003-01-27 2004-07-29 Shih-Chang Chen Serially connectable USB drive
KR101587457B1 (en) * 2009-05-26 2016-01-21 삼성전자주식회사 Apparatus and method for supporting suspend of composite network device
CA2819225A1 (en) * 2010-11-29 2012-06-07 Mce-Sys Ltd Host device coupled to a usb peripheral and method of operating the same

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101287219A (en) * 2008-04-15 2008-10-15 深圳华为通信技术有限公司 Method and apparatus for automatic switching port of terminal apparatus, and automatic switching system
CN101452435A (en) * 2008-12-12 2009-06-10 深圳华为通信技术有限公司 USB terminal mode switching method and terminal
CN101777032A (en) * 2009-01-14 2010-07-14 华为终端有限公司 Method and equipment for realizing USB endpoint multiplexing
US20130275640A1 (en) * 2011-12-16 2013-10-17 Jennifer C. Wang Automatic downstream to upstream mode switching at a universal serial bus physical layer
CN104199789A (en) * 2014-08-28 2014-12-10 中兴通讯股份有限公司 Port self-adaptive configuration method and system, management system and driving system

Also Published As

Publication number Publication date
CN106170778A (en) 2016-11-30
CN106170778B (en) 2019-04-19

Similar Documents

Publication Publication Date Title
JP6387370B2 (en) Electronic device and method of operating electronic device
US9980084B2 (en) Communication apparatus, method for controlling the same, and storage medium
TWI617919B (en) Devices and methods for facilitating direct pairing in a wireless docking system
US9544048B2 (en) System and method for persistent wireless docking
KR102181777B1 (en) A METHOD AND APPARATUS FOR DIRECT CONNECTION BETWEEN DOCKEE AND PERIPHERALS IN a Docking Network
JP5433531B2 (en) Host / peripheral local interconnect that can adapt to self-configurable peripherals
US9974104B2 (en) Wireless communication apparatus and method for seamlessly communicating data by setting up and switching between multiple networks
US20130044635A1 (en) Wireless Communication Device
US10282147B2 (en) Image forming device and control method
US20160198498A1 (en) Communication apparatus, method of controlling a communication apparatus, and storage medium
KR20190065101A (en) An electronic device for transmitting and receiving data in a wireless communication system and a method thereof
IL271243B2 (en) Data transmission method, terminal device, and network device
WO2016009762A1 (en) Communication system, communication method, communication apparatus, method of controlling the same, and computer program
JP2022191444A (en) Device for wireless communication handover
EP3550787B1 (en) Device connection method and terminal
WO2017049549A1 (en) Mobile terminal, power supply adapter, and upgrading method thereof
JP5143191B2 (en) System, server device, and method for using peripheral device
JP6261577B2 (en) Wireless communication apparatus, wireless communication method, and wireless communication control program
EP2924955B1 (en) Apparatus, communication control system, and communication control method
JP7407887B2 (en) Communication device, communication device control method, and program
KR102303990B1 (en) Communication apparatus, external apparatus, control method for communication apparatus, control method for external apparatus, and non-transitory computer-readable storage medium
WO2016127402A1 (en) Method for switching usb driver version and usb device
US9288833B2 (en) Communication apparatus and control method thereof
JP6970578B2 (en) Communication equipment and its control method, program
JP7070094B2 (en) Computer programs and communication equipment for communication equipment

Legal Events

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

Ref document number: 15881564

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15881564

Country of ref document: EP

Kind code of ref document: A1