WO2018099255A1 - 一种传输模式配置方法、装置及***、计算机存储介质 - Google Patents

一种传输模式配置方法、装置及***、计算机存储介质 Download PDF

Info

Publication number
WO2018099255A1
WO2018099255A1 PCT/CN2017/110283 CN2017110283W WO2018099255A1 WO 2018099255 A1 WO2018099255 A1 WO 2018099255A1 CN 2017110283 W CN2017110283 W CN 2017110283W WO 2018099255 A1 WO2018099255 A1 WO 2018099255A1
Authority
WO
WIPO (PCT)
Prior art keywords
transmission mode
usb
target host
mode information
usb device
Prior art date
Application number
PCT/CN2017/110283
Other languages
English (en)
French (fr)
Inventor
张建厂
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2018099255A1 publication Critical patent/WO2018099255A1/zh

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
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • 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
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • 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
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Definitions

  • the present invention relates to a universal serial bus (USB) communication technology, and in particular, to a transmission mode configuration method, apparatus and system, and a computer storage medium.
  • USB universal serial bus
  • USB 3.0 USB 3.0
  • USB 2.0 USB 3.0
  • the inventor also found that the USB device uses the USB3.0 data cable, and the electronic product with the USB 3.0 host controller is inserted, but the USB device reports the USB2.0 transmission mode, in fact It should be reported as the transfer mode of USB3.0.
  • the USB device is unplugged from the USB3.0 host controller and plugged into the USB2.0 host controller.
  • the driver port fails to be opened or the serial port driver function is abnormal.
  • USB2.0 the USB device will be reported as USB2.0, that is, the USB related information that may be reported is incorrect, resulting in the transmission mode set by the device. Invalid.
  • the inventor In order to verify that the failure of the USB information report causes the device configuration transmission mode to fail, it has a certain relationship with the operating system.
  • the operating systems mainly involved in the testing process include windows XP system, windows7 system, windows 8 system, windows 10 system, etc.
  • the 32-bit and 64-bit of these operating systems have been tested.
  • the test results show that if the computer supports the USB3.0 host controller, the USB information reporting failure will occur. If the failure of USB information reporting occurs only on the Windows XP system, it can be left unprocessed.
  • an embodiment of the present invention provides a transmission mode configuration method, apparatus, and system, and a computer storage medium.
  • an embodiment of the present invention provides a transmission mode configuration method, where the method includes:
  • USB transmission mode information is inconsistent with the USB transmission mode information recorded by the target host
  • the USB transmission mode information recorded by the target host is modified to the USB transmission mode information reported by the USB device side; and the transmission mode is configured based on the modified USB transmission mode information.
  • the acquiring the USB transmission mode information reported by the USB device includes:
  • the method further includes:
  • the transmission mode information acquisition instruction is sent to the USB device.
  • the method further includes:
  • the transmission mode configuration is performed based on the USB transmission mode information recorded by the target host.
  • the method further includes:
  • USB device If it is determined that the USB device is first inserted, an initial transmission mode connection is established with the USB device, and an initial transmission mode corresponding to the USB device is recorded.
  • the transmission mode information obtaining instruction is:
  • the standard USB request instruction includes: a USB device descriptor request instruction;
  • the custom USB request instruction includes: a small computer system interface SCSI carrying an indication of acquiring a USB transmission mode information instruction.
  • the USB transmission mode information recorded by the target host is obtained, including:
  • an embodiment of the present invention provides a transmission mode configuration method, where the method package includes include:
  • the method further includes:
  • the method further includes:
  • USB device If the USB device is inserted into the target host for the first time;
  • the transmission mode with successful adaptation is taken as the initial transmission mode, and an initial transmission mode connection is established with the target host.
  • an embodiment of the present invention provides a transmission mode configuration apparatus, which is applied to a target host side, where the apparatus includes:
  • the first receiving unit is configured to obtain USB transmission mode information reported by the USB device
  • the identification unit is configured to: when it is determined that the USB transmission mode information is inconsistent with the USB transmission mode information recorded by the target host, modify the USB transmission mode information recorded by the target host to the USB transmission mode information reported by the USB device side;
  • the first configuration unit is configured to perform a transmission mode configuration based on the modified USB transmission mode information.
  • the first receiving unit is further configured to acquire USB transmission mode information reported by the USB device based on the transmission mode information acquisition instruction.
  • the device further includes:
  • a first sending unit configured to detect that the USB device is inserted into the target host, if it is determined The USB device is not the first time to insert, and transmits a transmission mode information acquisition instruction to the USB device.
  • the first configuration unit is further configured to:
  • the identifying unit determines that the USB transmission mode information is consistent with the USB transmission mode information recorded by the target host, performing a transmission mode configuration based on the USB transmission mode information recorded by the target host.
  • the device further includes:
  • the first communication unit is configured to establish an initial transmission mode connection with the USB device if it is determined that the USB device is first inserted.
  • the transmission mode information obtaining instruction is:
  • the standard USB request instruction includes: a USB device descriptor request instruction
  • the custom USB request instruction includes: carrying a SCSI command for obtaining an indication of a USB transfer mode information.
  • the identifying unit is further configured to:
  • the transmission mode configuration device is applied to the target host.
  • the embodiment of the present invention provides a transmission mode configuration apparatus, which is applied to a USB device side, and the device includes:
  • a second receiving unit configured to receive a transmission mode information acquisition instruction sent by the target host
  • the second sending unit is configured to report the USB transmission mode information to the target host based on the transmission mode information acquisition instruction.
  • the device further includes:
  • a second configuration unit configured to be set in the USB according to the transmission mode selected by the target host
  • the standby side performs a transmission mode configuration, so that the USB device communicates with the target host based on the configured transmission mode.
  • the device further includes:
  • a second communication unit configured to: if the USB device is first inserted into the target host; adapt according to a type of the host controller of the target host; use a successfully adapted transmission mode as an initial transmission mode, and the target The host establishes an initial transport mode connection.
  • the transmission mode configuration device is applied to a USB device.
  • an embodiment of the present invention provides a transmission mode configuration system, where the system includes: a target host and a USB device;
  • the target host is configured to obtain USB transmission mode information reported by the USB device based on the transmission mode information acquisition instruction; when the USB transmission mode information is inconsistent with the USB transmission mode information recorded by the target host, the target host record is obtained.
  • the USB transmission mode information is modified to the USB transmission mode information reported by the USB device side; and the transmission mode is configured based on the modified USB transmission mode information;
  • the USB device is configured to receive a transmission mode information acquisition instruction sent by the target host, and report, according to the transmission mode information acquisition instruction, the USB transmission mode information to the target host, according to the transmission mode selected by the target host in the USB device.
  • the side performs a transmission mode configuration, so that the USB device communicates with the target host based on the configured transmission mode.
  • the target host includes the foregoing transmission mode configuration device applied to the target host side, where the USB device includes the USB device-side transmission mode described in the claims. Configure the device.
  • the embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the application to the target host according to the embodiment of the present invention.
  • Side transfer mode configuration method is used to execute the application to the target host according to the embodiment of the present invention.
  • an embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, where the computer executable instructions are used to execute the present The transmission mode configuration method applied to the USB device side according to the embodiment of the invention.
  • the USB transmission mode information reported by the USB device is obtained; when the USB transmission mode information is inconsistent with the USB transmission mode information recorded by the target host, the USB transmission mode information recorded by the target host is modified.
  • the target host can automatically identify and adapt the USB transmission mode compatible with the USB device, thereby improving the compatibility and stability of the USB device, thereby solving the sleep of the USB device or the target host.
  • the software that is connected to the network on the target host due to the mismatch between the transmission mode configured on the USB device side and the transmission mode configured on the target host side is prone to abnormality, the function of the drive port is abnormal, or the USB transmission mode is confusing. And other issues.
  • FIG. 1 is a schematic flowchart of a method for configuring a transmission mode according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of another method for configuring a transmission mode according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a transmission mode configuration apparatus according to an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of another transmission mode configuration apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a working architecture of a transmission mode configuration system according to an embodiment of the present disclosure
  • FIG. 6 is a schematic flowchart of a host module being preset to a target host according to an embodiment of the present disclosure
  • FIG. 7 is a schematic diagram of an initialization process of each module in a transmission mode configuration system according to an embodiment of the present disclosure
  • FIG. 8 is a schematic flowchart of a configuration communication operation provided by this embodiment.
  • FIG. 9 is a schematic diagram of a workflow of a transmission mode configuration according to the embodiment.
  • FIG. 1 is a schematic flowchart of a transmission mode configuration method according to an embodiment of the present invention, which is applied to a target host side. As shown in FIG. 1 , the transmission mode configuration method includes the following steps:
  • Step 101 Obtain USB transmission mode information reported by the USB device.
  • the obtaining the USB transmission mode information reported by the USB device includes:
  • the obtaining USB device transmits the USB transmission mode information reported by the instruction based on the transmission mode information, including:
  • the obtaining USB device transmits the USB transmission mode information reported by the instruction based on the transmission mode information, including:
  • the transmission mode information acquisition instruction is a custom USB request instruction
  • the method before step 101, the method further includes:
  • Step 100 When detecting that the USB device is inserted into the target host, if it is determined that the USB device is Non-first insertion, a transmission mode information acquisition instruction is sent to the USB device.
  • the USB device refers to a device capable of exchanging data with a target host based on a data transfer protocol, such as a USB flash drive, a mobile hard disk, or the like.
  • the target host is an electronic product having a USB interface, such as a desktop computer, a notebook computer, or the like.
  • the transmission mode information acquisition instruction is: a standard USB request instruction.
  • the standard USB request instruction includes: a USB device descriptor request instruction.
  • the USB device descriptor request instruction is used to obtain enumeration information of the USB device, and the enumeration information includes USB transmission mode information that needs to be reported to the target host.
  • the transmission mode information obtaining instruction is: a custom USB request instruction.
  • the custom USB request command includes: a Small Computer System Interface (SCSI) command carrying an indication of obtaining a USB transmission mode information.
  • SCSI Small Computer System Interface
  • the character indicating the obtaining the USB transmission mode information indication is negotiated by the target host and the USB device side.
  • the target host side negotiates with the USB device side which byte is used to indicate acquisition of USB transfer mode information, and characters for indicating USB 3.0 transfer mode information, USB 2.0 transfer mode information, and the like.
  • Step 102 When the USB transmission mode information is inconsistent with the USB transmission mode information recorded by the target host, modify the USB transmission mode information recorded by the target host to the USB transmission mode information reported by the USB device side;
  • the USB transfer mode information is configured for the transfer mode.
  • the target host recognizes the USB transmission mode information reported by the USB device side
  • the USB transmission mode information recorded by the target host is inconsistent
  • the USB transmission mode information recorded by the target host is modified into the USB transmission mode information reported by the USB device side, and then the transmission mode configuration is performed based on the modified USB transmission mode information.
  • the software that is connected to the network on the target host is likely to be abnormal due to the mismatch between the transmission mode configured on the USB device side and the transmission mode configured on the target host side.
  • the drive port function is abnormal or the USB transfer mode is confused.
  • the method before determining whether the USB transmission mode information is consistent with the USB transmission mode information recorded by the target host, the method further includes:
  • the information about the USB transmission mode recorded by the target host is obtained, including:
  • the identification information of the USB device includes but is not limited to:
  • USB device manufacturer ID USB device product ID
  • disc serial number USB device serial number
  • acquiring the USB transmission mode information recorded by the target host includes:
  • the method further includes:
  • the transmission mode configuration is performed based on the USB transmission mode information recorded by the target host.
  • the transmission mode configuration is performed based on the USB transmission mode information recorded by the target host, which can be completed by the USB device.
  • the transmission mode configuration adapted to the target host without generating an erroneous enumeration information or a speed transmission mode, thereby establishing the transmission The mode of communication, so that the USB device can work normally based on the transmission mode.
  • the method further includes:
  • USB device If it is determined that the USB device is first inserted, an initial transmission mode connection is established with the USB device, and an initial transmission mode corresponding to the USB device is recorded.
  • the USB device is adapted according to a type of a host controller of the target host; and a successfully adapted transmission mode is used as an initial transmission mode, and The target host establishes an initial transport mode connection.
  • the USB device is inserted into the target host for the first time, and the initial transmission mode is: the USB device is selected according to the target host's host controller being USB2.0 or USB3.0. Actively reported speed transfer mode.
  • the target host obtains the basis for providing the record information related to the USB device.
  • the USB transmission mode information acquisition instruction when detecting that the USB device is inserted into the target host, if it is determined that the USB device is not first inserted, sending a transmission mode information acquisition instruction to the USB device; acquiring the USB device based on the transmission The mode information obtaining the USB transmission mode information reported by the instruction; determining whether the USB transmission mode information is consistent with the USB transmission mode information recorded by the target host; and if the USB transmission mode information and the USB transmission mode information recorded by the target host Inconsistent, the USB transmission mode information recorded by the target host is modified to the USB transmission mode information reported by the USB device side; and the transmission mode is configured based on the modified USB transmission mode information.
  • the target host can automatically identify and adapt the USB transmission mode compatible with the USB device, thereby improving the compatibility and stability of the USB device, thereby solving the sleep of the USB device or the target host.
  • the software that is connected to the network on the target host due to the mismatch between the transmission mode configured on the USB device side and the transmission mode configured on the target host side is prone to abnormality, the function of the drive port is abnormal, or the USB transmission mode is confusing. And other issues.
  • FIG. 2 is a schematic flowchart of a transmission mode configuration method according to an embodiment of the present invention, which is applied to a USB device side. As shown in FIG. 2, the transmission mode configuration method includes the following steps:
  • Step 201 Receive a transmission mode information acquisition instruction sent by the target host.
  • the target host is an electronic product having a USB interface, such as a desktop computer, a notebook computer, or the like.
  • Step 202 Report USB transmission mode information to the target host based on the transmission mode information obtaining instruction, so that the target host determines whether the USB transmission mode information is consistent with the USB transmission mode information recorded by the target host, and The configuration of the transmission mode is performed based on the judgment result.
  • the USB device refers to a device capable of exchanging data with a target host based on a data transfer protocol, such as a USB flash drive, a mobile hard disk, or the like.
  • the USB device reports the USB transmission mode information to the target host in time, so that the target host can automatically recognize and adapt the USB transmission mode suitable for the USB device, thereby improving the compatibility and stability of the USB device, thereby solving the USB plugging and unplugging.
  • the software connected to the operation on the target host is prone to abnormality, the function of the drive port is abnormal, or the transmission mode configured on the USB device side does not match the transmission mode configured on the target host side.
  • the USB transfer mode recognizes problems such as confusion.
  • the method further includes:
  • the method further includes:
  • USB device If the USB device is inserted into the target host for the first time;
  • host controllers include: USB 2.0 host controller, USB 3.0 host controller.
  • the USB device is first inserted into the target host, the target host completes initialization in a short time, and the target host is connected to the initial transmission mode established by the USB device.
  • the target host and the USB device establish a communication connection and perform normal data interaction.
  • the USB device receives the transmission mode information acquisition instruction sent by the target host, and reports the USB transmission mode information to the target host based on the transmission mode information acquisition instruction, so that the target host determines the Whether the USB transmission mode information is consistent with the USB transmission mode information recorded by the target host, and the transmission mode is configured according to the determination result.
  • the USB device reports the USB transmission mode information to the target host in time, so that the target host can automatically recognize and adapt the USB transmission mode suitable for the USB device, thereby improving the compatibility and stability of the USB device, thereby solving the USB plugging and unplugging.
  • the software connected to the operation on the target host is prone to abnormality, the function of the drive port is abnormal, or the transmission mode configured on the USB device side does not match the transmission mode configured on the target host side.
  • the USB transfer mode recognizes problems such as confusion.
  • the embodiment of the present invention provides a transmission mode configuration apparatus, and the transmission mode configuration apparatus includes the following:
  • the first receiving unit 32 is configured to acquire USB transmission mode information reported by the USB device;
  • the identification unit 33 is configured to determine whether the USB transmission mode information is consistent with the USB transmission mode information recorded by the target host; when it is determined that the USB transmission mode information is inconsistent with the USB transmission mode information recorded by the target host, The USB transmission mode information recorded by the target host is modified to the USB transmission mode information reported by the USB device side;
  • the first configuration unit 34 is configured to perform transmission mode based on the modified USB transmission mode information. Configuration.
  • the first receiving unit 32 is specifically configured to acquire USB transmission mode information reported by the USB device based on the transmission mode information acquisition instruction.
  • the device further includes:
  • the first sending unit 31 is configured to, when detecting that the USB device is inserted into the target host, send a transmission mode information acquisition instruction to the USB device if it is determined that the USB device is not first inserted.
  • the first configuration unit 34 is further configured to:
  • the transmission mode is configured based on the USB transmission mode information recorded by the target host.
  • the device further includes:
  • the first communication unit 35 is configured to establish an initial transmission mode connection with the USB device if it is determined that the USB device is first inserted.
  • the transmission mode information obtaining instruction is:
  • the standard USB request instruction includes: a USB device descriptor request instruction
  • the custom USB request instruction includes: carrying a SCSI command for obtaining an indication of a USB transfer mode information.
  • the identifying unit 33 is further configured to:
  • the identifying unit 33 is specifically configured to:
  • the USB transmission mode information corresponding to the USB device recorded by the target host.
  • the transmission mode configuration device in this embodiment may be disposed on the target host side.
  • the target host is an electronic product having a USB interface, such as a desktop computer, a notebook computer, or the like.
  • the USB device refers to a device capable of exchanging data with a target host based on a data transfer protocol, such as a USB flash drive, a mobile hard disk, or the like.
  • the first sending unit 31, the first receiving unit 32, the identifying unit 33, the first configuring unit 34, and the first communication unit 35 in the transmission mode configuration apparatus may be in the actual application by the transmission mode.
  • a central processing unit (CPU), a digital signal processor (DSP), or a field-programmable gate array (FPGA) in the terminal to which the configuration device or the transmission mode configuration device belongs achieve.
  • the transmission mode configuration device of the embodiment of the invention can automatically identify and adapt the USB transmission mode suitable for the USB device, thereby improving the compatibility and stability of the USB device, thereby solving the sleep awakening of the USB device or the target host.
  • the software that is connected to the network on the target host due to the mismatch between the transmission mode configured on the USB device side and the transmission mode configured on the target host side is prone to abnormality, abnormal function of the drive port, or confusion of USB transmission mode recognition. .
  • the embodiment of the present invention provides a transmission mode configuration apparatus, and the transmission mode configuration apparatus includes the following:
  • the second receiving unit 41 is configured to receive a transmission mode information acquisition instruction sent by the target host;
  • the second sending unit 42 is configured to report the USB transmission mode information to the target host based on the transmission mode information acquisition instruction.
  • the device further includes:
  • the second configuration unit 43 is configured to perform a transmission mode configuration on the USB device side according to the transmission mode selected by the target host, so that the USB device communicates with the target host based on the configured transmission mode.
  • the device further includes:
  • the second communication unit 44 is configured to: if the USB device is inserted into the target host for the first time; adapt according to the type of the host controller of the target host; use the successfully adapted transmission mode as the initial transmission mode, and The target host establishes an initial transport mode connection.
  • the transmission mode configuration device in this embodiment may be disposed on the USB device side.
  • the USB device refers to a device capable of exchanging data with a target host based on a data transfer protocol, such as a USB flash drive, a mobile hard disk, or the like.
  • a data transfer protocol such as a USB flash drive, a mobile hard disk, or the like.
  • the target host is an electronic product having a USB interface, such as a desktop computer, a notebook computer, or the like.
  • the second receiving unit 41, the second sending unit 42, the second configuration unit 43, and the second communication unit 44 in the transmission mode configuration apparatus may be configured by the transmission mode in the actual application.
  • the implementation of the CPU, DSP, or FPGA in the terminal to which the transmission mode configuration device belongs is implemented.
  • the transmission mode configuration device of the embodiment of the invention can automatically identify and adapt the USB transmission mode suitable for the USB device, thereby improving the compatibility and stability of the USB device, thereby solving the sleep awakening of the USB device or the target host.
  • the software that is connected to the network on the target host due to the mismatch between the transmission mode configured on the USB device side and the transmission mode configured on the target host side is prone to abnormality, the function of the drive port is abnormal, or the USB transmission mode is disordered. And other issues.
  • the embodiment provides a transmission mode configuration system, where the transmission mode configuration system includes a target host and a USB device; wherein:
  • the target host is configured to obtain USB transmission mode information reported by the USB device based on the transmission mode information acquisition instruction; when the USB transmission mode information is inconsistent with the USB transmission mode information recorded by the target host, the USB recorded by the target host is The transmission mode information is modified to the USB transmission mode information reported by the USB device side; and the transmission mode is configured based on the modified USB transmission mode information;
  • the USB device is configured to receive a transmission mode information acquisition instruction sent by the target host, and report, according to the transmission mode information acquisition instruction, the USB transmission mode information to the target host, according to the transmission mode selected by the target host in the USB device.
  • the side performs a transmission mode configuration, so that the USB device communicates with the target host based on the configured transmission mode.
  • the target host is further configured to: when detecting that the USB device is inserted into the target host, if it is determined that the USB device is not first inserted, send a transmission mode information acquisition instruction to the USB device.
  • the target host is further configured to determine whether the USB transmission mode information is consistent with the USB transmission mode information recorded by the target host.
  • the target host includes the transmission mode configuration device shown in FIG. 3, and the USB device includes the transmission mode configuration device shown in FIG. 4, and details are not described herein again.
  • the transmission mode configuration device of the application target host side shown in FIG. 3 is referred to as a host module, wherein the host module includes a transmission mode identification module and a user interface control module.
  • the transmission mode identification module includes a first transmitting unit 31, a first receiving unit 32, an identifying unit 33, a first configuration unit 34, and a first communication unit 35.
  • the USB-side transmission mode configuration device shown in FIG. 4 is referred to as a USB-board-side module, wherein the USB-board-side module includes a kernel sub-module and a function sub-module; the kernel sub-module includes The second receiving unit 41, the second transmitting unit 42, and the second communication unit 44, the function sub-module includes a second configuration unit 43.
  • the embodiment of the present invention further describes a complete transmission mode configuration apparatus, where the transmission mode configuration apparatus includes: a host module and a USB board side module.
  • the host module and the USB board side module constitute a complete USB transmission mode configuration device.
  • the device installs the host module on the target host. After the installation of the host module is completed, the USB transfer mode identification module is also installed on the host system, and the data card type terminal device having the USB board side module described in this embodiment is used. It can form a recognition system that is not affected by the host system, can automatically and recognize the USB transmission mode supported by the target host, and at the same time determine the transmission mode type that the device can use.
  • the transmission mode identification module in the host module only needs to be installed once in the target host to complete the installation process of the device in the target host in the embodiment. In the subsequent use and operation of the device, all the main work only needs to communicate with the internal transmission mode identification module and the USB board side module to complete the function of this configuration.
  • the transmission mode identification module sends some standard USB requests to the USB board.
  • the side module obtains the transmission mode information of the device, determines according to the transmission mode supported by the device, and clears the information on the host that records the last device inserted into the host, and fills in the host operating system information according to the transmission mode information of the device. This makes it faster to implement the device's transfer mode to write to the host and port enumeration.
  • the transmission mode information and the enumeration information can be better recorded on the host by sending some standard USB request instructions through the transmission mode identification module on the target host to avoid device enumeration.
  • the information and transmission mode reported an error, causing the user to continue to use the Internet or the rate does not meet the user's requirements.
  • the host module contains a transport pattern recognition module.
  • the transmission mode identification module includes some USB request instructions for sending standards, etc., and the present invention focuses on how the function of the module is achieve.
  • the initial transmission mode is adopted when the device is first inserted into the host system.
  • the initial transmission mode is that the USB board side module selects an active reporting speed transmission mode according to whether the host controller of the host is adapted by USB2.0 or USB 3.0. . After adopting this scheme, users can provide good inheritance and compatibility of new and old products.
  • the main function of the transmission mode identification module of the device host module in this embodiment is to communicate with the kernel layer submodule of the USB board side module in the device in the embodiment, to provide a USB control message transmission, and to transmit a mode identification module and
  • the USB board side module establishes a communication default pipe connection, manages the control path of the speed transmission mode identification, and completes the connection phase of the host module and the USB board side module.
  • the technical solution provided in this embodiment realizes the automatic identification and adaptation of the USB speed transmission mode, which is flexible and convenient, and solves the problem that the device needs to be restarted or the device is plugged and unplugged to a normal port in the case of a transmission mode identification error.
  • the USB device in the process of speed transmission mode identification, the USB device cannot be used, and the USB device is not required to be repeatedly inserted and removed, thereby saving user time; only the host is needed on the target host. Once installed, it can interact with the USB device to adapt the transmission mode identification and configuration of the data card product; improve the compatibility and stability of the USB device.
  • FIG. 5 is a working architecture diagram of a transmission mode configuration system according to an embodiment of the present invention. As shown in FIG. 5, the workflow mainly includes:
  • Step 501 The USB board side module establishes communication with the target host.
  • the USB board side module establishes communication with the target host through the kernel submodule in the USB board side module.
  • Step 502 After the loading and starting of the USB board side module is completed, the transmission mode identification module in the host module sends a transmission mode information acquisition instruction, and performs the adaptation of the speed transmission mode with the kernel submodule in the USB board side module.
  • FIG. 6 is a schematic flowchart of a host module being preset to a target host according to an embodiment of the present invention. As shown in FIG. 6, the workflow mainly includes:
  • Step 601 The host module including the transmission mode identification module is nested in the optical disc of the USB device, or integrated into the host function driver or automatically prompts the user to automatically download the update from the recommended website by pushing.
  • Step 602 The USB device is inserted into the target host, and the host module is automatically installed after the installation of the optical disk, the installation of the host function driver, and the downloading is completed. After the installation is completed, the startup program of the transmission mode identification module is automatically invoked to complete the transmission mode identification. Initialization of the module.
  • Step 603 After the initialization of the transmission mode identification module is completed, the transmission mode information acquisition instruction is sent to the USB device to complete the acquisition of the USB information on the USB device board side.
  • the transmission mode information acquisition instruction may be a standard USB request instruction, such as a USB device descriptor request instruction.
  • the transmission mode information acquisition instruction may also be a custom USB request instruction, such as a SCSI command carrying an indication of obtaining a USB transmission mode information.
  • the transmission mode identification module is further configured to read a registry item of the USB device side information recorded by the target host system by calling a system function, so as to obtain USB transmission mode information recorded by the USB device side in the target host system.
  • FIG. 7 is a schematic diagram of an initialization process of each module in a transmission mode configuration system according to an embodiment of the present invention. As shown in FIG. 7, the initialization process mainly includes:
  • Step 701 After the USB device is inserted into the target host, the USB board side module completes initialization of the kernel submodule according to the USB standard protocol.
  • Step 702 After the initialization of the kernel submodule in the USB board side module is completed, the transmission mode identification module in the host module completes the initialization work according to the seventh embodiment.
  • the USB device can complete the enumeration work through the function submodule.
  • Step 703 The transmission mode of the kernel submodule and the host module side in the USB board side module After the identification module is initialized, the two can establish communication and work.
  • FIG. 8 is a schematic flowchart of the configuration communication operation provided by the embodiment.
  • the host module and the USB board side module establish connection initialization and switch adaptation speed mode for the first time, and finally establish a certain speed transmission mode process.
  • the upper part of the first dotted line in FIG. 8 indicates the process of completing the installation of the target host installation software and the USB board side module, and the flow has been described in detail in FIG. 7.
  • the first dotted line and the second dotted line indicate the USB board side module,
  • the transmission mode identification module and the host system perform the speed mode adaptation process, and the area below the second dotted line indicates that a certain speed mode connection communication is established after the adaptation is completed.
  • Step 801 After the USB device is inserted into the target host, the USB device completes the initialization of the USB core sub-module according to the USB standard protocol.
  • Step 802 After the initialization of the kernel submodule in the USB board side module is completed, the USB device can complete the enumeration work through the function submodule in the USB board side module. At this time, the host module can be installed according to the mass storage device enumerated by the device. After the installation is completed, the transmission pattern recognition module is initialized, or the second method is used to download the transmission pattern recognition module separately through the official website to perform initialization work.
  • Step 803 After the initialization of the transmission mode identification module in the kernel submodule and the host module in the USB board side module, the two can establish communication and work through the USB standard request instruction.
  • Step 804 After the initialization of the kernel submodule in the USB board side module is completed, the information is reported to the operating system through the function submodule, and the operating system records the USB related information.
  • Step 805 The transmission mode identification module in the host module reads related data reported by the kernel submodule to the host system memory by calling a related function of the operating system.
  • Step 806 The transmission mode identification module in the host module acquires USB related information of the USB device, and compares the operating system to record the USB related information saved to the memory when the USB device is used for the first time, and cleans the last device recorded on the target host according to the comparison result. Plugged into the host USB related information, and the transmission mode information on the USB board side is reported to the host operating system.
  • the target host and the USB device can complete a certain speed mode establishment and perform communication work.
  • FIG. 9 is a schematic diagram of a workflow of a transmission mode configuration according to the embodiment. As shown in FIG. 9, the process mainly includes:
  • Step 901 The target host establishes a connection with the USB device, and performs data transmission according to the initial transmission mode.
  • the USB device is inserted into the target host, the target host is initialized in a short time, and the target host is connected to the initial transmission mode established by the USB device.
  • the target host and the USB device establish a communication connection and perform normal data interaction.
  • Step 902 The transmission mode identification module in the host module sends a transmission mode information acquisition instruction to the USB device.
  • the transmission mode information acquisition instruction may be a USB standard request instruction or a custom USB request instruction.
  • the transmission mode information acquisition instruction is mainly for acquiring information related to the USB transmission mode, and the USB device reports the relevant USB transmission mode information based on the transmission mode information acquisition instruction.
  • the transmission mode information acquisition instruction can be implemented in various manners.
  • only the USB standard request instruction or the custom USB request instruction is taken as an example for description.
  • Step 903 The USB device receives a transmission mode information acquisition instruction of the target host.
  • the USB device After receiving the transmission mode information acquisition instruction sent by the target host, the USB device parses the transmission mode information acquisition instruction, and the transmission mode identification module in the synchronization host module reads the USB transmission mode information in the host system, and the method is USB vendor identification, product representation, and disc serial number information traversal query to save the transmission mode parameter information of the USB device, this
  • the transmission mode parameter information of these USB devices mainly includes bcdUSB, bMaxPacketSize0, and device driving capability parameters.
  • Step 904 The transmission mode identification module in the host module performs the determination according to the related information acquired in step 903.
  • the transmission mode identification module determines whether the information reported by the USB device side and the information recorded by the host system are consistent. Go to step 905; if not, go to step 906.
  • the transmission mode identification module will obtain the USB transmission mode information of the device by calling the function of the host system, so as to compare whether the two are consistent. If not, the USB transmission mode identification module uses the function of the host system to clear the host system. The information is directly written to the information reported by the USB device, so that the correct reading and writing of the USB transmission mode can be realized.
  • the USB device completes the transmission mode configuration adapted to the target host, thereby establishing an Interfaces (Interrupt Bulk IN/OUT Pipe Connection) communication of the speed transmission mode, so that the USB device operates normally according to the speed transmission mode.
  • Interfaces Interrupt Bulk IN/OUT Pipe Connection
  • Step 905 The transmission mode identification module in the host module reports the related information to the host system without modifying any information, and the USB device can directly report the related information, and the process goes to step 908.
  • Step 906 The transmission mode identification module in the host module modifies the USB information saved by the host system according to the USB information of the current USB board side module.
  • Step 907 The USB device and the target host perform transmission mode configuration based on the USB transmission mode information.
  • the transmission mode identification module is preset in the target host, and is suitable for a scenario in which the transmission mode is fixed, for example, the transmission mode of USB3.0 and USB2.0 is automatically switched; for example, the mode of USB2.0 and USB1.0 Automatic switching, you can use this module to identify and judge.
  • the dynamic acquisition is performed according to actual conditions, and is applicable to more flexible occasions.
  • the rate parameter to the speed parameter of USB2.0 or USB3.0, and use the transmission mode identification module to obtain the USB board side information and change the system memory more accurately.
  • Retention information does not cause enumeration failure of USB device or The host no longer obtains some information about the USB device, causing the USB device to function abnormally.
  • USB3.0 USB 3.0
  • the last device can only report USB2.0, which causes USB3.0 to be invalid. Or the device is plugged into the USB2.0 host controller, and the USB2.0 information should be reported. However, because the device recorded by the host system is a USB3.0 device, the information transmission error occurs and a driving abnormality occurs.
  • the technical solution of the present invention can avoid the USB information being emptied when the device is enumerated, and the transmission mode recognition module can quickly read the USB information on the USB board side and write related information into the memory corresponding to the host system. This way the enumeration of the device will be faster without affecting the user's waiting time.
  • the technical solution of the present invention can also be quickly identified without causing abnormality of the device driver.
  • the embodiment of the invention further describes a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the transmission mode applied to the target host side according to the foregoing various embodiments.
  • Configuration method That is to say, after the computer executable instructions are executed by the processor, the transmission mode configuration method applied to the target host side provided by any one of the foregoing technical solutions can be implemented.
  • the computer storage medium may be various types of storage media, and may be preferably a non-transitory storage medium in this embodiment.
  • the embodiment of the invention further describes a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the transmission mode applied to the USB device side according to the foregoing various embodiments.
  • Configuration method That is, the computer After the executable instructions are executed by the processor, the transmission mode configuration method applied to the USB device side provided by any one of the foregoing technical solutions can be implemented.
  • the computer storage medium may be various types of storage media, and may be preferably a non-transitory storage medium in this embodiment.
  • the disclosed method and smart device may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner such as: multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored or not executed.
  • the coupling, or direct coupling, or communication connection of the components shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms. of.
  • the units described above as separate components may or may not be physically separated, and the components displayed as the unit may or may not be physical units, that is, may be located in one place or 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 second processing unit, or each unit may be separately used as one unit, 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 hardware plus software functional units.
  • the target host can automatically identify and adapt the USB transmission mode that is compatible with the USB device, thereby improving the compatibility and stability of the USB device, thereby solving the sleep awakening of the USB device or the target host.
  • the software that is connected to the network on the target host due to the mismatch between the transmission mode configured on the USB device side and the transmission mode configured on the target host side is prone to abnormality, abnormal function of the drive port, or confusion of USB transmission mode recognition. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

一种传输模式配置方法、装置及***、计算机存储介质,其中,所述方法包括:获取USB设备上报的USB传输模式信息(101);当所述USB传输模式信息与所述目标主机记录的USB传输模式信息不一致时,将所述目标主机记录的USB传输模式信息修改为USB设备侧上报的USB传输模式信息;基于修改后的USB传输模式信息进行传输模式配置(102)。

Description

一种传输模式配置方法、装置及***、计算机存储介质
相关申请的交叉引用
本申请基于申请号为201611087145.5、申请日为2016年12月01日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本发明涉及通用串行总线(USB,Universal Serial Bus)通信技术,尤其涉及一种传输模式配置方法、装置及***、计算机存储介质。
背景技术
目前,带有USB接口的电子产品上具有的USB主机控制器越来越多。比如,一些电脑具有USB3.0和USB2.0两种类型的主机控制器。从而也就存在用户在不同USB协议的主机控制器上使用USB产品的问题。在使用过程中,发明人发现,部分电子产品厂商的USB 3.0主机控制器驱动做的不够完善,目前USB 3.0主机控制器驱动形成一个标准是比较困难的,USB3.0设备要适配各个厂商的USB 3.0主机控制器驱动也就会存在一些问题,并且USB3.0设备的兼容性不好,如将其插到具有USB2.0主机控制器的电脑上,有时无法正常工作。
在使用过程中,发明人还发现,USB设备采用的是USB3.0数据线,***的也是具有USB 3.0主机控制器的电子产品,但是USB设备却上报的是USB2.0的传输模式,事实上应该上报为USB3.0的传输模式。当电子产品的主机既支持具有USB2.0功能的设备,又支持具有USB3.0功能的设备,USB设备从USB3.0主机控制器上拔出后,插到USB2.0主机控制器上,主机上的操作联网的会出现打开驱动端口失败或者串口驱动功能异常的问题。 反之,从USB2.0主机控制器上拔出后,插到USB3.0主机控制器上,USB设备会上报成USB2.0,也就是有可能上报的USB相关信息错误,导致设备设置的传输模式失效。
为了验证USB信息上报失败导致设备配置传输模式失效是否和操作***有一定的关系。发明人在对USB3.0设备的使用过程中,针对此情况,需要在windows操作***进行测试,测试过程中主要涉及到的操作***包括windows XP***、windows7***、windows 8***、windows 10***等,在这些操作***的32位和64位都进行了摸底,测试的结果表明若电脑具有支持USB3.0主机控制器,都会出现USB信息上报失败的现象。若USB信息上报失败的现象只在windows XP***上出现,也可以不做处理的。毕竟目前市场上主流操作***没有包含windows XP***,但是市场主流的windows操作***上均有此失败现象,意味着该现象需要给予重视。因此,在windows操作***进行了多方面的摸底测试,发现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传输模式信息指示的小型计算机***接口SCSI指令。
本发明实施例中,可选地,获取所述目标主机记录的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传输模式信息指示的SCSI指令。
本发明实施例中,可选地,所述识别单元,还配置为:
根据所述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传输模式识别错乱等问题。
附图说明
图1为本发明实施例的一种传输模式配置方法的流程示意图;
图2为本发明实施例的另一种传输模式配置方法的流程示意图;
图3为本发明实施例的一种传输模式配置装置的流程示意图;
图4为本发明实施例的另一种传输模式配置装置的流程示意图;
图5为本发明实施例提供的一种传输模式配置***的工作架构图;
图6为本发明实施例提供的一种主机模块预置到目标主机的流程示意图;
图7为本发明实施例提供的一种传输模式配置***中各模块的初始化流程示意图;
图8为本实施例提供的配置通信工作的流程示意图;
图9为本实施例提供的传输模式配置的工作流程示意图。
具体实施方式
为了能够更加详尽地了解本发明实施例的特点与技术内容,下面结合附图对本发明实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本发明实施例。
实施例一
图1本发明实施例的传输模式配置方法的流程示意图,应用于目标主机侧,如图1所示,所述传输模式配置方法包括以下步骤:
步骤101:获取USB设备上报的USB传输模式信息。
作为一种具体方式,所述获取USB设备上报的USB传输模式信息,包括:
获取USB设备基于传输模式信息获取指令上报的USB传输模式信息。
作为一种具体方式,所述获取USB设备基于传输模式信息获取指令上报的USB传输模式信息,包括:
所述传输模式信息获取指令为标准USB请求指令时,
接收所述USB设备基于所述标准USB请求指令返回的标准USB请求响应;
解析所述标准USB请求响应,获取所述USB传输模式信息。
作为一种具体方式,所述获取USB设备基于传输模式信息获取指令上报的USB传输模式信息,包括:
所述传输模式信息获取指令为自定义USB请求指令时,
接收所述USB设备基于所述自定义USB请求指令返回的自定义USB请求响应;
解析所述自定义USB请求响应,获取所述USB传输模式信息。
在一实施例中,在步骤101之前,所述方法还包括:
步骤100:检测到USB设备***目标主机时,若判断所述USB设备为 非首次***,向所述USB设备发送传输模式信息获取指令。
这里,所述USB设备是指能够与目标主机之间基于数据传输协议交换数据的设备,如U盘、移动硬盘等。
这里,所述目标主机是具有USB接口的电子产品,如台式电脑、笔记本电脑等。
在一可选实施方式中,所述传输模式信息获取指令,为:标准USB请求指令。
作为一种具体方式,所述标准USB请求指令,包括:USB设备描述符请求指令。
这里,所述USB设备描述符请求指令,用于获取USB设备的枚举信息,所述枚举信息包括需要上报给目标主机的USB传输模式信息。
在另一可选实施方式中,所述传输模式信息获取指令,为:自定义USB请求指令。
作为一种具体方式,所述自定义USB请求指令,包括:携带有获取USB传输模式信息指示的小型计算机***接口(SCSI,Small Computer System Interface)指令。
其中,表征所述获取USB传输模式信息指示的字节,由所述目标主机与所述USB设备侧协商完成。
示例性地,目标主机侧与USB设备侧协商哪个字节用于表示获取USB传输模式信息,以及用于表示USB3.0传输模式信息、USB2.0传输模式信息的字符等。
步骤102:当所述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设备建立初始传输模式连接,并记录与所述USB设备对应的初始传输模式。
作为一种具体实施方式,若判断所述USB设备为首次***,所述USB设备根据所述目标主机的主机控制器的类型进行适配;将适配成功的传输模式作为初始传输模式,并与所述目标主机建立初始传输模式连接。
示例性地,USB设备首次***到目标主机上采取的是初始传输模式,初始传输模式为:USB设备根据目标主机的主机控制器是USB2.0或USB3.0进行适配后,选择的一种主动上报的速度传输模式。
如此,为后续USB设备下一次***所述目标主机时,目标主机获取与所述USB设备相关的记录信息提供依据。
本发明实施例的技术方案中,检测到USB设备***目标主机时,若判断所述USB设备为非首次***,向所述USB设备发送传输模式信息获取指令;获取所述USB设备基于所述传输模式信息获取指令上报的USB传输模式信息;判断所述USB传输模式信息与所述目标主机记录的USB传输模式信息是否一致;若所述USB传输模式信息与所述目标主机记录的USB传输模式信息不一致,将所述目标主机记录的USB传输模式信息修改为USB设备侧上报的USB传输模式信息;基于修改后的USB传输模式信息进行传输模式配置。通过本发明实施例提出的技术方案,目标主机能够自动识别和适配与USB设备相适应的USB传输模式,提升了USB设备的兼容性和稳定性,从而解决在拔插USB设备或者目标主机睡眠唤醒的过程中,因USB设备侧所配置的传输模式与目标主机侧所配置的传输模式不匹配而导致的目标主机上的操作联网的软件容易出现异常、驱动端口功能异常或者USB传输模式识别错乱等问题。
实施例二
图2本发明实施例的传输模式配置方法的流程示意图,应用于USB设备侧,如图2所示,所述传输模式配置方法包括以下步骤:
步骤201:接收目标主机发送的传输模式信息获取指令。
这里,所述目标主机是具有USB接口的电子产品,如台式电脑、笔记本电脑等。
步骤202:基于所述传输模式信息获取指令向所述目标主机上报USB传输模式信息,以由所述目标主机判断所述USB传输模式信息与所述目标主机记录的USB传输模式信息是否一致,并根据判断结果进行传输模式的配置。
这里,所述USB设备是指能够与目标主机之间基于数据传输协议交换数据的设备,如U盘、移动硬盘等。
如此,USB设备及时向目标主机上报USB传输模式信息,便于目标主机能够自动识别和适配与USB设备相适应的USB传输模式,提升了USB设备的兼容性和稳定性,从而解决在拔插USB设备或者目标主机睡眠唤醒的过程中,因USB设备侧所配置的传输模式与目标主机侧所配置的传输模式不匹配而导致的目标主机上的操作联网的软件容易出现异常、驱动端口功能异常或者USB传输模式识别错乱等问题。
在一可选实施方式中,所述基于所述传输模式信息获取指令向所述目标主机上报USB传输模式信息之后,所述方法还包括:
根据所述目标主机所选择的传输模式在USB设备侧进行传输模式配置,使所述USB设备基于配置完成的传输模式与所述目标主机进行通信。
如此,能够保证所述USB设备与所述目标主机进行正常通信。
进一步地,所述方法还包括:
若USB设备是首次***所述目标主机;
根据所述目标主机的主机控制器的类型进行适配;
将适配成功的传输模式作为初始传输模式,并与所述目标主机建立初 始传输模式连接。
例如,主机控制器的类型包括:USB2.0主机控制器、USB 3.0主机控制器。
在一具体实施方式中,USB设备首次***到目标主机,目标主机在短时间内完成初始化,目标主机同USB设备建立的初始传输模式连接。目标主机和USB设备建立通信连接后进行正常的数据交互。
如此,可以为用户提供良好的新旧产品继承、兼容能力。
本发明实施例的技术方案中,USB设备接收目标主机发送的传输模式信息获取指令;基于所述传输模式信息获取指令向所述目标主机上报USB传输模式信息,以由所述目标主机判断所述USB传输模式信息与所述目标主机记录的USB传输模式信息是否一致,并根据判断结果进行传输模式的配置。如此,USB设备及时向目标主机上报USB传输模式信息,便于目标主机能够自动识别和适配与USB设备相适应的USB传输模式,提升了USB设备的兼容性和稳定性,从而解决在拔插USB设备或者目标主机睡眠唤醒的过程中,因USB设备侧所配置的传输模式与目标主机侧所配置的传输模式不匹配而导致的目标主机上的操作联网的软件容易出现异常、驱动端口功能异常或者USB传输模式识别错乱等问题。
实施例三
本实施例提供了一种传输模式配置装置,所述传输模式配置装置的组成结构示意图如图3所示,所述传输模式配置装置包括:
第一接收单元32,配置为获取USB设备上报的USB传输模式信息;
识别单元33,配置为判断所述USB传输模式信息与所述目标主机记录的USB传输模式信息是否一致;当判定所述USB传输模式信息与目标主机记录的USB传输模式信息不一致时,将所述目标主机记录的USB传输模式信息修改为USB设备侧上报的USB传输模式信息;
第一配置单元34,配置为基于修改后的USB传输模式信息进行传输模 式配置。
在一可选实施方式中,所述第一接收单元32,具体配置为获取USB设备基于传输模式信息获取指令上报的USB传输模式信息。
在一可选实施方式中,所述装置还包括:
第一发送单元31,配置为检测到USB设备***目标主机时,若判断所述USB设备为非首次***,向所述USB设备发送传输模式信息获取指令。
在一可选实施方式中,所述第一配置单元34,还配置为:
若所述识别单元33判定所述USB传输模式信息与所述目标主机记录的USB传输模式信息一致,基于所述目标主机记录的USB传输模式信息进行传输模式配置。
在一可选实施方式中,所述装置还包括:
第一通信单元35,配置为若判断所述USB设备为首次***,与所述USB设备建立初始传输模式连接。
可选地,所述传输模式信息获取指令,为:
标准USB请求指令;或
自定义USB请求指令。
示例性地,所述标准USB请求指令,包括:USB设备描述符请求指令;
所述自定义USB请求指令,包括:携带有获取USB传输模式信息指示的SCSI指令。
在一可选实施方式中,所述识别单元33,还配置为:
根据所述USB设备的标识信息查询所述目标主机记录的与所述USB设备对应的USB传输模式信息。
在一具体实施方式中,所述识别单元33,具体配置为:
根据USB设备的厂商标识和产品标识查询所述目标主机记录的与所述USB设备对应的USB传输模式信息。
本实施例所述传输模式配置装置,可设置于目标主机侧。
这里,所述目标主机是具有USB接口的电子产品,如台式电脑、笔记本电脑等。这里,所述USB设备是指能够与目标主机之间基于数据传输协议交换数据的设备,如U盘、移动硬盘等。
本领域技术人员应当理解,本发明实施例的传输模式配置装置中各处理单元的功能,可参照前述传输模式配置方法的相关描述而理解,本发明实施例的传输模式配置装置中各处理单元,可通过实现本发明实施例所述的功能的模拟电路而实现,也可以通过执行本发明实施例所述的功能的软件在智能终端上的运行而实现。
本实施例中,所述传输模式配置装置中的第一发送单元31、第一接收单元32、识别单元33、第一配置单元34、第一通信单元35,在实际应用中可由所述传输模式配置装置或所述传输模式配置装置所属终端中的中央处理器(CPU,Central Processing Unit)、数字信号处理器(DSP,Digital Signal Processor)或可编程门阵列(FPGA,Field-Programmable Gate Array)等实现。
本发明实施例的传输模式配置装置,能够自动识别和适配与USB设备相适应的USB传输模式,提升了USB设备的兼容性和稳定性,从而解决在拔插USB设备或者目标主机睡眠唤醒的过程中,因USB设备侧所配置的传输模式与目标主机侧所配置的传输模式不匹配而导致的目标主机上的操作联网的软件容易出现异常、驱动端口功能异常或者USB传输模式识别错乱等问题。
实施例四
本实施例提供了一种传输模式配置装置,所述传输模式配置装置的组成结构示意图如图4所示,所述传输模式配置装置包括:
第二接收单元41,配置为接收目标主机发送的传输模式信息获取指令;
第二发送单元42,配置为基于所述传输模式信息获取指令向所述目标主机上报USB传输模式信息。
可选地,所述装置还包括:
第二配置单元43,配置为根据所述目标主机所选择的传输模式在USB设备侧进行传输模式配置,使所述USB设备基于配置完成的传输模式与所述目标主机进行通信。
可选地,所述装置还包括:
第二通信单元44,配置为若USB设备是首次***所述目标主机;根据所述目标主机的主机控制器的类型进行适配;将适配成功的传输模式作为初始传输模式,并与所述目标主机建立初始传输模式连接。
本实施例所述传输模式配置装置,可设置于USB设备侧。
这里,所述USB设备是指能够与目标主机之间基于数据传输协议交换数据的设备,如U盘、移动硬盘等。这里,所述目标主机是具有USB接口的电子产品,如台式电脑、笔记本电脑等。
本领域技术人员应当理解,本发明实施例的传输模式配置装置中各处理单元的功能,可参照前述传输模式配置方法的相关描述而理解,本发明实施例的传输模式配置装置中各处理单元,可通过实现本发明实施例所述的功能的模拟电路而实现,也可以通过执行本发明实施例所述的功能的软件在智能终端上的运行而实现。
本实施例中,所述传输模式配置装置中的第二接收单元41、第二发送单元42、第二配置单元43、第二通信单元44,在实际应用中可由所述传输模式配置装置或所述传输模式配置装置所属终端中的CPU、DSP或FPGA等实现。
本发明实施例的传输模式配置装置,能够自动识别和适配与USB设备相适应的USB传输模式,提升了USB设备的兼容性和稳定性,从而解决在拔插USB设备或者目标主机睡眠唤醒的过程中,因USB设备侧所配置的传输模式与目标主机侧所配置的传输模式不匹配而导致的目标主机上的操作联网的软件容易出现异常、驱动端口功能异常或者USB传输模式识别错乱 等问题。
实施例五
本实施例提供了一种传输模式配置***,所述传输模式配置***,包括目标主机和USB设备;其中:
所述目标主机,配置为获取USB设备基于传输模式信息获取指令上报的USB传输模式信息;当所述USB传输模式信息与目标主机记录的USB传输模式信息不一致时,将所述目标主机记录的USB传输模式信息修改为USB设备侧上报的USB传输模式信息;基于修改后的USB传输模式信息进行传输模式配置;
所述USB设备,配置为接收目标主机发送的传输模式信息获取指令;基于所述传输模式信息获取指令向所述目标主机上报USB传输模式信息,根据所述目标主机所选择的传输模式在USB设备侧进行传输模式配置,使所述USB设备基于配置完成的传输模式与所述目标主机进行通信。
在一实施例中,所述目标主机,还配置为检测到USB设备***目标主机时,若判断所述USB设备为非首次***,向所述USB设备发送传输模式信息获取指令。
在一实施例中,所述目标主机,还配置为判断所述USB传输模式信息与目标主机记录的USB传输模式信息是否一致。
具体地,所述目标主机包括图3所示的传输模式配置装置,所述USB设备包括图4所示的传输模式配置装置,在此不再赘述。
下面结合具体实施场景对本发明实施例的传输模式配置方法做详细描述。
为方便描述,将上述图3中所示的应用目标主机侧的传输模式配置装置记为主机模块,其中,所述主机模块中包括传输模式识别模块以及用户界面控制模块。所述传输模式识别模块包括第一发送单元31、第一接收单元32、识别单元33、第一配置单元34、第一通信单元35。
为方便描述,将上述图4中所示的应用USB侧的传输模式配置装置记为USB板侧模块,其中,所述USB板侧模块包括内核子模块和功能子模块;所述内核子模块包括第二接收单元41、第二发送单元42、第二通信单元44,所述功能子模块包括第二配置单元43。
本发明实施例还记载了一种完整的传输模式配置装置,所述传输模式配置装置包括:主机模块和USB板侧模块。
其中,主机模块和USB板侧模块构成一个完整的USB传输模式配置装置。该装置通过在目标主机上安装主机模块,随着主机模块的安装完成,USB传输模式识别模块也就安装到主机***上,使用具备本实施例所述USB板侧模块的数据卡类终端设备,即可构成一个不受主机***影响,能够自动和识别目标主机所支持的USB传输模式,同时判断设备可以使用的传输模式类型的识别***。
其中,主机模块中的传输模式识别模块只需要在目标主机中安装一次,即可完成本实施例所述装置在目标主机中的安装过程。在装置后续的使用和运行中,全部主要工作只需要在装置的传输模式识别模块与USB板侧模块内部进行通信可以完成此配置的功能,传输模式识别模块通过发送一些标准的USB请求到USB板侧模块获取设备的传输模式信息,根据设备支持的传输模式进行判断并清理主机上记录上次设备***到主机上的信息,并根据设备的传输模式信息将USB板侧的信息填写主机操作***中,这样比较快速实现设备的传输模式写入到主机上和端口枚举。如果出现本发明背景技术中提到的问题,这样可以通过目标主机上的传输模式识别模块发送一些标准USB请求指令将传输模式信息和枚举信息更好地记录到主机上,以避免设备枚举信息和传输模式上报错误,导致用户无法继续使用上网或者速率不符合用户的要求。
为实现这一功能,主机模块包含传输模式识别模块。传输模式识别模块包含一些发送标准的USB请求指令等,本发明重点阐述此模块功能如何 实现。设备首次使用***到主机***上采取的是初始传输模式,初始传输模式为USB板侧模块根据主机的主机控制器是USB2.0或USB 3.0进行适配后,选择一种主动上报的速度传输模式。采用本方案后可以为用户提供良好的新旧产品继承、兼容能力。
本实施例所述装置主机模块的传输模式识别模块的主要作用是同本实施例所述装置中的USB板侧模块的内核层子模块进行通信、提供USB控制消息的发送,传输模式识别模块和USB板侧模块建立通信默认管道连接,管理速度传输模式识别的控制通路,完成主机模块和USB板侧模块的连接阶段。
本实施例提供的技术方案,实现了USB速度传输模式自动识别和适配,灵活、方便,更解决在传输模式识别错误的情况下需要重启设备或者插拔设备到正常的端口的问题。通过本发明实施例提供的技术方案,速度传输模式识别过程中,不会出现USB设备无法使用的情况,不需要USB设备反复插拔的工作,节省用户的时间;在目标主机上只需将主机安装一次,可以和USB设备交互进行适配数据卡产品的传输模式识别和配置;提升了USB设备的兼容性和稳定性。
实施例六
图5为本发明实施例提供的一种传输模式配置***的工作架构图,如图5所示,该工作流程主要包括:
步骤501:USB板侧模块与目标主机建立通信。
具体地,USB板侧模块通过USB板侧模块中的内核子模块实现与目标主机建立通信。
步骤502:USB板侧模块加载和启动完成后,主机模块中的传输模式识别模块发送传输模式信息获取指令,与USB板侧模块中的内核子模块进行速度传输模式的适配工作。
实施例七
图6为本发明实施例提供的一种主机模块预置到目标主机的流程示意图,如图6所示,该工作流程主要包括:
步骤601:包含传输模式识别模块的主机模块嵌套在USB设备的光盘中、或集成到主机功能驱动中或者通过推送的方式自动提示用户将该主机模块自动从推荐网站上下载更新。
步骤602:USB设备***到目标主机上,随着光盘的安装、主机功能驱动的安装以及下载完成后自动安装该主机模块,安装完成后自动调用传输模式识别模块的启动程序,完成该传输模式识别模块的初始化。
步骤603:该传输模式识别模块初始化完成后,向USB设备发送传输模式信息获取指令,来完成获取USB设备板侧的USB信息。
这里,所述传输模式信息获取指令可以是标准USB请求指令,如USB设备描述符请求指令。所述传输模式信息获取指令还可以是自定义USB请求指令,如携带有获取USB传输模式信息指示的SCSI指令。
具体地,该传输模式识别模块,还负责通过调用***函数的方式读取目标主机***记录的USB设备侧信息的注册表项等,以获取USB设备侧在目标主机***记录的USB传输模式信息。
实施例八
图7为本发明实施例提供的一种传输模式配置***中各模块的初始化流程示意图,如图7所示,该初始化流程主要包括:
步骤701:当USB设备***到目标主机后,USB板侧模块根据USB标准协议完成内核子模块的初始化工作。
步骤702:USB板侧模块中的内核子模块初始化完成后,主机模块中的传输模式识别模块按照实施例七完成初始化工作。
具体地,USB板侧模块中的内核子模块初始化完成后USB设备就可以通过功能子模块完成枚举工作。
步骤703:当USB板侧模块中的内核子模块和主机模块侧的传输模式 识别模块初始化完成后,这样两者可以建立通信和工作了。
实施例九
图8为本实施例提供的配置通信工作的流程示意图,如图8所示,主机模块和USB板侧模块首次建立连接的初始化以及切换适配速度模式,最终建立某个速度传输模式过程。图8中的第一个虚线上面部分表示目标主机安装软件和USB板侧模块安装初始化完成的过程,图7已经详细介绍这个流程,第一虚线和第二个虚线中间区域表示USB板侧模块、传输模式识别模块以及主机***进行速度模式适配的过程,第二个虚线下面的区域表示适配完成后建立某种速度模式连接通信。
步骤801:当USB设备***到目标主机后,USB设备根据USB标准协议完成USB内核子模块的初始化工作。
步骤802:USB板侧模块中的内核子模块初始化完成后,USB设备就可以通过USB板侧模块中的功能子模块完成枚举工作,这时可以根据设备枚举的大容量存储设备安装主机模块的内容,待安装完成后,传输模式识别模块就会初始化完成,或者采用第二种方法即通过官方网站的方式下载该传输模式识别模块单独安装来进行初始化工作。
步骤803:当USB板侧模块中的内核子模块和主机模块中的传输模式识别模块初始化完成后,两者可以通过USB标准请求指令建立通信和工作了。
步骤804:USB板侧模块中的内核子模块初始化完成后,会通过功能子模块向操作***上报信息,此操作***会记录USB相关信息。
步骤805:主机模块中的传输模式识别模块通过调用操作***的相关函数读取内核子模块上报给主机***内存中的相关数据。
步骤806:主机模块中的传输模式识别模块获取USB设备的USB相关信息,同步比较操作***记录该USB设备首次使用时保存到内存的USB相关信息,根据比较结果清理目标主机上记录的上次设备***到主机上的 USB相关信息,并将USB板侧的传输模式信息上报给主机操作***。
如此,比较快速地实现USB设备的传输模式写入到目标主机上和端口枚举。
这样,目标主机与USB设备就可以完成某一种速度模式建立,进行通信工作了。
实施例十
图9为本实施例提供的传输模式配置的工作流程示意图,如图9所示该流程主要包括:
步骤901、目标主机与USB设备建立连接,并按照初始传输模式进行数据传输。
在一具体实施方式中,待USB设备***到目标主机,目标主机在短时间内初始化完成,目标主机同USB设备建立的初始传输模式连接。目标主机和USB设备建立通信连接后进行正常的数据交互。
步骤902、主机模块中的传输模式识别模块向USB设备发送传输模式信息获取指令。
这里,所述传输模式信息获取指令可以是USB标准请求指令或者自定义USB请求指令。本实施例中,所述传输模式信息获取指令主要是获取USB传输模式相关信息的,USB设备基于所述传输模式信息获取指令上报相关USB传输模式信息。
当然,传输模式信息获取指令可通过多种方式实现,本实施例中仅以USB标准请求指令或者自定义USB请求指令为例进行说明。
步骤903、USB设备接收目标主机的传输模式信息获取指令。
USB设备收到目标主机发送的传输模式信息获取指令后,将对所述传输模式信息获取指令进行解析,同步主机模块中的传输模式识别模块读取主机***中USB传输模式信息,该方法是通过USB的厂商标识、产品表示以及光盘序列号等信息遍历查询保存该USB设备的传输模式参数信息,这 些USB设备的传输模式参数信息主要包含bcdUSB、bMaxPacketSize0、设备驱动能力参数。
步骤904、主机模块中的传输模式识别模块根据步骤903获取的相关信息,进行判断;该传输模式识别模块判断是USB设备侧上报的信息和主机***记录该设备的信息是否一致,如果一致,跳至步骤905;如不一致,跳至步骤906。
同步,传输模式识别模块会通过调用主机***的函数获取主机保存该设备的USB传输模式信息,这样进行对比两者是否一致,若不一致,USB传输模式识别模块会利用主机***的函数清除主机***的信息,直接写入USB设备上报来的信息,这样可以实现USB传输模式的正确读写。USB设备完成与目标主机适配的传输模式配置,进而建立该速度传输模式的Interfaces(Interrupt Bulk IN/OUT Pipe连接)通信,这样USB设备根据该速度传输模式正常工作。
步骤905、主机模块中的传输模式识别模块将相关信息报送给主机***不修改任何信息,USB设备可以直接上报相关信息,并跳至步骤908。
步骤906、主机模块中的传输模式识别模块根据当前USB板侧模块的USB信息修改主机***保存的USB信息。
步骤907、USB设备和目标主机基于USB传输模式信息进行传输模式配置。
本实施例中,将传输模式识别模块预设在目标主机中,适用于传输模式固定的场景中,比如USB3.0和USB2.0的传输模式自动切换;比如USB2.0和USB1.0的模式自动切换,均可以利用该模块来进行识别判断。
本实施例中,根据实际情况动态获取,适用于更灵活的场合。检测主机端口工作在USB3.0或者USB2.0时,将所述速率参数设置为USB2.0或者USB3.0的速率参数,使用传输模式识别模块可以更加准确地获取USB板侧信息和改变***内存的保留信息,不至于USB设备出现枚举失败或者 主机不再获取USB设备的一些信息导致USB设备功能异常。
使用本发明所述技术方案的优点主要体现如下几点:
1、可以避免USB传输模式识别出现错误,不至于USB板侧上报成USB3.0,由于主机***记录的该设备支持USB2.0,而最后设备只能上报USB2.0,导致USB3.0失效;或者设备插到USB2.0的主机控制器上,应该上报的USB2.0信息,但由于主机***记录的该设备是USB3.0的设备,导致信息传输错误,出现驱动异常。
2、采取本发明所述技术方案,可以避免设备枚举时将USB信息清空,同时传输模式识别模块可以快速读取USB板侧的USB信息,将相关信息写入到主机***对应的内存中,这样设备的枚举会变快,而不会影响用户的等待时间。
3、在USB2.0和USB3.0的相互切换过程,使用本发明所述技术方案也可以快速识别,不会引起设备驱动出现异常的。
本发明实施例还记载了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行前述各个实施例所述的应用于目标主机侧的传输模式配置方法。也就是说,所述计算机可执行指令被处理器执行之后,能够实现前述任意一个技术方案提供的应用于目标主机侧的传输模式配置方法。
所述计算机存储介质可为各种类型的存储介质,在本实施例中可优选为非瞬间存储介质。
本领域技术人员应当理解,本实施例的存储介质中各程序的功能,可参照实施例所述的应用于目标主机侧的传输模式配置方法的相关描述而理解。
本发明实施例还记载了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行前述各个实施例所述的应用于USB设备侧的传输模式配置方法。也就是说,所述计算机 可执行指令被处理器执行之后,能够实现前述任意一个技术方案提供的应用于USB设备侧的传输模式配置方法。
所述计算机存储介质可为各种类型的存储介质,在本实施例中可优选为非瞬间存储介质。
本领域技术人员应当理解,本实施例的存储介质中各程序的功能,可参照实施例所述的应用于USB设备侧的传输模式配置方法的相关描述而理解。
本发明实施例所记载的技术方案之间,在不冲突的情况下,可以任意组合。
在本发明所提供的几个实施例中,应该理解到,所揭露的方法和智能设备,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个***,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。
另外,在本发明各实施例中的各功能单元可以全部集成在一个第二处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可 轻易想到变化或替换,都应涵盖在本发明的保护范围之内。
工业实用性
本发明实施例的技术方案,目标主机能够自动识别和适配与USB设备相适应的USB传输模式,提升了USB设备的兼容性和稳定性,从而解决在拔插USB设备或者目标主机睡眠唤醒的过程中,因USB设备侧所配置的传输模式与目标主机侧所配置的传输模式不匹配而导致的目标主机上的操作联网的软件容易出现异常、驱动端口功能异常或者USB传输模式识别错乱等问题。

Claims (24)

  1. 一种传输模式配置方法,所述方法包括:
    获取USB设备上报的USB传输模式信息;
    当所述USB传输模式信息与目标主机记录的USB传输模式信息不一致时,将所述目标主机记录的USB传输模式信息修改为USB设备侧上报的USB传输模式信息;基于修改后的USB传输模式信息进行传输模式配置。
  2. 根据权利要求1所述的传输模式配置方法,其中,所述获取USB设备上报的USB传输模式信息,包括:
    获取USB设备基于传输模式信息获取指令上报的USB传输模式信息。
  3. 根据权利要求1所述的传输模式配置方法,其中,所述获取USB设备上报的USB传输模式信息之前,还包括:
    检测到USB设备***目标主机时,若判断所述USB设备为非首次***,向所述USB设备发送传输模式信息获取指令。
  4. 根据权利要求1所述的传输模式配置方法,其中,所述方法还包括:
    若所述USB传输模式信息与所述目标主机记录的USB传输模式信息一致,基于所述目标主机记录的USB传输模式信息进行传输模式配置。
  5. 根据权利要求1所述的传输模式配置方法,其中,所述方法还包括:
    若判断所述USB设备为首次***,与所述USB设备建立初始传输模式连接,并记录与所述USB设备对应的初始传输模式。
  6. 根据权利要求1所述的传输模式配置方法,其中,所述传输模式信息获取指令,为:
    标准USB请求指令;或
    自定义USB请求指令。
  7. 根据权利要求6所述的传输模式配置方法,其中,
    所述标准USB请求指令,包括:USB设备描述符请求指令;
    所述自定义USB请求指令,包括:携带有获取USB传输模式信息指示的小型计算机***接口SCSI指令。
  8. 根据权利要求1所述的传输模式配置方法,其中,获取所述目标主机记录的USB传输模式信息,包括:
    根据所述USB设备的标识信息查询所述目标主机记录的与所述USB设备对应的USB传输模式信息。
  9. 一种传输模式配置方法,所述方法包括:
    接收目标主机发送的传输模式信息获取指令;
    基于所述传输模式信息获取指令向所述目标主机上报USB传输模式信息,以由所述目标主机判断所述USB传输模式信息与所述目标主机记录的USB传输模式信息是否一致,并根据判断结果进行传输模式的配置。
  10. 根据权利要求9所述的传输模式配置方法,其中,所述基于所述传输模式信息获取指令向所述目标主机上报USB传输模式信息之后,所述方法还包括:
    根据所述目标主机所选择的传输模式在USB设备侧进行传输模式配置,使所述USB设备基于配置完成的传输模式与所述目标主机进行通信。
  11. 根据权利要求9所述的传输模式配置方法,其中,所述方法还包括:
    若USB设备是首次***所述目标主机;
    根据所述目标主机的主机控制器的类型进行适配;
    将适配成功的传输模式作为初始传输模式,并与所述目标主机建立初始传输模式连接。
  12. 一种传输模式配置装置,所述装置包括:
    第一接收单元,配置为获取USB设备基于传输模式信息获取指令上报的USB传输模式信息;
    识别单元,配置为当判定所述USB传输模式信息与目标主机记录的 USB传输模式信息不一致时,将所述目标主机记录的USB传输模式信息修改为USB设备侧上报的USB传输模式信息;
    第一配置单元,配置为基于修改后的USB传输模式信息进行传输模式配置。
  13. 根据权利要求12所述的传输模式配置装置,其中,所述第一接收单元,还配置为获取USB设备基于传输模式信息获取指令上报的USB传输模式信息。
  14. 根据权利要求12所述的传输模式配置装置,其中,所述装置还包括:
    第一发送单元,配置为检测到USB设备***目标主机时,若判断所述USB设备为非首次***,向所述USB设备发送传输模式信息获取指令。
  15. 根据权利要求12所述的传输模式配置装置,其中,所述第一配置单元,还配置为:
    若所述识别单元判定所述USB传输模式信息与所述目标主机记录的USB传输模式信息一致,基于所述目标主机记录的USB传输模式信息进行传输模式配置。
  16. 根据权利要求12所述的传输模式配置装置,其中,所述装置还包括:
    第一通信单元,配置为若判断所述USB设备为首次***,与所述USB设备建立初始传输模式连接。
  17. 根据权利要求12所述的传输模式配置装置,其中,所述识别单元,还配置为:
    根据所述USB设备的标识信息查询所述目标主机记录的与所述USB设备对应的USB传输模式信息。
  18. 一种传输模式配置装置,所述装置包括:
    第二接收单元,配置为接收目标主机发送的传输模式信息获取指令;
    第二发送单元,配置为基于所述传输模式信息获取指令向所述目标主机上报USB传输模式信息。
  19. 根据权利要求18所述的传输模式配置装置,其中,所述装置还包括:
    第二配置单元,配置为根据所述目标主机所选择的传输模式在USB设备侧进行传输模式配置,使所述USB设备基于配置完成的传输模式与所述目标主机进行通信。
  20. 根据权利要求18所述的传输模式配置装置,其中,所述装置还包括:
    第二通信单元,配置为若USB设备是首次***所述目标主机;根据所述目标主机的主机控制器的类型进行适配;将适配成功的传输模式作为初始传输模式,并与所述目标主机建立初始传输模式连接。
  21. 一种传输模式配置***,所述***包括:目标主机、USB设备;其中,
    所述目标主机,配置为获取USB设备基于传输模式信息获取指令上报的USB传输模式信息;当所述USB传输模式信息与所述目标主机记录的USB传输模式信息不一致时,将所述目标主机记录的USB传输模式信息修改为USB设备侧上报的USB传输模式信息;基于修改后的USB传输模式信息进行传输模式配置;
    所述USB设备,配置为接收目标主机发送的传输模式信息获取指令;基于所述传输模式信息获取指令向所述目标主机上报USB传输模式信息,根据所述目标主机所选择的传输模式在USB设备侧进行传输模式配置,使所述USB设备基于配置完成的传输模式与所述目标主机进行通信。
  22. 根据权利要求21所述的传输模式配置***,其中,所述目标主机包括权利要求12至17任一项所述的传输模式配置装置,所述USB设备包括权利要求18至20任一项所述的传输模式配置装置。
  23. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1至8任一项所述的传输模式配置方法。
  24. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求9至11任一项所述的传输模式配置方法。
PCT/CN2017/110283 2016-12-01 2017-11-09 一种传输模式配置方法、装置及***、计算机存储介质 WO2018099255A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611087145.5A CN108132899A (zh) 2016-12-01 2016-12-01 一种传输模式配置方法、装置及***
CN201611087145.5 2016-12-01

Publications (1)

Publication Number Publication Date
WO2018099255A1 true WO2018099255A1 (zh) 2018-06-07

Family

ID=62241192

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/110283 WO2018099255A1 (zh) 2016-12-01 2017-11-09 一种传输模式配置方法、装置及***、计算机存储介质

Country Status (2)

Country Link
CN (1) CN108132899A (zh)
WO (1) WO2018099255A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108881208A (zh) * 2018-06-11 2018-11-23 深圳市沃特沃德股份有限公司 基于车载***的usb协议切换方法及装置
CN109032831A (zh) * 2018-08-30 2018-12-18 中新工程技术研究院有限公司 一种usb设备识别错误自动校正的方案
CN110597570A (zh) * 2019-09-26 2019-12-20 深圳市元征科技股份有限公司 一种通信模式适配方法及相关装置
CN115017082A (zh) * 2022-08-08 2022-09-06 长沙朗源电子科技有限公司 应用于教育一体机的数据传输自适应方法、设备及***

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6813648B1 (en) * 2001-07-02 2004-11-02 Adaptec, Inc. Method and apparatus for post boot-up domain validation
CN1987843A (zh) * 2005-12-23 2007-06-27 深圳市朗科科技有限公司 Usb协议自适应方法
US20100185785A1 (en) * 2008-04-02 2010-07-22 June-On Co., Ltd. Automatic mapping and updating computer switching device
CN102981981A (zh) * 2012-11-20 2013-03-20 中兴通讯股份有限公司 Usb设备、通信***及其工作模式切换方法
CN105279110A (zh) * 2014-07-25 2016-01-27 中兴通讯股份有限公司 一种usb设备识别主机***的方法及usb设备

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050221894A1 (en) * 2004-03-31 2005-10-06 Microsoft Corporation Multi-system game controller that operates in multiple USB modes
CN101427228B (zh) * 2006-04-26 2012-02-15 诺基亚公司 Usb连接
CN101739364A (zh) * 2009-12-08 2010-06-16 中兴通讯股份有限公司 一种基于usb接口的通信设备及实现业务配置的方法
JP2012053792A (ja) * 2010-09-02 2012-03-15 Alpine Electronics Inc Usbアイソクロナス転送エラー低減システム
CN102063320B (zh) * 2011-01-06 2013-08-28 华为终端有限公司 工作模式切换方法、usb设备和主机设备
CN105426199B (zh) * 2014-09-05 2019-12-27 中兴通讯股份有限公司 自动适配多模式数据卡设备的方法、装置及***
CN105573939A (zh) * 2014-10-10 2016-05-11 深圳市中兴微电子技术有限公司 一种基于通用串行总线进行数据传输的方法及终端

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6813648B1 (en) * 2001-07-02 2004-11-02 Adaptec, Inc. Method and apparatus for post boot-up domain validation
CN1987843A (zh) * 2005-12-23 2007-06-27 深圳市朗科科技有限公司 Usb协议自适应方法
US20100185785A1 (en) * 2008-04-02 2010-07-22 June-On Co., Ltd. Automatic mapping and updating computer switching device
CN102981981A (zh) * 2012-11-20 2013-03-20 中兴通讯股份有限公司 Usb设备、通信***及其工作模式切换方法
CN105279110A (zh) * 2014-07-25 2016-01-27 中兴通讯股份有限公司 一种usb设备识别主机***的方法及usb设备

Also Published As

Publication number Publication date
CN108132899A (zh) 2018-06-08

Similar Documents

Publication Publication Date Title
JP5065297B2 (ja) Mmc/sdデバイスからホストデバイスをブートする方法,mmc/sdデバイスからブート可能なホストデバイス及びホストデバイスをブートできるmmc/sdデバイス
US8862790B2 (en) Method for identifying version type of windows operating system on a host by a USB device
WO2018099255A1 (zh) 一种传输模式配置方法、装置及***、计算机存储介质
TWI584196B (zh) 基本輸入輸出系統回復管理系統、電腦程式產品 以及基本輸入輸出系統回復方法
US9747237B2 (en) Methods and apparatus for reliable detection and enumeration of devices
WO2018076792A1 (zh) 一种arm设备中磁盘管理的方法、装置和arm设备
US7689751B2 (en) PCI-express system
US20100274986A1 (en) Control apparatus and control method therefor
CN103412769A (zh) 外接卡参数配置方法、设备以及***
CN114003538B (zh) 一种智能网卡的识别方法及智能网卡
WO2022134855A1 (zh) PCIe外插卡的带宽分配方法、装置、设备及存储介质
CN107239372B (zh) 电子装置及其检测方法
CN115658582A (zh) 一种pcie设备扫描方法及服务器
WO2015196479A1 (zh) 程序数据的更新方法及设备
CN107145198B (zh) 一种提升服务器对硬盘兼容能力的方法及其主板
US7613879B2 (en) Method, system and media for improved operation of a device in a foreign domain
CN116627472A (zh) 高速***组件设备的固件程序升级方法及服务器
US8738816B2 (en) Management of detected devices coupled to a host machine
US7424580B2 (en) Data transfer control device, electronic instrument, program and method of fabricating electronic instrument
CN115407941A (zh) 一种vmd功能启动方法及其相关组件
TWM598968U (zh) 頻外的外接控制設備與系統
CN113467842B (zh) 适用于工业级应用场景的嵌入式设备的启动方法、嵌入式设备和计算机可读存储介质
TWM440483U (en) System external BIOS booting, bridge device and integrated chipset
TW201303603A (zh) 通用串列匯流排控制裝置及其初始化方法
WO2018188404A1 (zh) 一种usb设备的配置方法及主机

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: 17875589

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: 17875589

Country of ref document: EP

Kind code of ref document: A1