WO2018040429A1 - Usb设备模拟装置及方法 - Google Patents

Usb设备模拟装置及方法 Download PDF

Info

Publication number
WO2018040429A1
WO2018040429A1 PCT/CN2016/113193 CN2016113193W WO2018040429A1 WO 2018040429 A1 WO2018040429 A1 WO 2018040429A1 CN 2016113193 W CN2016113193 W CN 2016113193W WO 2018040429 A1 WO2018040429 A1 WO 2018040429A1
Authority
WO
WIPO (PCT)
Prior art keywords
module
request instruction
descriptor
usb
device descriptor
Prior art date
Application number
PCT/CN2016/113193
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 WO2018040429A1 publication Critical patent/WO2018040429A1/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/10Program control for peripheral devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network

Definitions

  • the present invention relates to the field of hardware analog technologies, and in particular, to a USB device emulation device and method.
  • the traditional USB device emulation mode is generally implemented by pure software emulation, and the interface for connecting is set by driving.
  • the anti-virus software that comes with the computer may intercept the driver of the software simulation, resulting in unsuccessful simulation and low reliability.
  • a USB device simulation device includes a communication module, a storage module and a processing module, the communication module is connected to the storage module and the processing module, the storage module is connected to the processing module, and the communication module is further used for communication Connecting the control end, the processing module is further configured to connect the controlled end to the interface;
  • the communication module receives a device descriptor of the USB device to be simulated sent by the control terminal, and outputs the device descriptor to the storage module for pre-storage;
  • the USB device emulation device communicates with the control terminal through the communication module, receives the device descriptor sent by the control terminal, and sends the device descriptor to the storage module for storage, thereby simulating the USB device corresponding to the device descriptor; passing the processing module and the controlled end
  • the interface is connected, the device descriptor is sent to the controlled end to enable the controlled end to recognize, and the data request instruction of the controlled end is received, the data request instruction is forwarded to the control end by the communication module, and the response data returned by the control end is received and sent to the Controlled end.
  • a USB device simulation method includes the following steps:
  • the USB device emulation method is configured to receive a device descriptor request instruction sent by the controlled end, and send a pre-stored device descriptor of the USB device to be simulated to the controlled end in response to the device descriptor request instruction; and receive the controlled end according to the device.
  • the data request instruction sent by the descriptor forwards the data request instruction to the control end, and receives the response data returned by the control end and sends the response data to the controlled end.
  • FIG. 1 is a block diagram showing the structure of a USB device emulation device in an embodiment
  • FIG. 2 is a schematic diagram showing the operation of a USB device simulation device in an application example
  • FIG. 3 is a flow chart of a USB device emulation method in an embodiment
  • FIG. 4 is a flow chart of a USB device emulation method in another embodiment.
  • a USB device emulation device in an embodiment includes a communication module 110, a storage module 130, and a processing module 150.
  • the communication module 110 is connected to the storage module 130 and the processing module 150.
  • the storage module 130 is connected to the processing module 150.
  • the communication module 110 It is also used for the communication connection control end, and the processing module 150 is also used for the interface connection control end.
  • the communication module 110 receives the device descriptor of the USB device to be simulated sent by the control terminal and outputs it to the storage module 130 for pre-storage.
  • the processing module 150 receives the device descriptor request instruction sent by the controlled end; and sends the pre-stored device descriptor from the storage module 130 to the controlled end in response to the device descriptor request instruction; and receives the controlled end according to the device descriptor
  • the transmitted data request instruction forwards the data request instruction to the control terminal through the communication module 110, and receives the response data returned by the control terminal and sends the response data to the controlled terminal.
  • the device descriptor is used to indicate general information of the USB device to be simulated.
  • the device descriptor includes information that plays a full role on the USB device and all device configurations, and the USB device device descriptor is enumerated when the USB device is enumerated. Reports the characteristics (input or output) of each endpoint to the host, including the endpoint number, direction of communication, maximum packet length supported on endpoint 0 (also known as data payload), bandwidth requirements, and so on.
  • the control terminal instructs the USB device emulation device to simulate the device corresponding to the device descriptor by transmitting the device descriptor to the communication module 110. For example, if the USB device A is required, the control terminal describes the device of the USB device A through the communication module 110. The symbol is sent to the storage module 130 for storage, instructing the USB device emulation device to emulate as the USB device A.
  • the controlled terminal refers to a terminal that performs analog communication with the USB device emulation device after the USB device emulation device simulates the device corresponding to the device descriptor.
  • the control terminal and the controlled terminal may be terminal devices such as a computer, and the control terminal and the controlled terminal may be different terminals, or may be the same terminal.
  • the USB device emulation device communicates with the control terminal through the communication module 110, receives the device descriptor sent by the control terminal, and sends the device descriptor to the storage module 130 for storage, thereby simulating the USB device corresponding to the device descriptor;
  • the controlled end interface is connected, the device descriptor is sent to the controlled end to enable the controlled end to recognize, and the data request instruction sent by the controlled end is received, and the data request instruction is forwarded to the control end by the communication module 110, and the receiving control end returns The response data is sent to the controlled end.
  • USB device emulation device that constitutes a hardware structure, does not require software drivers, and has high reliability.
  • the device descriptor includes general information for a plurality of USB devices to be simulated.
  • the communication module 110 receives the device descriptor sent by the control terminal and outputs it to the storage module 130 for pre-storage, at this time, one device descriptor can correspond to multiple USB devices to be simulated, and the USB device simulation device simultaneously simulates multiple devices, Need to repeatedly receive storage device descriptors to improve simulation efficiency.
  • the communication module 110 is a WiFi module.
  • the WiFi module can realize wireless communication, which is convenient and quick. It can be understood that in other embodiments, the communication module 110 can also adopt other types, such as a Bluetooth module.
  • the storage module 130 is a buffer.
  • the communication module 110 outputs the received device descriptor to the buffer for pre-storage, and the processing module 150 receives the device descriptor request instruction of the controlled terminal and sends the device descriptor from the buffer to the controlled terminal.
  • the buffer exchange speed is fast, and the storage and extraction efficiency can be improved by using the buffer storage device descriptor.
  • the processing module 150 is provided with a USB interface, and the processing module 150 is connected to the controlled end through a USB interface. In this way, the processing module 150 is connected to the controlled end by way of a USB interface connection, and the plugging and unplugging is convenient.
  • the processing module 150 is an MCU (Micro Control Unit).
  • MCU Micro Control Unit
  • the MCU is powerful, and the MCU can be used as the processing module 150 to improve data processing efficiency.
  • the processing module 150 can receive the re-enumeration instruction sent by the control terminal through the communication module 110, and send the enumeration signal to the controlled end according to the re-enumeration instruction, so that the controlled end sends the device descriptor according to the enumeration signal.
  • the instruction is requested to the processing module 150.
  • the communication module 110 adopts a WiFi module
  • the storage module 130 adopts a buffer
  • the processing module 150 adopts an MCU.
  • the overall working process is:
  • the control terminal sends a re-enumeration instruction to the MCU through the WiFi module, and the MCU sends an enumeration signal to the controlled end.
  • the controlled terminal sends a device descriptor request command to the MCU.
  • the MCU takes out the device descriptor from the buffer and returns the device descriptor to the controlled end, thereby completing the device identification process.
  • the USB device emulation device simulates the device A at this time.
  • the controlled end issues a device A-specific data request instruction to the MCU.
  • the MCU sends the data request instruction to the control terminal through the WiFi module, and the control terminal returns corresponding response data according to different data request instructions.
  • the response data is returned to the controlled terminal through the MCU.
  • steps (5) through (7) are repeated to complete the complete simulation of device A.
  • a USB device emulation method in an embodiment may be applied to the above USB device emulation device, and the method includes the following steps.
  • the controlled terminal refers to a terminal that performs analog communication with the USB device emulation device after the USB device emulation device is simulated as a device corresponding to the device descriptor, and may be a terminal device such as a computer.
  • S130 Send a device descriptor of the pre-stored USB device to be simulated to the controlled terminal in response to the device descriptor request instruction.
  • the device descriptor is used to indicate general information of the USB device to be simulated.
  • the device descriptor includes information that plays a full role on the USB device and all device configurations, and the USB device device descriptor is enumerated when the USB device is enumerated. Reports the characteristics (input or output) of each endpoint to the host, including the endpoint number, direction of communication, maximum packet length supported on endpoint 0 (also known as data payload), bandwidth requirements, and so on.
  • the device descriptor may be stored in the storage module after the device descriptor sent by the communication receiving control terminal, or may be stored in the storage module after directly receiving the device descriptor input by the interface.
  • the device descriptor can include general information for a plurality of USB devices to be simulated. In this way, one device descriptor can correspond to multiple USB devices to be simulated, and the USB device analog device simultaneously simulates multiple devices, and does not need to repeatedly receive storage device descriptors, thereby improving simulation efficiency.
  • the controlled terminal After receiving the device descriptor, the controlled terminal identifies the device model corresponding to the device descriptor according to the device descriptor. The intended USB device. If the device descriptor corresponds to a USB device to be simulated, the data request instruction is a request instruction corresponding to the device descriptor; if the device descriptor corresponds to multiple USB devices to be simulated, the data request instruction is a plurality of identified by the controlled end The request instruction corresponding to the USB device to be simulated selected in the simulated USB device. For example, the device descriptor of the receiving end of the controlled end corresponds to the USB device A to be simulated and the USB device B to be simulated. At this time, the controlled terminal needs the data of the USB device A to be simulated, and then sends a data request instruction corresponding to the USB device A to be simulated. .
  • S170 Forward the data request instruction to the control end, and receive the response data returned by the control end and send the response data to the controlled end.
  • the control terminal By forwarding the data request instruction to the control terminal, the control terminal returns the corresponding response data according to different data request instructions, thereby reducing the burden on the device simulation device and completing the data communication corresponding to the data request instruction.
  • the USB device emulation method is configured to receive a device descriptor request instruction sent by the controlled end, and send a pre-stored device descriptor of the USB device to be simulated to the controlled end in response to the device descriptor request instruction; and receive the controlled end according to the device.
  • the data request instruction sent by the descriptor forwards the data request instruction to the control end, and receives the response data returned by the control end and sends the response data to the controlled end.
  • step S100 is further included.
  • S100 Establish a communication connection with the control end, receive the device descriptor sent by the control end, and store.
  • the device descriptor sent by the control terminal is received for storage.
  • the communication terminal is specifically connected through the communication module, and the communication module receives the device descriptor sent by the control terminal, and outputs the device descriptor to the storage module for storage. It can be understood that in other embodiments, pre-storage of device descriptors may also be accomplished in other manners.
  • Step S110 includes: receiving a re-enumeration instruction sent by the control end, sending an enumeration signal to the controlled end according to the re-enumeration instruction, and receiving the controlled end according to the enumeration signal.
  • Device Descriptor Request Instruction includes: receiving a re-enumeration instruction sent by the control end, sending an enumeration signal to the controlled end according to the re-enumeration instruction, and receiving the controlled end according to the enumeration signal.
  • the enumeration signal is sent to the controlled end by receiving the re-enumeration instruction of the control end and according to the re-enumeration instruction, so as to notify the controlled end that it can be re-enumerated.
  • the processing module is connected The re-enumeration instruction sent by the control terminal is sent, and the enumeration signal is sent to the controlled end according to the re-enumeration instruction.
  • the enumeration signal may be sent to the controlled end by other means, for example, when it is required to notify the controlled end that the enumeration can be re-enumerated, the interface between the processing module and the controlled end is performed.
  • the plugging and unplugging causes the processing module to be reconnected to the controlled end after the power is turned off, and the controlled end detecting and processing module is reconnected after being powered off, and the processing module is considered to send the enumerated signal.

Abstract

一种USB设备模拟装置及方法。该装置包括通信模块(110)、存储模块(130)和处理模块(150),通信模块(110)连接存储模块(130)和处理模块(150),存储模块(110)连接处理模块(150),通信模块(110)通信连接控制端,处理模块(150)接口连接受控端。通信模块(110)接收控制端发送的待模拟USB设备的设备描述符并输出至存储模块(130)进行预存储;处理模块(150)接收受控端发送的设备描述符请求指令;响应于设备描述符请求指令,从存储模块(130)取预存储的设备描述符发送至受控端;接收受控端根据设备描述符发送的数据请求指令,通过通信模块(110)将数据请求指令转发至控制端,接收控制端返回的应答数据并发送至受控端。如此,通过采用通信模块(110)、存储模块(130)和处理模块(150)组成硬件结构的设备模拟装置,不需要软件驱动,可靠性高。

Description

USB设备模拟装置及方法 技术领域
本发明涉及硬件模拟技术领域,特别是涉及一种USB设备模拟装置及方法。
背景技术
软件开发人员在开发一款与某种硬件设备进行通信的软件、或者需要对开发的软件进行测试的时候,需要用到硬件设备。当没有足够的硬件设备,或者硬件设备的价格非常昂贵时,可能无法满足每一个开发人员都有一台硬件设备,此时,通常是采用设备模拟的方式解决硬件设备供用不足的问题。
传统的USB设备模拟方式一般是采用纯软件模拟实现,通过驱动设置连接的接口。当采用这种方式连接计算机时,计算机自带的杀毒软件可能拦截软件模拟的驱动,导致模拟不成功,可靠性低。
发明内容
基于此,有必要针对上述问题,提供一种可靠性高的USB设备模拟装置及方法。
一种USB设备模拟装置,包括通信模块、存储模块和处理模块,所述通信模块连接所述存储模块和所述处理模块,所述存储模块连接所述处理模块,所述通信模块还用于通信连接控制端,所述处理模块还用于接口连接受控端;
所述通信模块接收所述控制端发送的待模拟USB设备的设备描述符并输出至所述存储模块进行预存储;
所述处理模块接收所述受控端发送的设备描述符请求指令;以及响应于所述设备描述符请求指令,从所述存储模块取预存储的设备描述符发送至所述受控端;以及接收所述受控端根据所述设备描述符发送的数据请求指令,通过所述通信模块将所述数据请求指令转发至控制端,接收所述控制端返回的应答数据并发送至所述受控端。
上述USB设备模拟装置,通过通信模块与控制端进行通信,接收控制端发送的设备描述符并发送至存储模块进行存储,从而模拟为与设备描述符对应的USB设备;通过处理模块与受控端接口连接,将设备描述符发送至受控端以使受控端识别,以及接收受控端的数据请求指令,通过通信模块将数据请求指令转发至控制端,接收控制端返回的应答数据并发送至受控端。如此,通过采用通信模块、存储模块和处理模块组成硬件结构的USB设备模拟装置,不需要软件驱动,可靠性高。
一种USB设备模拟方法,包括如下步骤:
接收受控端发送的设备描述符请求指令;
响应于所述设备描述符请求指令,取预存储的待模拟USB设备的设备描述符发送至所述受控端;
接收所述受控端根据所述设备描述符发送的数据请求指令;
将所述数据请求指令转发至控制端,接收所述控制端返回的应答数据并发送至所述受控端。
上述USB设备模拟方法,接收受控端发送的设备描述符请求指令,响应于设备描述符请求指令,取预存储的待模拟USB设备的设备描述符发送至受控端;接收受控端根据设备描述符发送的数据请求指令,将数据请求指令转发至控制端,接收控制端返回的应答数据并发送至受控端。如此,通过模拟为与设备描述符对应的USB设备,并实现与受控端和控制端的模拟通信,不需要软件驱动,可靠性高。
附图说明
图1为一实施例中USB设备模拟装置的结构框图;
图2为一应用例中USB设备模拟装置的工作示意图;
图3为一实施例中USB设备模拟方法的流程图;
图4为另一实施例中USB设备模拟方法的流程图。
具体实施方式
参考图1,一实施例中的USB设备模拟装置,包括通信模块110、存储模块130和处理模块150,通信模块110连接存储模块130和处理模块150,存储模块130连接处理模块150,通信模块110还用于通信连接控制端,处理模块150还用于接口连接受控端。
通信模块110接收控制端发送的待模拟USB设备的设备描述符并输出至存储模块130进行预存储。处理模块150接收受控端发送的设备描述符请求指令;以及响应于设备描述符请求指令,从存储模块130取预存储的设备描述符发送至受控端;以及接收受控端根据设备描述符发送的数据请求指令,通过通信模块110将数据请求指令转发至控制端,接收控制端返回的应答数据并发送至受控端。
设备描述符用于指示待模拟USB设备的通用信息,例如对于USB设备,设备描述符包括对USB设备及所有设备配置起全程作用的信息,USB设备的设备描述符在USB设备被枚举时,向主机报告各个端点的特性(输入还是输出),包括端点号、通信方向、端点0上支持的最大数据包长度(也称做数据有效负载),带宽要求等。
控制端通过发送设备描述符至通信模块110,指示USB设备模拟装置模拟为与设备描述符对应的设备,例如,需用到USB设备A,则控制端通过通信模块110将USB设备A的设备描述符发送至存储模块130进行存储,指示USB设备模拟装置模拟为USB设备A。受控端指在USB设备模拟装置模拟为设备描述符对应的设备后,与USB设备模拟装置进行模拟通信的终端。控制端和受控端可以是计算机等终端设备,且控制端和受控端可以是不同的终端,也可以是采用同一终端。
上述USB设备模拟装置,通过通信模块110与控制端进行通信,接收控制端发送的设备描述符并发送至存储模块130进行存储,从而模拟为与设备描述符对应的USB设备;通过处理模块150与受控端接口连接,将设备描述符发送至受控端以使受控端识别,以及接收受控端发送的数据请求指令,通过通信模块110将数据请求指令转发至控制端,接收控制端返回的应答数据并发送至受控端。如此,通过采用通信模块110、存储模块130和处理模块 150组成硬件结构的USB设备模拟装置,不需要软件驱动,可靠性高。
在一实施例中,设备描述符包括多个待模拟USB设备的通用信息。如此,当通信模块110接收控制端发送的设备描述符并输出至存储模块130进行预存储,此时一个设备描述符可以对应多个待模拟USB设备,USB设备模拟装置同时模拟多台设备,不需要重复接收存储设备描述符,提高模拟效率。
在一实施例中,通信模块110为WiFi模块。WiFi模块可以实现无线通信,方便快捷。可以理解,在其他实施例中,通信模块110还可以采用其他类型,例如蓝牙模块。
在一实施例中,存储模块130为缓存器。通信模块110将接收的设备描述符输出至缓存器进行预存储,处理模块150接收受控端的设备描述符请求指令后从缓存器取出设备描述符发送至受控端。缓存器交换速度快,通过采用缓存器存户设备描述符,可提高存储和提取的效率。
在一实施例中,处理模块150设有USB接口,处理模块150通过USB接口连接受控端。如此,处理模块150通过USB接口连接的方式与受控端连接,插拔方便。
在一实施例中,处理模块150为MCU(Micro Control Unit微控制单元)。MCU功能强大,通过采用MCU作为处理模块150,可提高数据处理效率。
一实施例中,处理模块150可以通过通信模块110接收控制端发送的重新枚举指令,根据重新枚举指令发送枚举信号至受控端,以使受控端根据枚举信号发送设备描述符请求指令至处理模块150。
参考图2,为一具体应用例的工作示意图,本应用例中通信模块110采用WiFi模块,存储模块130采用缓存器,处理模块150采用MCU,整体工作过程为:
(1)、在控制端上通过软件来和USB设备模拟装置进行通信,将待模拟USB设备的设备描述符等信息通过WiFi模块写入到缓存器中。
(2)、控制端通过WiFi模块向MCU发出重新枚举指令,MCU发送枚举信号至受控端。
(3)、受控端发送设备描述符请求指令至MCU。
(4)、MCU从缓存器中取出设备描述符,将设备描述符返回给受控端,从而完成设备识别过程,比如此时USB设备模拟装置模拟的为设备A。
(5)、受控端向MCU发出特定于设备A的数据请求指令。
(6)、MCU将数据请求指令通过WiFi模块发送给控制端,控制端根据不同的数据请求指令返回相应的应答数据。
(7)、应答数据通过MCU返回给受控端。
对于受控端发送有多种类型的数据请求指令时,重复步骤(5)到(7),从而完成对设备A的完整模拟。
参考图3,一实施例中的USB设备模拟方法,可以应用于上述USB设备模拟装置,该方法包括如下步骤。
S110:接收受控端发送的设备描述符请求指令。
受控端指在USB设备模拟装置模拟为设备描述符对应的设备后,与USB设备模拟装置进行模拟通信的终端,可以是计算机等终端设备。
S130:响应于设备描述符请求指令,取预存储的待模拟USB设备的设备描述符发送至受控端。
设备描述符用于指示待模拟USB设备的通用信息,例如对于USB设备,设备描述符包括对USB设备及所有设备配置起全程作用的信息,USB设备的设备描述符在USB设备被枚举时,向主机报告各个端点的特性(输入还是输出),包括端点号、通信方向、端点0上支持的最大数据包长度(也称做数据有效负载),带宽要求等。设备描述符可以是通信接收控制端发送的设备描述符后存储在存储模块,也可以是直接接收界面输入的设备描述符后存储在存储模块。
设备描述符可以包括多个待模拟USB设备的通用信息。如此,一个设备描述符可以对应多个待模拟USB设备,USB设备模拟装置同时模拟多台设备,不需要重复接收存储设备描述符,提高模拟效率。
S150:接收受控端根据设备描述符发送的数据请求指令。
受控端接收设备描述符后,根据设备描述符识别设备描述符对应的待模 拟USB设备。若设备描述符对应一个待模拟USB设备,则数据请求指令为对应该设备描述符的请求指令;若设备描述符对应多个待模拟USB设备,则数据请求指令为受控端从识别的多个待模拟USB设备中选取的待模拟USB设备对应的请求指令。例如,受控端接收端的设备描述符对应待模拟USB设备A和待模拟USB设备B,此时,受控端需要待模拟USB设备A的数据,则发送对应待模拟USB设备A的数据请求指令。
S170:将数据请求指令转发至控制端,接收控制端返回的应答数据并发送至受控端。
通过将数据请求指令转发至控制端,由控制端根据不同的数据请求指令返回相应的应答数据,减轻设备模拟装置的负担,完成数据请求指令对应的数据通信。
上述USB设备模拟方法,接收受控端发送的设备描述符请求指令,响应于设备描述符请求指令,取预存储的待模拟USB设备的设备描述符发送至受控端;接收受控端根据设备描述符发送的数据请求指令,将数据请求指令转发至控制端,接收控制端返回的应答数据并发送至受控端。如此,通过模拟为与设备描述符对应的USB设备,并实现与受控端和控制端的模拟通信,不需要软件驱动,可靠性高。
在一实施例中,请参阅图4,步骤S110之前,还包括步骤S100。
S100:建立与控制端的通信连接,接收控制端发送的设备描述符并存储。
通过与控制端通信,以便接收控制端发送的设备描述符进行存储。例如,一实施例中,具体通过通信模块通信连接控制端,通信模块接收控制端发送的设备描述符,并输出至存储模块进行存储。可以理解,在其他实施例中,也可以采用其他方式完成设备描述符的预存储。
在一实施例中,请继续参阅图4,步骤S110包括:接收控制端发送的重新枚举指令,根据重新枚举指令发送枚举信号至受控端,并接收受控端根据枚举信号发送的设备描述符请求指令。
通过接收控制端的重新枚举指令并根据重新枚举指令发送枚举信号至受控端,如此以便通知受控端可以重新枚举。例如,一实施例中,处理模块接 收控制端发送的重新枚举指令,并根据重新枚举指令发送枚举信号至受控端。可以理解,在其他实施例中,还可以是采用其他方式发送枚举信号至受控端,例如,当需要通知受控端可以重新枚举时,对处理模块与受控端之间的接口进行拔插,使处理模块断电后重新连接受控端,受控端检测处理模块断电后重新连接,则认为处理模块发送枚举信号。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。

Claims (10)

  1. 一种USB设备模拟装置,其特征在于,包括通信模块、存储模块和处理模块,所述通信模块连接所述存储模块和所述处理模块,所述存储模块连接所述处理模块,所述通信模块还用于通信连接控制端,所述处理模块还用于接口连接受控端;
    所述通信模块接收所述控制端发送的待模拟USB设备的设备描述符并输出至所述存储模块进行预存储;
    所述处理模块接收所述受控端发送的设备描述符请求指令;以及响应于所述设备描述符请求指令,从所述存储模块取预存储的设备描述符发送至所述受控端;以及接收所述受控端根据所述设备描述符发送的数据请求指令,通过所述通信模块将所述数据请求指令转发至控制端,接收所述控制端返回的应答数据并发送至所述受控端。
  2. 根据权利要求1所述的USB设备模拟装置,其特征在于,所述设备描述符包括多个待模拟USB设备的通用信息。
  3. 根据权利要求1所述的USB设备模拟装置,其特征在于,所述处理模块设有USB接口,所述处理模块通过所述USB接口连接所述受控端。
  4. 根据权利要求1所述的USB设备模拟装置,其特征在于,所述通信模块为WiFi模块。
  5. 根据权利要求1所述的USB设备模拟装置,其特征在于,所述存储模块为缓存器。
  6. 根据权利要求1所述的USB设备模拟装置,其特征在于,所述处理模块为MCU。
  7. 一种USB设备模拟方法,其特征在于,包括如下步骤:
    接收受控端发送的设备描述符请求指令;
    响应于所述设备描述符请求指令,取预存储的待模拟USB设备的设备描述符发送至所述受控端;
    接收所述受控端根据所述设备描述符发送的数据请求指令;
    将所述数据请求指令转发至控制端,接收所述控制端返回的应答数据并 发送至所述受控端。
  8. 根据权利要求7所述的USB设备模拟方法,其特征在于,所述设备描述符包括多个待模拟USB设备的通用信息。
  9. 根据权利要求7所述的USB设备模拟方法,其特征在于,所述接收受控端发送的设备描述符请求指令的步骤之前,还包括步骤:
    建立与控制端的通信连接,接收所述控制端发送的设备描述符并存储。
  10. 根据权利要求7所述的USB设备模拟方法,其特征在于,所述接收受控端发送的设备描述符请求指令的步骤,包括:
    接收控制端发送的重新枚举指令,根据所述重新枚举指令发送枚举信号至所述受控端,并接收所述受控端根据所述枚举信号发送的所述设备描述符请求指令。
PCT/CN2016/113193 2016-08-31 2016-12-29 Usb设备模拟装置及方法 WO2018040429A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610798196.2 2016-08-31
CN201610798196.2A CN106452838A (zh) 2016-08-31 2016-08-31 Usb设备模拟装置及方法

Publications (1)

Publication Number Publication Date
WO2018040429A1 true WO2018040429A1 (zh) 2018-03-08

Family

ID=58164528

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/113193 WO2018040429A1 (zh) 2016-08-31 2016-12-29 Usb设备模拟装置及方法

Country Status (2)

Country Link
CN (1) CN106452838A (zh)
WO (1) WO2018040429A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108388372B (zh) * 2018-02-24 2020-11-06 广州视源电子科技股份有限公司 一种自适应触摸数据的方法、装置、设备及存储介质
CN110069288B (zh) * 2019-03-13 2022-03-04 北京淳中科技股份有限公司 Usb设备共享方法、装置及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080021693A1 (en) * 2006-07-21 2008-01-24 Microsoft Corporation Storage Device Simulator
US20080249759A1 (en) * 2007-04-03 2008-10-09 Microsoft Corporation USB Device Simulator
CN102737003A (zh) * 2011-04-01 2012-10-17 中兴通讯股份有限公司 一种模拟usb设备的方法及装置
CN103617068A (zh) * 2013-11-18 2014-03-05 四川长虹电器股份有限公司 在Android模拟器中模拟操作USB设备的方法
CN105488000A (zh) * 2015-12-23 2016-04-13 广东数字证书认证中心有限公司 实现usb设备快速访问的方法和系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101266590B (zh) * 2008-04-22 2010-09-08 北京飞天诚信科技有限公司 动态切换设备配置的方法和系统
US8661164B2 (en) * 2010-08-24 2014-02-25 Mediatek Inc. Method of USB device enumeration including detecting the operating system type of the USB host

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080021693A1 (en) * 2006-07-21 2008-01-24 Microsoft Corporation Storage Device Simulator
US20080249759A1 (en) * 2007-04-03 2008-10-09 Microsoft Corporation USB Device Simulator
CN102737003A (zh) * 2011-04-01 2012-10-17 中兴通讯股份有限公司 一种模拟usb设备的方法及装置
CN103617068A (zh) * 2013-11-18 2014-03-05 四川长虹电器股份有限公司 在Android模拟器中模拟操作USB设备的方法
CN105488000A (zh) * 2015-12-23 2016-04-13 广东数字证书认证中心有限公司 实现usb设备快速访问的方法和系统

Also Published As

Publication number Publication date
CN106452838A (zh) 2017-02-22

Similar Documents

Publication Publication Date Title
US8832328B2 (en) Data redirection for universal serial bus devices
TWI436204B (zh) 測試系統及測試方法
WO2017084400A1 (zh) 一种NVMe网络化存储的实现方法、终端、服务器及系统
US20090210884A1 (en) Processing of data to determine compatability in an input/output processing system
US20120316859A1 (en) Embedded bus emulation
KR20130042370A (ko) Ufs 인터페이스의 테스트 방법 및 이의 테스트 방법으로 테스트를 수행하는 메모리 장치
WO2020057084A1 (zh) 显示模组测试平台
US9811480B2 (en) Universal serial bus emulation of peripheral devices
US9195394B2 (en) Transport mode data transfer between a channel subsystem and input/output devices
US8275925B2 (en) Methods and apparatus for improved serial advanced technology attachment performance
US9772956B2 (en) Universal serial bus emulation of a host connection
US10162778B2 (en) Universal serial bus emulation layer
CN104199569A (zh) 一种kvm设备中基于usb接口的键鼠切换使用方法
WO2018040429A1 (zh) Usb设备模拟装置及方法
CN103744478A (zh) 一种蓝牙无线显示器及其控制方法
EP3117327B1 (en) Universal serial bus emulation of peripheral devices
US20140281041A1 (en) Facilitating transport mode data transfer between a channel subsystem and input/output devices
US20160026602A1 (en) Method and System for Communication of Device Information
CN104253900B (zh) 智能手机及其数据传输方法及系统
CN109725621A (zh) 一种基于1553b总线和can总线的二级总线程序在线烧写方法
US20170185705A1 (en) Method and device for simulating disk drive
CN103973534A (zh) 一种模拟u盘共享方法以及设备
US20200065236A1 (en) Testing devices and methods for testing a device driver software
CN109800202B (zh) 一种基于pcie的数据传输系统、方法及装置
CN107066360B (zh) 一种信息传输方法及服务器

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 23.07.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 16914990

Country of ref document: EP

Kind code of ref document: A1