WO2012000417A1 - Usb设备识别主机操作系统的方法 - Google Patents

Usb设备识别主机操作系统的方法 Download PDF

Info

Publication number
WO2012000417A1
WO2012000417A1 PCT/CN2011/076444 CN2011076444W WO2012000417A1 WO 2012000417 A1 WO2012000417 A1 WO 2012000417A1 CN 2011076444 W CN2011076444 W CN 2011076444W WO 2012000417 A1 WO2012000417 A1 WO 2012000417A1
Authority
WO
WIPO (PCT)
Prior art keywords
usb device
operating system
preset
command
identifier
Prior art date
Application number
PCT/CN2011/076444
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 飞天诚信科技股份有限公司
Priority to US13/639,875 priority Critical patent/US8725909B2/en
Publication of WO2012000417A1 publication Critical patent/WO2012000417A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication

Definitions

  • the present invention relates to an information or signal at input /
  • the method of interconnecting or transmitting between an output device or a central processing unit belongs to the field of information security, and specifically relates to a method for a USB device to recognize a host operating system.
  • the USB protocol technology is a serial bus standard for connecting a host to an external device. It is widely used on hosts (such as personal computers, personal digital assistants, and mobile computers). It supports hot plug and plug and play, and supports bus power. Almost all peripheral devices such as mouse, keyboard, gamepad, scanner, digital camera, printer, hard disk, security device, optical drive and network card can be connected to the host through the USB interface and communicate.
  • the USB interface has become the most The default interface to which the host peripheral is connected to the computer.
  • Linux system provides support for the USB interface.
  • the computer is required to support the USB interface, and the USB device is also required to recognize the host operating system.
  • a method for a USB device to identify a host operating system comprising:
  • Step A The USB device is powered on and initialized.
  • Step B The USB device determines whether the received first setup packet is the first preset command. If the first preset command is the first preset command, step C is performed. If the first preset command is not the first preset command, the step is performed. D;
  • Step C The USB device determines whether the seventh byte in the first preset command is the second preset value. If yes, the operating system identifier is set as the first preset identifier, and step F is performed. Otherwise, perform step E;
  • Step D The USB device determines whether the first setup packet is a second preset command, and if the second preset command is, the operating system identifier is set to a second preset identifier, and step F is performed. Otherwise, perform step E;
  • Step E The USB device exchanges information with the host according to the default operating system identifier until the last setup packet is received, and determines whether the last setup packet is a third preset command, and if the third preset is If the command is not set, the operating system identifier is set to the third preset identifier, and if not the third preset command, the operating system identifier is set to the fourth preset identifier.
  • Step F The USB device performs information interaction with the host according to the current operating system identifier, and the USB device establishes communication with the host, and waits to receive an instruction issued by the host.
  • the initializing the USB device includes: initializing the power-on identifier to a first preset value, and initializing the operating system identifier to a default identifier.
  • the step F further includes: the USB device determining whether the current operating system identifier is the same as the default identifier, if the same, the USB device establishes communication with the host, and waits to receive an instruction issued by the host; Similarly, the USB device performs soft power-down processing, and sets the power-on identifier to a third preset value, and performs step A.
  • the method further includes: determining whether the USB device is powered on for the first time, and if it is powering on for the first time, performing step B; if not, the USB device performing step F.
  • Determining whether the USB device is powered on for the first time is specifically: determining whether the power-on identifier is the first preset value, and if yes, the USB device is powered on for the first time, and if not, the USB device is not powered on for the first time. ;
  • the first preset command is a device descriptor command.
  • the USB device determines whether the first setup packet is the first preset command is: the USB device determines whether the first setup packet starts with a hexadecimal number 80 06, If yes, the first setup packet is the first preset command, otherwise it is not the first preset command.
  • the second preset value is a hexadecimal number Ox08.
  • the second preset command is a set device address command.
  • Determining, by the USB device, whether the first setup packet is a second preset command is: the USB device determining whether the first setup packet is a hexadecimal number 00 Starting with 05, if yes, the first setup package is the second preset command, otherwise, it is not the second preset command.
  • the last setup packet refers to the first instruction received by the USB device after receiving the descriptor information
  • the fetch descriptor information includes a fetch device descriptor command, an fetch interface descriptor command, an fetch endpoint descriptor command, and a fetch configuration descriptor command.
  • the third preset command is a selection configuration command.
  • the determining, by the USB device, whether the last setup packet is a third preset command is: the USB device determining whether the last setup packet is a hexadecimal number 00 Starting at 09, if yes, the last setup package is the third preset command, otherwise, it is not the third preset command.
  • the USB device can determine the host operating system by analyzing the commands sent by the host, and after determining the host operating system, the corresponding data is returned to the host in a targeted manner, so that the host can accurately identify the USB device.
  • the method further includes: the first preset identifier corresponds to the first operating system, the second preset identifier corresponds to the second operating system, the third preset identifier corresponds to the third operating system, and the fourth preset identifier corresponds to the fourth operation system.
  • the first operating system is an Apple operating system
  • the second operating system is a Linux 2.4 kernel system or a kernel system before Linux 2.6.10 and Linux 2.6.10
  • the third operating system is a kernel system after Linux 2.6.10.
  • the fourth operating system is the Windows operating system.
  • the USB device can determine the host operating system by analyzing the instructions issued by the host, and after determining the host operating system, the corresponding data is returned to the host in a targeted manner, so that the host can accurately identify the USB device.
  • FIG. 1 is a flowchart of a method for a USB device to identify a host operating system according to an embodiment of the present invention.
  • the communication between the USB device and the host is: the host sends a command to the USB device, and the USB device responds to the received command.
  • the basic unit of communication between the USB device and the host is a "package", wherein the "package” is classified. There are mainly: token packets, data packets and handshake packets, and the specific type of the packet is determined by the PID.
  • the format of the token packet is SYNC+PID+ADDR+ENDP+CRC; the data packet is divided into DATA0 packet and DATA1 packet.
  • the data is sent in batches. In general, the DATA0 packet and the DATA1 packet are sent alternately; the format of the handshake packet is: SYNC+PID.
  • the USB device sends and receives data through the endpoint.
  • the above command indicates that the package is a SETUP package and the data content is 80 06 00 01 00 00 40 00, the handshake packet is ACK; wherein the SETUP packet is delivered by the host, and the USB device returns a response message to the host after receiving the SETUP packet, for example:
  • the response data returned by the USB device to the host is 12 01 10 01 00 00 00 08, It should be noted that after receiving the token packet of the IN or OUT sent by the host, the USB device returns the response data to the host;
  • the embodiment provides a method for the USB device to identify the host operating system. Specifically, the USB device determines the type of the host operating system by analyzing the received command, and then returns corresponding information to the host for different host operating systems. So that the host can better identify and operate the USB device.
  • the embodiment provides a method for a USB device to identify a host operating system, and the specific content is as follows:
  • the USB device is powered on and initialized.
  • the USB device specifically includes a security device (such as USB) Key), card reader, storage device (such as U disk) and computer peripherals such as keyboard and mouse;
  • a security device such as USB) Key
  • card reader such as card reader
  • storage device such as U disk
  • computer peripherals such as keyboard and mouse
  • the USB device is connected to the host through the USB bus, and obtains a working voltage from the host Vcc (supply voltage or operating voltage);
  • the initialization operation specifically includes: the USB device initializes the power-on identifier and the operating system identifier to a default identifier;
  • the power-on identifier is initialized to a first preset value
  • the operating system identifier is initialized to a default identifier.
  • the default identifier is a fourth preset identifier.
  • the first preset value and the fourth preset identifier are customized.
  • the first preset value is 0, and the fourth preset identifier is 4;
  • the host operating system monitors the plug-in status of the USB device at all times.
  • the USB device When the host operating system detects that a USB device is connected to the bus, the USB device is enumerated. During the enumeration process, the USB device receives the host.
  • a series of setup packages including "fetch device descriptors", “ Set device address, “get configuration descriptor”, “take endpoint descriptor”, “ Select configuration, etc., the USB device responds to it one by one.
  • the USB device returns the descriptor, endpoint, configuration, etc. to the host, the host and the USB device can communicate with the endpoint according to the agreed protocol, such as 102. To 117.
  • the USB device After receiving the bus reset command sent by the host, the USB device performs a bus reset.
  • USB device bus is reset, the default address 0 of the USB device is enabled, and then the command and data are transmitted between the USB device and the host through the address 0.
  • the USB device determines whether it is powered on for the first time, if not, executes 104, and if so, executes 105;
  • Determining whether the USB device is powered on for the first time is specifically: determining whether the power-on flag is the first preset value, and if so, the USB device is powered on for the first time; otherwise, it is not powered on for the first time;
  • the power-on identification bit is a hardware identifier bit in the USB device, and can perform value conversion according to the power-on condition;
  • the USB device completes the enumeration operation according to the currently set operating system identifier, and executes 117;
  • the USB device performs the enumeration operation according to the currently set operating system identifier according to the type of the USB device, and the enumeration operation is also different, for example, when the USB device itself is a CCID device, the USB device
  • the operations performed in the enumeration process include returning device descriptors, interface descriptors, endpoint descriptors, and the like to the host.
  • the USB device itself is an HID device
  • operations performed by the USB device during the enumeration include The host returns information such as device descriptors, descriptor sets, string descriptors, port descriptors, configuration descriptors, and so on.
  • the USB device receives the first setup packet sent by the host, determines whether the received setup packet is the first preset command, if yes, executes 106, if not, executes 109;
  • the first preset command is a device descriptor command
  • the first setup packet is a device descriptor command, specifically: determining whether the first setup packet is a hexadecimal number of 80. The command started at 06, if it is, the first setup package is the device descriptor command. Otherwise, it is not the device descriptor command.
  • the USB device determines whether the seventh byte data in the first preset command is a second preset value, if yes, executes 107, if not, executes 112;
  • the second preset value is a hexadecimal number Ox08;
  • the USB device determines that the host operating system is the first operating system, and sets the operating system identifier as the first preset identifier.
  • the first operating system is an Apple system Mac os, specifically including Mac os x;
  • the first setup package received by the USB device is:
  • data:80 06 00 01 00 00 08 00 is a hexadecimal number
  • Ox01 represents a device descriptor
  • the seventh byte Ox08 represents a device descriptor of 8 bytes
  • the first setup packet received by the USB device is 80 06 00 01 00 00 08 00, indicating that the host operating system is the first operating system
  • the first preset identifier is customized, and the first preset identifier is 1 in this embodiment;
  • the USB device returns a device descriptor to the host, declares itself to be a CCID device, and executes 117;
  • the device descriptor information returned by the USB device is: 09 04 00 00 02 01 00 00 00 , Wherein, the Ox01 identifies the device type as a CCID device;
  • USB device After the USB device returns the device descriptor to the host, the remaining enumeration operations are also completed, such as returning the interface descriptor, the endpoint descriptor, and the like to the host. After the enumeration operation is completed, the USB device executes 117;
  • the USB device determines whether the received first setup packet is a second preset command, if it is a second preset command, executes 110, if not, executes 112;
  • the second preset command is a set device address command
  • the specific command is: determine whether the data of the first setup packet is 00. 05 starts, if yes, the received setup package is the set device address command;
  • the USB device determines that the host operating system is the second operating system, and sets the operating system identifier as the second preset identifier.
  • the second operating system is a Linux 2.4 system or a Linux 2.6 early kernel system
  • the early kernel system of Linux2.6 includes: Linux2.6.11, Linux2.6.10 and Linux2.6 kernel system before Linux2.6.10;
  • the first setup package received by the USB device is:
  • the second preset identifier is customized, and the second preset identifier is 2 in this embodiment;
  • the USB device returns an interface descriptor to the host, the interface descriptor does not contain description information about the number of available endpoints, and executes 117;
  • the USB device determines that the host operating system is the second operating system, the USB device does not report an additional endpoint to the host in the interface descriptor returned by the host;
  • the command to obtain the interface descriptor received by the USB device is:
  • the interface descriptor returned by the USB device is:
  • the interface descriptor returned by the USB device is 09 04 00 00 00 03 00 00 00, wherein the fifth byte Ox00, informs the host that the USB device has no additional endpoints.
  • the default endpoint 0 is used between the USB device and the host for data communication;
  • USB device After the USB device returns the interface descriptor to the host, the remaining enumeration operations are also completed. After the enumeration operation is completed, the USB device executes 117.
  • the USB device completes the enumeration operation according to the current default operating system identifier, and caches the last setup package.
  • the last setup packet refers to the first instruction of the USB device after receiving the descriptor information sent by the host.
  • the descriptor information sent by the host includes: a device descriptor command, an interface descriptor command, an endpoint descriptor command, a configuration descriptor command, and the like.
  • the USB device declares itself to the HID device when completing the enumeration operation
  • the USB device declares itself as a custom USB device when completing the enumeration operation
  • the USB device declares itself to be a CCID device when completing the enumeration operation
  • USB CD USB CD
  • USB Mass storage etc.
  • the default operating system is the fourth operating system, so the USB device will return corresponding information to the fourth operating system in this step.
  • the USB device determines whether the last received setup packet is a third preset command, and if so, executes 114, otherwise, executes 116;
  • the third preset command is a selection configuration instruction.
  • Determining whether the last received setup packet is a selection configuration command is specifically: determining whether the instruction is 00 Starting at 09, if yes, the instruction is to select a configuration command;
  • the last setup package received by the USB device is:
  • the USB device determines that the host operating system is the third operating system, and sets the operating system identifier to a third preset identifier.
  • the third operating system is a Linux 2.6 late kernel system, including Linux 2.6.18, Linux. 2.6.28;
  • the third preset identifier is a custom value, and the third preset identifier is 3 in this embodiment;
  • the USB device performs soft power-down processing, and sets the power-on identification position to a third preset value, and returns to 102;
  • the USB device informs the host of the plug-in state by changing the pull-up resistor state of the host Vcc (power supply voltage or operating voltage), and the USB device is internally integrated with a pull-up resistor. By default, it is not connected to Vcc.
  • Vcc power supply voltage or operating voltage
  • the USB device establishes a connection with the host, the USB internal pull-up resistor is connected to Vcc, so that the host can determine whether there is a USB device by detecting the change of the pull-up resistor on Vcc. Connected
  • the soft power-down processing specifically refers to: the USB device receives the power delivered by the host.
  • the off command disconnects the internal pull-up resistor from Vcc.
  • the host operating system will monitor that the USB device is unplugged, but the USB device is connected to Vcc and can still obtain power from Vcc.
  • the USB device still remains. It is in the power-on state.
  • the USB device receives the power delivered by the host.
  • the pull-up resistor inside the USB device is connected to Vcc, the host operating system will monitor the insertion of the USB device again, and restart the enumeration operation, that is, the USB device returns to execution 102;
  • the third preset value is a custom value, and the third preset value is 3 in this embodiment;
  • the USB device determines that the host operating system is the third operating system, it needs to perform soft power-down processing and re-enumerate the operation, because the USB device determines that the host operating system is the first
  • the three operating systems have completed the enumeration before, and are the descriptor information returned by the default operating system, that is, the fourth operating system, and the descriptor information that has been returned before when the host operating system is determined to be the third operating system. If it is wrong, it needs to be softly powered down, and the descriptor information is returned according to the third operating system of the host operating system.
  • the USB device determines that the host operating system is the fourth operating system, and sets the value of the operating system identifier to a fourth preset identifier.
  • the fourth operating system is a Windows operating system, including Windows 98, Windows. 2000, Windows XP, Windows Vista or Windows 7;
  • the last setup packet received by the USB device is a configuration command, for example: 80. 06 02 03 09 04 ff 00, the command refers to obtaining an index of 2 string descriptors;
  • the fourth preset identifier is a custom value, and the fourth preset identifier is 4 in this embodiment;
  • USB device determines that the host operating system is the fourth operating system, it does not perform soft power-down processing, but completes the enumeration operation, waiting for receiving an APDU command from the host, because USB The device uses the fourth operating system as the default operating system.
  • the USB device In the enumeration process, the USB device itself performs enumeration operations according to the fourth operating system, and the descriptor information returned to the host is correct, so there is no need to Perform an enumeration operation;
  • the USB device establishes data communication with the host, and waits for receiving an APDU command sent by the host;
  • step 101 if the USB device initializes the operating system identifier to the third preset identifier, the USB device performs soft power-down processing at 116 and sets the power-on identifier to a third preset value. , return 102; then no soft power-down processing is required in 115; that is, the USB device also makes a judgment before executing 117, that is, whether the current operating system identifier is the same as the default identifier, and if the same, according to the current The operating system identifier returns a response message to the host, and executes 117. If not, the USB device performs a soft power-down process, and sets the power-on flag to a third preset value, and executes 102.
  • the USB device determines that the host operating system is the first operating system, after receiving the interface descriptor sent by the host, the host device returns the number of the actual available endpoints to the host according to the setting of the host;
  • USB device For example, if the USB device itself has two available endpoints, it returns the interface descriptor 09 04 00 00 02 03 00 to the host. 00 00, the fifth byte Ox02, tells the host that it has two available endpoints;
  • the interface descriptor 09 04 00 00 00 03 is returned to the host.
  • 00 00 00, the fifth byte Ox00 tells the host that there is no additional available endpoint.
  • the USB device and the host communicate with each other through the default endpoint 0;
  • the interface descriptor returned to the host does not contain the endpoint information, for example, the returned interface descriptor is: 09 04 00 00 00 03 00 00 00;
  • USB device itself is an optical disc device
  • the USB device is in the process of communication between the host, and if the USB device receives an instruction from the host to download the content of the optical disc, the USB device will operate according to the determined operation. System type, returning different data to the host;
  • the instruction received by the USB device for reading the content of the optical disc is a standard SISC command, specifically: 55 53 42 43 b0 94 f0 85 00 08 00 00 080 00 0a 28 00 00 00 00 11 00 00 01 00 00 00 00 00 00 00 00 00;
  • the USB device If it is determined that the host operating system is the first operating system, the USB device returns data to the host after receiving the above instruction 02 43 44 30 30 31 01 00 00 57 00 69 00 6e 00 33 00 32 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 ;
  • the USB device returns to the host after receiving the above instruction.
  • 03 43 44 30 30 31 01 00 00 57 00 69 00 6e 00 33 00 32 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 ;
  • the USB device returns 01 43 44 30 30 to the host after receiving the above instruction.
  • the USB device can determine the host operating system by analyzing the commands sent by the host, and after determining the host operating system, the corresponding data is returned to the host in a targeted manner, so that the host can accurately identify the USB device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)

Abstract

本发明公开了一种USB设备识别主机操作系统的方法,属于信息安全领域。方法包括:A、USB设备上电并初始化;B、判断第一个setup包是否是第一预设命令,是,执行C,不是,执行D;C、判断第一预设命令中的第七个字节是否是第二预设值,是,将操作系统标识置为第一预设标识,执行F,否则,执行E;D、判断第一个setup包是否是第二预设命令,是,将操作系统标识置为第二预设标识,执行F,否则,执行E;E、按照默认操作系统标识与主机进行信息交互,直到接收到最后一个setup包,并判断最后一个setup包是否是第三预设命令,是,则将操作系统标识置为第三预设标识,不是,则将操作系统标识置为第四预设标识;F、根据当前操作系统标识与主机进行信息交互,之后,并等待接收主机下发的指令。

Description

USB设备识别主机操作系统的方法 技术领域
本发明涉及一种信息或信号在输入 / 输出设备或中央处理机之间互联或传送的方法,属于信息安全领域,具体涉及一种 USB 设备识别主机操作系统的方法。
背景技术
USB协议技术是主机与外部设备连接的串行总线标准,在主机(例如,个人计算机、个人数字助理以及移动电脑等)上使用十分广泛,支持热插拔和即插即用,并支持总线供电,鼠标、键盘、游戏手柄、扫描仪、数码相机、打印机、硬盘、安全设备、光驱和网卡等几乎所有的外围设备都可以通过运行USB接口与主机相连并进行通信,USB接口已经成为目前大多数主机外设与计算机相连的缺省接口。
在操作系统平台支持方面,Windows系统平台中Windows 98、Windows 2000、Windows XP及Windows Vista、Windows 7等,苹果操作系统,Linux系统都提供了对USB接口的支持。而随着USB接口计算机外围设备的增多,要求计算机对USB接口的支持能力也越高,同时也要求USB设备能够很好的识别主机操作系统。
发明内容
针对上述问题,现提出一种USB设备识别主机操作系统的方法,具体技术方案如下:
一种USB设备识别主机操作系统的方法,所述方法包括:
步骤A、USB设备上电,并进行初始化;
步骤B、所述USB设备判断接收到的第一个setup包是否是第一预设命令,如果是所述第一预设命令,执行步骤C,如果不是所述第一预设命令,执行步骤D;
步骤C、所述USB设备判断所述第一预设命令中的第七个字节是否是第二预设值,如果是,则将操作系统标识置为第一预设标识,执行步骤F,否则,执行步骤E;
步骤D、所述USB设备判断所述第一个setup包是否是第二预设命令,如果是所述第二预设命令,则将操作系统标识置为第二预设标识,执行步骤F,否则,执行步骤E;
步骤E、所述USB设备按照默认操作系统标识与主机进行信息交互,直到接收到最后一个setup包,并判断所述最后一个setup包是否是第三预设命令,如果是所述第三预设命令,则将操作系统标识置为第三预设标识,如果不是所述第三预设命令,则将操作系统标识置为第四预设标识;
步骤F、所述USB设备根据当前操作系统标识与所述主机进行信息交互,所述USB设备与所述主机建立通信,并等待接收所述主机下发的指令。
所述USB设备进行初始化包括:将上电标识初始化为第一预设值,将操作系统标识初始化为默认标识。
所述步骤F还包括,所述USB设备判断当前操作系统标识是否与所述默认标识相同,如果相同,则所述USB设备与主机建立通信,并等待接收所述主机下发的指令;如果不相同,所述USB设备进行软掉电处理,并将所述上电标识置为第三预设值,执行步骤A。
在所述步骤A之后,所述方法还包括:判断所述USB设备是否是首次上电,如果是首次上电,则执行步骤B;如果不是,所述USB设备执行步骤F。
判断所述USB设备是否是首次上电具体为:判断上电标识是否是第一预设值,如果是,则所述USB设备是首次上电,如果不是,则所述USB设备不是首次上电;
所述第一预设命令为取设备描述符命令。
所述USB设备判断第一个setup包是否是第一预设命令具体为:所述USB设备判断所述第一个setup包是否是以十六进制数80 06 开始的, 如果是, 则所述第一个 setup 包是 所述第一预设命令,否则,不是所述第一预设命令。
所述第二预设值为十六进制数Ox08。
所述第二预设命令为设置设备地址命令。
所述USB设备判断所述第一个setup数据包是否是第二预设命令具体为:所述USB设备判断所述第一个setup包是否是以十六进制数00 05开始的,如果是,则所述第一个setup包为所述第二预设命令,否则,不是所述第二预设命令。
所述最后一个setup包是指所述USB设备在接收完取描述符信息之后接收到的第一条指令;
所述取描述符信息包括取设备描述符命令、取接口描述符命令、取端点描述符命令、取配置描述符命令。
所述第三预设命令为选择配置指令。
所述USB设备判断最后一个setup包是否是第三预设命令具体为:所述USB设备判断所述最后一个setup包是否是以十六进制数00 09开始的,如果是,则所述最后一个setup包是所述第三预设命令,否则,不是所述第三预设命令。
USB设备通过对主机下发的指令进行分析,可以确定主机操作系统,并在确定主机操作系统后,有针对性的向主机返回相应的数据,使得主机能够准确的识别USB设备。
所述方法还包括:所述第一预设标识对应第一操作系统,第二预设标识对应第二操作系统,第三预设标识对应第三操作系统,第四预设标识对应第四操作系统。
所述第一操作系统为苹果操作系统,所述第二操作系统为Linux2.4内核系统或Linux2.6.10及Linux2.6.10之前的内核系统,所述第三操作系统为Linux2.6.10之后的内核系统,第四操作系统为Windows操作系统。
有益效果:USB设备通过对主机下发的指令进行分析,可以确定主机操作系统,并在确定主机操作系统后,有针对性的向主机返回相应的数据,使得主机能够准确的识别USB设备。
附图说明
图 1 为本发明实施例提供的一种 USB 设备识别主机操作系统的方法流程图。
具体实施方式
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。
在进行具体说明之前,对USB设备与主机之间的通信原理进行简单的说明,如下:
USB设备与主机之间的通信是:由主机发送命令给USB设备,USB设备对接收到的命令进行响应,USB设备与主机之间通信的基本单位是“包”,其中,“包”的分类主要有:令牌包、数据包和握手包,由PID来决定包的具体类型。
其中,令牌包的格式为SYNC+PID+ADDR+ENDP+CRC;数据包分为DATA0包和DATA1包,在USB设备返回的数据长度超过相应端点的最大输出数据包长度时,需要将返回的数据分批发送,一般情况下,DATA0包和DATA1包交替发送;握手包的格式为:SYNC+PID。
其中,USB设备通过端点来收发数据。
例如:
PID:SETUP ADDR:00 ENDP:00 CRC5:02 idle:3
PID:DATA0 data:80 06 00 01 00 00 40 00 CRC16:94dd idle:7
PID:ACK idle:2ela
上述命令说明,该包为SETUP包,数据内容是80 06 00 01 00 00 40 00,握手包为ACK;其中,SETUP包由主机下发,USB设备接收到该SETUP包后向主机返回应答信息,例如:
PID:IN ADDR:00 ENDP:00 CRC5:02 idle:7
PID:DATA1 data:12 01 10 01 00 00 00 08 CRC16:7711 idle:7
PID:ACK idle:2e16
PID:OUT ADDR:00 ENDP:00 CRC5:02 idle:3
PID:DATA1 data: CRC16:0000 idle:7
PID:ACK idle:2e5a
USB设备向主机返回的应答数据是12 01 10 01 00 00 00 08, 需要说明的是,USB设备在接收到主机下发的IN或OUT的令牌包后,向主机返回应答数据;
这样,USB设备与主机之间便完成了一次信息交互,而每一次的信息交互,都是由接收到主机下发的SETUP包开始的。
实施例1
本实施例提供了一种USB设备识别主机操作系统的方法,具体地,USB设备通过分析所接收到的命令来判断主机操作系统的类型,然后,针对不同的主机操作系统向主机返回相应的信息,以便主机能够更好的识别和操作USB设备。
参见图1,本实施例提供了一种USB设备识别主机操作系统的方法,具体内容如下:
101、USB设备上电,并进行初始化;
其中,USB设备具体包括安全设备(如USB Key)、读卡器、存储设备(如U盘)及键盘、鼠标等计算机外围设备;
具体地,USB设备通过USB总线连接到主机,并从主机Vcc(电源电压或工作电压)处获取工作电压;
初始化操作具体包括:USB设备将上电标识、操作系统标识初始化为默认标识;
具体地,将上电标识初始化为第一预设值,将操作系统标识初始化为默认标识,本实施例中该默认标识为第四预设标识;
其中,第一预设值及第四预设标识为自定义的,本实施例中第一预设值为0,第四预设标识为4;
需要说明的是,主机操作系统时刻在监控USB设备的插拔状态,当主机操作系统检测到有USB设备连接到总线时,对USB设备进行枚举,在枚举过程中,USB设备接收主机下发的一系列setup包,具体包括“取设备描述符”、“ 设置设备地址”、“ 取配置描述符”、“ 取端点描述符”、“ 选择配置”等,USB设备逐一对其做出响应,当USB设备将描述符、端点、配置等返回给主机后,主机和USB设备就可按照商定的协议和端点进行通信了,具体的如102至117所述。
102、USB设备总线复位;
具体地,USB设备接收到主机下发的总线复位命令后,进行总线复位;
需要说明的是,USB设备总线复位后,该USB设备的默认地址0被使能,则接下来USB设备与主机之间便通过地址0来传输命令及数据。
103、USB设备判断自身是否是首次上电,如果不是,执行104,如果是,执行105;
判断USB设备是否是首次上电具体为:判断上电标识位是否为第一预设值,如果是,则USB设备为首次上电,否则,不是首次上电;
其中,上电标识位是USB设备中的一个硬件标识位,能够根据上电情况进行数值转换;
104、USB设备按照当前设置的操作系统标识完成枚举操作,执行117;
需要说明的是,USB设备在按照当前设置的操作系统标识完成枚举操作的过程根据USB设备类型的不同,进行的枚举操作也不尽相同,如当USB设备自身是CCID设备时,USB设备在枚举的过程中进行的操作包括向主机返回设备描述符、接口描述符、端点描述符等信息,如当USB设备自身是HID设备时,USB设备在枚举的过程中进行的操作包括像主机返回设备描述符、描述符集合、字符串描述符、端口描述符、配置描述符等信息。
105、USB设备接收到主机下发的第一个setup包时,判断接收到的setup包是否是第一预设命令,如果是,执行106,如果不是,执行109;
具体地,第一预设命令为取设备描述符命令;
则判断第一个setup包是否是取设备描述符命令具体为:判断第一个setup包是否是以十六进制数80 06开始的命令,如果是,则第一个setup包是取设备描述符命令,否则,不是取设备描述符命令。
106、USB设备判断该第一预设命令中的第七个字节数据是否为第二预设值,如果是,执行107,如果不是,执行112;
本实施例中,第二预设值为十六进制数Ox08;
107、USB设备认定主机操作系统为第一操作系统,并将操作系统标识置为第一预设标识;
具体地,第一操作系统为苹果系统Mac os,具体包括Mac os x;
例如,主机操作系统为Mac os x时,USB设备接收到的第一个setup包为:
PID:SETUP ADDR:00 ENDP:00 CRC5:02 idle:3
PID:DATA0 data:80 06 00 01 00 00 08 00 CRC16:94eb idle:7
PID:ACK idle:3a
其中,data:80 06 00 01 00 00 08 00为十六进制数,Ox01表示设备描述符,第七个字节Ox08表示取8个字节的设备描述符,USB设备接收到的第一个setup包是80 06 00 01 00 00 08 00,则说明主机操作系统是第一操作系统;
具体地,第一预设标识是自定义的,本实施例中第一预设标识为1;
108、USB设备向主机返回设备描述符,声明自身是CCID设备,执行117;
例如,USB设备返回的设备描述符信息为:09 04 00 00 02 01 00 00 00 , 其中, Ox01 标识设备类型为CCID设备;
需要说明的是,USB设备向主机返回设备描述符后,还将完成剩余的枚举操作,如向主机返回接口描述符、端点描述符等信息,当枚举操作完成后,USB设备执行117;
还需要说明的是,上述所说的设备描述符、接口描述符、端点描述符等信息并不是一定要全部返回给主机的,USB设备可能只是返回其中的一项或多项信息给主机,这是由USB设备自身设置所决定的;
109、USB设备判断所接收到的第一个setup包是否是第二预设命令,如果是第二预设命令,执行110,如果不是,执行112;
具体地,第二预设命令为设置设备地址命令;
判断接收到的第一个setup包是否是设置设备地址命令具体为:判断第一个setup包的数据是否是以00 05开始的,如果是,则接收到的setup包是设置设备地址命令;
110、USB设备认定主机操作系统为第二操作系统,并将操作系统标识置为第二预设标识;
具体地,第二操作系统为Linux2.4系统或Linux2.6早期内核系统;
其中,Linux2.6早期内核系统包括:Linux2.6.11、Linux2.6.10及Linux2.6.10之前版本的Linux2.6内核系统;
例如,主机操作系统为第二操作系统时,USB设备接收到的第一个setup包为:
PID:SETUP ADDR:00 ENDP:00 CRC5:02 idle:3
PID:DATA0 data:00 05 04 00 00 00 00 00 CRC16:70eb idle:7
PID:ACK idle:2f
其中,data:00 05 04 00 00 00 00 00为十六进制数,为USB设备分配地址,新分配到的地址是Ox04,而USB设备在接收到上述命令后,向主机返回一个长度为0的空数据包;
具体地,第二预设标识是自定义的,本实施例中第二预设标识为2;
111、USB设备向主机返回接口描述符,该接口描述符中不含有对自身可用端点数的描述信息,执行117;
具体地,USB设备在认定主机操作系统为第二操作系统时,USB设备向主机返回的接口描述符中并不向主机报告额外的端点;
例如,在主机操作系统是第二操作系统时,USB设备接收到的获取接口描述符命令为:
PID:SETUP ADDR:04 ENDP:00 CRC5:05 idle:3
PID:DATA0 data:80 06 00 04 00 00 09 00 CRC16:04ae idle:7
PID:ACK idle:31
其中,data:80 06 00 04 00 00 09 00为十六进制数,Ox04为获取USB设备的接口描述符,Ox09表示获取9字节的接口描述符;
USB设备返回的接口描述符为:
PID:IN ADDR:04 ENDP:00 CRC5:05 idle:7
PID:DATA1 data:09 04 00 00 02 03 00 00 CRC16:a20a idle:7
PID:ACK idle:2c
PID:IN ADDR:04 ENDP:00 CRC5:05 idle:6
PID:DATA0 data:00 CRC16:7581 idle:7
PID:ACK idle:30
其中,USB设备返回的接口描述符为09 04 00 00 00 03 00 00 00,其中第五个字节Ox00,告知主机该USB设备没有额外的端点,在这种情况下,USB设备与主机之间使用默认的端点0来进行数据通信;
需要说明的是,USB设备向主机返回接口描述符后,还将完成剩余的枚举操作,当枚举操作完成后,USB设备执行117。
112、USB设备按照当前默认的操作系统标识来完成枚举操作,并缓存最后一个setup包;
具体地,该最后一个setup包是指USB设备在接收完主机下发的取描述符信息之后的第一条指令。
具体地,主机下发的取描述符信息包括:取设备描述符命令、取接口描述符命令、取端点描述符命令、取配置描述符命令等。
具体地,如果当前默认的操作系统标识对应的是Windows操作系统,USB设备在完成枚举操作时向系统声明自身为HID设备;
如果当前默认的操作系统标识对应的是Linux操作系统,USB设备在完成枚举操作时向系统声明自身为自定义USB设备;
如果当前默认的操作系统标识对应的是MACOSX操作系统,USB设备在完成枚举操作时向系统声明自身为CCID设备;
以上只是举例,也可以声明为其他类型的设备,如USB光盘,USB Mass storage等。
本实施例中,默认的操作系统是第四操作系统,所以USB设备在本步骤中将会向第四操作系统返回相应的信息。
113、USB设备判断接收到的最后一个setup包是否是第三预设命令,如果是,则执行114,否则,执行116;
具体地,第三预设命令是选择配置指令。
判断接收到的最后一个setup包是否是选择配置指令具体为:判断该指令是否是以00 09开始的,如果是,则该指令是选择配置指令;
例如,USB设备接收到的最后一个setup包为:
PID:SETUP ADDR:02 ENDP:00 CRC5:15 idle:3
PID:DATA0 data:00 09 01 00 00 00 00 00 CRC16:2527 idle:7
PID:ACK idle:2e1a
其中,data:00 09 01 00 00 00 00 00为选择配置指令;
114、USB设备认定主机操作系统为第三操作系统,并将操作系统标识置为第三预设标识;
具体地,第三操作系统为Linux2.6后期内核系统,包括Linux 2.6.18、Linux 2.6.28;
具体地,第三预设标识是自定义数值,本实施例中第三预设标识为3;
115、USB设备进行软掉电处理,并将上电标识位置为第三预设值,返回102;
在对软掉电处理进行说明之前,需要知道是,USB设备通过改变主机Vcc(电源电压或工作电压)的上拉电阻状态来告知主机自身的插拔状态,USB设备内部集成有上拉电阻,默认状态下是不与Vcc相连的,当USB设备与主机建立连接时,USB内部的上拉电阻连接到Vcc上,这样主机便可以通过检测Vcc上的上拉电阻的变化来确定是否有USB设备连入了;
软掉电处理具体是指:USB设备接收主机下发的power off命令,断开内部上拉电阻与Vcc的连接,这样,主机操作系统将会监控到USB设备是拔出状态,但USB设备是与Vcc相连的,依然可以从Vcc处获取电源,USB设备依然是处于上电状态的,断开预定时间后(极短的时间),USB设备接收到主机下发的power on命令,USB设备内部的上拉电阻连到Vcc,主机操作系统将再次监控到USB设备的插入,重新开始进行枚举操作,即USB设备返回执行102;
具体地,第三预设值为自定义数值,本实施例中第三预设值为3;
这里,还需要说明的是,USB设备在判断出主机操作系统是第三操作系统时,需要进行软掉电处理,重新进行枚举操作,这是因为:USB设备在判断出主机操作系统是第三操作系统之前已经完成了枚举,并且是按照默认操作系统,即第四操作系统来返回的描述符信息,而在判断出主机操作系统是第三操作系统时,前面已经返回的描述符信息是错误的,则就需要进行软掉电,重新按照主机操作系统是第三操作系统来返回描述符信息;
116、USB设备认定主机操作系统为第四操作系统,并将操作系统标识的值置为第四预设标识;
具体地,第四操作系统为Windows操作系统,包括Windows 98、Windows 2000、Windows XP、Windows Vista或Windows 7;
需要说明的是,在主机是第四操作系统下,USB设备接收到的最后一个setup包是配置命令,例如:80 06 02 03 09 04 ff 00,该命令是指获取索引为2个字符串描述符;
具体地,第四预设标识是自定义数值,本实施例中第四预设标识是4;
这里,需要说明的是,USB设备在判断出主机操作系统是第四操作系统时,并没有进行软掉电处理,而是完成了枚举操作,等待从主机接收APDU指令,这是因为,USB设备是将第四操作系统作为默认的操作系统,则在枚举过程中,USB设备本身就是按照第四操作系统来进行枚举操作的,向主机返回的描述符信息是正确的,故不用再次进行枚举操作了;
117、USB设备与主机建立数据通信,等待接收主机下发的APDU指令;
需要说明的是,当步骤101中,如果USB设备将操作系统标识初始化为第三预设标识,则USB设备将在116中进行软掉电处理,并将上电标识置为第三预设值,返回102;则在115中就不需要进行软掉电处理了;即,USB设备在执行117之前,还做了一个判断,即判断当前操作系统标识是否与默认标识相同,如果相同,按照当前操作系统标识向主机返回应答信息,执行117,如果不相同,则USB设备进行软掉电处理,并将上电标识置为第三预设值,执行102。
需要说明的是,如果USB设备认定主机操作系统是第一操作系统时,在接收到主机下发的接口描述符后,根据自身的设置情况向主机返回自身真实可用的端点数;
例如,USB设备自身有两个可用的端点,则向主机返回接口描述符09 04 00 00 02 03 00 00 00,第五个字节Ox02,告知主机自身有两个可用的端点;
再例如,USB设备自身没有额外可用的端点,则向主机返回接口描述符09 04 00 00 00 03 00 00 00,第五个字节Ox00,告知主机自身没有额外可用的端点,此时,USB设备与主机之间通过默认端点0来进行数据通信;
如果USB设备在认定主机是第三操作系统的情况下,向主机返回的接口描述符中不含有端点信息,例如,返回的接口描述符为:09 04 00 00 00 03 00 00 00;
还需要说明的是,如果USB设备自身是光盘设备,则USB设备在于主机进行通信的过程中,如果USB设备接收到主机下发读取光盘内容的指令时,USB设备将会根据所认定的操作系统类型,向主机返回不同的数据;
其中,USB设备接收到的读取光盘内容的指令为标准的SISC指令,具体为:55 53 42 43 b0 94 f0 85 00 08 00 00 080 00 0a 28 00 00 00 00 11 00 00 01 00 00 00 00 00 00 00;
如果认定主机操作系统是第一操作系统,USB设备在接收到上述指令后,则向主机返回数据02 43 44 30 30 31 01 00 00 57 00 69 00 6e 00 33 00 32 00 20 00 20 00 20 00 20 00 20 00 20 00 20;
如果认定主机操作系统为第二或第三操作系统,USB设备在接收到上述指令后,则向主机返回03 43 44 30 30 31 01 00 00 57 00 69 00 6e 00 33 00 32 00 20 00 20 00 20 00 20 00 20 00 20 00 20;
如果认定操作系统为第四操作系统,USB设备在接收到上述指令后,则向主机返回01 43 44 30 30 31 01 00 00 57 00 69 00 6e 00 33 00 32 00 20 00 20 00 20 00 20 00 20 00 20 00 20;
USB设备通过对主机下发的指令进行分析,可以确定主机操作系统,并在确定主机操作系统后,有针对性的向主机返回相应的数据,使得主机能够准确的识别USB设备。
以上仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (16)

  1. 一种USB设备识别主机操作系统的方法,其特征在于,所述方法包括:
    步骤A、USB设备上电,并进行初始化;
    步骤B、所述USB设备判断接收到的第一个setup包是否是第一预设命令,如果是所述第一预设命令,执行步骤C,如果不是所述第一预设命令,执行步骤D;
    步骤C、所述USB设备判断所述第一预设命令中的第七个字节是否是第二预设值,如果是,则将操作系统标识置为第一预设标识,执行步骤F,否则,执行步骤E;
    步骤D、所述USB设备判断所述第一个setup包是否是第二预设命令,如果是所述第二预设命令,则将操作系统标识置为第二预设标识,执行步骤F,否则,执行步骤E;
    步骤E、所述USB设备按照默认操作系统标识与主机进行信息交互,直到接收到最后一个setup包,并判断所述最后一个setup包是否是第三预设命令,如果是所述第三预设命令,则将操作系统标识置为第三预设标识,如果不是所述第三预设命令,则将操作系统标识置为第四预设标识;
    步骤F、所述USB设备根据当前操作系统标识与所述主机进行信息交互,所述USB设备与所述主机建立通信,并等待接收所述主机下发的指令。
  2. 根据权利要求1所述的方法,其特征在于,所述USB设备进行初始化包括:将上电标识初始化为第一预设值,将操作系统标识初始化为默认标识。
  3. 根据权利要求2所述的方法,其特征在于,所述步骤F还包括,所述USB设备判断当前操作系统标识是否与所述默认标识相同,如果相同,则所述USB设备与主机建立通信,并等待接收所述主机下发的指令;如果不相同,所述USB设备进行软掉电处理,并将所述上电标识置为第三预设值,执行步骤A。
  4. 根据权利要求3所述的方法,其特征在于,在所述步骤A之后,所述方法还包括:判断所述USB设备是否是首次上电,如果是首次上电,则执行步骤B;如果不是,所述USB设备执行步骤F。
  5. 根据权利要求4所述的方法,其特征在于,判断所述USB设备是否是首次上电具体为:判断上电标识是否是第一预设值,如果是,则所述USB设备是首次上电,如果不是,则所述USB设备不是首次上电。
  6. 根据权利要求1所述的方法,其特征在于,所述第一预设命令为取设备描述符命令。
  7. 根据权利要求6所述的方法,其特征在于,所述USB设备判断第一个setup包是否是第一预设命令具体为:所述USB设备判断所述第一个setup包是否是以十六进制数80 06开始的,如果是,则所述第一个setup包是所述第一预设命令,否则,不是所述第一预设命令。
  8. 根据权利要求1所述的方法,其特征在于,所述第二预设值为十六进制数Ox08。
  9. 根据权利要求1所述的方法,其特征在于,所述第二预设命令为设置设备地址命令。
  10. 根据权利要求9所述的方法,其特征在于,所述USB设备判断所述第一个setup数据包是否是第二预设命令具体为:所述USB设备判断所述第一个setup包是否是以十六进制数00 05开始的,如果是,则所述第一个setup包为所述第二预设命令,否则,不是所述第二预设命令。
  11. 根据权利要求1所述的方法,其特征在于,所述最后一个setup包是指所述USB设备在接收完取描述符信息之后接收到的第一条指令。
  12. 根据权利要求11所述的方法,其特征在于,所述取描述符信息包括取设备描述符命令、取接口描述符命令、取端点描述符命令、取配置描述符命令。
  13. 据权利要求1所述的方法,其特征在于,所述第三预设命令为选择配置指令。
  14. 根据权利13所述的方法,其特征在于,所述USB设备判断最后一个setup包是否是第三预设命令具体为:所述USB设备判断所述最后一个setup包是否是以十六进制数00 09开始的,如果是,则所述最后一个setup包是所述第三预设命令,否则,不是所述第三预设命令。
  15. 根据权利要求1所述的方法,其特征在于,所述方法还包括:所述第一预设标识对应第一操作系统,第二预设标识对应第二操作系统,第三预设标识对应第三操作系统,第四预设标识对应第四操作系统。
  16. 根据权利要求15的方法,其特征在于,所述第一操作系统为苹果操作系统,所述第二操作系统为Linux2.4内核系统或Linux2.6.10及Linux2.6.10之前的内核系统,所述第三操作系统为Linux2.6.10之后的内核系统,第四操作系统为Windows操作系统。
PCT/CN2011/076444 2010-06-29 2011-06-27 Usb设备识别主机操作系统的方法 WO2012000417A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US13/639,875 US8725909B2 (en) 2010-06-29 2011-06-27 Method for identifying host operating system by universal serial bus (USB) device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010213961.2 2010-06-29
CN201010213961.2A CN102043751B (zh) 2010-06-29 2010-06-29 Usb设备识别主机操作系统的方法

Publications (1)

Publication Number Publication Date
WO2012000417A1 true WO2012000417A1 (zh) 2012-01-05

Family

ID=43909897

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/076444 WO2012000417A1 (zh) 2010-06-29 2011-06-27 Usb设备识别主机操作系统的方法

Country Status (3)

Country Link
US (1) US8725909B2 (zh)
CN (1) CN102043751B (zh)
WO (1) WO2012000417A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013167615A1 (fr) * 2012-05-11 2013-11-14 Emmanuel Thibaudeau Procédé d'envoi automatique de lignes de commande pour accéder à un site internet et dispositif mettant en oeuvre le procédé
US11046836B2 (en) 2019-10-18 2021-06-29 Nutjobs Formulations and products to replace single-use plastics and polystyrene with bio-benign materials such as agricultural wastes

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043751B (zh) * 2010-06-29 2012-12-12 飞天诚信科技股份有限公司 Usb设备识别主机操作系统的方法
CN101916238B (zh) * 2010-08-26 2012-01-25 华为终端有限公司 数据卡识别操作系统的方法、装置及通信系统
CN102375786B (zh) * 2011-10-18 2014-09-10 中兴通讯股份有限公司 Usb设备自动识别操作系统的方法及系统
CN102890662B (zh) * 2012-10-19 2016-10-05 无锡海森诺科技有限公司 通过对usb hid设备进行二次枚举以识别主机操作系统的方法
CN103092799B (zh) * 2012-12-28 2015-07-22 飞天诚信科技股份有限公司 一种usb设备及其识别主机操作系统的方法
CN103544037B (zh) * 2013-10-29 2016-08-17 飞天诚信科技股份有限公司 一种支持OpenSC的软硬件驱动的实现方法
CN103577231A (zh) * 2013-10-31 2014-02-12 南京熊猫电子股份有限公司 一种usb嵌入式设备判断主机操作系统的方法
CN104317761B (zh) * 2014-10-27 2017-05-10 飞天诚信科技股份有限公司 一种带有电源管理的多接口移动安全设备及其工作方法
CN104571962B (zh) * 2014-12-31 2017-11-17 上海动联信息技术股份有限公司 一种适合批量生产的usbkey设备内固件的实现方法
US10084820B2 (en) * 2015-02-27 2018-09-25 Konica Minolta Laboratory U.S.A., Inc. Method and system for IPSec security for IPP-USB data
TW201702805A (zh) * 2015-07-06 2017-01-16 Dexin Corp 辨識電腦系統之輸入裝置及其辨識方法
CN106383796B (zh) * 2016-10-18 2019-06-14 广州视睿电子科技有限公司 一种主机操作系统类型的识别方法及系统
CN106406967A (zh) * 2016-11-15 2017-02-15 恒鸿达信息技术有限公司 一种基于stm32的usb在线升级方法及系统
CN108629175B (zh) * 2018-05-14 2020-07-17 深圳市江波龙电子股份有限公司 Usb大容量存储设备的访问控制方法及访问控制装置
CN113282186B (zh) * 2020-02-19 2022-03-11 上海闻泰电子科技有限公司 将hid触摸屏自适应成键盘鼠标的方法
CN112084524B (zh) * 2020-09-30 2023-10-13 北京智芯微电子科技有限公司 U盘访问方法及u盘
CN112068893B (zh) * 2020-11-12 2021-03-16 飞天诚信科技股份有限公司 一种usb设备及其区分移动设备操作系统的方法
CN116601618A (zh) * 2021-02-27 2023-08-15 华为技术有限公司 一种基于usb的通信方法和装置
EP4318230A4 (en) 2021-05-12 2024-08-07 Samsung Electronics Co Ltd ELECTRONIC DEVICE WITH USB CONNECTION TERMINAL AND OPERATING METHOD THEREFOR

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090248907A1 (en) * 2008-04-01 2009-10-01 Sunplus Innovation Technology Inc Method for automatically identifying an operating system for a USB device
CN101561785A (zh) * 2008-04-14 2009-10-21 凌阳创新科技股份有限公司 在usb装置上自动侦测操作系统的方法
CN101606136A (zh) * 2007-02-09 2009-12-16 西摩特克株式会社 通过软件仿真实现为光存储设备或/和可移动磁盘的计算机外设及其实现方法
CN102043751A (zh) * 2010-06-29 2011-05-04 北京飞天诚信科技有限公司 Usb设备识别主机操作系统的方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7574534B2 (en) * 2006-05-23 2009-08-11 International Business Machines Corporation Method for using device enumeration information to identify an operating system running on a computer system
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 (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101606136A (zh) * 2007-02-09 2009-12-16 西摩特克株式会社 通过软件仿真实现为光存储设备或/和可移动磁盘的计算机外设及其实现方法
US20090248907A1 (en) * 2008-04-01 2009-10-01 Sunplus Innovation Technology Inc Method for automatically identifying an operating system for a USB device
CN101561785A (zh) * 2008-04-14 2009-10-21 凌阳创新科技股份有限公司 在usb装置上自动侦测操作系统的方法
CN102043751A (zh) * 2010-06-29 2011-05-04 北京飞天诚信科技有限公司 Usb设备识别主机操作系统的方法

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013167615A1 (fr) * 2012-05-11 2013-11-14 Emmanuel Thibaudeau Procédé d'envoi automatique de lignes de commande pour accéder à un site internet et dispositif mettant en oeuvre le procédé
FR2990532A1 (fr) * 2012-05-11 2013-11-15 Emmanuel Thibaudeau Procede d'envoi automatique de lignes de commande pouracceder a un site internet et dispositif mettant en oeuvre le procede.
FR2990534A1 (fr) * 2012-05-11 2013-11-15 Emmanuel Thibaudeau Procede d'envoi automatique de lignes de commande pour acceder a un site internet et dispositif mettant en oeuvre le procede
US11046836B2 (en) 2019-10-18 2021-06-29 Nutjobs Formulations and products to replace single-use plastics and polystyrene with bio-benign materials such as agricultural wastes

Also Published As

Publication number Publication date
US20130042029A1 (en) 2013-02-14
CN102043751A (zh) 2011-05-04
US8725909B2 (en) 2014-05-13
CN102043751B (zh) 2012-12-12

Similar Documents

Publication Publication Date Title
WO2012000417A1 (zh) Usb设备识别主机操作系统的方法
WO2013075546A1 (zh) 一种USB Key及其与终端进行通信的方法
WO2018012749A1 (en) Electronic device supporting usb interface and control method for usb interface
WO2018076841A1 (zh) 数据分享方法、装置、存储介质及服务器
WO2017082653A1 (en) Electronic device and method for wireless charging in electronic device
WO2020246822A1 (en) Electronic device and method for switching electronic device between dual standby mode and single standby mode
WO2020218742A1 (ko) 폴더블 전자 장치 및 그 동작 방법
WO2016183721A1 (zh) 一种终端设备刷机方法、装置和设备
WO2018032681A1 (zh) 蓝牙配对方法及蓝牙设备
WO2018076861A1 (zh) 数据传输的控制方法、装置、存储介质、服务器及系统
WO2020251192A1 (en) Electronic device and method of utilizing storage space thereof
EP3939351A1 (en) Apparatus and method for fast communication between master and slave
EP3707921A1 (en) Method and apparatus for multimodal operation of near field communications circuitry
WO2018076867A1 (zh) 数据备份的删除方法、装置、系统、存储介质和服务器
WO2011134208A1 (zh) 一种基于时钟的安全装置的软件保护方法及安全装置
WO2011147116A1 (zh) 一种复合型usub设备及其实现方法
WO2020101351A1 (en) Electronic device and method for transceiving control signal
WO2016065619A1 (zh) 一种数据流量管理方法及装置
WO2020171470A1 (en) Electronic device and method for wirelessly transmitting power based on foreign object detection in the electronic device
WO2021162286A1 (en) Electronic device and method for recognizing audio output device connected to usb type-c connector
WO2014189275A1 (en) Apparatus and method of recognizing external device in a communication system
WO2013037257A1 (zh) 一种防止移动终端存储卡频繁热插拔的方法及移动终端
WO2019039851A1 (ko) Usb 인터페이스를 통해 외부 장치와 연결하는 방법 및 그를 위한 전자 장치
WO2018120680A1 (zh) 虚拟磁盘备份系统、方法、装置、服务主机和存储介质
AU2019384601B2 (en) Electronic device and method for obtaining information associated with fingerprint

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 13639875

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11800162

Country of ref document: EP

Kind code of ref document: A1