WO2012155573A1 - Usb设备自动识别操作系统的方法及系统 - Google Patents

Usb设备自动识别操作系统的方法及系统 Download PDF

Info

Publication number
WO2012155573A1
WO2012155573A1 PCT/CN2012/071550 CN2012071550W WO2012155573A1 WO 2012155573 A1 WO2012155573 A1 WO 2012155573A1 CN 2012071550 W CN2012071550 W CN 2012071550W WO 2012155573 A1 WO2012155573 A1 WO 2012155573A1
Authority
WO
WIPO (PCT)
Prior art keywords
operating system
host
usb device
descriptor request
response
Prior art date
Application number
PCT/CN2012/071550
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 EP12785397.6A priority Critical patent/EP2770440A4/en
Priority to US14/351,107 priority patent/US9081794B2/en
Publication of WO2012155573A1 publication Critical patent/WO2012155573A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • 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
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/006Identification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Definitions

  • the present invention relates to the field of data communications, and in particular, to a method and system for automatically identifying an operating system by a Universal Serial Bus (USB) device.
  • USB Universal Serial Bus
  • USB devices can perform certain special functions for an operating system. For example, some features of the USB device are specifically for the Windows WINDOWS operating system. The corresponding operations can only be done in the WINDOWS operating system. These features are not available in the LINUX kernel operating system. Therefore, how the USB device can automatically recognize the currently operating operating system type becomes a problem to be solved.
  • the main object of the present invention is to provide a method and system for automatically recognizing an operating system by a USB device that is convenient to operate.
  • the present invention provides a method for automatically identifying an operating system by a USB device, including the following steps: determining whether an operating system string descriptor request sent by a host is received;
  • determining that the operating system of the host is a WINDOWS operating system; if not, determining whether an operating system characteristic descriptor request sent by the host is received; and when receiving an operating system characteristic descriptor request sent by the host, determining The operating system of the host is a WINDOWS operating system; when the operating system property descriptor request sent by the host is not received, it is determined that the operating system of the host is a LINUX nuclear operating system.
  • the method for the USB device to automatically identify the operating system further includes the steps of: replying to the host response to the operating system string descriptor request when the USB device receives the operating system string descriptor request sent by the host ;
  • the host sends the operating system feature descriptor request to the USB device in response to the response to the operating system string descriptor request.
  • the sending, by the host, the operating system characteristic descriptor request to the USB device according to the response of the operating system string descriptor request comprises:
  • the host records, in the registry, a response that the USB device has sent the operating system string descriptor request;
  • the host sends the operating system property descriptor request to the USB device.
  • the method for the USB device to automatically identify the operating system further includes the step of: when the USB device receives the operating system property descriptor request sent by the host, replying to the host with the response of the operating system property descriptor request.
  • the method further includes:
  • the host obtains the features of the USB device and completes the corresponding operations.
  • the invention further provides a system for automatically identifying an operating system by a USB device, comprising a USB device and a host, wherein the host is configured to send an operating system string descriptor request or an operating system characteristic descriptor request;
  • the USB device comprises:
  • a request receiving module configured to determine whether an operating system string descriptor request or an operating system property descriptor request sent by the host is received
  • An operating system identification module configured to: when receiving an operating system string descriptor request or an operating system property descriptor request sent by the host, determine that the operating system of the host is a WINDOWS operating system; when an operating system sent by the host is not received When the feature descriptor is requested, it is determined that the operating system of the host is a LINUX nuclear operating system.
  • the USB device further includes a request response module, configured to: when receiving an operating system string descriptor request sent by the host, reply the host with a response to the operating system string descriptor request;
  • the host is specifically configured to send the operating system property descriptor request to the USB device according to the response of the operating system string descriptor request.
  • the host is further used to:
  • the request response module is further configured to:
  • the host is further configured to:
  • the invention adopts the MOSD provided by the WINDOWS operating system as a technical support, can realize automatic recognition of the operating system without adding other filtering drivers or optical disc functions, effectively reduces the development cost, and is simple and convenient to operate, and effectively improves the user experience of the USB device.
  • FIG. 1 is a flow chart of a method for automatically identifying an operating system by a USB device according to an embodiment of the present invention
  • FIG. 2 is a flow chart of a method for automatically identifying an operating system by a USB device according to another embodiment of the present invention, where the embodiment includes a step of responding to a request;
  • FIG. 3 is a flow chart of a method for automatically identifying an operating system by a USB device according to another embodiment of the present invention, where the embodiment includes a step of processing a response of an operating system string descriptor request;
  • FIG. 4 is a schematic structural diagram of a system for automatically identifying an operating system by a USB device according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of a system for automatically identifying an operating system by a USB device according to another embodiment of the present invention.
  • the USB device further includes a request response module. detailed description
  • FIG. 1 is a flowchart of a method for automatically identifying an operating system by a USB device according to an embodiment of the present invention.
  • the method for automatically identifying an operating system by a USB device mentioned in this embodiment includes: Step S10, it is determined whether the operating system string descriptor request sent by the host is received; if yes, step S21 is performed; if not, step S30 is performed;
  • Step S21 determining that the operating system of the host is a WINDOWS operating system
  • Step S30 determining whether the operating system characteristic descriptor request sent by the host is received; if yes, executing step S21; if not, executing step S22;
  • Step S22 determining that the operating system of the host is a LINUX nuclear operating system.
  • MOSD Microsoft OS Descriptors, Microsoft Operating System Descriptor, where OS (Operating System)
  • OS Operating System
  • OS Feature Descriptor only hosts of the WINDOWS operating system will send MOSD to the connected USB device.
  • the host computer is a personal computer PC, or other devices that support a USB host controller, such as a palmtop computer.
  • the WINDOWS operating system includes WINDOWS SP2 and above, such as WINDOWS XP SP2, win7, windows vista, and the like.
  • the OS String Descriptor and the OS Feature Descriptor request are used as the identification commands of the WINDOWS operating system.
  • FIG. 2 is a flowchart of a method for automatically identifying an operating system by a USB device according to another embodiment of the present invention. The embodiment includes the step of responding to a request.
  • Step S40 When the USB device receives the operating system string descriptor request sent by the host, the USB device returns a response to the operating system string descriptor request to the host.
  • step S50 the host sends an operating system property descriptor request to the USB device according to the response of the operating system string descriptor request.
  • the WINDOWS operating system host when the USB device first accesses the host, the WINDOWS operating system host sends an OS String Descriptor request to the USB device, and the USB device responds to the received OS String Descriptor request, and The response is sent to the host for identification.
  • the host determines whether the USB device supports the WINDOWS operating system by responding to whether the USB device responds to the OS String Descriptor request issued by the host. Only for USB devices that support the WINDOWS operating system, WINDOWS The operating system will send subsequent OS Feature Descriptor request instructions to implement the relevant functions. If the host's operating system is a LINUX kernel operating system, the host does not send an OS String Descriptor request to the USB device.
  • Step S60 When the USB device receives the operating system property descriptor request sent by the host, the USB device returns a response to the operating system property descriptor request to the host.
  • Step S70 The host acquires the functional characteristics of the USB device, and completes the corresponding operation.
  • FIG. 3 is a flowchart of a method for automatically identifying an operating system by a USB device according to another embodiment of the present invention.
  • the embodiment includes the step of processing a response of an operating system string descriptor request.
  • Step S40 specifically includes:
  • Step S41 The host records, in the registry, a response that the USB device has sent the operating system string descriptor request;
  • step S42 when the USB device is connected to the host next time, it is determined whether the registry exists.
  • the USB device responds to the operating system string descriptor request; if yes, step S43 is performed; if no, step S44 is performed;
  • Step S43 The host sends an operating system feature descriptor request to the USB device.
  • Step S44 The host terminates sending an operating system feature descriptor request to the USB device.
  • the OS String Descriptor request is mainly used to determine whether the function feature in the USB device supports the WINDOWS operating system.
  • the USB device When the USB device first accesses the WINDOWS operating system host and responds to the host with the response of the OS String Descriptor request, the host It will be recorded in the registry, and it is determined that the USB device supports the WINDOWS operating system; when the USB device accesses the same host again, the USB device will be found in the registry of the host. If the request is replied to the response record, the host directly issues an OS Feature Descriptor request to the USB device, and does not need to resend the OS String Descriptor request to the USB device, and does not need to determine whether the function of the USB device supports the WINDOWS operating system.
  • FIG. 4 is a schematic structural diagram of a system for automatically identifying an operating system by a USB device according to an embodiment of the present invention.
  • the system for automatically identifying an operating system by a USB device provided by the embodiment includes:
  • USB device 500 specifically includes:
  • the request receiving module 10 is configured to determine whether an operating system string descriptor request or an operating system property descriptor request sent by the host 400 is received;
  • the operating system identification module 20 is configured to: when receiving an operating system string descriptor request or an operating system property descriptor request sent by the host 400, determine that the operating system of the host 400 is a WINDOWS operating system; when the operation sent by the host is not received When the system property descriptor is requested, it is determined that the host's operating system is the LINUX kernel operating system.
  • the host 400 is a personal computer PC, or other device supporting a USB host controller, such as a palmtop computer.
  • the operating system of the host 400 is a WINDOWS operating system, including WINDOWS SP2 and above, such as WINDOWS XP SP2, win7, windows vista, etc.
  • the host 400 sends a USB product-specific MOSD to the USB device 500, including the OS String Descriptor and the OS.
  • Feature Descriptor This embodiment sets the OS String Descriptor and the OS Feature Descriptor as the identification commands of the WINDOWS operating system.
  • the request receiving module 10 set in the USB device 500 receives the OS String Descriptor or OS Feature Descriptor request, it is set by The operating system identification module 20 in the USB device 500 determines that the USB device 500 is connected to the host 400 of the WINDOWS operating system. If the operating system of the host 400 is a LINUX kernel operating system, the host 400 does not send an OS String Descriptor or OS Feature Descriptor request to the USB device, and the operating system identification module 20 determines that the USB device 500 is connected to the host of the LINUX nuclear operating system. 400.
  • FIG. 5 is a schematic structural diagram of a system for automatically identifying an operating system by a USB device according to another embodiment of the present invention.
  • the USB device 500 further includes a request response module 30, configured to receive a message sent by the host. Reply to the host when the operating system string descriptor is requested The response of the system string descriptor request;
  • the host 400 is specifically configured to send an operating system characteristic descriptor request to the USB device 500 according to the response of the operating system string descriptor request.
  • the USB device 500 when the USB device 500 first accesses the host 400, if the operating system of the host 400 is the WINDOWS operating system, it is necessary to determine whether the functional features included in the USB device 500 support the WINDOWS operating system, that is, the one or more characterizations. Is there a feature dedicated to the WINDOWS operating system? In this embodiment, it is determined whether the function feature in the USB device 500 supports the WINDOWS operating system by determining whether the request response module 30 provided in the USB device 500 responds to the OS String Descriptor request sent by the host 400. The USB device 500 of the WINDOWS operating system, the WINDOWS operating system will send an OS Feature Descriptor request to the USB device 500 to implement related functions. If the operating system of the host 400 is a LINUX core operating system, the host 400 does not send an OS String Descriptor request to the USB device 500. In the embodiment of the present invention, the request response module 30 is further configured to:
  • the response to the operating system property descriptor request is replied to the host 400.
  • the request response module 30 set in the USB device 500 also responds to the OS Feature Descriptor request, prompting the host 400 to extract the functional characteristics. If the operating system of the host 400 is a LINUX kernel operating system, the host 400 does not need to wait for the response request module 30 to reply to the OS Feature Descriptor response, and can directly perform operations according to the functional features of the Linux operating system included in the USB device 500. In the embodiment of the present invention, the host 400 is further configured to:
  • the request response module 30 set in the USB device 500 will respond correctly to the OS String Descriptor request.
  • the host 400 records the response of the USB device 500 in the registry;
  • a record of the response of the USB device 500 having responded to the OS String Descriptor request is found in the registry of the host 400, and the host 400 directly directly to the USB device.
  • the host 400 sends an OS Feature Descriptor request to the USB device 500, and does not need to resend the OS String Descriptor request to determine whether the functional features of the USB device 500 support the WINDOWS operating system. Otherwise, when the USB device 500 is later connected to the same host 400, the host 400 does not issue an OS Feature Descriptor request identification command to the USB device 500.
  • the above embodiment only judges the USB device 500 that is firstly connected to the host 400, and determines whether the functional features support the WINDOWS operating system, and records the judgment result, which can provide a reference for the USB device 500 to access the same host 400 again.
  • the 400 will select whether to send the OS Feature Descriptor request according to the record, reduce the processing flow of the operating system recognition process, and improve the processing efficiency.
  • the host 400 is further configured to acquire the functional characteristics of the USB device 500 and complete the corresponding operation when receiving the response of the operating system property descriptor request.
  • the host 400 of the WINDOWS operating system when the host 400 of the WINDOWS operating system receives the OS Feature Descriptor response replied by the USB device 500, the host 400 can obtain the USB device 500. Specific functional characteristics, and complete the corresponding related operations according to the functional characteristics. If the USB device 500 determines that the operating system of the host 400 is a LINUX kernel operating system, the LINUX core operating system can perform various special function related operations directly with the USB device 500.
  • the above description is only the preferred embodiment of the present invention, and is not intended to limit the scope of the invention, and the equivalent structure or equivalent flow transformation made by the specification and the drawings of the present invention may be directly or indirectly applied to other related The technical field is equally included in the scope of patent protection of the present invention. Industrial applicability
  • the invention adopts the MOSD provided by the WINDOWS operating system as a technical support, can realize automatic recognition of the operating system without adding other filtering drivers or optical disc functions, effectively reduces the development cost, and is simple and convenient to operate, and effectively improves the user experience 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)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Mathematical Physics (AREA)
  • Information Transfer Systems (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Description

USB设备自动识别操作系统的方法及系统 技术领域
本发明涉及到数据通信领域, 特别涉及到通用串行总线 (Universal Serial Bus , USB )设备自动识别操作系统的方法及系统。 背景技术
随着 USB产品的不断开发,越来越多的 USB设备被广泛应用在各种操 作系统之上。 但是, 不同的操作系统对同一个 USB设备的需求可能会有所 不同,一个 USB设备针对某一个操作系统可以完成某些特殊的功能,例如, USB 设备中某些特性是特别针对视窗 WINDOWS 操作系统的, 只能在 WINDOWS操作系统中完成对应的操作,这些特性在 LINUX核操作系统中 是无法进行的。 因此, USB设备如何能自动识别出当前接入的操作系统类 型便成为一个待解决的问题。
目前已有的自动识别操作系统的方法有两种。一种是在个人电脑 PC上 预先安装 USB设备的过滤驱动,并且在驱动中预先设置与 USB设备匹配约 定的识别码, 该方法要求用户在使用 USB设备前必须预先安装过滤驱动, 并预先设置识别命令。 另一种方法是在 USB设备中实现光盘功能, 利用小 型计算机系统接口 SCSI指令对于不同的操作系统预先定义好不同的切换指 令, 在切换光盘的时候向 USB设备下发预先设置的 SCSI命令, 以达到识 别当前操作系统的目的, 但这种方法需要 USB设备包含光盘功能, 并且需 要专门的操作界面来发送 SCSI指令。 以上两种方法都对用户的使用造成不 便。 发明内容
本发明的主要目的为提供一种操作方便的 USB设备自动识别操作系统 的方法及系统。
本发明提出一种 USB设备自动识别操作系统的方法, 包括以下步驟: 判断是否接收到主机发送的操作系统字符串描述符请求;
如果是, 则判定所述主机的操作系统为 WINDOWS操作系统; 如果否, 则判断是否接收到主机发送的操作系统特性描述符请求; 当 接收到主机发送的操作系统特性描述符请求时, 则判定所述主机的操作系 统为 WINDOWS操作系统; 当未接收到主机发送的操作系统特性描述符请 求时, 则判定所述主机的操作系统为 LINUX核操作系统。
优选地, 所述 USB设备自动识别操作系统的方法还包括步驟: 当所述 USB设备接收到主机发送的操作系统字符串描述符请求时, 向 主机回复所述操作系统字符串描述符请求的响应;
主机根据所述操作系统字符串描述符请求的响应发送所述操作系统特 性描述符请求至所述 USB设备。
优选地, 所述主机根据操作系统字符串描述符请求的响应发送所述操 作系统特性描述符请求至所述 USB设备具体包括:
主机在注册表中记录所述 USB设备已发送所述操作系统字符串描述符 请求的响应;
在所述 USB设备下一次与主机连接时,判断注册表中是否存在该 USB 设备对所述操作系统字符串描述符请求的响应;
如果是, 则主机发送所述操作系统特性描述符请求至所述 USB设备。 优选地, 所述 USB设备自动识别操作系统的方法还包括步驟: 当所述 USB设备接收到主机发送的操作系统特性描述符请求时, 向主 机回复所述操作系统特性描述符请求的响应。 优选地, 所述 USB设备向主机回复所述操作系统特性描述符请求的响 应之后还包括:
主机获取 USB设备的功能特性, 完成对应操作。
本发明还提出一种 USB设备自动识别操作系统的系统,包括 USB设备 和主机, 所述主机用于发送操作系统字符串描述符请求或操作系统特性描 述符请求; 所述 USB设备包括:
请求接收模块, 用于判断是否接收到主机发送的操作系统字符串描述 符请求或操作系统特性描述符请求;
操作系统识别模块, 用于当接收到主机发送的操作系统字符串描述符 请求或操作系统特性描述符请求时, 判定所述主机的操作系统为 WINDOWS操作系统; 当未接收到主机发送的操作系统特性描述符请求时, 判定所述主机的操作系统为 LINUX核操作系统。
优选地, 所述 USB设备还包括请求响应模块, 用于当接收到主机发送 的操作系统字符串描述符请求时, 向主机回复所述操作系统字符串描述符 请求的响应;
所述主机具体用于根据所述操作系统字符串描述符请求的响应发送所 述操作系统特性描述符请求至所述 USB设备。
优选地, 所述主机进一步用于:
当接收到所述操作系统字符串描述符请求的响应时, 在注册表中记录 所述 USB设备已发送所述操作系统字符串描述符请求的响应;
在所述 USB设备下一次与主机连接时,判断注册表中是否存在该 USB 设备对所述操作系统字符串描述符请求的响应;
如果是, 则发送所述操作系统特性描述符请求至所述 USB设备。
优选地, 所述请求响应模块还用于:
当接收到主机发送的操作系统特性描述符请求时, 向主机回复所述操 作系统特性描述符请求的响应。
优选地, 所述主机还用于:
当接收到操作系统特性描述符请求的响应时, 获取 USB设备的功能特 性, 完成对应操作。 本发明以 WINDOWS操作系统自带的 MOSD作为技术支撑,无需添加 其他过滤驱动或光盘功能即可实现操作系统的自动识别, 有效降低了开发 成本, 且操作简单方便, 有效提高 USB设备用户体验。 附图说明
图 1 为本发明一实施例中 USB设备自动识别操作系统的方法的流程 图;
图 2为本发明另一实施例中 USB设备自动识别操作系统的方法的流程 图, 该实施例中包括响应请求的步驟;
图 3为本发明另一实施例中 USB设备自动识别操作系统的方法的流程 图, 该实施例中包括处理操作系统字符串描述符请求的响应的步驟;
图 4为本发明一实施例中 USB设备自动识别操作系统的系统的结构示 意图;
图 5为本发明另一实施例中 USB设备自动识别操作系统的系统的结构 示意图, 该实施例中 USB设备还包括请求响应模块。 具体实施方式
应当理解, 此处所描述的具体实施例仅仅用以解释本发明, 并不用于 限定本发明。
如图 1所示, 图 1为本发明一实施例中 USB设备自动识别操作系统的 方法的流程图, 该实施例提到的 USB设备自动识别操作系统的方法包括: 步驟 S10,判断是否接收到主机发送的操作系统字符串描述符请求; 如 果是, 则执行步驟 S21 ; 如果否, 则执行步驟 S30;
步驟 S21 , 判定主机的操作系统为 WINDOWS操作系统;
步驟 S30, 判断是否接收到主机发送的操作系统特性描述符请求; 如果 是, 则执行步驟 S21 ; 如果否, 则执行步驟 S22;
步驟 S22, 判定主机的操作系统为 LINUX核操作系统。
本实施例中, 由于 MOSD ( Microsoft OS Descriptors, 微软操作系统描 述符, 其中 OS ( Operating System, 操作系统))是微软产品中特有的描述 符, 包括 OS String Descriptor (操作系统字符串描述符) 和 OS Feature Descriptor (操作系统特性描述符), 只有 WINDOWS操作系统的主机才会 向接入的 USB设备发送 MOSD。 其中, 主机为个人电脑 PC, 或其他支持 USB 主控制器的设备, 例如掌上电脑等, WINDOWS 操作系统包括 WINDOWS SP2及以上系统,例如 WINDOWS XP SP2、 win7、 windows vista 等。 本实施例将 OS String Descriptor和 OS Feature Descriptor请求作为 WINDOWS操作系统的识别指令, 当 USB设备接收到 OS String Descriptor 或 OS Feature Descriptor请求时, 则判定该 USB设备接入的是 WINDOWS 操作系统的主机。 如果主机的操作系统为 LINUX核操作系统, 则主机不会 向 USB设备发送 OS String Descriptor或 OS Feature Descriptor请求。本实施 例以 WINDOWS操作系统自带的 MOSD作为技术支撑,无需添加其他过滤 驱动或光盘功能即可实现操作系统的自动识别, 有效降低了开发成本, 且 操作简单方便, 有效提高 USB设备用户体验。 如图 2所示, 图 2为本发明另一实施例中 USB设备自动识别操作系统 的方法的流程图, 该实施例包括响应请求的步驟。
步驟 S40, 当 USB设备接收到主机发送的操作系统字符串描述符请求 时, 向主机回复操作系统字符串描述符请求的响应; 步驟 S50,主机根据操作系统字符串描述符请求的响应发送操作系统特 性描述符请求至 USB设备。
本实施例中针对 WINDOWS操作系统的主机,当 USB设备首次接入主 机时, WINDOWS操作系统主机将向 USB设备发送 OS String Descriptor请 求, USB设备对接收到的 OS String Descriptor请求做出响应, 并将响应发 给主机识别,主机通过辨别 USB设备是否对主机下发的 OS String Descriptor 请求做出响应,来判断 USB设备中的功能特性是否支持 WINDOWS操作系 统, 只有对于支持 WINDOWS操作系统的 USB设备, WINDOWS操作系 统才会发送后续 OS Feature Descriptor请求指令, 以实现相关功能。 如果主 机的操作系统为 LINUX核操作系统,则主机不会向 USB设备发送 OS String Descriptor请求。
步驟 S60,当 USB设备接收到主机发送的操作系统特性描述符请求时, 向主机回复操作系统特性描述符请求的响应。
步驟 S70, 主机获取 USB设备的功能特性, 完成对应操作。
本实施例中, 当 WINDOWS操作系统的主机接收到 USB设备回复的 OS Feature Descriptor请求的响应, 则可从 USB设备中获取 USB设备包含 的具体功能特性, 并可完成各功能特性对应的相关操作。 如果 USB设备判 定主机的操作系统为 LINUX核操作系统, 则 LINUX核操作系统可直接与 USB设备进行各特殊功能相关操作。 如图 3所示, 图 3为本发明另一实施例中 USB设备自动识别操作系统 的方法的流程图, 该实施例中包括处理操作系统字符串描述符请求的响应 的步驟。 步驟 S40具体包括:
步驟 S41, 主机在注册表中记录 USB设备已发送操作系统字符串描述 符请求的响应;
步驟 S42, 在 USB设备下一次与主机连接时, 判断注册表中是否存在 该 USB设备对操作系统字符串描述符请求的响应;如果是,则执行步驟 S43; 如果否, 则执行步驟 S44;
步驟 S43, 主机发送操作系统特性描述符请求至 USB设备;
步驟 S44, 主机终止向 USB设备下发操作系统特性描述符请求。
本实施例中, OS String Descriptor请求主要用来判断 USB设备中的功 能特性是否支持 WINDOWS操作系统, 当 USB设备首次接入 WINDOWS 操作系统主机, 并向主机回复了 OS String Descriptor请求的响应后, 主机 将在注册表中记录下来, 并且判定该 USB设备支持 WINDOWS操作系统; 当该 USB设备以后再一次接入同一个主机时, 在这个主机的注册表中就会 找到该 USB设备已对 OS String Descriptor请求回复了响应的记录, 则主机 直接向该 USB设备下发 OS Feature Descriptor请求, 无需重新向该 USB设 备发送 OS String Descriptor请求, 也无需判断该 USB设备的功能特性是否 支持 WINDOWS操作系统。如果注册表中记录 USB设备的功能特性不支持 WINDOWS操作系统, 则当该 USB设备以后接入同一个主机时, 主机均不 会向该 USB设备下发后续 OS Feature Descriptor请求指令。 本实施例在 WINDOWS操作系统主机利用注册表进行记录,只对首次接入的 USB设备 发送 OS String Descriptor请求并接收 USB设备回复的响应,在同一 USB设 备再次接入时, 只需查找注册表中的记录, 即可判断是否下发 OS Feature Descriptor请求, 为后续主机获取 USB设备的功能特性并完成对应操作节 省了时间, 处理速度更快, 工作效率得到有效提高。 如图 4所示, 图 4为本发明一实施例中 USB设备自动识别操作系统的 系统的结构示意图, 该实施例提供的 USB设备自动识别操作系统的系统包 括:
主机 400 ,用于发送操作系统字符串描述符请求或操作系统特性描述符 请求; USB设备 500 , 该 USB设备 500具体包括:
请求接收模块 10 , 用于判断是否接收到主机 400发送的操作系统字符 串描述符请求或操作系统特性描述符请求;
操作系统识别模块 20, 用于当接收到主机 400发送的操作系统字符串 描述符请求或操作系统特性描述符请求时, 判定主机 400 的操作系统为 WINDOWS操作系统; 当未接收到主机发送的操作系统特性描述符请求时, 判定主机的操作系统为 LINUX核操作系统。
本实施例中, 主机 400为个人电脑 PC, 或其他支持 USB主控制器的 设备,例如掌上电脑等。如果主机 400的操作系统为 WINDOWS操作系统, 包括 WINDOWS SP2及以上系统,例如 WINDOWS XP SP2、 win7、 windows vista等, 则主机 400会向 USB设备 500发送微软产品特有的 MOSD, 包括 OS String Descriptor 和 OS Feature Descriptor 本实施例将 OS String Descriptor和 OS Feature Descriptor请求作为 WINDOWS操作系统的识别指 令,当设置于 USB设备 500中的请求接收模块 10接收到 OS String Descriptor 或 OS Feature Descriptor请求时, 则由设置于 USB设备 500中的操作系统 识别模块 20判定该 USB设备 500接入的是 WINDOWS操作系统的主机 400。如果主机 400的操作系统为 LINUX核操作系统,主机 400不会向 USB 设备发送 OS String Descriptor或 OS Feature Descriptor请求, 操作系统识别 模块 20则判定该 USB设备 500接入的是 LINUX核操作系统的主机 400。 本实施例以 WINDOWS操作系统自带的 MOSD作为技术支撑,无需添加其 他过滤驱动或光盘功能即可实现操作系统的自动识别, 有效降低了开发成 本, 且操作简单方便, 有效提高 USB设备用户体验。 如图 5所示, 图 5为本发明另一实施例中 USB设备自动识别操作系统 的系统的结构示意图, 该实施例中 USB设备 500还包括请求响应模块 30, 用于当接收到主机发送的操作系统字符串描述符请求时, 向主机回复操作 系统字符串描述符请求的响应;
主机 400具体用于根据操作系统字符串描述符请求的响应发送操作系 统特性描述符请求至 USB设备 500。
本实施例在 USB设备 500首次接入主机 400时, 如果主机 400的操作 系统为 WINDOWS操作系统,则需要判断 USB设备 500中包含的功能特性 是否支持 WINDOWS操作系统, 即该一个或多个特性描述是否有专用于 WINDOWS操作系统的功能。本实施例是通过辨别设置于 USB设备 500中 的请求响应模块 30是否对主机 400下发的 OS String Descriptor请求做出响 应,来判断 USB设备 500中的功能特性是否支持 WINDOWS操作系统,只 有对于支持 WINDOWS操作系统的 USB设备 500 , WINDOWS操作系统才 会发送 OS Feature Descriptor请求到 USB设备 500, 以实现相关功能。 如果 主机 400的操作系统为 LINUX核操作系统, 则主机 400不会向 USB设备 500发送 OS String Descriptor请求。 本发明实施例中, 请求响应模块 30还用于:
当接收到主机 400发送的操作系统特性描述符请求时, 向主机 400回 复操作系统特性描述符请求的响应。
本实施例中, 当请求接收模块 10接收到主机 400发送的 OS Feature Descriptor请求后, USB设备 500中设置的请求响应模块 30还对 OS Feature Descriptor请求做出响应, 提示主机 400可以提取功能特性。 如果主机 400 的操作系统为 LINUX核操作系统, 则主机 400不用等待请求响应模块 30 回复 OS Feature Descriptor响应, 即可直接根据 USB设备 500包含的针对 LINUX核操作系统的功能特性进行相关操作。 本发明实施例中, 主机 400进一步用于:
当接收到操作系统字符串描述符请求的响应时, 在注册表中记录 USB 设备 500已发送操作系统字符串描述符请求的响应;
在 USB设备 500下一次与主机 400连接时, 判断注册表中是否存在该 USB设备 500对操作系统字符串描述符请求的响应;
如果是, 则发送操作系统特性描述符请求至 USB设备 500;
如果否, 则终止向 USB设备 500下发操作系统特性描述符请求。
本实施例中,当 USB设备 500包含的功能特性支持 WINDOWS操作系 统时, USB设备 500中设置的请求响应模块 30才会对 OS String Descriptor 请求做出正确的响应。 对于第一次接入 WINDOWS操作系统主机 400 的 USB设备 500, 当 USB设备 500向主机回复 OS String Descriptor请求的响 应后, 主机 400则会在注册表中将该 USB设备 500的响应记录下来; 当该 USB设备 500以后再一次接入同一个主机 400时, 在这个主机 400的注册 表中就会找到该 USB设备 500已回复对 OS String Descriptor请求的响应的 记录, 则主机 400直接向该 USB设备 500下发 OS Feature Descriptor请求 至 USB设备 500, 无需重新发送 OS String Descriptor请求判断该 USB设备 500的功能特性是否支持 WINDOWS操作系统。 否则, 当该 USB设备 500 以后接入同一个主机 400时, 主机 400均不会向该 USB设备 500下发 OS Feature Descriptor请求识别指令。上述实施例只对首次接入主机 400的 USB 设备 500进行判断, 辨别其功能特性是否支持 WINDOWS操作系统, 并记 录判断结果, 可以为该 USB设备 500再次接入同一主机 400时提供参考依 据, 主机 400会根据记录选择是否发送 OS Feature Descriptor请求, 减少操 作系统识别过程的处理流程, 提高处理效率。 本发明实施例中, 主机 400还用于当接收到操作系统特性描述符请求 的响应时, 获取 USB设备 500的功能特性, 完成对应操作。
本实施例中, 当 WINDOWS操作系统的主机 400接收到 USB设备 500 回复的 OS Feature Descriptor响应, 则主机 400可从 USB设备 500中获取 具体功能特性, 并根据功能特性完成对应的相关操作。 如果 USB设备 500 判定主机 400的操作系统为 LINUX核操作系统, 则 LINUX核操作系统可 直接与 USB设备 500进行各特殊功能相关操作。 以上所述仅为本发明的优选实施例, 并非因此限制本发明的专利范围, 凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换, 或直 接或间接运用在其他相关的技术领域, 均同理包括在本发明的专利保护范 围内。 工业实用性
本发明以 WINDOWS操作系统自带的 MOSD作为技术支撑,无需添加 其他过滤驱动或光盘功能即可实现操作系统的自动识别, 有效降低了开发 成本, 且操作简单方便, 有效提高 USB设备用户体验。

Claims

权利要求书
1、 一种 USB设备自动识别操作系统的方法, 包括以下步驟: 判断是否接收到主机发送的操作系统字符串描述符请求;
如果是, 则判定所述主机的操作系统为 WINDOWS操作系统; 如果否, 则判断是否接收到主机发送的操作系统特性描述符请求; 当 接收到主机发送的操作系统特性描述符请求时, 则判定所述主机的操作系 统为 WINDOWS操作系统; 当未接收到主机发送的操作系统特性描述符请 求时, 则判定所述主机的操作系统为 LINUX核操作系统。
2、 根据权利要求 1所述的 USB设备自动识别操作系统的方法, 其中, 还包括步驟:
当所述 USB设备接收到主机发送的操作系统字符串描述符请求时, 向 主机回复所述操作系统字符串描述符请求的响应;
主机根据所述操作系统字符串描述符请求的响应发送所述操作系统特 性描述符请求至所述 USB设备。
3、 根据权利要求 2所述的 USB设备自动识别操作系统的方法, 其中, 所述主机根据操作系统字符串描述符请求的响应发送所述操作系统特性描 述符请求至所述 USB设备具体包括:
主机在注册表中记录所述 USB设备已发送所述操作系统字符串描述符 请求的响应;
在所述 USB设备下一次与主机连接时,判断注册表中是否存在该 USB 设备对所述操作系统字符串描述符请求的响应;
当存在时, 主机发送所述操作系统特性描述符请求至所述 USB设备。
4、 根据权利要求 2或 3所述的 USB设备自动识别操作系统的方法, 其中, 还包括步驟:
当所述 USB设备接收到主机发送的操作系统特性描述符请求时, 向主 机回复所述操作系统特性描述符请求的响应。
5、 根据权利要求 4所述的 USB设备自动识别操作系统的方法, 其中, 所述 USB 设备向主机回复所述操作系统特性描述符请求的响应之后还包 括:
主机获取 USB设备的功能特性, 完成对应操作。
6、 一种 USB设备自动识别操作系统的系统, 该系统包括 USB设备和 主机, 所述主机用于发送操作系统字符串描述符请求或操作系统特性描述 符请求; 所述 USB设备包括:
请求接收模块, 用于判断是否接收到主机发送的操作系统字符串描述 符请求或操作系统特性描述符请求;
操作系统识别模块, 用于当接收到主机发送的操作系统字符串描述符 请求或操作系统特性描述符请求时, 判定所述主机的操作系统为 WINDOWS操作系统; 当未接收到主机发送的操作系统特性描述符请求时, 判定所述主机的操作系统为 LINUX核操作系统。
7、 根据权利要求 6所述的 USB设备自动识别操作系统的系统, 其中, 所述 USB设备还包括请求响应模块, 用于当接收到主机发送的操作系统字 符串描述符请求时, 向主机回复所述操作系统字符串描述符请求的响应; 所述主机具体用于根据所述操作系统字符串描述符请求的响应发送所 述操作系统特性描述符请求至所述 USB设备。
8、 根据权利要求 7所述的 USB设备自动识别操作系统的系统, 其中, 所述主机进一步用于:
当接收到所述操作系统字符串描述符请求的响应时, 在注册表中记录 所述 USB设备已发送所述操作系统字符串描述符请求的响应;
在所述 USB设备下一次与主机连接时,判断注册表中是否存在该 USB 设备对所述操作系统字符串描述符请求的响应;
当存在时, 发送所述操作系统特性描述符请求至所述 USB设备。
9、 根据权利要求 7或 8所述的 USB设备自动识别操作系统的系统, 其中, 所述请求响应模块还用于:
当接收到主机发送的操作系统特性描述符请求时, 向主机回复所述操 作系统特性描述符请求的响应。
10、根据权利要求 9所述的 USB设备自动识别操作系统的系统,其中, 所述主机还用于:
当接收到操作系统特性描述符请求的响应时, 获取 USB设备的功能特 性, 完成对应操作。
PCT/CN2012/071550 2011-10-18 2012-02-23 Usb设备自动识别操作系统的方法及系统 WO2012155573A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP12785397.6A EP2770440A4 (en) 2011-10-18 2012-02-23 METHOD AND SYSTEM FOR A USB DEVICE TO AUTOMATICALLY RECOGNIZE AN OPERATING SYSTEM
US14/351,107 US9081794B2 (en) 2011-10-18 2012-02-23 Method and system for automatically recognizing operating system by USB device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110317039.2A CN102375786B (zh) 2011-10-18 2011-10-18 Usb设备自动识别操作系统的方法及系统
CN201110317039.2 2011-10-18

Publications (1)

Publication Number Publication Date
WO2012155573A1 true WO2012155573A1 (zh) 2012-11-22

Family

ID=45794417

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/071550 WO2012155573A1 (zh) 2011-10-18 2012-02-23 Usb设备自动识别操作系统的方法及系统

Country Status (4)

Country Link
US (1) US9081794B2 (zh)
EP (1) EP2770440A4 (zh)
CN (1) CN102375786B (zh)
WO (1) WO2012155573A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2990956A4 (en) * 2013-05-28 2016-04-13 Zte Corp USB DEVICE AND METHOD FOR AUTOMATIC DETECTION OF A MICROSOFT WINDOWS OPERATING SYSTEM VERSION

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102890662B (zh) * 2012-10-19 2016-10-05 无锡海森诺科技有限公司 通过对usb hid设备进行二次枚举以识别主机操作系统的方法
CN104156328B (zh) * 2013-05-15 2019-02-05 中兴通讯股份有限公司 一种识别操作系统类型的方法及usb设备
CN104660788B (zh) * 2013-11-20 2018-11-13 中兴通讯股份有限公司 一种移动终端及自适应外接设备免驱或非免驱的方法
CN104834611A (zh) * 2014-02-12 2015-08-12 中兴通讯股份有限公司 一种自动识别主机操作系统的方法、装置及usb设备
CN104199789B (zh) * 2014-08-28 2018-01-16 中兴通讯股份有限公司 端口自适应配置的方法、管理系统、驱动系统及系统
US9892064B2 (en) 2014-09-02 2018-02-13 Logitech Europe S.A. Universal input device
CN109446120B (zh) * 2016-06-22 2020-05-15 飞天诚信科技股份有限公司 一种USB设备及其识别MacOS系统的方法
CN106383796B (zh) * 2016-10-18 2019-06-14 广州视睿电子科技有限公司 一种主机操作系统类型的识别方法及系统
JP7386012B2 (ja) * 2019-07-30 2023-11-24 株式会社ワコム 情報入力装置、方法、及びプログラム
JP7444728B2 (ja) * 2020-08-11 2024-03-06 シャープ株式会社 電子機器、制御方法、及びプログラム
TWI765665B (zh) * 2021-04-16 2022-05-21 宏正自動科技股份有限公司 作業系統識別方法與使用該方法之電子裝置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1664778A (zh) * 2004-03-05 2005-09-07 英业达股份有限公司 信息平台测试环境自动化建置方法及系统
CN101853142A (zh) * 2010-05-05 2010-10-06 四川九洲电器集团有限责任公司 一种带虚拟光驱的usb设备的识别方法
CN101957807A (zh) * 2010-09-16 2011-01-26 北京飞天诚信科技有限公司 USB设备识别主机Windows操作系统版本类型的方法

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6832273B2 (en) * 2000-12-21 2004-12-14 Microsoft Corporation System and method to specify extended configuration descriptor information in USB devices
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
WO2008049102A2 (en) * 2006-10-19 2008-04-24 Fair Thomas T System and methods for zero-configuration data backup
TW200943188A (en) * 2008-04-01 2009-10-16 Sunplus Innovation Technology Inc A method for automatically detecting an operating system on a USB device
CN101561785B (zh) * 2008-04-14 2012-01-04 凌阳创新科技股份有限公司 在usb装置上自动侦测操作系统的方法
CN107015825A (zh) * 2009-07-10 2017-08-04 中兴通讯股份有限公司 一种通用串行接口数据卡的配置方法和系统
CN101620577B (zh) * 2009-08-12 2011-09-14 广州广电运通金融电子股份有限公司 自动柜员机部件的自动化配置方法及系统
CN101853224B (zh) * 2010-04-21 2014-12-10 中兴通讯股份有限公司 一种Linux系统数据卡设备端口识别的方法及装置
CN101833466A (zh) * 2010-05-14 2010-09-15 华为终端有限公司 终端设备及其驱动程序的安装方法
CN102043751B (zh) * 2010-06-29 2012-12-12 飞天诚信科技股份有限公司 Usb设备识别主机操作系统的方法
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
CN101916238B (zh) * 2010-08-26 2012-01-25 华为终端有限公司 数据卡识别操作系统的方法、装置及通信系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1664778A (zh) * 2004-03-05 2005-09-07 英业达股份有限公司 信息平台测试环境自动化建置方法及系统
CN101853142A (zh) * 2010-05-05 2010-10-06 四川九洲电器集团有限责任公司 一种带虚拟光驱的usb设备的识别方法
CN101957807A (zh) * 2010-09-16 2011-01-26 北京飞天诚信科技有限公司 USB设备识别主机Windows操作系统版本类型的方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2770440A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2990956A4 (en) * 2013-05-28 2016-04-13 Zte Corp USB DEVICE AND METHOD FOR AUTOMATIC DETECTION OF A MICROSOFT WINDOWS OPERATING SYSTEM VERSION
US9501444B2 (en) 2013-05-28 2016-11-22 Zte Corporation USB device and method thereof for automatically recognizing microsoft windowing operating system version

Also Published As

Publication number Publication date
CN102375786B (zh) 2014-09-10
CN102375786A (zh) 2012-03-14
US9081794B2 (en) 2015-07-14
US20140297901A1 (en) 2014-10-02
EP2770440A1 (en) 2014-08-27
EP2770440A4 (en) 2015-03-04

Similar Documents

Publication Publication Date Title
WO2012155573A1 (zh) Usb设备自动识别操作系统的方法及系统
EP3570175B1 (en) Method for implementing nvme over fabrics, terminal, server, and system
TWI358665B (zh)
US7069350B2 (en) Data transfer control system, electronic instrument, and data transfer control method
CN102799691B (zh) 文件系统转换访问方法及文件系统转换访问设备
CN103902427A (zh) 一种带外获取硬盘状态的方法
WO2012100498A1 (zh) 一种usb设备的端口切换方法和系统
WO2011130975A1 (zh) 一种linux系统数据卡设备端口识别的方法及装置
US7165124B2 (en) Data transfer control system, electronic instrument, program, and data transfer control method
EP3707597B1 (en) Bitwise writing apparatus for system-on-chip system
WO2014183358A1 (zh) 一种识别操作系统类型的方法及usb设备
WO2013189432A2 (zh) Usb设备及其自动识别微软窗口化操作系统版本的方法
WO2015139431A1 (zh) 一种稳定热插拔驱动方法、装置及一种支持热插拔设备
WO2015117460A1 (zh) Usb设备识别主机系统的方法、usb设备及存储介质
CN107783793B (zh) 自动辨识主机操作系统的方法与usb装置
WO2014176956A1 (zh) 一种usb设备适配操作系统的方法及usb设备
TWI587147B (zh) 自動辨識主機作業系統之方法與usb裝置
JP4664077B2 (ja) 光学ストレージの転送性能の向上
CN108845899B (zh) 一种m.3 ssd上电初始化的方法及系统
US20040230734A1 (en) Data transfer control system, electronic instrument, and data transfer control method
CN109299025B (zh) 一种后端存储设备的管理方法、装置、设备以及存储介质
US8209452B2 (en) External device having a virtual storage device
KR101295216B1 (ko) 외부 저장장치 확장 기능을 가지는 휴대용 무선 컨텐츠 공유 장치 및 방법
WO2024060193A1 (zh) 应用于计算机设备的操作方法、装置和计算机设备
TW200413940A (en) Method and apparatus for handling data transfers

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2012785397

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 14351107

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE