WO2015117460A1 - Usb设备识别主机系统的方法、usb设备及存储介质 - Google Patents

Usb设备识别主机系统的方法、usb设备及存储介质 Download PDF

Info

Publication number
WO2015117460A1
WO2015117460A1 PCT/CN2014/091644 CN2014091644W WO2015117460A1 WO 2015117460 A1 WO2015117460 A1 WO 2015117460A1 CN 2014091644 W CN2014091644 W CN 2014091644W WO 2015117460 A1 WO2015117460 A1 WO 2015117460A1
Authority
WO
WIPO (PCT)
Prior art keywords
host
usb device
descriptor
request
usb
Prior art date
Application number
PCT/CN2014/091644
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 WO2015117460A1 publication Critical patent/WO2015117460A1/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

Definitions

  • the present invention relates to the field of computers, and in particular, to a USB device for identifying a host system, a USB device, and a computer storage medium.
  • USB Universal Serial Bus
  • USB is a serial bus standard that allows computer mainframes to communicate with peripheral devices, supporting hot-swap and plug-and-play functionality.
  • peripherals such as keyboards, mice, gamepads, scanners, digital cameras, printers, hard drives, optical drives, and network cards.
  • USB has become the most widely used type. Interface technology.
  • the embodiment of the present invention is to provide a USB device for identifying a host system, a USB device, and a computer storage medium, so as to implement USB device identification of the BIOS of the basic input/output system, further compatible with the host BIOS, and improve the operation of the USB device. reliability.
  • an embodiment of the present invention provides a method for a USB device to identify a host system, where the method includes:
  • the USB device sets the configurable number of the device descriptors of the USB device to an integer greater than or equal to 2, and reports the device descriptor to the host;
  • USB device When the USB device does not detect the MODS request sent by the host and the polling request sent according to the configurable number, it is determined that the BIOS is currently running on the host, where the polling request is used. All configuration descriptors in the USB device are polled on request.
  • the USB device reports the device descriptor to the host, including: the USB device receives a device descriptor request sent by the host; and the USB device executes the device descriptor request, and reports the device Describe the device descriptor.
  • the method further includes: when detecting the MODS request, the USB device determines that the host is currently running Windows. system.
  • the method further includes: when the USB device does not detect the MODS request, and detects the polling request, Make sure that the host is currently running a Linux/Mac system.
  • the device descriptor is device descriptor information of the mass storage device.
  • an embodiment of the present invention provides a USB device, where the USB device includes: a configuration unit, a reporting unit, and an identification unit; wherein the configuration unit is configured to: The number of configurations is set to an integer greater than or equal to 2; the reporting unit is configured to report the device descriptor to the host; the identifying unit is configured to detect, without detecting, the MODS delivered by the host according to the device descriptor When requesting and transmitting the polling request according to the configurable number, it is determined that the BIOS is currently running on the host, wherein the polling request is used to request polling all configuration descriptors in the USB device.
  • the reporting unit is configured to receive a device descriptor sent by the host Requesting; executing the device descriptor request, reporting the device descriptor.
  • the identifying unit is further configured to: after the reporting unit reports the device descriptor to the host, when detecting the MODS request, determine that the host system is currently running a Windows system.
  • the identifying unit is further configured to: after the reporting unit reports the device descriptor to the host, when the MODS request is not detected, and the polling request is detected, determining The Linux/Mac system is currently running on the host.
  • the device descriptor is device descriptor information of the mass storage device.
  • an 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 foregoing USB device identification host system method.
  • the USB device sets the configurable number in the device descriptor to an integer greater than or equal to 2, and reports the device descriptor to the host;
  • the USB device does not detect the MODS request sent by the host and the polling request sent according to the configurable number, it is determined that the BIOS is currently running on the host, where the polling request is used for the request. Poll all configuration descriptors in the USB device.
  • the technical solution of the embodiment of the invention can realize the identification of the basic input/output system BIOS by the USB device. Further, since the USB device can recognize that the BIOS is currently running on the host, when the drive mode is selected, the USB device selects the driver model corresponding to the BIOS to be compatible with the host BIOS, thereby improving the reliability of the USB device.
  • FIG. 1 is a schematic structural diagram of a USB communication system according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of a method for performing a USB device identification host system on a side of a USB communication system according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a method for a USB device to recognize a Windows system on a USB communication system side according to an embodiment of the present invention
  • FIG. 4 is a schematic flowchart of a method for a USB device to recognize a Linux/Mac system on a USB communication system side according to an embodiment of the present invention
  • FIG. 5 is a schematic flowchart of a method for performing USB device identification BIOS by a USB communication system side according to an embodiment of the present invention
  • FIG. 6 is a schematic flowchart of a method for performing a USB device identification host system of a USB device according to an embodiment of the present invention
  • FIG. 7 is a schematic structural diagram of a USB device according to an embodiment of the present invention.
  • FIG. 1 is a schematic structural diagram of a USB communication system according to an embodiment of the present invention.
  • the USB communication system includes: a host 11 and a USB device 12;
  • the host device 11 can run one or more systems, such as a Windows system, a Basic Input Output System (BIOS), a Linux system, or a Mac system.
  • the USB device 12 can be a USB network card, a USB data card, or the like.
  • the host 11 is configured to perform data transmission with the USB device 12;
  • the USB device 12 is configured to set the configurable number in the device descriptor to an integer greater than or equal to 2, and report the device descriptor to the host 11; the MODS request sent by the host 11 is not detected and the configurable according to the configurable When the number of polling requests is issued, it is determined that the current operation on the host 11
  • the line is the BIOS, where the polling request is used to request polling of all configuration descriptors in the USB device 12.
  • a method for identifying a host system by a USB device in the embodiment of the present invention will be described below in conjunction with the above communication system.
  • FIG. 2 is a schematic flowchart diagram of a method for performing a USB device identification host system on a USB communication system side according to an embodiment of the present invention.
  • the method includes:
  • USB device is inserted into the host, enters a power-on state, and starts enumeration;
  • S202 The host detects that a new USB device is inserted, and performs an enumeration interaction with the USB device; if the host is running a Windows system, skip to S203; if the host is running a non-Windows system, skip to S204;
  • the USB hub on the host uses the interrupt channel to report the event to the host;
  • the host sends a request for obtaining a port status (Get_Port_Status) to the hub to obtain more device information;
  • the hub detects whether the USB device is running at a low speed or a high speed, and sends this information to the host, which is a response to Get_Port_Status;
  • the host sends a request to set the port status (Set_Port_Feature) to the hub, and requests it to reset the port;
  • the hub resets the USB device
  • the host detects whether the connected full-speed USB device supports high-speed operation
  • a data transmission channel is established between the host and the USB device
  • the host obtains the maximum packet length of the default pipeline
  • the host allocates an address for the USB device.
  • the above process is the interaction between the host, the hub, and the USB device during the enumeration process.
  • S203 The host sends a MODS request to the USB device to request the USB device to report the MODS therein; skip to S204;
  • the USB device sets the configurable number in its device descriptor to an integer greater than or equal to 2;
  • the USB device can generate a set of device descriptors, and then set the configurable number in the device descriptor to an integer greater than or equal to 2, so that when the host analyzes the device descriptor, the USB device is considered to have Multiple sets of configuration descriptors.
  • the device descriptor is device descriptor information of the mass storage device.
  • S205 The host issues a device descriptor request (Get_Device_Descriptor);
  • S206 The USB device performs a device descriptor request, and reports the device descriptor.
  • the USB device can also report the device descriptor autonomously.
  • S207 The host analyzes the device descriptor; if the host is currently running a Linux/Mac system, skip to S208a; if the host is currently running BIOS or Windows system, skip to S208b;
  • S208a The host sends a polling request to the USB device to request to poll all the configuration descriptors on the USB device; skip to S209;
  • the Linux/Mac system supports a multi-configured USB device.
  • the USB device When the number of configurations in the host read device descriptor is greater than or equal to 2, the USB device is considered to have multiple sets of configuration descriptors, and then the round is issued to the USB device. Request a request to poll each set of configuration descriptors in the USB device for a complete understanding of the configuration information of the USB device.
  • the host can also issue a configuration descriptor request (Get_Descriptor) multiple times to request each set of configuration descriptors.
  • Get_Descriptor a configuration descriptor request
  • S208b The host sends a configuration descriptor request (Get_Descriptor) to the USB device; skip to S209;
  • the BIOS or the Windows system does not support multiple configurations of the USB device, when the host reads the device descriptor, regardless of the configurable number, the host A configuration descriptor request is issued to request a first set of configuration descriptors of the USB device.
  • USB device detects whether a MODS request and a polling request exist
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • FIG. 3 is a schematic flowchart of a method for a USB device to recognize a Windows system on a USB communication system side according to an embodiment of the present invention. Referring to FIG. 3, the method includes:
  • USB device is inserted into the host, enters a power-on state, and starts enumeration;
  • S302 The host detects that a new USB device is inserted, performs an enumeration interaction with the USB device, and issues a MODS request.
  • the USB device sets the configurable number in the device descriptor to an integer greater than or equal to 2;
  • S304 The host sends a device descriptor request (Get_Device_Descriptor);
  • S305 The USB device performs a device descriptor request, and reports the device descriptor.
  • S306 The host analyzes the device descriptor, and sends a configuration descriptor request (Get_Descriptor);
  • the USB device receives the configuration descriptor request, and detects whether there is a MODS request and a polling request;
  • USB device When the USB device detects only the MODS request sent by the host, it determines that the host is currently Running a Windows system.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • FIG. 4 is a schematic flowchart of a method for a USB device to recognize a Linux/Mac system on a USB communication system side according to an embodiment of the present invention. Referring to FIG. 4, the method includes:
  • USB device is inserted into the host, enters a power-on state, and starts enumeration;
  • S402 The host detects that a new USB device is inserted, and performs an enumeration interaction with the USB device.
  • the USB device sets the configurable number in the device descriptor to an integer greater than or equal to 2;
  • S404 The host sends a device descriptor request (Get_Device_Descriptor);
  • S405 The USB device performs a device descriptor request, and reports the device descriptor.
  • S406 The host analyzes the device descriptor, and sends a polling request (Get_Descriptor);
  • the USB device receives the configuration descriptor request, and detects whether there is a MODS request and a polling request;
  • USB device When the USB device detects only the polling request sent by the host, it determines that the host is currently running a Linux/Mac system.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • BIOS is currently running on the host.
  • FIG. 5 is a schematic flowchart of a method for a USB device to identify a BIOS on a USB communication system side according to an embodiment of the present invention. Referring to FIG. 5, the method includes:
  • USB device is inserted into the host, enters a power-on state, and starts enumeration;
  • S502 The host detects that a new USB device is inserted, and performs an enumeration interaction with the USB device.
  • the USB device sets the configurable number in the device descriptor to an integer greater than or equal to 2;
  • S504 The host sends a device descriptor request (Get_Device_Descriptor);
  • USB device performs a device descriptor request, and reports the device descriptor.
  • S506 The host analyzes the device descriptor, and sends a configuration descriptor request (Get_Descriptor);
  • USB device receives the configuration descriptor request, and detects whether there is a MODS request and a polling request;
  • USB device completes the identification of the host system.
  • the USB device selects the most suitable configuration descriptor from the host system according to the identified host system, and mounts a driver matching the host system to complete the enumeration.
  • the USB device can identify each system according to different responses of different systems to multiple configuration devices, not only can identify different common desktop systems, but also can identify the BIOS and realize the USB device to identify the host BIOS; Further, since the USB device can recognize that the BIOS is currently running on the host, when the drive mode is selected, the USB device selects the driver model corresponding to the BIOS, is compatible with the host BIOS, and improves the reliability of the USB device operation.
  • an embodiment of the present invention provides a method for a USB device to identify a host system, which is applied to the USB device described in one or more of the above embodiments.
  • FIG. 6 is a schematic flowchart of a method for performing a USB device identification host system of a USB device according to an embodiment of the present invention. Referring to FIG. 6, the method includes:
  • the USB device sets the configurable number in the device descriptor to an integer greater than or equal to 2, and reports the device descriptor to the host;
  • the S601 may be: the USB device receives the device descriptor request sent by the host; the USB device performs the device descriptor request, and reports the device descriptor.
  • the device descriptor is device descriptor information for a mass storage device.
  • the method further comprises: when detecting the MODS request, the USB device determines that the Windows system is currently running on the host.
  • the method further comprises: the USB device determines that the Linux/Mac system is currently running on the host when the MODS request is not detected and the polling request is detected.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the foregoing method for the USB device to identify the host system.
  • the USB device sets the configurable number in the device descriptor to an integer greater than or equal to 2, and reports the device descriptor to the host; when the host receives the device After the descriptor, if the host is currently running a Windows system, the host will issue a MODS to the USB device; if the host is currently running a Linux/Mac system, the host will consider that after obtaining a configurable number,
  • the USB device is a multi-configuration device that sends a polling request to the USB device to request to poll all configuration descriptors in the USB device; if the host is currently running the BIOS, the host does not send the above two types to the USB device.
  • the USB device can identify the host system based on whether or not the two requests are received. Then, when the USB device does not detect the MODS request and the polling request sent by the host, it can be determined that the BIOS is currently running on the host. In this way, the problem that the USB device existing in the prior art can only recognize the Windows system is solved, and the USB device recognizes the BIOS of the host. Further, since the USB device can recognize that the BIOS is currently running on the host, then When the drive mode is selected, the USB device selects the driver model corresponding to the BIOS to be compatible with the host BIOS and improve the operation of the USB device. Reliability.
  • an embodiment of the present invention provides a USB device that is consistent with the USB device described in one or more of the above embodiments.
  • FIG. 7 is a schematic structural diagram of a USB device according to an embodiment of the present invention.
  • the USB device includes: a configuration unit 71, a reporting unit 72, and an identification unit 73.
  • the configuration unit 71 is configured to set the device descriptor.
  • the number of configurables is set to an integer greater than or equal to 2;
  • the reporting unit 72 is configured to report the device descriptor to the host;
  • the identifying unit 73 is configured to not detect the MODS request issued by the host according to the device descriptor and according to the configurable When the number of polling requests is issued, it is determined that the BIOS is currently running on the host, wherein the polling request is used to request to poll all configuration descriptors in the USB device.
  • the reporting unit 72 is specifically configured to receive a device descriptor request sent by the host; execute a device descriptor request, and report the device descriptor.
  • the identifying unit 73 is further configured to determine that the Windows system is currently running on the host after detecting that the MODS request is detected by the reporting unit 72 to the host.
  • the identifying unit 73 is further configured to: after the reporting unit 72 reports the device descriptor to the host, when the MODS request is not detected, and the polling request is detected, it is determined that the host is currently running Linux/Mac. system.
  • the device descriptor in one or more of the above embodiments is device descriptor information for the mass storage device.
  • the configuration unit 71, the reporting unit 72, and the identification unit 73 in one or more of the above embodiments may be disposed in a control chip in the USB device, and the control chip may pass through a central processing unit (CPU) or a digital signal.
  • CPU central processing unit
  • the processing is implemented by a DSP (Digital Signal Processor), a Microprocessor Unit (MPU), or a Field Programmable Gate Array (FPGA).
  • DSP Digital Signal Processor
  • MPU Microprocessor Unit
  • FPGA Field Programmable Gate Array
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the USB device sets the configurable number in the device descriptor to an integer greater than or equal to 2, and reports the device descriptor to the host;
  • the USB device does not detect the MODS request sent by the host and the polling request sent according to the configurable number, it is determined that the BIOS is currently running on the host, where the polling request is used for the request. Poll all configuration descriptors in the USB device.
  • the technical solution of the embodiment of the invention can realize the identification of the basic input/output system BIOS by the USB device. Since the USB device can recognize that the BIOS is currently running on the host, when the drive mode is selected, the USB device selects the driver model corresponding to the BIOS to be compatible with the host BIOS, thereby improving the reliability of the USB device.

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设备将设备描述符中可配置数目设置为大于等于2的整数,并向主机上报所述设备描述符(S601);所述USB设备在未检测到所述主机下发的MODS请求及根据所述可配置数目下发的轮询请求时,确定所述主机上当前运行的是BIOS(S602),其中,所述轮询请求用于请求轮询所述USB设备中所有的配置描述符。同时还公开了一种USB设备及计算机存储介质。该方案实现了USB设备对基本输入输出系统BIOS的识别,进一步兼容主机BIOS,提高USB设备运行的可靠性。

Description

USB设备识别主机系统的方法、USB设备及存储介质 技术领域
本发明涉及计算机领域,尤其涉及一种USB设备识别主机系统的方法、USB设备及计算机存储介质。
背景技术
通用串行总线(USB,Universal Serial Bus)技术是一种让计算机主机和外围设备进行通讯的串行总线标准,支持热插拔和即插即用功能。目前几乎所有的计算机外围设备,例如键盘、鼠标、游戏手柄、扫描仪、数码相机、打印机、硬盘、光驱和网卡等均可以通过USB接口与主机连接并使用,USB已经成为使用最为广泛的一种接口技术。
目前,由于Windows系统在XP及以后的版本上提供了微软操作系统描述符(MODS,Microsoft OS Descriptors),那么,当将USB设备插入到运行有Windows系统的主机中时,主机会下发MODS请求,请求查询USB设备中的MODS,这样,USB设备就可以基于是否接收到MODS请求将Windows系统识别出来。但是对于其他系统的识别,现有技术中并不存在较为合理的解决方案。
所以,现有技术存在USB设备仅能够识别Windows系统的技术问题。
发明内容
有鉴于此,本发明实施例期望提供一种USB设备识别主机系统的方法、USB设备及计算机存储介质,以实现USB设备对基本输入输出系统BIOS的识别,进一步兼容主机BIOS,提高USB设备运行的可靠性。
本发明实施例的技术方案是这样实现的:
一方面,本发明实施例提供一种USB设备识别主机系统的方法,所述方法包括:
USB设备将所述USB设备的设备描述符中可配置数目设置为大于等于2的整数,并向主机上报所述设备描述符;
所述USB设备在未检测到所述主机下发的MODS请求及根据所述可配置数目下发的轮询请求时,确定所述主机上当前运行的是BIOS,其中,所述轮询请求用于请求轮询所述USB设备中所有的配置描述符。
上述方案中,所述USB设备向所述主机上报所述设备描述符,包括:所述USB设备接收所述主机发送的设备描述符请求;所述USB设备执行所述设备描述符请求,上报所述设备描述符。
上述方案中,在所述USB设备向所述主机上报所述设备描述符之后,所述方法还包括:所述USB设备在检测到所述MODS请求时,确定所述主机上当前运行的是Windows系统。
上述方案中,在所述USB设备向所述主机上报所述设备描述符之后,所述方法还包括:所述USB设备在未检测到所述MODS请求,且检测到所述轮询请求时,确定所述主机上当前运行的是Linux/Mac系统。
上述方案中,所述设备描述符为大容量存储设备的设备描述符信息。
另一方面,本发明实施例提供一种USB设备,所述USB设备包括:配置单元、上报单元及识别单元;其中,所述配置单元,配置为将所述USB设备的设备描述符中的可配置数目设置为大于等于2的整数;所述上报单元,配置为向所述主机上报所述设备描述符;所述识别单元,配置为在未检测到主机根据所述设备描述符下发的MODS请求及根据所述可配置数目下发的轮询请求时,确定所述主机上当前运行的是BIOS,其中,所述轮询请求用于请求轮询所述USB设备中所有的配置描述符。
上述方案中,所述上报单元,配置为接收所述主机发送的设备描述符 请求;执行所述设备描述符请求,上报所述设备描述符。
上述方案中,所述识别单元,还配置为在所述上报单元向所述主机上报所述设备描述符之后,在检测到所述MODS请求时,确定所述主机上当前运行的是Windows系统。
上述方案中,所述识别单元,还配置为在所述上报单元向所述主机上报所述设备描述符之后,在未检测到所述MODS请求,且检测到所述轮询请求时,确定所述主机上当前运行的是Linux/Mac系统。
上述方案中,所述设备描述符为大容量存储设备的设备描述符信息。
再一方面,本发明实施例还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行前述的USB设备识别主机系统的方法。
本发明实施例提供的USB设备识别主机系统的方法、USB设备及计算机存储介质,USB设备将设备描述符中的可配置数目设置为大于等于2的整数,并向主机上报设备描述符;所述USB设备在未检测到所述主机下发的MODS请求及根据所述可配置数目下发的轮询请求时,确定所述主机上当前运行的是BIOS,其中,所述轮询请求用于请求轮询所述USB设备中所有的配置描述符。本发明实施例的技术方案可实现USB设备对基本输入输出系统BIOS的识别。进一步的,由于USB设备能够识别出主机上当前运行的是BIOS,那么,在选择驱动模式时,USB设备就会选择BIOS对应的驱动模型,以兼容主机BIOS,提高USB设备运行的可靠性。
附图说明
图1为本发明实施例中的USB通信系统的结构示意图;
图2为本发明实施例中的USB通信系统侧进行USB设备识别主机系统的方法的流程示意图;
图3为本发明实施例中的USB通信系统侧进行USB设备识别Windows系统的方法的流程示意图;
图4为本发明实施例中的USB通信系统侧进行USB设备识别Linux/Mac系统的方法的流程示意图;
图5为本发明实施例中的USB通信系统侧进行USB设备识别BIOS的方法的流程示意图;
图6为本发明实施例中的USB设备的进行USB设备识别主机系统的方法的流程示意图;
图7为本发明实施例中的USB设备的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。
本发明实施例提供一种USB通信系统,图1为本发明实施例中的USB通信系统的结构示意图,参考图1所示,该USB通信系统包括:主机11及USB设备12;
其中,主机11上可以运行一个或者多个系统,比如,Windows系统、基本输入输出系统(BIOS,Basic Input Output System)、Linux系统或者Mac系统;USB设备12可以为USB网卡、USB数据卡等。
需要说明的是,上述系统的各个版本均属于本发明的保护范围,本发明不作具体限定。
结合本发明实施例,在上述通信系统中,主机11,配置为与USB设备12进行数据传输;
USB设备12,配置为将自身的设备描述符中的可配置数目设置为大于等于2的整数,并向主机11上报该设备描述符;在未检测到主机11下发的MODS请求及根据可配置数目下发的轮询请求时,确定主机11上当前运 行的是BIOS,其中,轮询请求用于请求轮询USB设备12中所有的配置描述符。
下面结合上述通信系统对本发明实施例中的USB设备识别主机系统的方法进行说明。
图2为本发明实施例中的USB通信系统侧进行USB设备识别主机系统的方法的流程示意图。
请参考图2所示,该方法包括:
S201:USB设备插入主机,进入上电状态,开始枚举;
S202:主机检测到有新的USB设备插入,与USB设备进行枚举交互;若主机上运行的是Windows系统,跳至S203;若主机上运行的是非Windows系统,跳至S204;
具体来说,在主机检测到有新的USB设备插入之后,首先,主机上的USB集线器使用中断通道将事件报告给主机;
第二步,主机向集线器发送获得端口状态的请求(Get_Port_Status),以获取更多的设备信息;
第三步,集线器检测USB设备是低速运行还是高速运行,并将此信息送给主机,这是对Get_Port_Status的响应;
第四步,主机向集线器发送设置端口状态的请求(Set_Port_Feature),要求其复位端口;
第五步,集线器对USB设备复位;
第六步,主机检测所连接的全速USB设备是否支持高速运行;
第七步,主机与USB设备之间建立数据传输通道;
第八步,主机获取默认管道的最大包长度;
第九步,主机为USB设备分配地址。
以上过程均为枚举过程中主机、集线器以及USB设备之间的交互。
S203:主机向USB设备下发MODS请求,以请求USB设备上报其中的MODS;跳至S204;
S204:USB设备将其设备描述符中的可配置数目设置为大于等于2的整数;
在具体实施过程中,USB设备可以生成一套设备描述符,然后,将设备描述符中的可配置数目设置为大于等于2的整数,这样,主机在分析设备描述符时,会认为USB设备具有多套配置描述符。
较优地,上述设备描述符为大容量存储设备的设备描述符信息。
S205:主机下发设备描述符请求(Get_Device_Descriptor);
S206:USB设备执行设备描述符请求,上报设备描述符;
在实际应用中,在S203之后,USB设备还可以自主上报设备描述符。
S207:主机分析设备描述符;若主机上当前运行的是Linux/Mac系统,跳至S208a;若主机上当前运行的是BIOS或Windows系统,跳至S208b;
S208a:主机向USB设备下发轮询请求,以请求轮询USB设备上所有的配置描述符;跳至S209;
具体来说,Linux/Mac系统支持多配置的USB设备,当主机读取设备描述符中的配置数目为大于等于2时,就认为USB设备为具有多套配置描述符,然后向其下发轮询请求,请求轮询USB设备中的每一套配置描述符,以全面了解USB设备的配置信息。
当然,主机也可以多次下发配置描述符请求(Get_Descriptor),以请求每一套配置描述符。
S208b:主机向USB设备下发配置描述符请求(Get_Descriptor);跳至S209;
具体来说,由于BIOS或者Windows系统是不支持USB设备的多配置的,那么,当主机读取设备描述符中时,无论可配置数目是多少,主机均 下发配置描述符请求,以请求USB设备的第一套配置描述符。
S209:USB设备检测是否存在MODS请求及轮询请求;
S210a:若不存在MODS请求,但存在轮询请求时,USB设备确定主机上当前运行的是Linux/Mac系统。
S210b:若存在MODS请求,但不存在轮询请求时,USB设备确定主机上当前运行的是Windows系统。
S210c:若MODS请求及轮询请求均不存在时,USB设备确定主机上当前运行的是BIOS。
下面针对不同的系统对上述一个或者多个实施例中所述的方案进行说明。
实施例一:
假设主机上当前运行的是Windows系统。
图3为本发明实施例中的USB通信系统侧进行USB设备识别Windows系统的方法的流程示意图,参考图3所示,该方法包括:
S301:USB设备插入主机,进入上电状态,开始枚举;
S302:主机检测到有新的USB设备插入,与USB设备进行枚举交互,并下发MODS请求;
S303:USB设备将设备描述符中的可配置数目设置为大于等于2的整数;
S304:主机下发设备描述符请求(Get_Device_Descriptor);
S305:USB设备执行设备描述符请求,上报设备描述符;
S306:主机分析设备描述符,并下发配置描述符请求(Get_Descriptor);
S307:USB设备接收配置描述符请求,并检测是否存在MODS请求及轮询请求;
S308:USB设备仅检测到主机下发的MODS请求时,确定主机上当前 运行的是Windows系统。
实施例二:
假设主机上当前运行的是Linux/Mac系统。
图4为本发明实施例中的USB通信系统侧进行USB设备识别Linux/Mac系统的方法的流程示意图,参考图4所示,该方法包括:
S401:USB设备插入主机,进入上电状态,开始枚举;
S402:主机检测到有新的USB设备插入,与USB设备进行枚举交互;
S403:USB设备将设备描述符中的可配置数目设置为大于等于2的整数;
S404:主机下发设备描述符请求(Get_Device_Descriptor);
S405:USB设备执行设备描述符请求,上报设备描述符;
S406:主机分析设备描述符,并下发轮询请求(Get_Descriptor);
S407:USB设备接收配置描述符请求,并检测是否存在MODS请求及轮询请求;
S408:USB设备仅检测到主机下发的轮询请求时,确定主机上当前运行的是Linux/Mac系统。
实施例三:
假设主机上当前运行的是BIOS。
图5为本发明实施例中的USB通信系统侧进行USB设备识别BIOS的方法的流程示意图,参考图5所示,该方法包括:
S501:USB设备插入主机,进入上电状态,开始枚举;
S502:主机检测到有新的USB设备插入,与USB设备进行枚举交互;
S503:USB设备将设备描述符中的可配置数目设置为大于等于2的整数;
S504:主机下发设备描述符请求(Get_Device_Descriptor);
S505:USB设备执行设备描述符请求,上报设备描述符;
S506:主机分析设备描述符,并下发配置描述符请求(Get_Descriptor);
S507:USB设备接收配置描述符请求,并检测是否存在MODS请求及轮询请求;
S508:USB设备未检测到主机下发的MODS请求及轮询请求时,确定主机上当前运行的是BIOS。
至此,USB设备就完成了对主机系统的识别。
在一个实施例中,USB设备根据识别出来的主机系统选择最合适的配置描述符上给主机,并挂载与主机系统匹配的驱动,完成枚举。
由上述可以,USB设备针对不同系统对于多配置设备的不同响应,来对各个系统进行识别,不仅能够识别出不同的普通桌面系统,还可以识别出BIOS,实现了USB设备对主机BIOS的识别;进一步地,由于USB设备能够识别出主机上当前运行的是BIOS,那么,在选择驱动模式时,USB设备就会选择BIOS对应的驱动模型,兼容主机BIOS,提高USB设备运行的可靠性。
基于同一发明构思,本发明实施例提供一种USB设备识别主机系统的方法,该方法应用于上述一个或者多个实施例所述的USB设备中。
图6为本发明实施例中的USB设备的进行USB设备识别主机系统的方法的流程示意图,参考图6所示,该方法包括:
S601:USB设备将设备描述符中可配置数目设置为大于等于2的整数,并向主机上报设备描述符;
在具体实施过程中,S601可以为:USB设备接收主机发送的设备描述符请求;USB设备执行设备描述符请求,上报设备描述符。
在一个实施例中,上述设备描述符为大容量存储设备的设备描述符信息。
S602:USB设备在未检测到主机下发的MODS请求及根据可配置数目下发的轮询请求时,确定主机上当前运行的是BIOS;其中,轮询请求用于请求轮询USB设备中所有的配置描述符。
在一个实施例中,在S601之后,该方法还包括:USB设备在检测到MODS请求时,确定主机上当前运行的是Windows系统。
在一个实施例中,在S601之后,该方法还包括:USB设备在未检测到MODS请求,且检测到轮询请求时,确定主机上当前运行的是Linux/Mac系统。
本发明实施例还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行前述的USB设备识别主机系统的方法。
由此可见,本发明实施例提供的USB设备识别主机系统的方法,USB设备将设备描述符中的可配置数目设置为大于等于2的整数,并向主机上报设备描述符;当主机接收到设备描述符之后,如果主机上上当前运行的是Windows系统的话,主机会向USB设备下发MODS;而如果主机上当前运行的是Linux/Mac系统的话,主机会在获取到可配置数目后,认为USB设备为多配置设备,向USB设备发送轮询请求,以请求轮询USB设备中所有的配置描述符;而如果主机上当前运行的是BIOS的话,主机是不会向USB设备发送上述两种请求,所以,USB设备就可以根据有没有接收到上述两种请求,来对主机系统进行识别。那么,在USB设备未检测到主机下发的MODS请求及轮询请求时,就能够确定主机上当前运行的是BIOS。如此,就解决了现有技术中存在的USB设备仅能够识别Windows系统的技术问题,实现了USB设备对主机BIOS的识别;进一步地,由于USB设备能够识别出主机上当前运行的是BIOS,那么,在选择驱动模式时,USB设备就会选择BIOS对应的驱动模型,以兼容主机BIOS,提高USB设备运行 的可靠性。
基于同一发明构思,本发明实施例提供一种USB设备,该设备与上述一个或者多个实施例中所述的USB设备一致。
图7为本发明实施例中的USB设备的结构示意图,参考图7所示,该USB设备包括:配置单元71、上报单元72及识别单元73;其中,配置单元71,配置为将设备描述符中的可配置数目设置为大于等于2的整数;上报单元72,配置为向主机上报设备描述符;识别单元73,配置为在未检测到主机根据设备描述符下发的MODS请求及根据可配置数目下发的轮询请求时,确定主机上当前运行的是BIOS,其中,轮询请求用于请求轮询USB设备中所有的配置描述符。
在一个实施例中,上报单元72,具体配置为接收主机发送的设备描述符请求;执行设备描述符请求,上报设备描述符。
在一个实施例中,识别单元73,还配置为在上报单元72向主机上报设备描述符之后,在检测到MODS请求时,确定主机上当前运行的是Windows系统。
在一个实施例中,识别单元73,还配置为在上报单元72向主机上报设备描述符之后,在未检测到MODS请求,且检测到轮询请求时,确定主机上当前运行的是Linux/Mac系统。
在一个实施例中,上述一个或者多个实施例中的设备描述符为大容量存储设备的设备描述符信息。
以上一个或者多个实施例中的配置单元71、上报单元72及识别单元73可以设置USB设备中的控制芯片内,所述控制芯片可通过中央处理单元(CPU,Central Processing Unit)、或数字信号处理(DSP,Digital Signal Processor)、或微处理器(MPU,Micro Processor Unit)、或现场可编程门阵列(FPGA,Field Programmable Gate Array)等来实现。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。
工业实用性
本发明实施例提供的USB设备识别主机系统的方法、USB设备及计算机存储介质,USB设备将设备描述符中的可配置数目设置为大于等于2的整数,并向主机上报设备描述符;所述USB设备在未检测到所述主机下发的MODS请求及根据所述可配置数目下发的轮询请求时,确定所述主机上当前运行的是BIOS,其中,所述轮询请求用于请求轮询所述USB设备中所有的配置描述符。本发明实施例的技术方案可实现USB设备对基本输入输出系统BIOS的识别。由于USB设备能够识别出主机上当前运行的是BIOS,那么,在选择驱动模式时,USB设备就会选择BIOS对应的驱动模型,以兼容主机BIOS,提高USB设备运行的可靠性。

Claims (11)

  1. 一种通用串行总线USB设备识别主机系统的方法,所述方法包括:
    USB设备将所述USB设备的设备描述符中可配置数目设置为大于等于2的整数,并向主机上报所述设备描述符;
    所述USB设备在未检测到所述主机下发的微软操作系统描述符MODS请求及根据所述可配置数目下发的轮询请求时,确定所述主机上当前运行的是基本输入输出系统BIOS,其中,所述轮询请求用于请求轮询所述USB设备中所有的配置描述符。
  2. 根据权利要求1所述的方法,其中,所述USB设备向所述主机上报所述设备描述符,包括:
    所述USB设备接收所述主机发送的设备描述符请求;
    所述USB设备执行所述设备描述符请求,上报所述设备描述符。
  3. 根据权利要求1所述的方法,其中,在所述USB设备向所述主机上报所述设备描述符之后,所述方法还包括:
    所述USB设备在检测到所述MODS请求时,确定所述主机上当前运行的是Windows系统。
  4. 根据权利要求1所述的方法,其中,在所述USB设备向所述主机上报所述设备描述符之后,所述方法还包括:
    所述USB设备在未检测到所述MODS请求,且检测到所述轮询请求时,确定所述主机上当前运行的是Linux/Mac系统。
  5. 根据权利要求1至4任一项所述的方法,其中,所述设备描述符为大容量存储设备的设备描述符信息。
  6. 一种通用串行总线USB设备,所述USB设备包括:配置单元、上报单元及识别单元;其中,
    所述配置单元,配置为将所述USB设备的设备描述符中的可配置数目设置为大于等于2的整数;
    所述上报单元,配置为向所述主机上报所述设备描述符;
    所述识别单元,配置为在未检测到主机根据所述设备描述符下发的微软操作系统描述符MODS请求及根据所述可配置数目下发的轮询请求时,确定所述主机上当前运行的是基本输入输出系统BIOS,其中,所述轮询请求用于请求轮询所述USB设备中所有的配置描述符。
  7. 根据权利要求6所述的USB设备,其中,所述上报单元,还配置为接收所述主机发送的设备描述符请求;执行所述设备描述符请求,上报所述设备描述符。
  8. 根据权利要求6所述的USB设备,其中,所述识别单元,还配置为在所述上报单元向所述主机上报所述设备描述符之后,在检测到所述MODS请求时,确定所述主机上当前运行的是Windows系统。
  9. 根据权利要求6所述的USB设备,其中,所述识别单元,还配置为在所述上报单元向所述主机上报所述设备描述符之后,在未检测到所述MODS请求,且检测到所述轮询请求时,确定所述主机上当前运行的是Linux/Mac系统。
  10. 根据权利要求6至9任一项所述的USB设备,其中,所述设备描述符为大容量存储设备的设备描述符信息。
  11. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1至5任一项所述的USB设备识别主机系统的方法。
PCT/CN2014/091644 2014-07-25 2014-11-19 Usb设备识别主机系统的方法、usb设备及存储介质 WO2015117460A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410360697.3A CN105279110B (zh) 2014-07-25 2014-07-25 一种usb设备识别主机系统的方法及usb设备
CN201410360697.3 2014-07-25

Publications (1)

Publication Number Publication Date
WO2015117460A1 true WO2015117460A1 (zh) 2015-08-13

Family

ID=53777269

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/091644 WO2015117460A1 (zh) 2014-07-25 2014-11-19 Usb设备识别主机系统的方法、usb设备及存储介质

Country Status (2)

Country Link
CN (1) CN105279110B (zh)
WO (1) WO2015117460A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190056959A1 (en) * 2016-08-22 2019-02-21 Hewlett-Packard Development Company, L.P. Connected devices information

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106126446B (zh) * 2016-06-22 2019-01-04 飞天诚信科技股份有限公司 一种USB设备及其识别MacOS系统的方法
CN108132899A (zh) * 2016-12-01 2018-06-08 中兴通讯股份有限公司 一种传输模式配置方法、装置及系统
US10827271B1 (en) * 2019-10-07 2020-11-03 Synaptics Incorporated Backward compatibility for audio systems and methods

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101515260A (zh) * 2008-02-21 2009-08-26 扬智科技股份有限公司 在不拔插装置的情况下切换装置功能的方法
CN101957807A (zh) * 2010-09-16 2011-01-26 北京飞天诚信科技有限公司 USB设备识别主机Windows操作系统版本类型的方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN102103555A (zh) * 2011-01-30 2011-06-22 中兴通讯股份有限公司 一种usb设备的端口切换方法和系统

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101515260A (zh) * 2008-02-21 2009-08-26 扬智科技股份有限公司 在不拔插装置的情况下切换装置功能的方法
CN101957807A (zh) * 2010-09-16 2011-01-26 北京飞天诚信科技有限公司 USB设备识别主机Windows操作系统版本类型的方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190056959A1 (en) * 2016-08-22 2019-02-21 Hewlett-Packard Development Company, L.P. Connected devices information
US10585674B2 (en) * 2016-08-22 2020-03-10 Hewlett-Packard Development Company, L.P. Connected devices information

Also Published As

Publication number Publication date
CN105279110A (zh) 2016-01-27
CN105279110B (zh) 2018-07-27

Similar Documents

Publication Publication Date Title
EP3204862B1 (en) Emulated endpoint configuration
TWI596485B (zh) 用於虛擬化主機通用序列匯流排轉接器之方法、裝置和電腦程式產品
EP3276481B1 (en) Nvme networked storage implementation method, terminal, server, and system
US9081794B2 (en) Method and system for automatically recognizing operating system by USB device
US20160224493A1 (en) Universal serial bus (usb) kvm switch using virtual usb for switching among multiple hosts
CN102959502A (zh) 在系统中提供异步事件通知的方法
US9806959B2 (en) Baseboard management controller (BMC) to host communication through device independent universal serial bus (USB) interface
WO2015117460A1 (zh) Usb设备识别主机系统的方法、usb设备及存储介质
US8898361B2 (en) Systems and methods for advanced interrupt scheduling and priority processing in a storage system environment
US9779047B2 (en) Universal intelligent platform management interface (IPMI) host to baseboard management controller (BMC) communication for non-x86 and legacy free systems
TW202013130A (zh) 計算裝置中使用管理控制器的散熱管理方法與系統
US9626319B2 (en) Allocating lanes in a peripheral component interconnect express (‘PCIe’) bus
US20200218681A1 (en) Method for automatically identifying host operating systems
US20160077986A1 (en) Electronic apparatus providing real-time switching and sharing of usb electronic devices among hosts
EP2990956B1 (en) Usb device and method thereof for automatically recognizing microsoft windowing operating system version
CN110175146B (zh) 硬盘信息获取方法和获取硬盘信息的装置
US20090172214A1 (en) Usb host controller
CN107783793B (zh) 自动辨识主机操作系统的方法与usb装置
TWI587147B (zh) 自動辨識主機作業系統之方法與usb裝置
TWI441026B (zh) 電子裝置及usb設備的移除策略設定方法
US8832341B2 (en) Dynamically determining a primary or slave assignment based on receiving a power signal from the cable at the port of a device
CN104536932B (zh) 专用低速usb设备的通用通讯方法
US10042792B1 (en) Method for transferring and receiving frames across PCI express bus for SSD device
CN107169378B (zh) 一种计算机开机加密的方法和设备
US10025736B1 (en) Exchange message protocol message transmission between two devices

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

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

Country of ref document: EP

Kind code of ref document: A1