WO2015113472A1 - Method and device for detecting interface access mode of smart key device - Google Patents

Method and device for detecting interface access mode of smart key device Download PDF

Info

Publication number
WO2015113472A1
WO2015113472A1 PCT/CN2015/071200 CN2015071200W WO2015113472A1 WO 2015113472 A1 WO2015113472 A1 WO 2015113472A1 CN 2015071200 W CN2015071200 W CN 2015071200W WO 2015113472 A1 WO2015113472 A1 WO 2015113472A1
Authority
WO
WIPO (PCT)
Prior art keywords
pin
detecting
level
unit
detects
Prior art date
Application number
PCT/CN2015/071200
Other languages
French (fr)
Chinese (zh)
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 WO2015113472A1 publication Critical patent/WO2015113472A1/en

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/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • G06F13/4081Live connection to bus, e.g. hot-plugging

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

A method and device for detecting an interface access mode of a smart key device, capable of enabling a smart key device to obtain an access mode and enter an operational state corresponding to the mode. The method comprises: a detection module is connected to a D+ pin of a USB interface via a first detection pin, and is connected to a D- pin via a second detection pin (101); the first detection pin outputs a high level to the D+ pin (102), it is detected whether the first detection pin and the second detection pin receive a terminal handshake signal, and a first level of the second detection pin is detected (103); if the terminal handshake signal is received, it is determined that an access mode is a USB information transmission mode, and the smart key device enters a corresponding operational state (104); if the terminal handshake signal is not received and the first level of the second detection pin is the high level, the first detection pin outputs a low level to the D+ pin (105), a second level of the second detection pin is detected, and if the second level of the second detection pin is the low level, it is determined that the access mode is a charger mode, and the smart key device enters a corresponding operational state (106).

Description

一种智能密钥设备的接口接入模式检测方法及设备Method and device for detecting interface access mode of smart key device 技术领域Technical field
本发明涉及一种电子技术领域,尤其涉及一种智能密钥设备的接口接入模式检测方法及设备。The present invention relates to the field of electronic technologies, and in particular, to a method and a device for detecting an interface access mode of a smart key device.
背景技术Background technique
目前,智能密钥设备是保护网上银行资金安全的重要工具,从技术角度来看,智能密钥设备是用于网上银行电子签名和数据认证的工具,其内置微型安全芯片,采用密钥算法对网上数据进行加密、解密和数字签名,确保网上交易的保密性、真实性、完整性和不可否认性。At present, smart key equipment is an important tool to protect the security of online banking funds. From a technical point of view, smart key equipment is a tool for online banking electronic signature and data authentication. It has a built-in micro security chip and uses a key algorithm. Online data is encrypted, decrypted and digitally signed to ensure the confidentiality, authenticity, integrity and non-repudiation of online transactions.
智能密钥设备的充电器大部分都采用支持国家充电标准的USB(Universal Serial BUS,通用串行总线)充电接口,而智能密钥设备也通过USB接口与终端传递数据。这样导致了当智能密钥设备与其他设备通过USB接口连接时,无法判断连接设备为终端还是充电器,进而无法在智能密钥设备的屏幕上正确显示接入模式,且智能密钥设备不能根据接入模式进入该接入模式的工作状态。Most of the smart key device chargers use a USB (Universal Serial BUS) charging interface that supports the national charging standard, and the smart key device also transmits data to the terminal through the USB interface. This causes when the smart key device and other devices are connected through the USB interface, and cannot determine whether the connected device is a terminal or a charger, and thus the access mode cannot be correctly displayed on the screen of the smart key device, and the smart key device cannot be based on The access mode enters the working state of the access mode.
发明内容Summary of the invention
本发明旨在解决上述问题之一。The present invention is directed to solving one of the above problems.
本发明的主要目的在于提供一种智能密钥设备的接口接入模式检测方法。A main object of the present invention is to provide a method for detecting an interface access mode of a smart key device.
本发明的另一目的在于提供一种智能密钥设备的接口接入模式检测设备。Another object of the present invention is to provide an interface access mode detecting device of a smart key device.
为达到上述目的,本发明的技术方案具体是这样实现的:In order to achieve the above object, the technical solution of the present invention is specifically implemented as follows:
本发明提供了一种智能密钥设备的接口接入模式检测方法,包括:The present invention provides a method for detecting an interface access mode of a smart key device, including:
检测模块通过所述检测模块的第一检测引脚与USB接口的D+引脚连接,通过所述检测模块的第二检测引脚与所述USB接口的D-引脚连接;The detecting module is connected to the D+ pin of the USB interface through the first detecting pin of the detecting module, and is connected to the D- pin of the USB interface through the second detecting pin of the detecting module;
所述检测模块通过所述第一检测引脚向所述D+引脚输出高电平,所述检测模块检测所述第一检测引脚和所述第二检测引脚是否接收到终端握手信号以及检测所述第二检测引脚的电平;The detecting module outputs a high level to the D+ pin through the first detecting pin, and the detecting module detects whether the first detecting pin and the second detecting pin receive a terminal handshake signal and Detecting a level of the second detection pin;
如果所述检测模块检测所述第一检测引脚及所述第二检测引脚接收到所述终端握手信号,则判断所述接入模式为USB信息传输模式,所述智能密钥设备进入USB信息传输模 式工作状态;If the detecting module detects that the first detecting pin and the second detecting pin receive the terminal handshake signal, determining that the access mode is a USB information transmission mode, and the smart key device enters the USB Information transmission module Working state
如果所述检测模块检测所述第一检测引脚和所述第二检测引脚没有接收到所述终端握手信号且检测到所述第二检测引脚的所述第一电平为高电平,则所述检测模块通过所述第一检测引脚向所述D+引脚输出低电平,检测所述第二检测引脚的第二电平;If the detecting module detects that the first detecting pin and the second detecting pin do not receive the terminal handshake signal and detects that the first level of the second detecting pin is a high level The detecting module outputs a low level to the D+ pin through the first detecting pin, and detects a second level of the second detecting pin;
如果所述第二检测引脚的所述第二电平为低电平,则判断所述接入模式为充电器模式,所述智能密钥设备进入充电器模式工作状态。If the second level of the second detection pin is a low level, it is determined that the access mode is a charger mode, and the smart key device enters a charger mode operation state.
此外,在所述如果所述第二检测引脚的所述第二电平为低电平和所述判断所述接入模式为充电器模式的步骤之间,还包括以下步骤:Furthermore, between the step of if the second level of the second detecting pin is a low level and the step of determining that the access mode is a charger mode, the following steps are further included:
所述检测模块通过所述第一检测引脚向所述D+输出高电平,检测所述第二检测引脚的第三电平;The detecting module outputs a high level to the D+ through the first detecting pin, and detects a third level of the second detecting pin;
如果所述第二检测引脚的所述第三电平为高电平,则判断所述接入模式为充电器模式。If the third level of the second detection pin is a high level, it is determined that the access mode is a charger mode.
此外,该方法还包括:In addition, the method further includes:
如果所述检测模块检测所述第一检测引脚及所述第二检测引脚没有接收到终端握手信号且所述第二检测引脚的所述第一电平为低电平,则所述检测模块继续通过所述第一检测引脚向所述D+引脚输出高电平,直到所述检测模块检测所述第二检测引脚的电平为高电平或所述第一检测引脚及所述第二检测引脚接收到所述终端握手信号为止。If the detecting module detects that the first detecting pin and the second detecting pin do not receive a terminal handshake signal and the first level of the second detecting pin is a low level, The detecting module continues to output a high level to the D+ pin through the first detecting pin until the detecting module detects that the level of the second detecting pin is a high level or the first detecting pin And the second detecting pin receives the terminal handshake signal.
本发明另一方面提供了一种智能密钥设备的接口接入模式检测设备,包括检测模块和USB接口;Another aspect of the present invention provides an interface access mode detecting device of a smart key device, including a detecting module and a USB interface;
所述USB接口,包括D-引脚和D+引脚;The USB interface includes a D-pin and a D+ pin;
所述检测模块,包括输出单元、检测单元和判断单元;The detecting module includes an output unit, a detecting unit, and a determining unit;
所述输出单元与所述D+引脚连接,所述检测单元与所述D+引脚和所述D-引脚连接;The output unit is connected to the D+ pin, and the detecting unit is connected to the D+ pin and the D- pin;
所述检测单元与所述输出单元连接;The detecting unit is connected to the output unit;
所述判断单元与所述检测单元连接;The determining unit is connected to the detecting unit;
所述输出单元,用于向所述D+引脚输出高电平;The output unit is configured to output a high level to the D+ pin;
所述检测单元,用于在所述输出单元向所述D+引脚输出高电平后,检测所述D+引脚和所述D-引脚是否接收到终端握手信号以及检测所述D-引脚的电平,将检测结果发送至所述输出单元和所述判断单元;The detecting unit is configured to detect, after the output unit outputs a high level to the D+ pin, whether the D+ pin and the D- pin receive a terminal handshake signal and detect the D-reference a level of the foot, the detection result is sent to the output unit and the determining unit;
所述判断单元,用于如果检测单元检测所述D+引脚和所述D-引脚接收到所述终端握手信号,则判断接入模式为USB信息传输模式,所述智能密钥设备进入USB信息传输模式工作状态;The determining unit is configured to: if the detecting unit detects that the D+ pin and the D- pin receive the terminal handshake signal, determine that the access mode is a USB information transmission mode, and the smart key device enters the USB Information transmission mode working state;
所述输出单元,还用于如果所述检测单元检测所述D+引脚和所述D-引脚没有接收到 所述终端握手信号且检测到所述D-引脚的所述第一电平为高电平,向所述D+引脚输出低电平;The output unit is further configured to: if the detecting unit detects that the D+ pin and the D- pin are not received The terminal handshake signal detects that the first level of the D-pin is a high level, and outputs a low level to the D+ pin;
所述检测单元,还用于所述输出单元向所述D+引脚输出低电平后,检测所述D-引脚的第二电平,将所述检测结果发送至所述输出单元和所述判断单元;The detecting unit is further configured to: after the output unit outputs a low level to the D+ pin, detect a second level of the D-pin, and send the detection result to the output unit and the Determining unit;
所述判断单元,还用于如果所述输出单元向所述D+引脚输出低电平后,所述检测单元检测所述D-引脚的所述第二电平为低电平,判断所述接入模式为充电器模式,所述智能密钥设备进入充电器模式工作状态。The determining unit is further configured to: if the output unit outputs a low level to the D+ pin, the detecting unit detects that the second level of the D-pin is a low level, and determines that The access mode is a charger mode, and the smart key device enters a charger mode working state.
此外,In addition,
所述输出单元,还用于在所述检测单元检测所述D-引脚的所述第二电平为低电平后,向所述D+引脚输出高电平;The output unit is further configured to output a high level to the D+ pin after the detecting unit detects that the second level of the D-pin is a low level;
所述检测单元,还用于所述输出单元向所述D+引脚输出高电平后,检测所述D-引脚的第三电平;The detecting unit is further configured to: after the output unit outputs a high level to the D+ pin, detecting a third level of the D-pin;
所述判断单元,还用于如果所述检测单元检测所述D-引脚的所述第三电平为高电平,判断所述接入模式为充电器模式。The determining unit is further configured to determine that the access mode is a charger mode if the detecting unit detects that the third level of the D-pin is a high level.
此外,所述输出单元,还用于如果检测单元检测所述D+引脚及所述D-引脚没有接收到所述终端握手信号且所述D-引脚的所述第一电平为低电平,继续向所述D+引脚输出高电平,直到所述检测单元检测所述D-引脚电平为高电平或检测到所述D+引脚和所述D-引脚接收到所述终端握手信号为止。In addition, the output unit is further configured to: if the detecting unit detects that the D+ pin and the D- pin do not receive the terminal handshake signal and the first level of the D-pin is low Level, continuing to output a high level to the D+ pin until the detecting unit detects that the D-pin level is high or detects that the D+ pin and the D- pin are received The terminal handshake signal up to now.
由上述本发明提供的技术方案可以看出,采用了本发明提供的智能密钥设备的接口接入模式检测方法和设备,检测模块通过向USB接口的D+引脚输入高电平,检测D+引脚和D-引脚的接收终端握手信号以及检测D-引脚的第一电平,可判断出接入智能密钥设备的USB接口的接入模式是否为USB信息传输模式,如果D-引脚的第一电平为高电平,可进一步向D+引脚输入低电平,如果D-引脚的第二电平为低电平,可以判断接入模式为充电器模式。智能密钥设备获知接入模式后,可以进一步使智能密钥设备进入相应的工作状态,显示屏正确显示出智能密钥设备的工作状态。It can be seen from the technical solution provided by the present invention that the interface access mode detection method and device of the smart key device provided by the present invention are adopted, and the detection module detects the D+ lead by inputting a high level to the D+ pin of the USB interface. The receiving terminal handshake signal of the pin and the D-pin and detecting the first level of the D-pin can determine whether the access mode of the USB interface connected to the smart key device is the USB information transmission mode, if the D-reference The first level of the pin is high, and the low level can be further input to the D+ pin. If the second level of the D- pin is low, it can be judged that the access mode is the charger mode. After the smart key device learns the access mode, the smart key device can be further brought into a corresponding working state, and the display screen correctly displays the working state of the smart key device.
附图说明DRAWINGS
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他附图。 In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention, Those of ordinary skill in the art will be able to obtain other figures from these drawings without the inventive effort.
图1为本发明实施例1提供的智能密钥设备的接口接入模式检测方法的流程图;1 is a flowchart of a method for detecting an interface access mode of a smart key device according to Embodiment 1 of the present invention;
图2为本发明实施例1提供的智能密钥设备的接口接入模式检测设备的结构示意图。FIG. 2 is a schematic structural diagram of an interface access mode detecting device of a smart key device according to Embodiment 1 of the present invention.
具体实施方式detailed description
下面结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明的保护范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
在本发明的描述中,需要理解的是,术语“中心”、“纵向”、“横向”、“上”、“下”、“前”、“后”、“左”、“右”、“竖直”、“水平”、“顶”、“底”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或数量或位置。In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "upper", "lower", "front", "back", "left", "right", " The orientation or positional relationship of the indications of "upright", "horizontal", "top", "bottom", "inside", "outside", etc. is based on the orientation or positional relationship shown in the drawings, only for the convenience of describing the present invention and The simplification of the description is not intended to limit or imply that the device or component that is referred to has a particular orientation, is constructed and operated in a particular orientation, and thus is not to be construed as limiting. Moreover, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or quantity or location.
在本发明的描述中,需要说明的是,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。In the description of the present invention, it should be noted that the terms "installation", "connected", and "connected" are to be understood broadly, and may be fixed or detachable, for example, unless otherwise explicitly defined and defined. Connected, or integrally connected; can be mechanical or electrical; can be directly connected, or indirectly connected through an intermediate medium, can be the internal communication of the two components. The specific meaning of the above terms in the present invention can be understood in a specific case by those skilled in the art.
下面将结合附图对本发明实施例作进一步地详细描述。The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
实施例1Example 1
图1出示了本发明的智能密钥设备的接口接入模式检测方法的流程图,参见图1,本发明的智能密钥设备的接口接入模式检测方法,包括:1 is a flowchart of a method for detecting an interface access mode of a smart key device according to the present invention. Referring to FIG. 1, a method for detecting an interface access mode of a smart key device according to the present invention includes:
S101,检测模块通过所述检测模块的第一检测引脚与USB接口的D+引脚连接,通过所述检测模块的第二检测引脚与所述USB接口的D-引脚连接;S101, the detecting module is connected to the D+ pin of the USB interface through a first detecting pin of the detecting module, and is connected to a D- pin of the USB interface through a second detecting pin of the detecting module;
在本实施例中,USB接口为USB充电器接口或与终端连接的USB连接线接口,终端可以为个人电脑、平板电脑、手机、智能电视、智能眼镜以及未来出现的具有数据传输功能的设备。可选的,检测模块可以是独立设置在智能密钥设备内安全芯片外的电路,也可以是安全芯片内部的一个可实现检测功能的模块。In this embodiment, the USB interface is a USB charger interface or a USB connection line interface connected to the terminal, and the terminal may be a personal computer, a tablet computer, a mobile phone, a smart TV, smart glasses, and a device with a data transmission function that appears in the future. Optionally, the detecting module may be a circuit that is independently disposed outside the security chip in the smart key device, or may be a module that can implement the detecting function inside the security chip.
S102,所述检测模块通过所述第一检测引脚向所述D+引脚输出高电平; S102. The detecting module outputs a high level to the D+ pin through the first detecting pin.
在本实施例中,高电平为电压值在3.0V~3.6V范围内波动的电压,或电压值为3.0V~3.6V范围内的某一固定值的电压。In the present embodiment, the high level is a voltage whose voltage value fluctuates within a range of 3.0 V to 3.6 V, or a voltage whose voltage value is a fixed value within a range of 3.0 V to 3.6 V.
S103,所述检测模块检测所述第一检测引脚和所述第二检测引脚是否接收到终端握手信号以及检测所述第二检测引脚的第一电平;S103. The detecting module detects whether the first detection pin and the second detection pin receive a terminal handshake signal and detect a first level of the second detection pin.
在本实施例中,终端握手信号为终端发送至智能密钥设备的通信握手信号,目的是与智能密钥设备建立USB通信连接。所述终端握手信号为一组传输时间较短的信号,其传输时间远小于第一检测引脚输入的高电平或低电平的持续时间,所以,终端握手信号的检测过程并不影响判断第二检测引脚的电平。In this embodiment, the terminal handshake signal is a communication handshake signal sent by the terminal to the smart key device, and the purpose is to establish a USB communication connection with the smart key device. The terminal handshake signal is a group of signals with short transmission time, and the transmission time is much shorter than the duration of the high level or low level input by the first detection pin. Therefore, the detection process of the terminal handshake signal does not affect the judgment. The level of the second detection pin.
S104,如果所述检测模块检测所述第一检测引脚及所述第二检测引脚接收到所述终端握手信号,则判断所述接入模式为USB信息传输模式,智能密钥设备进入USB信息传输模式工作状态;S104. If the detecting module detects that the first detecting pin and the second detecting pin receive the terminal handshake signal, determining that the access mode is a USB information transmission mode, and the smart key device enters the USB. Information transmission mode working state;
在本实施例中,本步骤可进一步包括:智能密钥设备显示屏显示正在通信。In this embodiment, the step may further include: the smart key device display screen indicates that the communication is in progress.
智能密钥设备进入USB数据通信模式,即智能密钥设备接收终端发送的握手信息,与终端建立连接后,可接收待签名数据,对待签名数据进行签名操作后,将签名后的信息发送至终端,保障终端交易数据的保密性、真实性、完整性和不可否认性。The smart key device enters the USB data communication mode, that is, the smart key device receives the handshake information sent by the terminal, and after establishing a connection with the terminal, can receive the data to be signed, and after signing the signature data, send the signed information to the terminal. To ensure the confidentiality, authenticity, integrity and non-repudiation of terminal transaction data.
S105,如果所述检测模块检测所述第一检测引脚和所述第二检测引脚没有接收到终端握手信号且检测到所述第二检测引脚的第一电平为高电平;则所述检测模块通过所述第一检测引脚向所述D+引脚输出低电平,检测所述第二检测引脚的第二电平;S105. If the detecting module detects that the first detecting pin and the second detecting pin do not receive the terminal handshake signal and detects that the first level of the second detecting pin is high level, The detecting module outputs a low level to the D+ pin through the first detecting pin, and detects a second level of the second detecting pin;
在本实施例中,低电平为电压值在0V~0.3V范围内波动的电压,或电压值为0V~0.3V范围内的某一固定值的电压。In the present embodiment, the low level is a voltage whose voltage value fluctuates within a range of 0 V to 0.3 V, or a voltage whose voltage value is a fixed value within a range of 0 V to 0.3 V.
S106,如果所述第二检测引脚的第二电平为低电平,则判断所述接入模式为充电器模式,所述智能密钥设备进入充电器模式工作状态。S106. If the second level of the second detection pin is a low level, determine that the access mode is a charger mode, and the smart key device enters a charger mode working state.
在本实施例中,本步骤可进一步包括:智能密钥设备显示屏显示正在充电。In this embodiment, the step may further include: the smart key device display screen is displaying charging.
智能密钥设备进入充电器模式工作状态,即发送使能信号至充电器使能输入端,充电器收到使能信号后开始充电。The smart key device enters the charger mode working state, that is, sends an enable signal to the charger enable input terminal, and the charger starts charging after receiving the enable signal.
另外,在本实施例中,在所述如果所述第二检测引脚的第二电平为低电平和所述判断所述接入模式为充电器模式的步骤之间,还可以包括以下步骤:In addition, in this embodiment, between the step of if the second level of the second detecting pin is a low level and the step of determining that the access mode is a charger mode, the following steps may be further included :
S106a,所述检测模块通过所述第一检测引脚向所述D+输出高电平,检测所述第二检测引脚的第三电平;S106a, the detecting module outputs a high level to the D+ through the first detecting pin, and detects a third level of the second detecting pin;
S106b,如果所述第二检测引脚的第三电平为高电平,则判断所述接入模式为充电器模式。 S106b, if the third level of the second detection pin is a high level, determining that the access mode is a charger mode.
在本实施例中,在本实施例中,对第二检测引脚的电平需要进行三次检测才判断接入模式为充电器模式,即:检测模块通过第一检测引脚向D+引脚输出高电平,检测第二引脚第一电平为高电平;检测模块通过第一检测引脚向D+引脚输出低电平,检测第二检测引脚第二电平为低电平;检测模块通过第一检测引脚向D+引脚输出高电平,检测第二检测引脚第三电平为高电平;判断接入模式为充电器模式。In this embodiment, in the embodiment, the level of the second detection pin needs to be detected three times to determine that the access mode is the charger mode, that is, the detection module outputs to the D+ pin through the first detection pin. a high level, detecting that the first level of the second pin is a high level; the detecting module outputs a low level to the D+ pin through the first detecting pin, and detecting that the second level of the second detecting pin is a low level; The detecting module outputs a high level to the D+ pin through the first detecting pin, and detects that the third level of the second detecting pin is high level; determining that the access mode is the charger mode.
采用三次检测的方案,对第二检测引脚与第一检测引脚的电平是否一致进行了第三次检测,可以克服两次检测时,第二检测引脚的低电平来自D-引脚接收到的其他信号,而非D+引脚输入的低电平,而导致的错误判断的问题。Using the three-detection scheme, the third detection is performed on whether the level of the second detection pin and the first detection pin are the same, which can overcome the low detection of the second detection pin from the D-reference. The other signals received by the pin, rather than the low level of the D+ pin input, cause problems with the error judgment.
在本实施例中还包括:In this embodiment, the method further includes:
S107,如果所述检测模块检测所述第一检测引脚及所述第二检测引脚没有接收到终端握手信号且所述第二检测引脚的第一电平为低电平,则所述检测模块继续通过所述第一检测引脚向所述D+引脚输出高电平,直到所述检测模块检测所述第二检测引脚的电平为高电平或所述第一检测引脚及所述第二检测引脚接收到所述终端握手信号为止。S107, if the detecting module detects that the first detecting pin and the second detecting pin do not receive a terminal handshake signal and the first level of the second detecting pin is a low level, The detecting module continues to output a high level to the D+ pin through the first detecting pin until the detecting module detects that the level of the second detecting pin is a high level or the first detecting pin And the second detecting pin receives the terminal handshake signal.
在本实施例中,由于在USB通讯过程中,D+引脚必须处于高电平状态才能正常进行通信。因此,如果检测模块通过第一检测引脚向D+引脚输入高电平,第二检测引脚的电平为低电平,判断D-引脚接收到其他未知信号,检测模块通过第一检测引脚继续向D+引脚输入高电平并等待检测结果的方案,在进行接入模式检测时,如果暂时不能判断究竟是哪种接入模式,D+引脚处于高电平状态,不会影响USB正常的通讯过程。In this embodiment, since the D+ pin must be in a high state during USB communication, communication can be performed normally. Therefore, if the detection module inputs a high level to the D+ pin through the first detection pin, the level of the second detection pin is a low level, and it is determined that the D- pin receives another unknown signal, and the detection module passes the first detection. The pin continues to input a high level to the D+ pin and waits for the detection result. When the access mode detection is performed, if it is temporarily unable to determine which access mode, the D+ pin is in a high state and will not affect. USB normal communication process.
由上述实施例提供的技术方案可以看出,采用了本实施例提供的智能密钥设备的接口接入模式检测方法,检测模块通过第一检测引脚向USB接口的D+引脚输入高电平,检测第一检测引脚和第二检测引脚的是否接收到终端握手信号以及第二检测引脚的第一电平,可判断出接入智能密钥设备的USB接口的接入模式是否为USB信息传输模式,如果第二检测引脚的第一电平为高电平,可进一步通过第一检测引脚向D+引脚输入低电平,如果第二检测引脚的第二电平为低电平,可以判断接入模式为充电器模式。判断出接入模式后,可以进一步使智能密钥设备进入相应的工作状态,显示屏正确显示智能密钥设备的工作状态。如果无法判断接入模式,继续通过第一检测引脚向D+引脚输入高电平,可持续检测接入状态,在检测过程中不影响其他USB信息传输。It can be seen from the technical solution provided by the foregoing embodiment that the interface access mode detection method of the smart key device provided by the embodiment is adopted, and the detection module inputs a high level to the D+ pin of the USB interface through the first detection pin. Detecting whether the first detection pin and the second detection pin receive the terminal handshake signal and the first level of the second detection pin, and determining whether the access mode of the USB interface accessing the smart key device is USB information transmission mode, if the first level of the second detection pin is high, the first detection pin can further input a low level to the D+ pin, if the second level of the second detection pin is Low level, you can judge the access mode to charger mode. After the access mode is determined, the smart key device can be further brought into a corresponding working state, and the display screen correctly displays the working state of the smart key device. If the access mode cannot be determined, continue to input a high level to the D+ pin through the first detection pin to continuously detect the access status, and does not affect other USB information transmission during the detection process.
实施例2Example 2
图2出示了本发明的智能密钥设备的接口接入模式检测设备的结构示意图,参见图2,本发明的智能密钥设备的接口接入模式检测设备,包括:检测模块201和USB接口202; 2 is a schematic structural diagram of an interface access mode detecting device of the smart key device of the present invention. Referring to FIG. 2, the interface access mode detecting device of the smart key device of the present invention includes: a detecting module 201 and a USB interface 202. ;
所述USB接口202,包括D+引脚2021和D-引脚2022;The USB interface 202 includes a D+ pin 2021 and a D-pin 2022;
所述检测模块201,包括输出单元2011、检测单元2012和判断单元2013;The detecting module 201 includes an output unit 2011, a detecting unit 2012, and a determining unit 2013;
所述输出单元2011与所述D+引脚2021连接,所述检测单元2012与所述D+引脚2021和所述D-引脚2022连接;The output unit 2011 is connected to the D+ pin 2021, and the detecting unit 2012 is connected to the D+ pin 2021 and the D-pin 2022;
所述检测单元2012与所述输出单元2011连接;The detecting unit 2012 is connected to the output unit 2011;
所述判断单元2013与所述检测单元2012连接;The determining unit 2013 is connected to the detecting unit 2012;
在本实施例中,USB接口202为USB充电器接口或与终端连接的USB连接线接口,终端可以为个人电脑、平板电脑、手机、智能电视、智能眼镜以及未来出现的具有数据传输功能的设备。可选的,检测模块201可以是独立设置在智能密钥设备内安全芯片外的电路,也可以是安全芯片内部的一个可实现检测功能的模块。In this embodiment, the USB interface 202 is a USB charger interface or a USB connection line interface connected to the terminal, and the terminal can be a personal computer, a tablet computer, a mobile phone, a smart TV, smart glasses, and a device with data transmission function appearing in the future. . Optionally, the detecting module 201 may be a circuit that is independently disposed outside the security chip in the smart key device, or may be a module that can implement the detecting function inside the security chip.
所述输出单元2011,用于向所述D+引脚2021输出高电平;The output unit 2011 is configured to output a high level to the D+ pin 2021.
在本实施例中,高电平为电压值在3.0V~3.6V范围内波动的电压,或电压值为3.0V~3.6V范围内的某一固定值的电压。In the present embodiment, the high level is a voltage whose voltage value fluctuates within a range of 3.0 V to 3.6 V, or a voltage whose voltage value is a fixed value within a range of 3.0 V to 3.6 V.
所述检测单元2012,用于在所述输出单元2011向所述D+引脚输出高电平后,检测所述D+引脚2021和所述D-引脚2022是否接收到终端握手信号以及检测所述D-引脚2022的第一电平,将检测结果发送至所述输出单元2011和所述判断单元2013;The detecting unit 2012 is configured to detect, after the output unit 2011 outputs a high level to the D+ pin, whether the D+ pin 2021 and the D-pin 2022 receive a terminal handshake signal and a detection center. Describe the first level of the D-pin 2022, and send the detection result to the output unit 2011 and the determining unit 2013;
在本实施例中,终端握手信号为终端发送至智能密钥设备的通信握手信号,目的是与智能密钥设备建立USB通信连接。所述终端握手信号为一组传输时间较短的信号,其传输时间远小于D+引脚2021输入的高电平或低电平的持续时间,所以,终端握手信号的检测过程并不影响判断D-引脚2022的电平。In this embodiment, the terminal handshake signal is a communication handshake signal sent by the terminal to the smart key device, and the purpose is to establish a USB communication connection with the smart key device. The terminal handshake signal is a group of signals with short transmission time, and the transmission time is much shorter than the duration of the high level or low level input by the D+ pin 2021. Therefore, the detection process of the terminal handshake signal does not affect the judgment D. - Level of pin 2022.
所述判断单元2013,用于如果检测单元2012检测所述D+引脚2021和所述D-引脚2022接收到所述终端握手信号,则判断接入模式为USB信息传输模式,输出判断结果,使得所述智能密钥设备进入USB信息传输模式工作状态;The determining unit 2013 is configured to: if the detecting unit 2012 detects that the D+ pin 2021 and the D-pin 2022 receive the terminal handshake signal, determine that the access mode is a USB information transmission mode, and output a determination result, Causing the smart key device to enter a USB information transmission mode working state;
在本实施例中,可进一步包括:智能密钥设备显示屏显示正在通信。智能密钥设备进入USB数据通信模式,即接收终端发送的握手信息,与终端建立连接后,可接收待签名数据,对待签名数据进行签名操作后,将签名后的信息发送至终端,保障终端交易数据的保密性、真实性、完整性和不可否认性。In this embodiment, the method further includes: the smart key device display screen indicates that the communication is in progress. The smart key device enters the USB data communication mode, that is, receives the handshake information sent by the terminal, and after establishing a connection with the terminal, can receive the data to be signed, and after signing the signature data, send the signed information to the terminal to secure the terminal transaction. The confidentiality, authenticity, integrity and non-repudiation of the data.
所述输出单元2011,还用于如果所述检测单元2012检测所述D+引脚2021和所述D-引脚2022没有接收到所述终端握手信号且检测到所述D-引脚2022的第一电平为高电平,向所述D+引脚2021输出低电平;The output unit 2011 is further configured to: if the detecting unit 2012 detects that the D+ pin 2021 and the D-pin 2022 do not receive the terminal handshake signal and detect the D-pin 2022 A level is a high level, and a low level is output to the D+ pin 2021.
在本实施例中,低电平为电压值在0V~0.3V范围内波动的电压,或电压值为0V~0.3V 范围内的某一固定值的电压。In this embodiment, the low level is a voltage whose voltage value fluctuates within a range of 0V to 0.3V, or the voltage value is 0V to 0.3V. A fixed value of voltage within the range.
所述检测单元2012,还用于所述输出单元2011向所述D+引脚2021输出低电平后,检测所述D-引脚2022的第二电平,将所述检测结果发送至所述输出单元2011和所述判断单元2013;The detecting unit 2012 is further configured to: after the output unit 2011 outputs a low level to the D+ pin 2021, detect a second level of the D-pin 2022, and send the detection result to the An output unit 2011 and the determining unit 2013;
所述判断单元2013,还用于如果所述输出单元2011向所述D+引脚2021输出低电平后,所述检测单元2012检测所述D-引脚2022的第二电平为低电平,判断所述接入模式为充电器模式,输出判断结果,使得智能密钥设备进入充电器模式工作状态。The determining unit 2013 is further configured to: if the output unit 2011 outputs a low level to the D+ pin 2021, the detecting unit 2012 detects that the second level of the D-pin 2022 is a low level. And determining that the access mode is a charger mode, and outputting a determination result, so that the smart key device enters a charger mode working state.
在本实施例中,可进一步包括:智能密钥设备显示屏显示正在充电。In this embodiment, the method further includes: the smart key device display screen indicates that charging is being performed.
智能密钥设备进入充电器模式工作状态,即判断单元2013发送使能信号至充电器使能输入端,充电器收到使能信号后开始充电。The smart key device enters the charger mode working state, that is, the determining unit 2013 sends an enable signal to the charger enable input terminal, and the charger starts charging after receiving the enable signal.
另外,在本实施例中,所述输出单元2011,还用于在所述检测单元2012检测所述D-引脚2022的第二电平为低电平后,向所述D+引脚2021输出高电平;In addition, in the embodiment, the output unit 2011 is further configured to output to the D+ pin 2021 after the detecting unit 2012 detects that the second level of the D-pin 2022 is a low level. High level
所述检测单元2012,还用于所述输出单元2011向所述D+引脚2021输出高电平后,检测所述D-引脚2022的第三电平;The detecting unit 2012 is further configured to detect the third level of the D-pin 2022 after the output unit 2011 outputs a high level to the D+ pin 2021.
所述判断单元2013,还用于如果所述检测单元2012检测所述D-引脚2021的第三电平为高电平,判断所述接入模式为充电器模式。The determining unit 2013 is further configured to determine that the access mode is a charger mode if the detecting unit 2012 detects that the third level of the D-pin 2021 is a high level.
在本实施例中,对检测单元2012对D-引脚2022的电平需要进行三次检测才判断接入模式为充电器模式,即:输出单元2011向D+引脚2021输出高电平,检测单元2012检测D-引脚2022为高电平;输出单元2011向D+引脚2021输出低电平,检测单元2012检测D-引脚2022为低电平;输出单元2011向D+引脚2021输出高电平,检测单元2012检测D+引脚2021为高电平;判断单元2013判断接入模式为充电器模式。In this embodiment, the detection unit 2012 needs to perform three detections on the level of the D-pin 2022 to determine that the access mode is the charger mode, that is, the output unit 2011 outputs a high level to the D+ pin 2021, and the detecting unit 2012 detects that the D-pin 2022 is at a high level; the output unit 2011 outputs a low level to the D+ pin 2021, the detecting unit 2012 detects that the D-pin 2022 is at a low level; and the output unit 2011 outputs a high power to the D+ pin 2021. The detection unit 2012 detects that the D+ pin 2021 is at a high level; the determination unit 2013 determines that the access mode is the charger mode.
采用三次检测的方案,对D-引脚2022与D+引脚2021的电平是否一致进行了第三次检测,可以克服两次检测时,D-引脚2022的低电平来自D-引脚2022接收到的其他信号,而非D+引脚2021输入的低电平,而导致的错误判断的问题。Using the three-detection scheme, the third detection is performed on whether the D-pin 2022 and the D+ pin 2021 are in the same level, and the D-pin 2022 can be overcome from the D-pin when the two detections are overcome. The other signals received by the 2022, rather than the low level of the D+ pin 2021 input, cause the problem of misjudgment.
在本实施例中还包括,Also included in this embodiment,
所述输出单元2011,还用于如果检测单元2012检测所述D+引脚2021及所述D-引脚2022没有接收到所述终端握手信号且所述D-引脚2022的第一电平为低电平,继续向所述D+引脚2021输出高电平,直到所述检测单元2012检测所述D-引脚2022电平为高电平或检测到所述D+引脚2021和所述D-引脚2022接收到所述终端握手信号为止。The output unit 2011 is further configured to: if the detecting unit 2012 detects that the D+ pin 2021 and the D-pin 2022 do not receive the terminal handshake signal and the first level of the D-pin 2022 is Low level, continue to output a high level to the D+ pin 2021 until the detecting unit 2012 detects that the D-pin 2022 level is high or detects the D+ pin 2021 and the D - Pin 2022 receives the terminal handshake signal.
在本实施例中,由于在USB通讯过程中,D+引脚2021必须处于高电平状态才能正常进行通信。因此,如果检测模块201通过输入单元2011向D+引脚2021输入高电平,D- 引脚2022的第一电平为低电平,判断D-引脚2022接收到其他未知信号,检测模块201通过输入单元2011继续向D+引脚2021输入高电平并等待检测结果的方案,在进行接入模式检测时,如果暂时不能判断究竟是哪种接入模式,D+引脚2011处于高电平状态,不会影响USB正常的通讯过程。In this embodiment, since the D+ pin 2021 must be in a high state during USB communication, communication can be performed normally. Therefore, if the detection module 201 inputs a high level to the D+ pin 2021 through the input unit 2011, D- The first level of the pin 2022 is a low level, and it is determined that the D- pin 2022 receives other unknown signals, and the detecting module 201 continues to input a high level to the D+ pin 2021 through the input unit 2011 and waits for a detection result. When access mode detection is performed, if it is temporarily unable to determine which access mode, D+ pin 2011 is in a high state, it will not affect the normal USB communication process.
由上述实施例提供的技术方案可以看出,采用了本实施例提供的智能密钥设备的接口接入模式检测设备,检测模块201通过输入单元2011向USB接口202的D+引脚2021输入高电平,检测D+引脚2021和D-引脚2022的是否接收到终端握手信号以及D-引脚2022的第一电平,可判断出接入智能密钥设备的USB接口的接入模式是否为USB信息传输模式,如果D-引脚2022的第一电平为高电平,可进一步通过输入单元2011向D+引脚2021输入低电平,如果D-引脚2022的第二电平为低电平,可以判断接入模式为充电器模式。判断出接入模式后,可以进一步使智能密钥设备进入相应的工作状态,显示屏正确显示智能密钥设备的工作状态。如果无法判断接入模式,则检测模块201继续通过输入单元2011向D+引脚2021输入高电平,可持续检测接入状态,并在检测过程中不影响其他USB信息传输。It can be seen from the technical solution provided by the foregoing embodiment that the interface access mode detecting device of the smart key device provided by the embodiment is used, and the detecting module 201 inputs high power to the D+ pin 2021 of the USB interface 202 through the input unit 2011. Ping, detecting whether the D+ pin 2021 and the D-pin 2022 receive the terminal handshake signal and the first level of the D-pin 2022, and can determine whether the access mode of the USB interface connected to the smart key device is USB information transmission mode, if the first level of the D-pin 2022 is high, the input unit 2011 can further input a low level to the D+ pin 2021 if the second level of the D-pin 2022 is low. Level, you can judge the access mode to charger mode. After the access mode is determined, the smart key device can be further brought into a corresponding working state, and the display screen correctly displays the working state of the smart key device. If the access mode cannot be determined, the detecting module 201 continues to input a high level to the D+ pin 2021 through the input unit 2011, and can continuously detect the access state, and does not affect other USB information transmission during the detection process.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。Any process or method description in the flowcharts or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a particular logical function or process. And the scope of the preferred embodiments of the invention includes additional implementations, in which the functions may be performed in a substantially simultaneous manner or in an opposite order depending on the functions involved, in the order shown or discussed. It will be understood by those skilled in the art to which the embodiments of the present invention pertain.
应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that portions of the invention may be implemented in hardware, software, firmware or a combination thereof. In the above-described embodiments, multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals. Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art can understand that all or part of the steps carried by the method of implementing the above embodiments can be completed by a program to instruct related hardware, and the program can be stored in a computer readable storage medium. When executed, one or a combination of the steps of the method embodiments is included.
此外,在本发明各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既 可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above integrated module is It can be implemented in the form of hardware or in the form of a software function module. The integrated modules, if implemented in the form of software functional modules and sold or used as stand-alone products, may also be stored in a computer readable storage medium.
上述提到的存储介质可以是只读存储器,磁盘或光盘等。The above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of the present specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like means a specific feature described in connection with the embodiment or example. A structure, material or feature is included in at least one embodiment or example of the invention. In the present specification, the schematic representation of the above terms does not necessarily mean the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples.
尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在不脱离本发明的原理和宗旨的情况下在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。本发明的范围由所附权利要求及其等同限定。 Although the embodiments of the present invention have been shown and described, it is understood that the foregoing embodiments are illustrative and not restrictive Variations, modifications, alterations and variations of the above-described embodiments are possible within the scope of the invention. The scope of the invention is defined by the appended claims and their equivalents.

Claims (8)

  1. 一种智能密钥设备的接口接入模式检测方法,其特征在于,包括:A method for detecting an interface access mode of a smart key device, comprising:
    检测模块通过所述检测模块的第一检测引脚与USB接口的D+引脚连接,通过所述检测模块的第二检测引脚与所述USB接口的D-引脚连接;The detecting module is connected to the D+ pin of the USB interface through the first detecting pin of the detecting module, and is connected to the D- pin of the USB interface through the second detecting pin of the detecting module;
    所述检测模块通过所述第一检测引脚向所述D+引脚输出高电平,所述检测模块检测所述第一检测引脚和所述第二检测引脚是否接收到终端握手信号以及检测所述第二检测引脚的第一电平;The detecting module outputs a high level to the D+ pin through the first detecting pin, and the detecting module detects whether the first detecting pin and the second detecting pin receive a terminal handshake signal and Detecting a first level of the second detection pin;
    如果所述检测模块检测所述第一检测引脚及所述第二检测引脚接收到所述终端握手信号,则判断所述接入模式为USB信息传输模式,所述智能密钥设备进入USB信息传输模式工作状态;If the detecting module detects that the first detecting pin and the second detecting pin receive the terminal handshake signal, determining that the access mode is a USB information transmission mode, and the smart key device enters the USB Information transmission mode working state;
    如果所述检测模块检测所述第一检测引脚和所述第二检测引脚没有接收到所述终端握手信号且检测到所述第二检测引脚的所述第一电平为高电平,则所述检测模块通过所述第一检测引脚向所述D+引脚输出低电平,检测所述第二检测引脚的第二电平;If the detecting module detects that the first detecting pin and the second detecting pin do not receive the terminal handshake signal and detects that the first level of the second detecting pin is a high level The detecting module outputs a low level to the D+ pin through the first detecting pin, and detects a second level of the second detecting pin;
    如果所述第二检测引脚的所述第二电平为低电平,则判断所述接入模式为充电器模式,所述智能密钥设备进入充电器模式工作状态。If the second level of the second detection pin is a low level, it is determined that the access mode is a charger mode, and the smart key device enters a charger mode operation state.
  2. 根据权利要求1所述的方法,其特征在于,在所述如果所述第二检测引脚的所述第二电平为低电平和所述判断所述接入模式为充电器模式的步骤之间,还包括以下步骤:The method of claim 1 wherein said step of said second mode of said second detection pin being a low level and said step of determining said access mode being a charger mode In addition, the following steps are included:
    所述检测模块通过所述第一检测引脚向所述D+输出高电平,检测所述第二检测引脚的第三电平;The detecting module outputs a high level to the D+ through the first detecting pin, and detects a third level of the second detecting pin;
    如果所述第二检测引脚的所述第三电平为高电平,则判断所述接入模式为充电器模式。If the third level of the second detection pin is a high level, it is determined that the access mode is a charger mode.
  3. 根据权利要求1所述的方法,其特征在于,该方法还包括:The method of claim 1 further comprising:
    如果所述检测模块检测所述第一检测引脚及所述第二检测引脚没有接收到终端握手信号且所述第二检测引脚的所述第一电平为低电平,则所述检测模块继续通过所述第一检测引脚向所述D+引脚输出高电平,直到所述检测模块检测所述第二检测引脚的电平为高电平或所述第一检测引脚及所述第二检测引脚接收到所述终端握手信号为止。If the detecting module detects that the first detecting pin and the second detecting pin do not receive a terminal handshake signal and the first level of the second detecting pin is a low level, The detecting module continues to output a high level to the D+ pin through the first detecting pin until the detecting module detects that the level of the second detecting pin is a high level or the first detecting pin And the second detecting pin receives the terminal handshake signal.
  4. 根据权利要求2所述的方法,其特征在于,该方法还包括:The method of claim 2, further comprising:
    如果所述检测模块检测所述第一检测引脚及所述第二检测引脚没有接收到终端握手信号且所述第二检测引脚的所述第一电平为低电平,则所述检测模块继续通过所述第一检测引脚向所述D+引脚输出高电平,直到所述检测模块检测所述第二检测引脚的电平为高电平或所述第一检测引脚及所述第二检测引脚接收到所述终端握手信号为止。 If the detecting module detects that the first detecting pin and the second detecting pin do not receive a terminal handshake signal and the first level of the second detecting pin is a low level, The detecting module continues to output a high level to the D+ pin through the first detecting pin until the detecting module detects that the level of the second detecting pin is a high level or the first detecting pin And the second detecting pin receives the terminal handshake signal.
  5. 一种智能密钥设备的接口接入模式检测设备,其特征在于,包括检测模块和USB接口;An interface access mode detecting device of a smart key device, comprising: a detecting module and a USB interface;
    所述USB接口,包括D-引脚和D+引脚;The USB interface includes a D-pin and a D+ pin;
    所述检测模块,包括输出单元、检测单元和判断单元;The detecting module includes an output unit, a detecting unit, and a determining unit;
    所述输出单元与所述D+引脚连接,所述检测单元与所述D+引脚和所述D-引脚连接;The output unit is connected to the D+ pin, and the detecting unit is connected to the D+ pin and the D- pin;
    所述检测单元与所述输出单元连接;The detecting unit is connected to the output unit;
    所述判断单元与所述检测单元连接;The determining unit is connected to the detecting unit;
    所述输出单元,用于向所述D+引脚输出高电平;The output unit is configured to output a high level to the D+ pin;
    所述检测单元,用于在所述输出单元向所述D+引脚输出高电平后,检测所述D+引脚和所述D-引脚是否接收到终端握手信号以及检测所述D-引脚的第一电平,将检测结果发送至所述输出单元和所述判断单元;The detecting unit is configured to detect, after the output unit outputs a high level to the D+ pin, whether the D+ pin and the D- pin receive a terminal handshake signal and detect the D-reference a first level of the foot, the detection result is sent to the output unit and the determining unit;
    所述判断单元,用于如果检测单元检测所述D+引脚和所述D-引脚接收到所述终端握手信号,则判断接入模式为USB信息传输模式,所述智能密钥设备进入USB信息传输模式工作状态;The determining unit is configured to: if the detecting unit detects that the D+ pin and the D- pin receive the terminal handshake signal, determine that the access mode is a USB information transmission mode, and the smart key device enters the USB Information transmission mode working state;
    所述输出单元,还用于如果所述检测单元检测所述D+引脚和所述D-引脚没有接收到所述终端握手信号且检测到所述D-引脚的所述第一电平为高电平,向所述D+引脚输出低电平;The output unit is further configured to: if the detecting unit detects that the D+ pin and the D- pin do not receive the terminal handshake signal and detect the first level of the D-pin Is high, outputting a low level to the D+ pin;
    所述检测单元,还用于所述输出单元向所述D+引脚输出低电平后,检测所述D-引脚的第二电平,将所述检测结果发送至所述输出单元和所述判断单元;The detecting unit is further configured to: after the output unit outputs a low level to the D+ pin, detect a second level of the D-pin, and send the detection result to the output unit and the Determining unit;
    所述判断单元,还用于如果所述输出单元向所述D+引脚输出低电平后,所述检测单元检测所述D-引脚的所述第二电平为低电平,判断所述接入模式为充电器模式,所述智能密钥设备进入充电器模式工作状态。The determining unit is further configured to: if the output unit outputs a low level to the D+ pin, the detecting unit detects that the second level of the D-pin is a low level, and determines that The access mode is a charger mode, and the smart key device enters a charger mode working state.
  6. 根据权利要求5所述的设备,其特征在于,The device according to claim 5, characterized in that
    所述输出单元,还用于在所述检测单元检测所述D-引脚的第二电平为低电平后,向所述D+引脚输出高电平;The output unit is further configured to output a high level to the D+ pin after the detecting unit detects that the second level of the D-pin is a low level;
    所述检测单元,还用于所述输出单元向所述D+引脚输出高电平后,检测所述D-引脚的第三电平;The detecting unit is further configured to: after the output unit outputs a high level to the D+ pin, detecting a third level of the D-pin;
    所述判断单元,还用于如果所述检测单元检测所述D-引脚的所述第三电平为高电平,判断所述接入模式为充电器模式。The determining unit is further configured to determine that the access mode is a charger mode if the detecting unit detects that the third level of the D-pin is a high level.
  7. 根据权利要求5所述的设备,其特征在于, The device according to claim 5, characterized in that
    所述输出单元,还用于如果检测单元检测所述D+引脚及所述D-引脚没有接收到所述终端握手信号且所述D-引脚的所述第一电平为低电平,继续向所述D+引脚输出高电平,直到所述检测单元检测所述D-引脚电平为高电平或检测到所述D+引脚和所述D-引脚接收到所述终端握手信号为止。The output unit is further configured to: if the detecting unit detects that the D+ pin and the D- pin do not receive the terminal handshake signal, and the first level of the D- pin is a low level And continuing to output a high level to the D+ pin until the detecting unit detects that the D-pin level is high or detects that the D+ pin and the D- pin receive the The terminal handshake signal is up.
  8. 根据权利要求6所述的设备,其特征在于,The device according to claim 6 wherein:
    所述输出单元,还用于如果检测单元检测所述D+引脚及所述D-引脚没有接收到所述终端握手信号且所述D-引脚的所述第一电平为低电平,继续向所述D+引脚输出高电平,直到所述检测单元检测所述D-引脚电平为高电平或检测到所述D+引脚和所述D-引脚接收到所述终端握手信号为止。 The output unit is further configured to: if the detecting unit detects that the D+ pin and the D- pin do not receive the terminal handshake signal, and the first level of the D- pin is a low level And continuing to output a high level to the D+ pin until the detecting unit detects that the D-pin level is high or detects that the D+ pin and the D- pin receive the The terminal handshake signal is up.
PCT/CN2015/071200 2014-01-28 2015-01-21 Method and device for detecting interface access mode of smart key device WO2015113472A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410041538.7 2014-01-28
CN201410041538.7A CN103760451B (en) 2014-01-28 2014-01-28 The interface access module detection method of a kind of intelligent cipher key equipment and equipment

Publications (1)

Publication Number Publication Date
WO2015113472A1 true WO2015113472A1 (en) 2015-08-06

Family

ID=50527720

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/071200 WO2015113472A1 (en) 2014-01-28 2015-01-21 Method and device for detecting interface access mode of smart key device

Country Status (2)

Country Link
CN (1) CN103760451B (en)
WO (1) WO2015113472A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528472A (en) * 2015-09-10 2017-03-22 深圳市中兴微电子技术有限公司 Efficient utilization method for USB (Universal Serial Bus), and USB
CN110244161A (en) * 2018-03-07 2019-09-17 和硕联合科技股份有限公司 Connecting detection system and its detection method
CN114328068A (en) * 2021-12-08 2022-04-12 中国人民解放军第六九O五工厂 Novel burn and write and test integration device

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104123512B (en) * 2014-07-17 2018-02-02 天地融科技股份有限公司 Realize the method and apparatus switched between intelligent cipher key equipment pattern
CN104539318B (en) * 2014-12-11 2017-06-06 飞天诚信科技股份有限公司 Bluetooth switching device and its method of work
CN110018976B (en) * 2018-01-10 2022-06-10 华为技术有限公司 Method for USB master device to respond to USB slave device and related device
CN111061515B (en) * 2019-12-19 2022-09-30 展讯通信(上海)有限公司 User equipment starting control method and user equipment
CN111428227B (en) * 2020-03-20 2023-04-07 天地融科技股份有限公司 Intelligent key device supporting card reading

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079550A (en) * 2006-12-06 2007-11-28 华为技术有限公司 Determination system, terminal charging method, terminal and charger of charger style
CN101674366A (en) * 2009-09-19 2010-03-17 惠州Tcl移动通信有限公司 Mobile terminal USB, or charger inserting identification method and identification device thereof
TW201214917A (en) * 2010-09-17 2012-04-01 Qisda Corp Adapter, electrical device and charging method thereof
US8458376B1 (en) * 2012-01-19 2013-06-04 I/O Interconnect Inc. USB peripheral device with automatic mode switch
CN103221962A (en) * 2010-11-22 2013-07-24 摩托罗拉移动有限责任公司 Peripheral authentication
CN103760415A (en) * 2013-12-12 2014-04-30 中国原子能科学研究院 Strong-flow compact type circular accelerator tuning loop phase detection method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101702146B (en) * 2009-11-02 2016-01-20 北京中星微电子有限公司 The method of distinguishing charger and data line of universal serial bus and unit
CN103064489B (en) * 2011-10-21 2016-03-30 华为终端有限公司 A kind of method and terminal of carrying out internal circuit selection according to USB interface state
CN102855202B (en) * 2012-08-21 2015-06-17 天地融科技股份有限公司 Method for detecting type of electronic equipment and data interface
CN103019991B (en) * 2012-12-03 2016-04-13 深圳市文鼎创数据科技有限公司 Interface system and changing method, USB key and UART terminal
CN103279432A (en) * 2013-04-27 2013-09-04 深圳市文鼎创数据科技有限公司 Method for switching working modes of intelligent secrete key device and intelligent secrete key device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101079550A (en) * 2006-12-06 2007-11-28 华为技术有限公司 Determination system, terminal charging method, terminal and charger of charger style
CN101674366A (en) * 2009-09-19 2010-03-17 惠州Tcl移动通信有限公司 Mobile terminal USB, or charger inserting identification method and identification device thereof
TW201214917A (en) * 2010-09-17 2012-04-01 Qisda Corp Adapter, electrical device and charging method thereof
CN103221962A (en) * 2010-11-22 2013-07-24 摩托罗拉移动有限责任公司 Peripheral authentication
US8458376B1 (en) * 2012-01-19 2013-06-04 I/O Interconnect Inc. USB peripheral device with automatic mode switch
CN103760415A (en) * 2013-12-12 2014-04-30 中国原子能科学研究院 Strong-flow compact type circular accelerator tuning loop phase detection method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528472A (en) * 2015-09-10 2017-03-22 深圳市中兴微电子技术有限公司 Efficient utilization method for USB (Universal Serial Bus), and USB
CN110244161A (en) * 2018-03-07 2019-09-17 和硕联合科技股份有限公司 Connecting detection system and its detection method
CN114328068A (en) * 2021-12-08 2022-04-12 中国人民解放军第六九O五工厂 Novel burn and write and test integration device
CN114328068B (en) * 2021-12-08 2024-04-19 中国人民解放军第六九O五工厂 Novel burn and write and test integration device

Also Published As

Publication number Publication date
CN103760451A (en) 2014-04-30
CN103760451B (en) 2016-08-17

Similar Documents

Publication Publication Date Title
WO2015113472A1 (en) Method and device for detecting interface access mode of smart key device
AU2014296537B2 (en) Mobile computing device and wearable computing device having automatic access mode control
US9448611B2 (en) Interface expending method and device for tablet computer
US9448259B2 (en) Apparatuses and methods to distinguish proprietary, non-floating and floating chargers for regulating charging currents
TWI573368B (en) Portable electronic device and charging method therefor
WO2016106616A1 (en) Charging protection method and apparatus
KR102218242B1 (en) Method for controlling I/O interface and Electronic Device for the same
WO2014079347A1 (en) One time password and generation method thereof
US20150156089A1 (en) Data communication interface
US9547573B2 (en) Serial communication over communication control pin
KR20140007316A (en) Detection of cable connections for electronic devices
CN102855202A (en) Method for detecting type of electronic equipment and data interface
KR20160064842A (en) Method for confirming a foreign substance in earjack and electronic device thereof
EP3274836A1 (en) System and method to enable closed chassis debug control interface using a usb type-c connector
US20180240109A1 (en) Data Processing Method and System, and Wearable Electronic Device
CN102820970B (en) Electronic installation and the authentication method of battery module thereof
CN109298266A (en) Test macro, test method, test device and storage medium
US20150097548A1 (en) Cable detection in a pin constrained connector
CN106451593B (en) Wireless charging device and method, and wireless charging receiver
CN103605473A (en) Mobile terminal touch screen unlocking method and mobile terminal
WO2016008447A1 (en) Method and apparatus for realizing switching between intelligent key device modes
TW201445320A (en) USB interface detection device
CN106026232A (en) Detecting method and apparatus for USB port type
TWI449926B (en) Transmitting interface and method for determining transmitting signals
CN107681727A (en) The control method and device of electronic equipment

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

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

Country of ref document: EP

Kind code of ref document: A1